/*This style sheet id only for users.In which we define following function..*/
/*
1. function validate_cartpfrdfrm();  --for product_view.php

2. function validate_loginfrm();  --for login.php

3. function check_reward();  --for payment_Option.php

4. function show_award();  --for payment_Option.php

5. function validate_address_form();  --for user_adress_form.php

*/





//Check add_product.php form

function validate_cartpfrdfrm()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For size Validation*/
	if(document.addtocartfrm.size.value==0)
				 {
                   document.getElementById('size_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Sorry ! Size is missing</b>";
				   if(focus_field=='') focus_field = 'size';
			       count_bug+=1;
				 }


	/* For color Name Validation*/

	if(document.addtocartfrm.color.value==0)
				 {
                   document.getElementById('color_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Sorry ! Color is missing</b>";
				   if(focus_field=='') focus_field = 'color';
			       count_bug+=1;
				 }

/* For quantity  Validation*/

	if(document.addtocartfrm.quantity.value==0)
				 {
                   document.getElementById('qty_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Sorry ! minimum quantity can't be 0.</b>";
				   if(focus_field=='') focus_field = 'quantity';
			       count_bug+=1;
				 }


	if(count_bug >0)
		return false;
	else
		return true;

}


function isNumberKey(evt,enabledot)
{
	if(!enabledot) enabledot=0;
 var charCode = (evt.which) ? evt.which : event.keyCode
	 //alert(charCode)
 if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode!=46 && enabledot==1)
	return false;
 else if (charCode > 31 && (charCode < 48 || charCode > 57) && enabledot==0)
	return false;

 return true;
}

//////////////////////Checkform for addproduct Ends herer////////////////


/////////////////////////Check Bloks for Login ID///////////////////////
function showpass(){
//document.getElementById('pass').style.display=visible;
//document.getElementById('pass').style.visibility = "visible";
document.getElementById('pass').style.display = "block";
}

function blockpass(){
//document.getElementById("pass").style.display=="hidden";
//document.all.pass.style.visibility = "hidden";
document.getElementById('pass').style.display = "none";
}

function chekbug(){
if(count_bug >0){
		return false;
}else{
		return true;
}
}
///////////////////////////////////////////////////////////////////////










///////////////////////////////Login Frm Check//////////////////////////


function validate_loginfrm()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For email Validation*/
	if(document.loginfrm.email.value=='')
				 {
                   document.getElementById('email_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter user id</b>";
				   if(focus_field=='') focus_field = 'email';
			       count_bug+=1;
				 }
	else
				 {
apos=document.loginfrm.email.value.indexOf("@");
dotpos=document.loginfrm.email.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('email_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'email';
			       count_bug+=1;
				 }
				 }

	if(count_bug >0)
		return false;
	else
		return true;

}



/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////

///////////////////////////////Login Frm Check//////////////////////////
//Check add_product.php form

function validate_passwordfrm()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	if(document.passwordfrm.userid.value=='')
				 {
                   document.getElementById('msg_userid').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your User Id</b>";
				   if(focus_field=='') focus_field = 'userid';
			       count_bug+=1;
				 }



	if(count_bug >0)
		return false;
	else
		return true;

}





//////////////////////////////////////////////////shopping cart form validations.///////////////////////////////////////////////////


function checkShoppingCartForm(frm){

 var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
//////////////////////////////////sender validation///////////////////////////////////////////////////////////////////////////////


/*For sender name Validation*/
	if(document.shipfrm.txiSenderName.value=='')
				 {
                   document.getElementById('send_name').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>First Name is missing</b>";
				   if(focus_field=='') focus_field = 'txiSenderName';
			       count_bug+=1;
				 }

	if(document.shipfrm.txiSenderLName.value=='')
				 {
                   document.getElementById('send_lname').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Last Name is missing</b>";
				   if(focus_field=='') focus_field = 'txiSenderLName';
			       count_bug+=1;
				 }



//For sender Address Validation
	if(document.shipfrm.txaSenderAddress.value=='')
				 {
                   document.getElementById('send_address').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Address is missing</b>";
				   if(focus_field=='') focus_field = 'txaSenderAddress';
			       count_bug+=1;
				 }
//For sender City Validation
	if(document.shipfrm.txiSenderCity.value=='')
				 {
                   document.getElementById('send_city').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>City is missing</b>";
				   if(focus_field=='') focus_field = 'txiSenderCity';
			       count_bug+=1;
				 }
//For sender state Validation
	if(document.shipfrm.txiSenderState.value=='0')
				 {
                   document.getElementById('send_state').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>State is missing</b>";
				   if(focus_field=='') focus_field = 'txiSenderState';
			       count_bug+=1;
				 }
if(document.shipfrm.txiContact.value=='')
				 {
                   document.getElementById('send_phone').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Contact number is missing</b>";
				   if(focus_field=='') focus_field = 'txiContact';
			       count_bug+=1;
				 }
//For sender zip Validation
	if(document.shipfrm.txiSenderZipcode.value=='')
				 {
                   document.getElementById('send_zip').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Postal code is missing</b>";
				   if(focus_field=='') focus_field = 'txiSenderZipcode';
			       count_bug+=1;
				 }



//For sender email Validation
	if(document.shipfrm.txiSenderEmail.value=='')
				 {
                   document.getElementById('send_email').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Email is missing</b>";
				   if(focus_field=='') focus_field = 'txiSenderEmail';
			       count_bug+=1;
				 }
if(document.shipfrm.txiSenderEmail.value!='')
				 {
                   apos=document.shipfrm.txiSenderEmail.value.indexOf("@");
dotpos=document.shipfrm.txiSenderEmail.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('send_email').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'txiSenderEmail';
			       count_bug+=1;
				 }
				 }

/////////////////////////////////////////////////////////end///////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////Reciepient Validations//////////////////////////////////////////////////////////////////

//For sender name Validation
	if(document.shipfrm.txiName.value=='')
				 {
                   document.getElementById('recip_name').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>First Name is missing</b>";
				   if(focus_field=='') focus_field = 'txiName';
			       count_bug+=1;
				 }
	if(document.shipfrm.txiLName.value=='')
				 {
                   document.getElementById('recip_lname').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Last Name is missing</b>";
				   if(focus_field=='') focus_field = 'txiLName';
			       count_bug+=1;
				 }



//For sender Address Validation
	if(document.shipfrm.txaAddress.value=='')
				 {
                   document.getElementById('recip_address').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Address is missing</b>";
				   if(focus_field=='') focus_field = 'txaAddress';
			       count_bug+=1;
				 }
//For sender City Validation
	if(document.shipfrm.txiCity.value=='')
				 {
                   document.getElementById('recip_city').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>City is missing</b>";
				   if(focus_field=='') focus_field = 'txiCity';
			       count_bug+=1;
				 }
//For sender state Validation
	if(document.shipfrm.txiState.value=='0')
				 {
                   document.getElementById('recip_state').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>State is missing</b>";
				   if(focus_field=='') focus_field = 'txiState';
			       count_bug+=1;
				 }
if(document.shipfrm.txiPhone.value=='')
				 {
                   document.getElementById('m_phone').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Contact number is missing</b>";
				   if(focus_field=='') focus_field = 'txiPhone';
			       count_bug+=1;
				 }
//For sender zip Validation
	if(document.shipfrm.txiZipcode.value=='')
				 {
                   document.getElementById('recip_zip').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Postal code is missing</b>";
				   if(focus_field=='') focus_field = 'txiZipcode';
			       count_bug+=1;
				 }




//For sender email Validation
	if(document.shipfrm.txiEmail.value=='')
				 {
                   document.getElementById('recip_email').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Email is missing</b>";
				   if(focus_field=='') focus_field = 'txiEmail';
			       count_bug+=1;
				 }
if(document.shipfrm.txiEmail.value!='')
				 {
                   apos=document.shipfrm.txiEmail.value.indexOf("@");
dotpos=document.shipfrm.txiEmail.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('recip_email').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'txiEmail';
			       count_bug+=1;
				 }
				 }
/////////////////////////////////////////////////////end//////////////////////////////////////////////////////////////////////////////


if(count_bug >0)
		return false;
	else
		return true;

}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function doSameAs(frm){





	//if(document.frm.selSenderCountry.value=="United States"){


	if (window.document.shipfrm.sameAs.checked){		


		window.document.shipfrm.txiName.value	=			window.document.shipfrm.txiSenderName.value;
        window.document.shipfrm.txiLName.value	=			window.document.shipfrm.txiSenderLName.value;

		window.document.shipfrm.txaAddress.value	=		window.document.shipfrm.txaSenderAddress.value;


		window.document.shipfrm.txiCity.value	=		window.document.shipfrm.txiSenderCity.value;


		window.document.shipfrm.txiState.value	=		window.document.shipfrm.txiSenderState.value;
		window.document.shipfrm.txiPhone.value	=		window.document.shipfrm.txiContact.value;



		window.document.shipfrm.txiZipcode.value	=		window.document.shipfrm.txiSenderZipcode.value;


		window.document.shipfrm.selCountry.value	=		window.document.shipfrm.selSenderCountry.value;		


		window.document.shipfrm.txiEmail.value	=		window.document.shipfrm.txiSenderEmail.value;


		window.document.shipfrm.txaRemarks.value	=		window.document.shipfrm.txaSenderRemarks.value;


	}else{	


		window.document.shipfrm.txiName.value	= "";		
        window.document.shipfrm.txiLName.value	= "";
		window.document.shipfrm.txaAddress.value	= "";


		window.document.shipfrm.txiCity.value	= "";


		window.document.shipfrm.txiState.value	= "";
		window.document.shipfrm.txiPhone.value	= "";


		window.document.shipfrm.txiZipcode.value	= "";


		window.document.shipfrm.selCountry.value	= "";		


		window.document.shipfrm.txiEmail.value	= "";


		window.document.shipfrm.txaRemarks.value	= "";


	}


return true;//}


/*else{


	alert("To dispatch outside India, Please choose another Currency  ");


	return false;


}*/


}





//////////////////////////////////////////////////shopping cart form validations.///////////////////////////////////////////////////


///////////////////////////////Login Frm Check//////////////////////////
//Check add_product.php form

function validate_registration_form()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For email Validation*/
	if(document.registration_form.password.value=='')
				 {
                   document.getElementById('pass_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter Password</b>";
				   if(focus_field=='') focus_field = 'password';
			       count_bug+=1;
				 }

if(document.registration_form.re_password.value=='')
				 {
                   document.getElementById('re_pass_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please re-type password.</b>";
				   if(focus_field=='') focus_field = 're_password';
			       count_bug+=1;
				 }
if(document.registration_form.re_password.value!=document.registration_form.password.value)
				 {
                   document.getElementById('re_pass_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Re-type password doesn't match.</b>";
				   if(focus_field=='') focus_field = 're_password';
			       count_bug+=1;
				 }

if(document.registration_form.txiName.value=='')
				 {
                   document.getElementById('name_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your first name</b>";
				   if(focus_field=='') focus_field = 'txiName';
			       count_bug+=1;
				 }
if(document.registration_form.txiLName.value=='')
				 {
                   document.getElementById('lname_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your last name</b>";
				   if(focus_field=='') focus_field = 'txiLName';
			       count_bug+=1;
				 }
if(document.registration_form.txiAddress.value=='')
				 {
                   document.getElementById('adds_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your address</b>";
				   if(focus_field=='') focus_field = 'txiAddress';
			       count_bug+=1;
				 }

if(document.registration_form.txiCity.value=='')
				 {
                   document.getElementById('city_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your city</b>";
				   if(focus_field=='') focus_field = 'txiCity';
			       count_bug+=1;
				 }
if(document.registration_form.txiState.value=='0')
				 {
                   document.getElementById('state_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your state</b>";
				   if(focus_field=='') focus_field = 'txiState';
			       count_bug+=1;
				 }
if(document.registration_form.txiContactNo.value=='')
				 {
                   document.getElementById('phone_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your contact number</b>";
				   if(focus_field=='') focus_field = 'txiContactNo';
			       count_bug+=1;
				 }
if(document.registration_form.txiPostCode.value=='')
				 {
                   document.getElementById('pin_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter postal code</b>";
				   if(focus_field=='') focus_field = 'txiPostCode';
			       count_bug+=1;
				 }




	if(count_bug >0)
		return false;
	else
		return true;

}



/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////

////////////////////////////////////edit profile/////////////////////////////////////////////////////
function check_edit_form()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For email Validation*/
	

if(document.prfilefrm.txiName.value=='')
				 {
                   document.getElementById('name_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your first name</b>";
				   if(focus_field=='') focus_field = 'txiName';
			       count_bug+=1;
				 }
if(document.prfilefrm.txiLName.value=='')
				 {
                   document.getElementById('lname_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your last name</b>";
				   if(focus_field=='') focus_field = 'txiLName';
			       count_bug+=1;
				 }
if(document.prfilefrm.txiAddress.value=='')
				 {
                   document.getElementById('address_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your address</b>";
				   if(focus_field=='') focus_field = 'txiAddress';
			       count_bug+=1;
				 }

if(document.prfilefrm.txiCity.value=='')
				 {
                   document.getElementById('city_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your city</b>";
				   if(focus_field=='') focus_field = 'txiCity';
			       count_bug+=1;
				 }
if(document.prfilefrm.txiState.value=='0')
				 {
                   document.getElementById('state_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your state</b>";
				   if(focus_field=='') focus_field = 'txiState';
			       count_bug+=1;
				 }
if(document.prfilefrm.txiContactNo.value=='')
				 {
                   document.getElementById('phone_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your contact number</b>";
				   if(focus_field=='') focus_field = 'txiContactNo';
			       count_bug+=1;
				 }
if(document.prfilefrm.txiPostCode.value=='')
				 {
                   document.getElementById('postal_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter postal code</b>";
				   if(focus_field=='') focus_field = 'txiPostCode';
			       count_bug+=1;
				 }

if(document.prfilefrm.txiEmailAddress.value=='')
				 {
                   document.getElementById('mail_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your email-id</b>";
				   if(focus_field=='') focus_field = 'txiEmailAddress';
			       count_bug+=1;
				 }


apos=document.prfilefrm.txiEmailAddress.value.indexOf("@");
dotpos=document.prfilefrm.txiEmailAddress.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('mail_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'txiEmailAddress';
			       count_bug+=1;
				 }


	if(count_bug >0)
		return false;
	else
		return true;

}

////////////////////////////////////////end///////////////////////////////////////////////////////////


///////////////////////////////Change Passowrd Form Check//////////////////////////


function validate_changepass_form()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For email Validation*/
	
if(document.changepass_form.txiUserId.value!=document.changepass_form.uid.value)
				 {
                   document.getElementById('userid_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Sorry Wrong User Id</b>";
				   if(focus_field=='') focus_field = 'txiUserId';
			       count_bug+=1;
				 }
if(document.changepass_form.txiPassword.value!=document.changepass_form.oldpass.value)
				 {
                   document.getElementById('pass_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Sorry Wrong Password</b>";
				   if(focus_field=='') focus_field = 'txiPassword';
			       count_bug+=1;
				 }
if(document.changepass_form.txiNewPassword.value=='')
				 {
                   document.getElementById('pass_new_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please Enter New Password</b>";
				   if(focus_field=='') focus_field = 'txiNewPassword';
			       count_bug+=1;
				 }



	if(count_bug >0)
		return false;
	else
		return true;

}



/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////

///////////////////////////////Login Frm Check//////////////////////////
//Check add_product.php form

function validate_paymentfrm(thisform)
             {
				
myOption = -1;
for (i=thisform.pay.length-1; i > -1; i--) {
if (thisform.pay[i].checked) {
myOption = i; i = -1;
}
}


     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For Payment Options Validation*/
	if(myOption == -1)
				 {
                   document.getElementById('payment_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please Chose atlest One Payment Options</b>";
				   if(focus_field=='') focus_field = 'pay';
			       count_bug+=1;
				 }
    if(document.paymentfrm.reward_code.value!="")
				 {
     if(document.paymentfrm.reward_code.value!=document.paymentfrm.reward_txt_hidden.value)
					 {
		 document.getElementById('rewrd_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please Enter Correct Given Reward Code</b>";
				   if(focus_field=='') focus_field = 'reward_code';
			       count_bug+=1;
					 }
				 }



	if(count_bug >0)
		return false;
	else
		return true;

}



/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////



///////////////////////////////Add to cart Check//////////////////////////

function check_quantity(qty)
{

if(qty==0){
alert("Sorry On selecting this quantity minimum quantity will be added");
}
}

function show_award()
{
	
	document.getElementById("hidden_reward").style.visibility = "visible";
}



function check_reward()
{	
	i=parseFloat(document.paymentfrm.r_no.value);
	j=parseFloat(document.paymentfrm.reward_no.value);
	
	if(j>i)
	{			
    document.getElementById("error_msg").innerHTML='<font color="red">Plese enter valid number.</font>';
	
	}
	else
	{		
		document.getElementById("error_msg").innerHTML='';
		
	}
}

///////////////////////////////////////Ends///////////////////////////////

//Check bulkorder form

function validate_bulkfrm()
             {
				 
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	
/*For email Validation*/
	if(document.bulkfrm.name.value=='')
				 {
		//alert("hi");
                   document.getElementById('bulkname_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter name </b>";
				   if(focus_field=='') focus_field = 'name';
			       count_bug+=1;
				 }

if(document.bulkfrm.contact.value=='')
				 {
		//alert("hi");
                   document.getElementById('bulkcontact_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter contact no. </b>";
				   if(focus_field=='') focus_field = 'name';
			       count_bug+=1;
				 }

	if(document.bulkfrm.productcode.value=='')
				 {
		//alert("hi");
                   document.getElementById('bulkproductcode_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter product code </b>";
				   if(focus_field=='') focus_field = 'name';
			       count_bug+=1;
				 }

	if(document.bulkfrm.productname.value=='')
				 {
		//alert("hi");
                   document.getElementById('bulkproductname_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter product name </b>";
				   if(focus_field=='') focus_field = 'name';
			       count_bug+=1;
				 }

	if(document.bulkfrm.code_field.value=='')
				 {
		//alert("hi");
                   document.getElementById('captcha_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter captcha code </b>";
				   if(focus_field=='') focus_field = 'code_field';
			       count_bug+=1;
				 }

				

apos=document.bulkfrm.email.value.indexOf("@");
dotpos=document.bulkfrm.email.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('bulkmail_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'email';
			       count_bug+=1;
				 }else{
                 document.getElementById('bulkmail_msg').innerHTML="";
				 count_bug=0;
				 }


	if(count_bug >0)
		return false;
	else
		return true;

}



/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////





/////////////////////////////Color check validation//////////////////////////////////////////////////////////////////

//Check bulkorder form

function qty_check(qty,minqty,maxqty)
             {
   
//if(maxqty==0){
if(qty < minqty)
				 {
		
                   alert("You can't select quantity below the minimum quantity.");
				   //document.product_detailsfrm.quantity.value=minqty;
				   return false;
				 }

/*}else{
if(qty > maxqty)
				 {
		
                   alert("You can't select "+qty+" piece of this product.\nYou can select Maximum upto "+maxqty+" piece.");
				   //document.product_detailsfrm.quantity.value=maxqty;
				   return false;
				 }
	if(qty < minqty)
				 {
		
                   alert("You can't select quantity below the minimum quantity.");
				   //document.product_detailsfrm.quantity.value=minqty;
				   return false;
				 }*/

}
	
	


/////////////////////////////Function for validating business_with_hhec.php//////////////////////////////
function validate_business_frm()
             {
				
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}

	if(document.bussiness_frm.textName.value=='')
				 {
                   document.getElementById('div_name').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter Name</b>";
				   if(focus_field=='') focus_field = 'textName';
			       count_bug+=1;
				 }

	
apos=document.bussiness_frm.textMail.value.indexOf("@");
dotpos=document.bussiness_frm.textMail.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('div_mail').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail.</b>";
				   if(focus_field=='') focus_field = 'textMail';
			       count_bug+=1;
				 }else{
                 document.getElementById('div_mail').innerHTML="";
				 count_bug=0;
				 }
if(document.bussiness_frm.code_field.value=='')
				 {
		//alert("hi");
                   document.getElementById('captcha_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter captcha code </b>";
				   if(focus_field=='') focus_field = 'code_field';
			       count_bug+=1;
				 }


	if(count_bug >0)
		return false;
	else
		return true;

}




/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////
////Function for displaying password on addressdetails form//////////////////

function fetchaddpass(){
document.getElementById('logacctd').style.display = "block";
}

function disclsaddpass(){
document.getElementById('logacctd').style.display = "none";
}

/////////////////////////////////////////////////////////////////////////////

//Check user_adress_form.php form

function validate_address_form()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
/*For email Validation*/
	

if(document.registration_form.txiName.value=='')
				 {
                   document.getElementById('name_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your name</b>";
				   if(focus_field=='') focus_field = 'txiName';
			       count_bug+=1;
				 }
if(document.registration_form.txiAddress.value=='')
				 {
                   document.getElementById('adds_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your Address</b>";
				   if(focus_field=='') focus_field = 'txiAddress';
			       count_bug+=1;
				 }

if(document.registration_form.txiCity.value=='')
				 {
                   document.getElementById('city_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your City</b>";
				   if(focus_field=='') focus_field = 'txiCity';
			       count_bug+=1;
				 }
if(document.registration_form.txiState.value=='')
				 {
                   document.getElementById('state_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your State</b>";
				   if(focus_field=='') focus_field = 'txiState';
			       count_bug+=1;
				 }
if(document.registration_form.txiPostCode.value=='')
				 {
                   document.getElementById('pin_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your Pincode</b>";
				   if(focus_field=='') focus_field = 'txiPostCode';
			       count_bug+=1;
				 }
if(document.registration_form.txiPhone.value=='')
				 {
                   document.getElementById('phone_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your Pincode</b>";
				   if(focus_field=='') focus_field = 'txiPhone';
			       count_bug+=1;
				 }
if(document.registration_form.txiEmailAddress.value=='')
				 {
                   document.getElementById('email_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Please enter your email</b>";
				   if(focus_field=='') focus_field = 'txiEmailAddress';
			       count_bug+=1;
				 }

apos=document.registration_form.txiEmailAddress.value.indexOf("@");
dotpos=document.registration_form.txiEmailAddress.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('email_msg').innerHTML ="<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'txiEmailAddress';
			       count_bug+=1;
				 }




	if(count_bug >0)
		return false;
	else
		return true;

}

function password_length()
{
	
                 var passlen=document.registration_form.password.value;
				 var len=passlen.length;
                  if(len<=4){
                 document.getElementById('pass_msg').innerHTML ="&nbsp;<b>Strength is weak</b>";
				  }
				  else if((len<=6)&&(len>4)){
                document.getElementById('pass_msg').innerHTML ="&nbsp;<b>Strength is medium</b>";
				  }
				  else if(((len<=8)&&(len>6))||(len>8)){
                document.getElementById('pass_msg').innerHTML ="&nbsp;<b>Strength is high(<i>Secure</i>)</b>";
				  }
				 
}

///////////////////////////////Subscription Form/////////////////////////


function validate_subscription()
             {
     var count_bug=0;
	var focus_field = '';	
	var tmp_arr = document.getElementsByTagName("div");
	for(var i = 0; i < tmp_arr.length; i++)
	{
		if(tmp_arr[i].className == "texterror_sub")
		{
			 tmp_arr[i].innerHTML = "&nbsp;";
		}
	}
	
/*For email Validation*/
	if(document.subfrm.email.value=='Enter your e-mail address')
				 {
                   document.getElementById('email_msg_sub').innerHTML ="&nbsp;&nbsp;&nbsp;<img src='images/error_icon.gif'>&nbsp;<b>Please enter your email id!</b>";
				   if(focus_field=='') focus_field = 'email';
			       count_bug+=1;
				 }
	else
				 {
		
				
apos=document.subfrm.email.value.indexOf("@");
dotpos=document.subfrm.email.value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
				 {
                   document.getElementById('email_msg_sub').innerHTML ="&nbsp;&nbsp;&nbsp;<img src='images/error_icon.gif'>&nbsp;<b>Not a valid e-mail address!</b>";
				   if(focus_field=='') focus_field = 'email';
			       count_bug+=1;
				 }
	else
					 {
		if(document.subfrm.code_field.value=='Enter given code')
				 {
                   document.getElementById('email_msg_sub').innerHTML ="&nbsp;&nbsp;&nbsp;<img src='images/error_icon.gif'>&nbsp;<b>Please enter given code!</b>";
				   if(focus_field=='') focus_field = 'code_field';
			       count_bug+=1;
				 }
					 }
				 }

	if(count_bug >0)
		return false;
	else
		return true;

}

function isDistributor()
{
if(document.registration_form.utype.value=='Y')
				 {
                   document.getElementById('is_dist').innerHTML ="&nbsp;<b>Distributor account can be accessed only after the admin authentication.</b>";
				   if(focus_field=='') focus_field = 'utype';			       
				 }
else
	{
document.getElementById('is_dist').innerHTML ="";
				   
	}
}



/////////////////////////////////////////////////////////Ends//////////////////////////////////////////////////////////////////
