function process()
{
	window.open('','paypal','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=500,left=100,top=100')
}
function checknumber(str)
{
	if(str.value=="")
	{
	    alert("Paw number cannot be empty")
	    return false;
	}
	else if(!isInteger(str.value)){
		alert('Invalid paw number');
		str.focus();
		return false;
	}
	
	return true;
}

function sentto_friend() {
	var light=lightform.petsname.value;
	if (light=="") {
		light="all";
	}
	var sendurl='sendlight.php?petsname='+light;
	mywin = window.open(sendurl,"win",'toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=500,height=500');

}
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function checksignup()
{
	if(document.signupfrm.name.value=="")
		 {

		 	alert("Name cannot be null")
		 	document.signupfrm.name.focus();
			return false;
		 }

	if(document.signupfrm.item_name.value=="")
		 {

		 	alert("Username cannot be null")
		 	document.signupfrm.item_name.focus();
			return false;
		 }

	if(document.signupfrm.password.value=="")
		 {

		 	alert("Password cannot be null")
		 	document.signupfrm.password.focus();
			return false;
		 }

	if(document.signupfrm.email.value=="")
	 {

	 	alert("Email cannot be null")
	 	document.signupfrm.mail.focus();
		return false;
	 }
	 else{
	    str = document.signupfrm.email.value;
	    if(!checkMail(str)){
	        alert("Email not valid")
		 	document.signupfrm.email.focus();
			return false;
	    }
	 }
}

function checkMail(str)
{
var x = str
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)) return true;
else return false;
}
