// JavaScript Document
function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
			 if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }


function isAlpha ( evt ) {
   var keyCode = evt.which ? evt.which : evt.keyCode;
   alpha = ( keyCode >= 'a'.charCodeAt ( ) &&
      keyCode <= 'z'.charCodeAt ( ) ) || 
      ( keyCode >= 'A'.charCodeAt ( ) &&
      keyCode <= 'Z'.charCodeAt ( ) );
   return ( alpha );
}


function isalphnum(evt)
{
	if(isNumberKey(evt) || isAlpha ( evt ))
	{
		return true;
	}
	return false;
}

function cNum(e) {
	var strCheck = '0123456789\b\t	 ';
	var whichCode = (window.event) ? e.keyCode : e.which;
	if (whichCode == 0 || whichCode == 13)
	{
		return true ;		
	}
	key = String.fromCharCode(whichCode);  // Get key value from key code
	if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
}

function cNumPhone(e) {
	var strCheck = '0123456789\b\t	 +()[]-';
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 0 || whichCode == 13)
	{
		return true ;		
	}
	key = String.fromCharCode(whichCode);  // Get key value from key code
	if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
}

function whichButton(event)
{
if (event.button==2)//RIGHT CLICK
  {
   alert('Please Verify Email Address.');
   return false;
  }

}
function noCTRL(e)
{
var code = (document.all) ? event.keyCode:e.which;

var msg = "Please Verify Email Address.";
if (parseInt(code)==17) //CTRL
{
alert(msg);
return;
}
}

// JavaScript Document
popUpWin = 0;
function PopUpWindow(URLStr, title, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
//  alert(URLStr);
  popUpWin = open(URLStr, title, 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollBars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

	function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}
