function SendPass(formnm,qs){
		if (formnm.txt_emailid.value == "")
		{
		alert ("Enter Email Id");
		formnm.txt_emailid.focus();
		}		 		
		else	
		{
		formnm.qs.value = qs;
		formnm.submit();			
	} 
}

function checkBlank(formelement,text)
{
	if(formelement.value=='')	{
    alert('Enter '+text);
    formelement.focus();
	return false;
    }
	else
	{
	return true;
	}
}



function checkEmail(formelement,text)	
{
	if(formelement.value!='')
	{
		var b=formelement.value.indexOf('@');
		var c=formelement.value.indexOf('.');
		var d=c-b;
		var len=formelement.value.length;

		if((d==0)||(c==-1)||(b==-1)||(d==1)||((len-c)==1))
		{
			alert("Enter a valid "+text);
			formelement.focus();
			return false;
		}
		else
		{
			return true;
		}
	}
}

function checkSpace(formelement,text)
{
	var msg='true';
	var a=formelement.value;
	var b=a.length;
	var i,j;
		for(j=0;j<b;j++)
		{
			var a1=a.substring(j,j+1);
			if(a1==' ')
			{
				msg='Spaces are not allowed in '+text;
				alert(msg);	
				formelement.focus();
				return false;
			}
		}

	if (msg=='true')
	{
	return true;
	}
}

function validateuc()
{	
	   if (document.login_frm.emailid.value=="")	{
		alert ('Please enter Email Id');
		document.login_frm.emailid.focus();
		return false;
	}	else if (document.login_frm.password.value=="")	{
		alert ('Please enter Password');
		document.login_frm.password.focus();
		return false;
		}	else	{
		return true;
		}
}

function MM_openBrWindow(theURL,winName,features) { 
	window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
	var d=document; 
	if(d.images){ 
		if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0){ 
    		d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];

    	}

    }

}



function MM_swapImgRestore() { //v3.0

	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

function validate9()
{
if(!checkBlank(document.frmnews.txt_emailid,'Email Address')) return false;
if(!checkEmail(document.frmnews.txt_emailid,'Email Address')) return false;
}


function validate1()
	{	
		if(!checkBlank(document.login_frm1.txt_fname,'First Name')) return false;
		if(!checkBlank(document.login_frm1.txt_org,'Last Name.')) return false;
		if(!checkBlank(document.login_frm1.txt_phone,'Telephone No.')) return false;
		if(!checkNaN(document.login_frm1.txt_phone,'Telephone No.')) return false;
		if(!checkBlank(document.login_frm1.txt_emailid,'Email address')) return false;
		if(!checkEmail(document.login_frm1.txt_emailid,'Email Address')) return false;
	}

function checkNaN(formelement,text)

{

	if (isNaN(formelement.value))

	{

  alert('Enter Numeric '+text);

  formelement.focus();

	return false;

  }

	else

	{
	return true;
	}
}

function validatesp1()
	{	
		if(!checkBlank(document.login_frm1.txt_fname,'Name')) return false;
		if(!checkBlank(document.login_frm1.txt_emailid,'Email address')) return false;
		if(!checkSpace(document.login_frm1.txt_emailid,'Email address')) return false;
		if(!checkEmail(document.login_frm1.txt_emailid,'Email Address')) return false;
		if(!checkBlank(document.login_frm1.txt_qtyshop,'Quantity for shop')) return false;
		if(!checkNaN(document.login_frm1.txt_qtyshop,'Quantity for shop')) return false;
		if(!checkBlank(document.login_frm1.txtar_comments,'Description or Drug Name')) return false;
	}

function SubmitProfile(formnm,qs)	{

	if (qs == "changeprofile_todb" || qs == "addprofile_todb")	{

		if (formnm.cust_name.value =="") {

			alert("Please Enter Name");

			formnm.cust_name.focus();

		}else if (formnm.cust_phone.value == "") {

			alert("Please Enter Phone Number");

			formnm.cust_phone.focus();

		}else if (formnm.cust_email.value == "") {

			alert("Please Enter Email");

			formnm.cust_email.focus();

		}else if (formnm.cust_address.value == "") {

			alert("Please Enter Address");

			formnm.cust_address.focus();

		}else if (formnm.city.value == "") {

			alert("Please Enter City");

			formnm.city.focus();

		}else if (formnm.zip.value == "") {

			alert("Please Enter Zip code");

			formnm.zip.focus();

		}else if (qs == "addprofile_todb" && formnm.txt_username.value =="") {

			alert("Please Enter User Name");

			formnm.txt_username.focus();

		}else if (qs == "addprofile_todb" && formnm.txt_password.value == "") {

			alert("Please Enter Password");

			formnm.txt_password.focus();			

		}else if (qs == "addprofile_todb" && formnm.txt_confpassword.value == "") {

			alert("Please Enter Password to Confirm");

			formnm.txt_confpassword.focus();			

		}else if (qs == "addprofile_todb" && (formnm.txt_password.value != formnm.txt_confpassword.value)) {

			alert("Confirm password to should be same as password");

			formnm.txt_confpassword.focus();			

		}else {		

			formnm.qs.value= qs;

			formnm.submit();				

		}

	}	

	else{

		formnm.qs.value= qs;

		formnm.submit();

	}

}

function isNull(FieldName){

	if(FieldName.charAt(0)==""){

		return true;

	}

	else{

		return false;

	}

 }

function resetForm(formnm) {
	formnm.reset();
}



function deleteProduct(formnm,qs,id){
		formnm.product_id.value= id;
		formnm.qs.value= qs;
		formnm.submit();
}

function SubmitToForgotPass()	

	{  

		window.open("forgot_pass.php",'ForgotPass',"scrollbars=no,menubar=no,width=350,height=200");

	}

function validate_wed()
{
		if(!checkBlank(document.wedform.fname,'Full Name')) return false;
		if(!checkBlank(document.wedform.bdname,'Brideg Name')) return false;
		if(!checkBlank(document.wedform.bgname,'Bridegroom Name')) return false;
		if(!checkBlank(document.wedform.txt_dat,'Marrige Date')) return false;
		//if(!checkDate(document.wedform.txt_dat)) return false;
		if(!checkBlank(document.wedform.add,' Address ')) return false;
		if(!checkBlank(document.wedform.emailid,'Email Address')) return false;
		if(!checkEmail(document.wedform.emailid,'Email Address')) return false;
		if(!checkBlank(document.wedform.city,'City Name')) return false;
		if(!checkBlank(document.wedform.state,'State Name')) return false;
		if(!checkBlank(document.wedform.zipcode,'Zip Code')) return false;
		if(!checkNaN(document.wedform.zipcode,'Zip Code')) return false;
		if(!checkNaN(document.wedform.cel_no,'Contact Number')) return false;
		
}
function SubmitListing(formnm,ListingID)
{
	formnm.CategoryID.value = ListingID;
	formnm.submit();
}
function SubmitListingDetails(formnm,CatID,SubCatID)
{
	formnm.CategoryID.value = CatID;
	formnm.SubCategoryID.value = SubCatID;
	formnm.submit();
}

function SubmitprodListing(formnm,SubCatID)
{
	formnm.SubCategoryID.value = SubCatID;
	formnm.submit();
}
