function GetCharCount(e,CountDisplayID,total)
{

//alert(e);
 n = document.getElementById(e);
varTheText = n.value;

//alert(n.name);



///Get the text from the control


/// return the name of the control and the length of the text
 CountDisplayID.innerText = total - parseInt(varTheText.length);
 
  if(varTheText.length > total)
     {
     alert('You used too many characters. Please correct.')
          event.returnValue = false;
     }
 
 
 
}

function confirm_delete(){
  if (confirm("Are you sure you want to delete the record?")==true)
    return true;
  else
   return false;}
   
   function confirm_empty(){
  if (confirm("Your cart is empty.")==true)
     history.back();

  else
    history.back();
}


//for login page
function clickButton(e, buttonid){ 

      var evt = e ? e : window.event;

      var bt = document.getElementById(buttonid);

      if (bt){ 

          if (evt.keyCode == 13){ 

                bt.click(); 

                return false; 

          } 

      } 

}

 
/// picture click
var win = null; 
function NewWindow(mypage,myname,w,h,scroll){ 
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
settings = 
        'height='+h+',width='+w+',top=­'+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',­resizable' 

        try
{
//Run some code here
win.close();
 win = window.open(mypage, myname, settings);
}
catch(err)
{
//Handle errors here
  win = window.open(mypage, myname, settings);
}
        //win = window.open(mypage, myname, settings);
        //
        //win2 = window.open(mypage, myname, settings);
        //win = window.open(mypage, myname, settings);
} 

