function winShippingPolicy() {
	ShippingWin=window.open("shipping_policy.htm",'ShippingWin2','width=740,height=700,top=50,left=50');
	ShippingWin.focus();
}

function show(line,div){
	line.style.display='';
	div.style.visibility='visible';
}

function hide(line,div){
	line.style.display='none';
	div.style.visibility='hidden';
}

function loadincludes(){	
	clientSideInclude('topinc', '../includes/link.htm');

}
function loadincludes1(){
	clientSideInclude('topinc1', '../includes/left_panel.htm');
	clientSideInclude('menucomm3Div', '../includes/photogallerymenu.php');
}

function loadincludes2(c){
	clientSideInclude('pgsp', 'p.php?c='+c);
}

function loadCategory(){
	clientSideInclude('topinc1', '../includes/left_panel.htm');
	clientSideInclude('categorylist', 'online_category.php');
}

function loadproduct(c){
	clientSideInclude('Products', 'online_catproductphp.php?c='+c);
}
function loadproductdesc(c,r){
	clientSideInclude('Product', 'online_product.php?c='+c+'&r='+r);
}

function loadadminincludes(){	
	if(document.getElementById('topinc')) clientSideInclude('topinc', '../includes/admin_link.php');
	if(document.getElementById('topinc1')) clientSideInclude('topinc1', '../includes/admin_left.php');
	if(document.getElementById('topinc1s')) clientSideInclude('topinc1s', '../includes/storeadmin_left.php');
	if(document.getElementById('echk')) clientSideInclude('echk', 'echk.php');

}

function validateLogin()
{
	form = document.login;
	if(trim(form.admin_name.value)=="")
	{
		alert("Please Enter Login Name");
		form.admin_name.value='';
		form.admin_name.focus();
		return false;
		}
	if(trim(form.admin_password.value)=="")
	{
		alert("Please Enter Password");
		form.admin_password.value='';
		form.admin_password.focus();
		return false;
		}	
	form.action = "db_login.php";
	form.submit();
	return true;
	}
	
	function validate_customer_Login()
{
	form = document.login;
	if(trim(form.cust_email.value)=="")
	{
		alert("Please Enter E-mail");
		form.cust_email.focus();
		return false;
		}
	else if(checkEmailAddress(form.cust_email.value)=="")
	{
		alert("Please Enter Valid E-mail");
		form.cust_email.focus();
		return false;
		}
	if(trim(form.cust_password.value)=="")
	{
		alert("Please Enter Password");
		form.cust_password.value='';
		form.cust_password.focus();
		return false;
		}	
	form.action = "https://www.playersturfsystems.com/inner/db_customer_login.php";
	form.submit();
	return true;
	}
	
function validateAccountInformation()
{
	form = document.frm_accountInformation;
	if(trim(form.admin_email.value)=="")
	{
		alert("Please Enter E-mail");
		form.admin_email.focus();
		return false;
		}
	else if(checkEmailAddress(form.admin_email.value)=="")
	{
		alert("Please Enter Valid E-mail");
		form.admin_email.focus();
		return false;
		}	
	
	form.action = "db_accountInformation.php";
	form.submit();
	return true;
	
	}	
function validateChangePassword()
{
	form = document.changepassword;
	if(trim(form.oldPass.value)=='')
	{
		alert("Please Enter Old Password");
		form.oldPass.focus();
		return false;
		}
	if(trim(form.newPass.value)=='')
	{
		alert("Please Enter New Password");
		form.newPass.focus();
		return false;
		}	
	if(trim(form.cNewPass.value)=='')
	{
		alert("Please Enter Confirm Password");
		form.cNewPass.focus();
		return false;
		}	
	if(form.newPass.value!=form.cNewPass.value)
	{
		alert("New Password and Confirm Password are not matched ");
		form.cNewPass.focus()
		return false;
		}
	form.action = "db_changePassword.php";
	form.submit();
	return true;
	}	
	
function validateCategory(id){
	form = document.frm;
	/*if(id==0) form = document.frm;
	else form = document.editFrm;
	//else form = document.editFrm;*/
	if(trim(form.Category.value)==""){
		alert("Please enter category.")
		return returnFalse(form.Category);
	}else if(!checkcity(trim(form.Category.value))){
		alert("Invalid category.")
		return returnFalse(form.Category);
	}
	
	if(id==0) form.action="db_category.php?a=i";
	else {
		form.action="db_category.php?a=u&id="+id;
	}
	//alert(form.action);
	form.submit()
}

function validateSubCategory(id){
	if(id==0) form = document.frm;
	else form = document.editFrm;
	//else form = document.editFrm;*/
	if(trim(form.Category.value)==""){
		alert("Please enter category.")
		return returnFalse(form.Category);
	}else if(!checkcity(trim(form.Category.value))){
		alert("Invalid category.")
		return returnFalse(form.Category);
	}
	
	if(id==0) form.action="db_category.php?a=i";
	else {
		form.action="db_category.php?a=u&id="+id;
	}
	//alert(form.action);
	form.submit()
}


function validateFlower(id){
	form = document.frm;
	
	if(trim(form.parent_cat.value)==""){
		alert("Please select category.")
		return returnFalse(form.parent_cat);
	}
	if(trim(form.title.value)==""){
		alert("Please enter title.")
		return returnFalse(form.title);
	}
	
	/*if(trim(form.desc.value)==""){
		alert("Please enter description.")
		return returnFalse(form.desc);
	}*/
	
	if(id==0){
		if(trim(form.Flimg.value)==""){
			alert("Please browse for product image.");
			return returnFalse(form.Flimg);
		}
		else{
		rest = form.Flimg.value.substr(form.Flimg.value.length-3,form.Flimg.value.length);
		lower=rest.toLowerCase();
	
	if(lower!="jpg" && lower!="jpeg" && lower!="png")
	{
		alert("Please Upload Only JPG and PNG File");
		return returnFalse(form.Flimg);
	}
  }
}


	if(id==0) form.action="db_product.php?a=i";
	else form.action="db_product.php?a=u&id="+id;
	/*if(form.F.checked){
		form.F.value="y";
	}else{form.F.value="n";}*/
	
	form.submit()
}

function callFunc(title){
	if(document.frm.chkchk){
		if(document.frm.chkchk.value==''){
			alert('Please select product option.'); 
			return false;
		}
	}
	if(document.frm.qty.value==''){
		alert('Please enter quantity.'); 
		document.frm.qty.focus();
		return false;
	} else if(!isInteger(trim(document.frm.qty.value)) || document.frm.qty.value==0){
		alert("Please enter valid quantity");
		document.frm.qty.focus();
		return false;
	}
	
	
	if(document.frm.prod_opt[document.frm.prod_opt.selectedIndex]) var opt = document.frm.prod_opt[document.frm.prod_opt.selectedIndex].value;
	else var opt = document.frm.prod_opt.value;
	
	if(document.getElementById("prco")) var optnm = document.getElementById('optnm').innerHTML.replace("'","\'").replace("\"","\\\"");
	else var optnm = "|*|";
	
	qty = document.getElementById('qty').value;
	prc111 = document.getElementById('prc').innerHTML.replace("$","").replace(",","");
	pcode = document.frm.pcode.value;
	if(opt>1){
		if(optnm!="") ptitle = pcode + " - "+opt+" ft. "+title + '<br>'+optnm;
		else ptitle = pcode + " - "+opt+" ft. "+title;
	}else{
		if(optnm!="") ptitle = pcode + " - "+title + '<br>'+optnm;
		else ptitle = pcode + " - "+title;
	}
	
	/* for cart form*/
	document.frm.w.value=opt;
	document.frm.n.value=ptitle;
	document.frm.p.value=prc111;
	document.frm.pc.value=pcode;
	document.frm.submit();
	/*
	cartform = document.cartparams;
	cartparams.w.value=opt;
	cartparams.n.value=ptitle;
	cartparams.qty.value=qty;
	cartparams.p.value=prc111;
	cartparams.pc.value=pcode;
	cartparams.action='mycart.php';
	cartparams.submit();
	
	*/
	//var path = 'mycart.php?w='+opt+'&n='+ptitle+'&qty='+qty+'&p='+prc111+'&pc='+pcode;
	//var w=window.open(path,'prodwin','top=0,left=0,height=600,width=775');
	//w.focus();
	
	////window.location=path;
}

function processOrder(Y,m){
	var form = 	document.ordFrm;
	
	//Write Billing info validations
	if(trim(form.bfname.value)!=""){
		if (!checkname(trim(form.bfname.value))){
			alert('Billing - Invalid first name.');
			form.bfname.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter first name");
		form.bfname.focus();
		return false;
	}
	if(trim(form.blname.value)!=""){
		if (!checkname(trim(form.blname.value))){
			alert('Billing - Invalid last name.');
			form.blname.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter last name");
		form.blname.focus();
		return false;
	}
	if(trim(form.baddr1.value)==""){
		alert("Billing - Please enter address1");
		form.baddr1.focus();
		return false;
	}
	
	if(trim(form.bcity.value)!=""){
		if (!checkname(trim(form.bcity.value))){
			alert('Billing - Invalid city.');
			form.bcity.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter city");
		form.bcity.focus();
		return false;
	}
	if(trim(form.bstate.value)!=""){
		if (!checkname(trim(form.bstate.value))){
			alert('Billing - Invalid state.');
			form.bstate.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter state");
		form.bstate.focus();
		return false;
	}
	if(trim(form.bzip.value)!=""){
		if (!inValidCharZip(trim(form.bzip.value))){
			alert('Billing - Invalid zip.');
			form.bzip.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter zip");
		form.bzip.focus();
		return false;
	}
	/*if(trim(form.bcountry.value)!=""){
		if (!checkname(trim(form.bcountry.value))){
			alert('Billing - Invalid country.');
			form.bcountry.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter country");
		form.bcountry.focus();
		return false;
	}*/
	if(trim(form.bphone.value)!=""){
		if (!checkPhone(trim(form.bphone.value))){
			alert('Billing - Invalid phone.');
			form.bphone.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter phone");
		form.bphone.focus();
		return false;
	}
	
	//Shipping info validation
	if(trim(form.sname.value)!=""){
		if (!checkname(trim(form.sname.value))){
			alert('Shipping - Invalid name.');
			form.sname.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter name");
		form.sname.focus();
		return false;
	}
	if(trim(form.saddr1.value)==""){
		alert("Shipping - Please enter address1");
		form.saddr1.focus();
		return false;
	}
	
	if(trim(form.scity.value)!=""){
		if (!checkname(trim(form.scity.value))){
			alert('Shipping - Invalid city.');
			form.scity.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter city");
		form.scity.focus();
		return false;
	}
	if(trim(form.sstate.value)!=""){
		if (!checkname(trim(form.sstate.value))){
			alert('Shipping - Invalid state.');
			form.sstate.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter state");
		form.sstate.focus();
		return false;
	}
	if(trim(form.szip.value)!=""){
		if (!inValidCharZip(trim(form.szip.value))){
			alert('Shipping - Invalid zip.');
			form.szip.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter zip");
		form.szip.focus();
		return false;
	}
	/*if(trim(form.scountry.value)!=""){
		if (!checkname(trim(form.scountry.value))){
			alert('Shipping - Invalid country.');
			form.scountry.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter country");
		form.scountry.focus();
		return false;
	}*/
	if(trim(form.sphone.value)!=""){
		if (!checkPhone(trim(form.sphone.value))){
			alert('Shipping - Invalid phone.');
			form.sphone.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter phone");
		form.sphone.focus();
		return false;
	}
	
	//Validate payment information
	var Rchk=0;
	var chkval="";
	for(i=0; i<form.R.length; i++){
		if(form.R[i].checked) {Rchk = 1;chkval=form.R[i].value}
	}
	if(Rchk==0){
		alert("Payment Information - Please select Credit Card.");
		form.R.focus();
		return false;
	}
	if(trim(form.ccnum.value)!=""){
		if (!checkCC(trim(form.ccnum.value))){
			alert('Payment Information - Invalid credit card number.');
			form.ccnum.focus();
			return false;
		}
	}else{
		alert("Payment Information - Please enter credit card number");
		form.ccnum.focus();
		return false;
	}
	if(trim(form.ccname.value)!=""){
		if (!checkname(trim(form.ccname.value))){
			alert('Payment Information - Invalid name on card.');
			form.ccname.focus();
			return false;
		}
	}else{
		alert("Payment Information - Please enter name on card.");
		form.ccname.focus();
		return false;
	}
	if(form.ccmonth[form.ccmonth.selectedIndex].value==""){
		alert("Payment Information - Please select expiration month.");
		form.ccmonth.focus();
		return false;
	}
	if(form.ccyear[form.ccyear.selectedIndex].value==""){
		alert("Payment Information - Please select expiration year.");
		form.ccyear.focus();
		return false;
	}
	if((form.ccyear[form.ccyear.selectedIndex].value==Y)&&(form.ccmonth[form.ccmonth.selectedIndex].value<m)){
			alert("Payment Information - Invalid expiration date.");
			form.ccmonth.focus();
			return false;
	}
	form.ccexp.value = form.ccmonth[form.ccmonth.selectedIndex].value+form.ccyear[form.ccyear.selectedIndex].value
	
	if(trim(form.ccvvnum.value)==""){
		alert("Payment Information - Please enter Card Security Code.");
		form.ccvvnum.focus();
		return false;
	}else{
		if((chkval=="v") || (chkval=="m") || (chkval=="d")){
			if(form.ccvvnum.value.length!=3){
				alert("Payment Information - Card Security Code should be 3-digit.")	
				form.ccvvnum.focus();
				return false;
			}
		}
		if(chkval=="a"){
			if(form.ccvvnum.value.length!=4){
				alert("Payment Information - Card Security Code should be 4-digit.")	
				form.ccvvnum.focus();
				return false;
			}
		}
	}
	
	//Validate Registration information
	if(form.email){
		if(trim(form.email.value)=="") {
			alert("Registration - Please Enter E-mail");
			form.email.focus();
			return false;
		}
		else if(checkEmailAddress(form.email.value)=="") {
			alert("Registration - Please Enter Valid E-mail");
			form.email.focus();
			return false;
		}else /*if (form.echk.value.indexOf(trim(form.email.value)+",")>=0){
			alert('This user already exists.');
			form.email.focus();
			return false;
		}*/
		if(trim(form.pwd.value)==""){
			alert("Registration - Please enter password.");
			form.pwd.focus();
			return false;
		}
		if(trim(form.rpwd.value)==""){
			alert("Registration - Please retype password.");
			form.rpwd.focus();
			return false;
		}
		if(trim(form.pwd.value)!=trim(form.rpwd.value)){
			alert("Registration - Confirm password failed.");
			form.rpwd.focus();
			return false;
		}
	}
	
	//Check for return policy
	if(!form.retPolicy.checked){
		alert("Please read our return policy and click on the checkbox.");
			form.retPolicy.focus();
			return false;
	}
	//**********************
	
	form.action = "db_processOrder.php";
	form.action = "verifyorder.php";
	form.submit();
}
function updateaccount(){
	var form = 	document.ordFrm;
	
	//Write Billing info validations
	if(trim(form.bfname.value)!=""){
		if (!checkname(trim(form.bfname.value))){
			alert('Billing - Invalid first name.');
			form.bfname.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter first name");
		form.bfname.focus();
		return false;
	}
	if(trim(form.blname.value)!=""){
		if (!checkname(trim(form.blname.value))){
			alert('Billing - Invalid last name.');
			form.blname.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter last name");
		form.blname.focus();
		return false;
	}
	if(trim(form.baddr1.value)==""){
		alert("Billing - Please enter address1");
		form.baddr1.focus();
		return false;
	}
	
	if(trim(form.bcity.value)!=""){
		if (!checkname(trim(form.bcity.value))){
			alert('Billing - Invalid city.');
			form.bcity.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter city");
		form.bcity.focus();
		return false;
	}
	if(trim(form.bstate.value)!=""){
		if (!checkname(trim(form.bstate.value))){
			alert('Billing - Invalid state.');
			form.bstate.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter state");
		form.bstate.focus();
		return false;
	}
	if(trim(form.bzip.value)!=""){
		if (!inValidCharZip(trim(form.bzip.value))){
			alert('Billing - Invalid zip.');
			form.bzip.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter zip");
		form.bzip.focus();
		return false;
	}
	if(form.bcountry){
		if(trim(form.bcountry.value)!=""){
			if (!checkname(trim(form.bcountry.value))){
				alert('Billing - Invalid country.');
				form.bcountry.focus();
				return false;
			}
		}else{
			alert("Billing - Please enter country");
			form.bcountry.focus();
			return false;
		}
	}
	if(trim(form.bphone.value)!=""){
		if (!checkPhone(trim(form.bphone.value))){
			alert('Billing - Invalid phone.');
			form.bphone.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter phone");
		form.bphone.focus();
		return false;
	}
	
	//Shipping info validation
	if(trim(form.sname.value)!=""){
		if (!checkname(trim(form.sname.value))){
			alert('Shipping - Invalid name.');
			form.sname.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter name");
		form.sname.focus();
		return false;
	}
	if(trim(form.saddr1.value)==""){
		alert("Shipping - Please enter address1");
		form.saddr1.focus();
		return false;
	}
	
	if(trim(form.scity.value)!=""){
		if (!checkname(trim(form.scity.value))){
			alert('Shipping - Invalid city.');
			form.scity.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter city");
		form.scity.focus();
		return false;
	}
	if(trim(form.sstate.value)!=""){
		if (!checkname(trim(form.sstate.value))){
			alert('Shipping - Invalid state.');
			form.sstate.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter state");
		form.sstate.focus();
		return false;
	}
	if(trim(form.szip.value)!=""){
		if (!inValidCharZip(trim(form.szip.value))){
			alert('Shipping - Invalid zip.');
			form.szip.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter zip");
		form.szip.focus();
		return false;
	}
	if(form.scountry){
		if(trim(form.scountry.value)!=""){
			if (!checkname(trim(form.scountry.value))){
				alert('Shipping - Invalid country.');
				form.scountry.focus();
				return false;
			}
		}else{
			alert("Shipping - Please enter country");
			form.scountry.focus();
			return false;
		}
	}
	if(trim(form.sphone.value)!=""){
		if (!checkPhone(trim(form.sphone.value))){
			alert('Shipping - Invalid phone.');
			form.sphone.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter phone");
		form.sphone.focus();
		return false;
	}
	if(trim(form.email.value)=="") {
		alert("Registration - Please Enter an E-mail address");
		form.email.focus();
		return false;
	}
	else if(checkEmailAddress(form.email.value)=="") {
		alert("Registration - Please Enter a Valid E-mail address");
		form.email.focus();
		return false;
	}
	if(trim(form.pwd.value)==""){
		alert("Registration - Please enter a password.");
		form.pwd.focus();
		return false;
	}
	else if(trim(form.pwd.value)!=trim(form.retypepwd.value)){
		alert("Registration - Passwords do not match.");
		form.pwd.value = '';
		form.retypepwd.value = '';
		form.pwd.focus();
		return false;
	}
	else if(!validatePassword(trim(form.pwd.value))){
		alert("Registration - Invalid password.");
		form.pwd.focus();
		return false;
	}
	
	//**********************
	
	form.action = "db_processaccount.php";
	form.submit();
}
function updateaccount1(){
	var form = 	document.ordFrm;
	
	//Write Billing info validations
	if(trim(form.bfname.value)!=""){
		if (!checkname(trim(form.bfname.value))){
			alert('Billing - Invalid first name.');
			form.bfname.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter first name");
		form.bfname.focus();
		return false;
	}
	if(trim(form.blname.value)!=""){
		if (!checkname(trim(form.blname.value))){
			alert('Billing - Invalid last name.');
			form.blname.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter last name");
		form.blname.focus();
		return false;
	}
	if(trim(form.baddr1.value)==""){
		alert("Billing - Please enter address1");
		form.baddr1.focus();
		return false;
	}
	
	if(trim(form.bcity.value)!=""){
		if (!checkname(trim(form.bcity.value))){
			alert('Billing - Invalid city.');
			form.bcity.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter city");
		form.bcity.focus();
		return false;
	}
	if(trim(form.bstate.value)!=""){
		if (!checkname(trim(form.bstate.value))){
			alert('Billing - Invalid state.');
			form.bstate.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter state");
		form.bstate.focus();
		return false;
	}
	if(trim(form.bzip.value)!=""){
		if (!inValidCharZip(trim(form.bzip.value))){
			alert('Billing - Invalid zip.');
			form.bzip.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter zip");
		form.bzip.focus();
		return false;
	}
	if(trim(form.bcountry.value)!=""){
		if (!checkname(trim(form.bcountry.value))){
			alert('Billing - Invalid country.');
			form.bcountry.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter country");
		form.bcountry.focus();
		return false;
	}
	if(trim(form.bphone.value)!=""){
		if (!checkPhone(trim(form.bphone.value))){
			alert('Billing - Invalid phone.');
			form.bphone.focus();
			return false;
		}
	}else{
		alert("Billing - Please enter phone");
		form.bphone.focus();
		return false;
	}
	
	//Shipping info validation
	if(trim(form.sname.value)!=""){
		if (!checkname(trim(form.sname.value))){
			alert('Shipping - Invalid name.');
			form.sname.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter name");
		form.sname.focus();
		return false;
	}
	if(trim(form.saddr1.value)==""){
		alert("Shipping - Please enter address1");
		form.saddr1.focus();
		return false;
	}
	
	if(trim(form.scity.value)!=""){
		if (!checkname(trim(form.scity.value))){
			alert('Shipping - Invalid city.');
			form.scity.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter city");
		form.scity.focus();
		return false;
	}
	if(trim(form.sstate.value)!=""){
		if (!checkname(trim(form.sstate.value))){
			alert('Shipping - Invalid state.');
			form.sstate.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter state");
		form.sstate.focus();
		return false;
	}
	if(trim(form.szip.value)!=""){
		if (!inValidCharZip(trim(form.szip.value))){
			alert('Shipping - Invalid zip.');
			form.szip.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter zip");
		form.szip.focus();
		return false;
	}
	if(trim(form.scountry.value)!=""){
		if (!checkname(trim(form.scountry.value))){
			alert('Shipping - Invalid country.');
			form.scountry.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter country");
		form.scountry.focus();
		return false;
	}
	if(trim(form.sphone.value)!=""){
		if (!checkPhone(trim(form.sphone.value))){
			alert('Shipping - Invalid phone.');
			form.sphone.focus();
			return false;
		}
	}else{
		alert("Shipping - Please enter phone");
		form.sphone.focus();
		return false;
	}
	if(trim(form.email.value)=="") {
		alert("Registration - Please Enter E-mail");
		form.email.focus();
		return false;
	}
	else if(checkEmailAddress(form.email.value)=="") {
		alert("Registration - Please Enter Valid E-mail");
		form.email.focus();
		return false;
	}
	if(trim(form.pwd.value)==""){
		alert("Registration - Please enter password.");
		form.pwd.focus();
		return false;
	}
	else if(!validatePassword(trim(form.pwd.value))){
		alert("Registration - Invalid password.");
		form.pwd.focus();
		return false;
	}
	
	//**********************
	
	form.action = "db_processaccount.php";
	form.submit();
}

function validateForgotEmail() {
	form = document.forgot;
	if(trim(form.txtEmail.value)=="") {
		alert("Please Enter E-mail");
		form.txtEmail.focus();
		return false;
	}
	else if(checkEmailAddress(form.txtEmail.value)=="") {
		alert("Please Enter Valid E-mail");
		form.txtEmail.focus();
		return false;
	}
	form.submit();
}