﻿function showMed(objVal)
{
  if (objVal != "")
    document.all.trMed.style.display = "inline";
  else
    document.all.trMed.style.display = "none";
}

function openshipto(urlpg)
{
  window.open (urlpg,'Option','height=210,width=350,status=yes,toolbar=no,menubar=no,location=1');
}


function openoptionwin(urlpg)
{
  window.open (urlpg,'Option','height=350,width=500,status=yes,toolbar=no,menubar=no,location=no');
}

function openorderwin(urlpg)
{
 window.open (urlpg,'Option','height=550,width=500,status=yes,toolbar=no,menubar=no,location=no,resizable=yes');
}

function textCounter(field, countfield, maxlimit) 
{
  if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
  else 
  countfield.value = maxlimit - field.value.length;
}

function openorderTrackwin(trackid)
{
 var urlpg = "http://track.dhl-usa.com/TrackByNbr.asp?ShipmentNumber=" + trackid;
 window.open (urlpg,'Option','height=550,width=650,status=yes,toolbar=yes,menubar=yes,location=no,resizable=yes');
}

function checkKey(idi)
{
  var key = window.event.keyCode;
  if (key < 48 || key > 57)
    window.event.returnValue = false;
  else
    document.all(idi).checked = true;
}
function checkNumKey(idi)
{
  var key = window.event.keyCode;
  if (key < 48 || key > 57)
    window.event.returnValue = false;
  else
    window.event.returnValue = true;
}
function checkLength(idi)
{
  if (idi >=80)
    window.event.returnValue = false;
}

function searchBy()
{
  if (document.getElementById('ctl00_MainMaster_rdoSearchBy_0').checked)
  {
      document.getElementById('trHcode').style.display = "none";
      document.getElementById('trBTC').style.display = "inline";
      document.getElementById('trBTS').style.display = "inline";
  }
  else
  {
    document.getElementById('trHcode').style.display = "inline";
    document.getElementById('trBTC').style.display = "none";
    document.getElementById('trBTS').style.display = "none";
  }
}


