﻿// JScript File
function trim(str) 
{ 
   //str.replace(/^\s*/, '').replace(/\s*$/, ''); 
   str = str.replace(/^\s*/, "");
   str = str.replace(/\s*$/, "");
   return str;
} 
function SetShipmentTrackingWindow(strnumber,strtype)
{
    var vturl = "/Pages/ShipmentTrackingResult.aspx?stype=";
    vturl = vturl +strtype+ "&snumber=" + strnumber;
    if(window.NewWindow)
    {
      //ensure to open only one window 
      if(!NewWindow.closed){
        NewWindow.close();
      }
    }
    NewWindow = window.open(vturl,'vt','left=160,top=100,width=800,height=600,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=yes');
    NewWindow.window.focus();
}
function textCounter(objInput,maxlimit) 
{
      var str="";
      field = document.getElementById(objInput);
      str=field.value;
      str=str.replace(/[^\x00-\xff]/g,"**"); 

      if (str.length > maxlimit)
      {
          field.value = field.value.substring(0, maxlimit);
      }
 }