function verify_admin_update()
{
	if(document.upd_amt.amt.value=='')
	{
		alert("Update Amount can't be blanked!");
		document.upd_amt.amt.focus();
		return false;
	}
}
function verify_email()
{
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.f1.email.value)))
	{
		alert("Please enter a valid Email address!");
		document.f1.email.focus();
		return false;
	}
}
function chk_letter()
{
	if(document.f1.name.value=='')
	{
		alert("Name can't be blanked!");
		document.f1.name.focus();
		return false;
	}
	if(document.f1.email.value=='')
	{
		alert("Email can't be blanked!");
		document.f1.email.focus();
		return false;
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.f1.email.value)))
	{
		alert("Please enter a valid Email address!");
		document.f1.email.focus();
		return false;
	}
	return true;
}
function chk_paypalid()
{
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.f1.id.value)) && document.f1.id.disabled==false)
	{
		alert("Please enter a valid Paypal Email Id!");
		document.f1.id.focus();
		return false;
	}
	if(document.f1.detail.value=='' && document.f1.detail.disabled==false)
	{
		alert("Bank Detail Can't be blank");
		document.f1.detail.focus();
		return false;
	}

	val=document.f1.amount.value;
	if(isBlank(val))
	{
		alert("Blank amount can't be inserted!");
		return false;
	}
	if(isNaN(val))
	{
		alert("Insert valid decimal quantity!");
		return false;
	}
	if(val<10)
	{
		alert("Amount can't be Less then $ 10.00");
		return false;
	}
	var conf = confirm("Do you want to withdraw $ " + val + " amount");
	if(!conf)
	{
		return false;
	}
	return true;
}
function verify_register_frm()
{
	var difference = 0;
	var dt=document.f1.d_month.value + "/" + document.f1.d_day.value + "/" + document.f1.d_year.value;
	date = new Date(dt);
	today = new Date();
	difference = today-date;
	var dif=difference/(1000*60*60*24*365);
	if(dif<=16)
	{
		alert("You should be 16 year or more to register to this site!");
		document.f1.d_year.focus();
		return false;
	}
	if(document.f1.formuser.value=='')
	{
		alert("User Name can't be blanked!");
		document.f1.formuser.focus();
		return false;
	}
	if(document.f1.pwd.value=='')
	{
		alert("Password can't be blanked!");
		document.f1.pwd.focus();
		return false;
	}
	strpwd=document.f1.pwd.value;
	if(strpwd.length<=5)
	{
		alert("Password must be atleast 6 charectars!");
		document.f1.pwd.focus();
		return false;
	}
	if(document.f1.pwd1.value!=document.f1.pwd.value)
	{
		alert("Password does not match!");
		document.f1.pwd.focus();
		return false;
	}
	if(document.f1.fname.value=='')
	{
		alert("First Name can't be blanked!");
		document.f1.fname.focus();
		return false;
	}
	if(document.f1.lname.value=='')
	{
		alert("Last Name can't be blanked!");
		document.f1.fname.focus();
		return false;
	}
	if(document.f1.email.value=='')
	{
		alert("Email can't be blanked!");
		document.f1.fname.focus();
		return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.f1.email.value)))
	{
		alert("Please enter a valid e-mail address!");
		document.f1.email.focus();
	    return false;
	}
	
	if(!document.f1.C1.checked)
	{
		alert("You should be agree to the terms and conditions!");
		document.f1.C1.focus();
		return false;
	}
	return true;
}
function check_amt()
{
	val=document.f1.amount.value;
	if(isBlank(val))
	{
		alert("Blank amount can't be inserted!");
		return false;
	}
	if(isNaN(val))
	{
		alert("Insert valid decimal quantity!");
		return false;
	}
	if(val<2)
	{
		alert("Amount can't be Less then $ 2.00");
		return false;
	}
	
	var conf = confirm("Do you want to deposit $ " + val + " amount");
	if(!conf) {
	return false;
	}
	return true;
}
function check()
{
	val=document.f1.noofticket.value;
	if(isBlank(val))
	{
		alert("Ticket Quantity can't be left blank!");
		return false;
	}
	if(val<=0)
	{
		alert("You should buy atleast 1 ticket!");
		return false;
	}
	for(var i=0;i<val.length;i++)
	{
		if(!isDigit(val.charAt(i)))
		{
			alert("Please provide proper ticket quantity!");
			return false;
		}
	}
	var conf = confirm("Do You want to buy " + val + " Tickets");
	if(!conf) {
	return false;
	}
	return true;
}
function isDigit(num)
{
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
}
function isBlank(val)
{
	if(val==null){return true;}
	for(var i=0;i<val.length;i++)
	{
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
	}
	return true;
}

function popup(url,w,h,scroll,poptype)
{
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	if(poptype!='p')url='popup.php?imgname='+url+'&height='+h+'&width='+w;
	w=w+25;
	h=h+45;
	var customize = "toolbar=no,menubar=no,resizable=no,scrollbars="+scroll+",width="+w+",height="+h+",top="+top+",left="+left;
	var x = window.open(url,'_blank',customize);
}

function popup_prod_desc(url,w,h,scroll)
{
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	w=w+25;
	h=h+45;
	var customize = "toolbar=no,menubar=no,resizable=no,scrollbars="+scroll+",width="+w+",height="+h+",top=0,left=0";
	var x = window.open(url,'_blank',customize);
}

function chklogin()
{
	str="Please Give : \n\n";
	flag=0;
	if(document.frm_login.username.value=="")
	{
		str+="User Name\n";
		flag=1;
	}
	if(document.frm_login.password.value=="")
	{
		str+="Password\n";
		flag=1;
	}
	if(flag==1)
	{
		alert(str);
		return false;
	}
	return true;
}

function chkcontact()
{
	str="Please Give : \n\n";
	flag=0;
	if(document.frm_contact.subject.value=="")
	{
		str+="Subject\n";
		flag=1;
	}
	if(document.frm_contact.message.value=="")
	{
		str+="E-mail Message\n";
		flag=1;
	}
	if(flag==1)
	{
		alert(str);
		return false;
	}
	return true;
}
function chkcontactus()
{
	str="Please Give : \n\n";
	flag=0;
	if(document.frm_contact.yname.value=="")
	{
		str+="Your Name\n";
		flag=1;
	}
	if(document.frm_contact.yemail.value=="")
	{
		str+="Your Email\n";
		flag=1;
	}
	if(document.frm_contact.subject.value=="")
	{
		str+="Subject\n";
		flag=1;
	}
	if(document.frm_contact.message.value=="")
	{
		str+="E-mail Message\n";
		flag=1;
	}
	if(flag==1)
	{
		alert(str);
		return false;
	}
	return true;
}
