// JavaScript Document
function check_length(value,limit)
{
	if (value.length <=limit)
		return false;
	return true;
}
function compare_pass(pass,re_pass)
{
	if (pass != re_pass)
		return false;
	return true;
}
function check_valid_email(a)	
{	
	myexp = /^[0-9a-zA-Z\-\.\_]+@[0-9a-zA-Z\-]+\.[0-9a-zA-Z\-\.]+$/;
	if (a.toString().match(myexp)) 
		return true;
	return false;
}	
function openlgprod(i)
{
	var win = window.open("large_img.php?pid=" + i, "largeprod","resizable=no,scrollbars=no,width=400,height=300"); //"toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=410")
	
}
//------------------------------------------------------------
function trimStr(str) {
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
//------------------------------------------------------------
function isNumeric(sText)
{
   var ValidChars = "0123456789.,";
   var IsNumber=true;
   var Char;
	sText=trimStr(sText)
  if(sText.length==0)
		return false;

   for (i = 0; i < sText.length && IsNumber == true; i++)
   {
      Char = sText.charAt(i);
      if (ValidChars.indexOf(Char) == -1)
      {
         IsNumber = false;
      }
   }
   //alert(IsNumber);
   return IsNumber;
  }
  function popWin(url, width, height, windowName, scrollbar, content){
	var x = (screen.width) ? (screen.width-width) / 2 : 100;
	var y = (screen.height) ? (screen.height-height) / 2 : 100;

	var features = "width=" + width + "px, height=" + height + "px, top=" + y + "px, left=" + x + "px";
		features += (scrollbar) ? ", scrollbars=yes" : "";
		features += ", resizable=yes";
	if (!windowName){
		windowName = "untitled";
	}
	var popWindow = window.open(url, windowName, features);

	if (popWin.arguments.length == 6 && content != ""){
		popWindow.document.write(content);
	}
	if (document.layers){
		window.moveTo(x, y);
	}
	popWindow.focus();
}
function openForm()
{
	popWin('forgetmail.php', 500,100, 'Edit_Profile',true);
}