﻿// JScript File for All The Validations
//********Validate Add reviews
function ValReview()
{

var txtTitle=document.getElementById("txtTitle")
var txtReview=document.getElementById("txtReview")
if (txtTitle.value=="")
{
alert("Please enter title for your review.")
txtTitle.focus()
return false;
}
if (txtReview.value=="")
{
alert("Please add your review.")
txtReview.focus()
return false;
}
}


//********Function add text to quick search
function AddText()
{
txtSearch=document.getElementById("ctl00_txtSearch")
if (txtSearch.value=="" || txtSearch.value=="Enter Keyword")
{
alert("Please enter search keyword.")
txtSearch.value="Enter Keyword"
txtSearch.focus()
return false;
}
}
//**************
function ChkText()
{
var	txtSearch=document.getElementById("ctl00_txtSearch")
	if(txtSearch.value=="Enter Keyword")
	{
	txtSearch.value="";
	}
}
//***********	
function FillText()
{
  var  txtSearch=document.getElementById("ctl00_txtSearch")
	if(txtSearch.value=="")
	{
	txtSearch.value="Enter Keyword";
	}
}

//********Added By Sunil Yadav on 27.07.07
//*****Check email

//**************
function ChkTextSubscribe()
{
var	txtSubscribe=document.getElementById("ctl00_Subscribe1_txtEmail")
	if(txtSubscribe.value=="Email Address")
	{
	txtSubscribe.value="";
	}
}
//***********	
function FillTextSubscribe()
{
  var  txtSubscribe=document.getElementById("ctl00_Subscribe1_txtEmail")
	if(txtSubscribe.value=="")
	{
	txtSubscribe.value="Email Address";
	}
}


//check email
function CheckSubscriber()
{
txtEmail=document.getElementById("ctl00_Subscribe1_txtEmail")

	if (txtEmail.value=="" || txtEmail.value=="Email Address")
{
alert("Please enter email address.")
txtEmail.value="Email Address"
txtEmail.focus()
return false;
}


	if (txtEmail.value=="")
	{
		alert("Email should not be blank.")
		txtEmail.focus();
		return false;
	}

	var str = txtEmail.value;   
	if (str.length<=5)
	{
		alert("Email should not be less than 6 characters.")
		txtEmail.focus();
		return false;
	}
	
	var mail = txtEmail.value;
	if (mail == "")
	{
		alert("Incomplete Email ID.");
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf("@")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf(".")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	var aa=0;
	var bb=0;
	var cc=0;
	var td="";
	for (j =0 ; j<mail.length ;j++)
	{
		if(mail.charAt(j) =="@"){
		aa=j;
		cc=cc+1;
			if ((aa==0) || (cc>1)){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else if(mail.charAt(j)=="."){
		bb=j;
		td=td+mail.charAt(j);
			if(td==".."){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
			if (bb==0){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else{
			td="";
		}
	} //end for loop
	if (aa == mail.length-1)
	{
	    alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (bb == mail.length-1)
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}	
	if(aa >= (bb-1))
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
}

//********Funtion to remove spaces
function removeSpaces(string) 
{
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}	
function ValidateLogin()
{
txtUserName=document.getElementById("ctl00_ContentPlaceHolder1_txtLoginMail")
txtPass=document.getElementById("ctl00_ContentPlaceHolder1_txtPassword")
    if (txtUserName.value=="")
	{
		alert("Email Id should not be blank.")
		txtUserName.focus();
		return false;
	}
	if (txtPass.value=="")
	{
		alert("Password should not be blank.")
		txtPass.focus();
		return false;
	}
}

//Function to copy from billing value to shipping
function Billtoship()
{
if (document.getElementById("chkBilltoship").checked==true)
{
var i;
var drpCountry,drpState,txtState,divdrpState,divtxtState
drpCountry=document.getElementById("ctl00_ContentPlaceHolder1_cboBillCountry")
drpState=document.getElementById("ctl00_ContentPlaceHolder1_cboBillState")
divdrpState=document.getElementById("ctl00_ContentPlaceHolder1_divdrpState")
divtxtState=document.getElementById("ctl00_ContentPlaceHolder1_divtxtState")

document.getElementById("ctl00_ContentPlaceHolder1_txtBillFName").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddFName").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillLName").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddLName").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillCity").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddCity").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillZip").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddZip").value
document.getElementById("ctl00_ContentPlaceHolder1_txtState").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddState").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone1").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddPh1").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone2").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddPh2").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone3").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddPh3").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillAddress1").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddAdrs1").value
document.getElementById("ctl00_ContentPlaceHolder1_txtBillAddress2").value=document.getElementById("ctl00_ContentPlaceHolder1_HiddAdrs2").value
for(i=0;drpCountry.length-1;i++)
{
if (drpCountry.options[i].value==document.getElementById("ctl00_ContentPlaceHolder1_HiddCountry").value)
{
drpCountry.options[i].selected=true;
break;
}
}
if (drpCountry.value!="US")
{
    divdrpState.style.display="none"
    divtxtState.style.display="block"
     
}
else
{

 divtxtState.style.display="none"
 divdrpState.style.display="block"
 }



for(i=0;drpState.length-1;i++)
{
//alert(document.getElementById("cboBillState").options[i].selected);
if (drpState.options[i].value==document.getElementById("ctl00_ContentPlaceHolder1_HiddState").value)
{
drpState.options[i].selected=true;
break;
}
}


////document.getElementById("cboState").selected =document.getElementById("HiddState")
////document.getElementById("cboCountry").selected =document.getElementById("HiddCountry")

return true;
}
else
{
document.getElementById("ctl00_ContentPlaceHolder1_txtBillFName").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillLName").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillCity").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillZip").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone1").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone2").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone3").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillAddress1").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtBillAddress2").value=""
document.getElementById("ctl00_ContentPlaceHolder1_txtState").value=""
//document.getElementById("cboState")=
//document.getElementById("cboCountry")=
return true;

}

}





function allValidChars(txtEmail) {
  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
  for (var i=0; i < txtEmail.value.length; i++) {
    var letter = txtEmail.value.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)
      continue;
    parsed = false;
    break;
  }
  return parsed;
}




//Check and validate email
function checkMail(txtEmail)
{
//-----Email


 if (! allValidChars(txtEmail)) {  // check to make sure all characters are valid
        alert("Invalid Email ID Format.");
        return false;
    }
    
     
    
    
	if (txtEmail.value=="")
	{
		alert("Email should not be blank.")
		txtEmail.focus();
		return false;
	}

	var str = txtEmail.value;   
	if (str.length<=5)
	{
		alert("Email should not be less than 6 characters.")
		txtEmail.focus();
		return false;
	}
	
	var mail = txtEmail.value;
	if (mail == "")
	{
		alert("Incomplete Email ID.");
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf("@")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf(".")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	var aa=0;
	var bb=0;
	var cc=0;
	var td="";
	for (j =0 ; j<mail.length ;j++)
	{
		if(mail.charAt(j) =="@"){
		aa=j;
		cc=cc+1;
			if ((aa==0) || (cc>1)){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else if(mail.charAt(j)=="."){
		bb=j;
		td=td+mail.charAt(j);
			if(td==".."){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
			if (bb==0){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else{
			td="";
		}
	} //end for loop
	if (aa == mail.length-1)
	{
	    alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (bb == mail.length-1)
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}	
	if(aa >= (bb-1))
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
return true;
}
			
function ValidateCustReg()
{
//Shipping text fields
txtFirstName=document.getElementById("ctl00_ContentPlaceHolder1_txtFName")
txtLastName=document.getElementById("ctl00_ContentPlaceHolder1_txtLName")
txtRegConfPassword=document.getElementById("ctl00_ContentPlaceHolder1_txtRegConfPassword")
txtPass=document.getElementById("ctl00_ContentPlaceHolder1_txtRegPassword")
txtEmail=document.getElementById("ctl00_ContentPlaceHolder1_txtEmail")
txtConfEmail=document.getElementById("ctl00_ContentPlaceHolder1_txtConfEmail")




//txtFirstName.value=txtFirstName.value.replace(/\s/g,""); 

txtFirstName.value=txtFirstName.value.replace(/^\s+|\s+$/g,"");

txtLastName.value=txtLastName.value.replace(/^\s+|\s+$/g,"");

	if (txtFirstName.value=="")
	{
		alert("First Name should not be blank.")
		txtFirstName.focus();
		return false;
	}
	
    if (txtFirstName.value!="")
	{
  
    var strc=removeSpaces(txtFirstName.value)
  
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			        if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtFirstName.focus();
		            return false;
				}
			}
	 }

	
	if (txtLastName.value=="")
	{
		alert("Last Name should not be blank.")
		txtLastName.focus();
		return false;
	}
	
	if (txtLastName.value!="")
	{

var strc=removeSpaces(txtLastName.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtLastName.focus();
		            return false;
				}
			}
	 }
	 
	 	
	 	
if (checkMail(txtEmail) == false) 
{
return false;
}

if (checkMail(txtConfEmail) == false) 
{
return false;
}
	 	
if (txtEmail.value!="" && txtConfEmail.value!="" && txtEmail.value!=txtConfEmail.value)
	{
		alert("Email and Confirm email Address do not match.")
		txtConfEmail.focus();
		return false;
	}	 	
	 	
	 	//Password 
	if (txtPass.value=="")
	{
		alert("Password should not be blank.")
		txtPass.focus();
		return false;
	}
	 	//Confirm Password 
	if (txtRegConfPassword.value=="")
	{
		alert("Confirm Password should not be blank.")
		txtRegConfPassword.focus();
		return false;
	}
	
	if (txtRegConfPassword.value!="" && txtPass.value!="" && txtRegConfPassword.value!=txtPass.value)
	{
		alert("Password and Confirm Password do not match.")
		txtRegConfPassword.focus();
		return false;
	}
	if (txtPass.value.length < 6)
{
alert("Password should not be less than 6 characters.")
		txtPass.focus();
		return false;
}

if (txtRegConfPassword.value.length < 6)
{
alert("Password should not be less than 6 characters.")
		txtRegConfPassword.focus();
		return false;
}
	
	
}


function ValidateShippInfo()
{
//Shipping text fields

txtCity=document.getElementById("ctl00_ContentPlaceHolder1_txtCity")
txtZip=document.getElementById("ctl00_ContentPlaceHolder1_txtZip")
txtAdd1=document.getElementById("ctl00_ContentPlaceHolder1_txtAddress1")
txtAdd2=document.getElementById("ctl00_ContentPlaceHolder1_txtAddress2")
drpState=document.getElementById("ctl00_ContentPlaceHolder1_cboState")
drpCountry=document.getElementById("ctl00_ContentPlaceHolder1_cboCountry")
txtPhoneA=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone1")
txtPhoneB=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone2")
txtPhoneC=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone3")
txtState1=document.getElementById("ctl00_ContentPlaceHolder1_txtState")

if (txtAdd1.value=="")
	{
		alert("Address Line 1 should not be blank.")
		txtAdd1.focus();
		return false;
	}
	
	

if (txtCity.value=="")
	{
		alert("City name should not be blank.")
		txtCity.focus();
		return false;
	}	
	
	
if (txtCity.value!="")
	{

var strc=removeSpaces(txtCity.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtCity.focus();
		            return false;
				}
			}
	 }
	
	
    	
	  if (drpCountry.value!="US")
	    {
	 
	   if(txtState1.value=="")
	        {
	            alert("State should not be blank.")
	            txtState1.focus();
	            return false;
	            }
	   }
	   else
	   {
	   
	   }
	
	    	

	
	//Zip
	if (txtZip.value=="")
	   {
	    alert("Zip Should not be blank")
	    txtZip.focus();
		return false;
	   }
	if (isNaN(txtZip.value))
	{
	
		alert("Zip should be numeric.")
		txtZip.focus();
		return false;
	}
	if (txtZip.value.length<5)
	   {
	    alert("Invalid Zip")
	    txtZip.focus();
		return false;
	   }
	   
	   
	     if (drpCountry.value=="US")
	    {
	 
	   if (txtZip.value.length!=5)
	   {
	    alert("Invalid Zip.")
	    txtZip.focus();
		return false;
	   }
	  
	   }
	   
	   //Country
	   
	   	if (drpCountry.value=="")
	{
		alert("Please Select a Country.")
		drpCountry.focus();
		return false;
	}
	
	
	

	
	//-----Phone Number
		if (txtPhoneA.value=="")
	{
		alert("Please enter phone number.")
		txtPhoneA.focus();
		return false;
	}
	
	if (txtPhoneA.value!="")
	{
	
		i=0;
		ch="";
		var CN1 = txtPhoneA.value;
		for (var i = 0; i < CN1.length; i++){
			var ch = CN1.substring(i, i + 1);
		if (((ch < "0" || "9" < ch) && (ch!=" ") ))
			{
				alert("Contact Phone accepts ONLY numeric characters (0-9)");
				txtPhoneA.focus();
				return false;
			}
		}
	}
		if (txtPhoneB.value=="")
	{
		alert("Please enter phone number.")
		txtPhoneB.focus();
		return false;
	}
	if (txtPhoneB.value!="")
	{
	
		i=0;
		ch="";
		var CN1 = txtPhoneB.value;
		for (var i = 0; i < CN1.length; i++){
			var ch = CN1.substring(i, i + 1);
		if (((ch < "0" || "9" < ch) && (ch!=" ") ))
			{
				alert("Contact Phone accepts ONLY numeric characters (0-9)");
				txtPhoneB.focus();
				return false;
			}
		}
	}
		if (txtPhoneC.value=="")
	{
		alert("Please enter phone number.")
		txtPhoneC.focus();
		return false;
	}
	if (txtPhoneC.value!="")
	{

		i=0;
		ch="";
		var CN1 = txtPhoneC.value;
		for (var i = 0; i < CN1.length; i++){
			var ch = CN1.substring(i, i + 1);
		if (((ch < "0" || "9" < ch) && (ch!=" ") ))
			{
				alert("Contact Phone accepts ONLY numeric characters (0-9)");
				txtPhoneC.focus();
				return false;
			}
		}
	}





}

function ValidateCard()
{
//Payment method
txtCardHoldrName=document.getElementById("ctl00_ContentPlaceHolder1_txtCardHoldrName")
txtCardNumber=document.getElementById("ctl00_ContentPlaceHolder1_txtCardNumber")
drpMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpMonth")
drpYear=document.getElementById("ctl00_ContentPlaceHolder1_drpYear")
drpCardtype=document.getElementById("ctl00_ContentPlaceHolder1_drpPaymentType")

//txtVarification=document.getElementById("txtVarification")
var time =new Date()
var month = time.getMonth() +1
var day = time.getDate()
var year =time.getFullYear()

//var ccdate = (month + "/" + day + "/" + year) 
//var cdate = (drpMonth.value + "/" + day + "/" + drpYear.value )

if ((drpMonth.value <= month) && (drpYear.value <= year))
{
alert("Invalid date.")
	return false;
}

if (txtCardHoldrName.value=="")
	{
		alert("Card Holder's name should not be blank.")
		txtCardHoldrName.focus();
		return false;
	}

if (drpCardtype.value == "--Select--")
{
alert("Select Card Type.")
		drpCardtype.focus();
		return false;
}


	
		if (txtCardNumber.value=="")
	{
		alert("Card Number should not be blank.")
		txtCardNumber.focus();
		return false;
	}
	
	if ((txtCardNumber.value.length < 13)||(txtCardNumber.value.length > 16))
	{
		alert("Enter Valid Card Number.")
		txtCardNumber.focus();
		return false;
	}
	
	if (isNaN(txtCardNumber.value))
	{
	alert("Card Number should be numeric.")
	txtCardNumber.focus();
	return false;
	}
	if (drpMonth.value=="Month")
	{
		alert("Please select card expiry month.")
		drpMonth.focus();
		return false;
	}
		if (drpYear.value=="Year")
	{
		alert("Please select card expiry year.")
		drpYear.focus();
		return false;
	}
	
}

function SearchandManu()
{

txtSearch=document.getElementById("ctl00_ContentPlaceHolder1_txtSearch")
ddlmanufacturer=document.getElementById("ctl00_ContentPlaceHolder1_ddlmanufacturer")
if (txtSearch.value=="" && ddlmanufacturer.value=="--Select--") 
	{
		alert("Enter Search Criteria.")
		txtSearch.focus();
		return false;
	}
		
	
}


function ValidateBillInfo()
{
//Payment method
txtCardHoldrName=document.getElementById("ctl00_ContentPlaceHolder1_txtCardHoldrName")
txtCardNumber=document.getElementById("ctl00_ContentPlaceHolder1_txtCardNumber")
//drpPaymentType=document.getElementById("drpPaymentType")
drpMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpMonth")
drpYear=document.getElementById("ctl00_ContentPlaceHolder1_drpYear")
//txtVarification=document.getElementById("txtVarification")



//Billing text fields
txtFirstName1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillFName")
txtLastName1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillLName")
txtCity1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillCity")
txtEmail1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillEmail")
txtZip1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillZip")
txtPhoneA1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone1")
txtPhoneB1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone2")
txtPhoneC1=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone3")
txtAdd11=document.getElementById("ctl00_ContentPlaceHolder1_txtBillAddress1")
txtAdd21=document.getElementById("ctl00_ContentPlaceHolder1_txtBillAddress2")
drpState1=document.getElementById("ctl00_ContentPlaceHolder1_cboBillState")
txtState1=document.getElementById("ctl00_ContentPlaceHolder1_txtState")
drpCountry1=document.getElementById("ctl00_ContentPlaceHolder1_cboBillCountry")

	if (txtCardHoldrName.value=="")
	{
		alert("Card Holder's name should not be blank.")
		txtCardHoldrName.focus();
		return false;
	}
	
		if (txtCardNumber.value=="")
	{
		alert("Card Number should not be blank.")
		txtCardNumber.focus();
		return false;
	}
	
	if (isNaN(txtCardNumber.value))
	{
	alert("Card Number should be numeric.")
	txtCardNumber.focus();
	return false;
	}
	if (drpMonth.value=="Month")
	{
		alert("Please select card expiry month.")
		drpMonth.focus();
		return false;
	}
		if (drpYear.value=="Year")
	{
		alert("Please select card expiry year.")
		drpYear.focus();
		return false;
	}

	
	
	//Here is the validation code for billing information Added by SUNIL YADAV on 05.07.07
	if (txtFirstName1.value=="")
	{
		alert("First Name should not be blank.")
		txtFirstName1.focus();
		return false;
	}
	
    if (txtFirstName1.value!="")
	{
  
    var strc=removeSpaces(txtFirstName1.value)
  
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			        if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtFirstName1.focus();
		            return false;
				}
			}
	 }

	
	if (txtLastName1.value=="")
	{
		alert("Last Name should not be blank.")
		txtLastName1.focus();
		return false;
	}
	
	if (txtLastName1.value!="")
	{

var strc=removeSpaces(txtLastName1.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtLastName1.focus();
		            return false;
				}
			}
	 }
	if (txtAdd11.value=="")
	{
		alert("Address Line 1 should not be blank.")
		txtAdd11.focus();
		return false;
	}
	
	
if (txtCity1.value=="")
	{
		alert("City name should not be blank.")
		txtCity1.focus();
		return false;
	}	
	
	
if (txtCity1.value!="")
	{

var strc=removeSpaces(txtCity1.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtCity1.focus();
		            return false;
				}
			}
	 }
	
	  if (drpCountry1.value!="US")
	    {
	 
	   if(txtState1.value=="")
	        {
	            alert("State should not be blank.")
	            txtState1.focus();
	            return false;
	            }
	   }
	
       
	    	

	
	//Zip
	if (txtZip1.value=="")
	   {
	    alert("Zip Should not be blank.")
	    txtZip1.focus();
		return false;
	   }
	if (isNaN(txtZip1.value))
	{
	
		alert("Zip should be numeric.")
		txtZip1.focus();
		return false;
	}
	if (txtZip1.value.length<5)
	   {
	    alert("Invalid Zip")
	    txtZip1.focus();
		return false;
	   }
	   
	     if (drpCountry1.value=="US")
	    {
	 
	   if (txtZip1.value.length!=5)
	   {
	    alert("Invalid Zip.")
	    txtZip1.focus();
		return false;
	   }
	  
	   }
	   
	   //Country
	   
	   	if (drpCountry1.value=="")
	{
		alert("Please Select a Country.")
		drpCountry1.focus();
		return false;
	}
	
	


//-----Phone Number
		if (txtPhoneA1.value=="")
	{
		alert("Please enter phone number.")
		txtPhoneA1.focus();
		return false;
	}
	
	if (txtPhoneA1.value!="")
	{
	
		i=0;
		ch="";
		var CN1 = txtPhoneA1.value;
		for (var i = 0; i < CN1.length; i++){
			var ch = CN1.substring(i, i + 1);
		if (((ch < "0" || "9" < ch) && (ch!=" ") ))
			{
				alert("Contact Phone accepts ONLY numeric characters (0-9)");
				txtPhoneA1.focus();
				return false;
			}
		}
	}
		if (txtPhoneB1.value=="")
	{
		alert("Please enter phone number.")
		txtPhoneB1.focus();
		return false;
	}
	if (txtPhoneB1.value!="")
	{
	
		i=0;
		ch="";
		var CN1 = txtPhoneB1.value;
		for (var i = 0; i < CN1.length; i++){
			var ch = CN1.substring(i, i + 1);
		if (((ch < "0" || "9" < ch) && (ch!=" ") ))
			{
				alert("Contact Phone accepts ONLY numeric characters (0-9)");
				txtPhoneB1.focus();
				return false;
			}
		}
	}
		if (txtPhoneC1.value=="")
	{
		alert("Please enter phone number.")
		txtPhoneC1.focus();
		return false;
	}
	if (txtPhoneC1.value!="")
	{

		i=0;
		ch="";
		var CN1 = txtPhoneC1.value;
		for (var i = 0; i < CN1.length; i++){
			var ch = CN1.substring(i, i + 1);
		if (((ch < "0" || "9" < ch) && (ch!=" ") ))
			{
				alert("Contact Phone accepts ONLY numeric characters (0-9)");
				txtPhoneC1.focus();
				return false;
			}
		}
	}
	   
	
  return true;
}


//Phone Entry

function moveFocus1()
{ 
var txtPhoneA,txtPhoneB
txtPhoneA=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone1")
txtPhoneB=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone2")
 	var len;
	len = txtPhoneA.value.length;
	if (len == 3)
	{
		txtPhoneB.focus();
	}
}
function moveFocus2()
{var txtPhoneB,txtPhoneC

txtPhoneC=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone3")
txtPhoneB=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone2")
	var len;
	len = txtPhoneB.value.length;
	if (len == 3)
	{
		txtPhoneC.focus();
	}
}
//Phone Entry

function moveBillFocus1()
{ 
var txtPhoneA,txtPhoneB
txtPhoneA=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone1")
txtPhoneB=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone2")
 	var len;
	len = txtPhoneA.value.length;
	if (len == 3)
	{
		txtPhoneB.focus();
	}
}
function moveBillFocus2()
{var txtPhoneB,txtPhoneC

txtPhoneC=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone3")
txtPhoneB=document.getElementById("ctl00_ContentPlaceHolder1_txtBillPhone2")
	var len;
	len = txtPhoneB.value.length;
	if (len == 3)
	{
		txtPhoneC.focus();
	}
}
 
//
function CCValidatePage()
{
	var frm=document.Form1
	if (frm.txtNameOnCard.value=="" || frm.txtCardNo.value=="" || frm.txtMonth.value=="" || frm.txtYear.value=="")
	{
		//Credit Card===================
		if(document.Form1.txtNameOnCard.value.length==0)
		{
			alert("Please enter your name as it appear on the Card.");
			document.Form1.txtNameOnCard.focus();
			return false;
		}
		else if(document.Form1.txtCardNo.value.length==0)
		{
			alert("Please enter your Card No.");
			document.Form1.txtCardNo.focus();
			return false;
		}
		else if(document.Form1.txtMonth.value.length==0)
		{
			alert("Please enter your Card's Expiry Date.");
			document.Form1.txtMonth.focus();	
			return false;
		}
		else if(document.Form1.txtYear.value.length==0)
		{
			alert("Please enter your Card's Expiry Date.");
			document.Form1.txtYear.focus();	
			return false;
		}
		return true;
	}
	return true;
}


//check email for Send To Friend
function CheckSendToFriend()
{
txtEmail=document.getElementById("ctl00_txtToFriend")

	if (txtEmail.value=="" || txtEmail.value=="Email Address")
{
alert("Please enter email address.")
txtEmail.value=""
txtEmail.focus()
return false;
}


	if (txtEmail.value=="")
	{
		alert("Email should not be blank.")
		txtEmail.focus();
		return false;
	}

	var str = txtEmail.value;   
	if (str.length<=5)
	{
		alert("Email should not be less than 6 characters.")
		txtEmail.focus();
		return false;
	}
	
	var mail = txtEmail.value;
	if (mail == "")
	{
		alert("Incomplete Email ID.");
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf("@")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf(".")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	var aa=0;
	var bb=0;
	var cc=0;
	var td="";
	for (j =0 ; j<mail.length ;j++)
	{
		if(mail.charAt(j) =="@"){
		aa=j;
		cc=cc+1;
			if ((aa==0) || (cc>1)){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else if(mail.charAt(j)=="."){
		bb=j;
		td=td+mail.charAt(j);
			if(td==".."){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
			if (bb==0){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else{
			td="";
		}
	} //end for loop
	if (aa == mail.length-1)
	{
	    alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (bb == mail.length-1)
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}	
	if(aa >= (bb-1))
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
}

//Validate Feedback form
function ValidateFeedback()
{
//Shipping text fields
txtFirstName=document.getElementById("ctl00_ContentPlaceHolder1_txtFName")
txtLastName=document.getElementById("ctl00_ContentPlaceHolder1_txtLName")
txtEmail=document.getElementById("ctl00_ContentPlaceHolder1_txtEmail")
txtCity=document.getElementById("ctl00_ContentPlaceHolder1_txtCity")
txtZip=document.getElementById("ctl00_ContentPlaceHolder1_txtZip")
txtMessage=document.getElementById("ctl00_ContentPlaceHolder1_txtMessage")
txtState=document.getElementById("ctl00_ContentPlaceHolder1_txtState")
drpCountry=document.getElementById("ctl00_ContentPlaceHolder1_cboCountry")
	if (txtFirstName.value=="")
	{
		alert("First Name should not be blank.")
		txtFirstName.focus();
		return false;
	}
	
    if (txtFirstName.value!="")
	{
  
    var strc=removeSpaces(txtFirstName.value)
  
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			        if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtFirstName.focus();
		            return false;
				}
			}
	 }

	
	if (txtLastName.value=="")
	{
		alert("Last Name should not be blank.")
		txtLastName.focus();
		return false;
	}
	
	if (txtLastName.value!="")
	{

var strc=removeSpaces(txtLastName.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtLastName.focus();
		            return false;
				}
			}
	 }
	 
	 	
if (txtEmail.value=="")
	{
		alert("Email should not be blank.")
		txtEmail.focus();
		return false;
	}

	var str = txtEmail.value;   
	if (str.length<=5)
	{
		alert("Email should not be less than 6 characters.")
		txtEmail.focus();
		return false;
	}
	
	var mail = txtEmail.value;
	if (mail == "")
	{
		alert("Incomplete Email ID.");
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf("@")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (mail.indexOf(".")== -1)
	{
		alert("Invalid Email ID.")
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	var aa=0;
	var bb=0;
	var cc=0;
	var td="";
	for (j =0 ; j<mail.length ;j++)
	{
		if(mail.charAt(j) =="@"){
		aa=j;
		cc=cc+1;
			if ((aa==0) || (cc>1)){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else if(mail.charAt(j)=="."){
		bb=j;
		td=td+mail.charAt(j);
			if(td==".."){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
			if (bb==0){
				alert("Invalid Email ID Format.");
				txtEmail.select();
				txtEmail.focus();
				return false;
			}
		}else{
			td="";
		}
	} //end for loop
	if (aa == mail.length-1)
	{
	    alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}
	if (bb == mail.length-1)
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}	
	if(aa >= (bb-1))
	{
		alert("Invalid Email ID Format.");
		txtEmail.select();
		txtEmail.focus();
		return false;
	}	 	
	 	
	 	//Password 
	if (txtCity.value=="")
	{
		alert("City Name should not be blank.")
		txtCity.focus();
		return false;
	}
	  
	    if (txtCity.value!="")
	{

var strc=removeSpaces(txtCity.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtCity.focus();
		            return false;
				}
			}
	 }
	    
	  
	  if (drpCountry.value!="US")
	    {
	 
	   if(txtState.value=="")
	        {
	            alert("State should not be blank.")
	            txtState.focus();
	            return false;
	            }
	               if (txtState.value!="")
	{

var strc=removeSpaces(txtState.value)
	 
	for (var i = 0; i < strc.length; i++)
			{
				var ch = strc.substring(i, i + 1);
			if((ch >= 0 && ch <= 9 ))
				{
					alert("Please enter alphabets only [A-Z, a-z].")
					txtState.focus();
		            return false;
				}
			}
	 } 
 }
	
	
	 	//Confirm Password 
	if (txtZip.value=="")
	{
		alert("Zip code should not be blank.")
		txtZip.focus();
		return false;
	}
	if (isNaN(txtZip.value))
{

alert("Zip should be numeric.")
txtZip.focus();
return false;
}
	 
	 if (drpCountry.value=="US")
	    {
	
	   if (txtZip.value.length!=5)
	   {
	    alert("Invalid Zip.")
	    txtZip.focus();
		return false;
	   }
	  
	   }
	  
	
	
	
	if (txtMessage.value=="")
	{
		alert("Please enter your message in feedback area.")
		txtMessage.focus();
		return false;
	}
	
	
	
}




//Validate Reviewer form
function ValidateReviewer()
{

txtFirstName=document.getElementById("txtFName")
txtLastName=document.getElementById("txtLName")
txtEmail=document.getElementById("txtEmail")
txtConfEmail=document.getElementById("txtConfMail")
drpCountry=document.getElementById("cboCountry")
txtCity=document.getElementById("txtCity")
drpState=document.getElementById("cboState")
txtZip=document.getElementById("txtZip")
txtPass=document.getElementById("txtRegPassword")
txtRegConfPassword=document.getElementById("txtRepassword")
	txtState1=document.getElementById("txtState")
	 
       



if (txtFirstName.value=="")
{
	alert("First Name should not be blank.")
	txtFirstName.focus();
	return false;
}

	
	if (txtLastName.value=="")
	{
		alert("Last Name should not be blank.")
		txtLastName.focus();
		return false;
	}
	
	 
	 	
if (checkMail(txtEmail) == false) 
{
return false;
}

if (checkMail(txtConfEmail) == false) 
{
return false;
}
	 	
if (txtEmail.value!="" && txtConfEmail.value!="" && txtEmail.value!=txtConfEmail.value)
	{
		alert("Email and Confirm email Address do not match.")
		txtConfEmail.focus();
		return false;
	}	 	 	
	

if (txtCity.value=="")
{
	alert("City name should not be blank.")
	txtCity.focus();
	return false;
}	


 if (drpCountry.value!="US")
	    {
	 
	   if(txtState1.value=="")
	        {
	            alert("State should not be blank.")
	            txtState1.focus();
	            return false;
	            }
	   }
	



//Zip
if (txtZip.value=="")
{
alert("Zip Should not be blank")
txtZip.focus();
return false;
}
if (isNaN(txtZip.value))
{

alert("Zip should be numeric.")
txtZip.focus();
return false;
}
if (txtZip.value.length<5)
{
alert("Invalid Zip")
txtZip.focus();
return false;
}
	   
 if (drpCountry.value=="US")
{

if (txtZip.value.length!=5)
{
alert("Invalid Zip.")
txtZip.focus();
return false;
}
}

	 	//Password 
	if (txtPass.value=="")
	{
		alert("Password should not be blank.")
		txtPass.focus();
		return false;
	}
	 	//Confirm Password 
	if (txtRegConfPassword.value=="")
	{
		alert("Confirm Password should not be blank.")
		txtRegConfPassword.focus();
		return false;
	}
	
	if (txtRegConfPassword.value!="" && txtPass.value!="" && txtRegConfPassword.value!=txtPass.value)
	{
		alert("Password and Confirm Password do not match.")
		txtRegConfPassword.focus();
		return false;
	}
	
	
}


function validateQuant()
{
txtQuant=document.getElementById("ctl00_ContentPlaceHolder1_txtQuantity")

if (isNaN(txtQuant.value))
{

alert("Quantity should be numeric.")
txtQuant.focus();
return false;
}
if (txtQuant.value<=0)
{
	alert("Quantity should be greater then 0.")
	txtQuant.focus();
	return false;
}	
if (txtQuant.value=="")
{
	alert("Please enter product quantity .")
	txtQuant.focus();
	return false;
}	

}

//function validateQuantCart()
//{
//{	
//var ibArray = document.getElementsByTagName("input");	
//for (i=0;i<=ibArray.length-1 ;i++ )	
//{		
//if(ibArray[i].type == "text" && ibArray[i].id!="ctl00_txtSearch" && ibArray[i].id!="ctl00_Subscribe1_txtEmail")	
//{	
//if (isNaN(ibArray[i].value))
//{

//alert("Quantity should be numeric.")
//ibArray[i].focus();
//return false;
//}
//if (ibArray[i].value<=0)
//{
//	alert("Quantity should be greater then 0.")
//	ibArray[i].focus();
//	return false;
//}	
//if (ibArray[i].value=="")
//{
//	alert("Please enter product quantity .")
//	txtQuant.focus();
//	return false;
//}
//}	
//}
//}
//}


function validateQuantCart()
{
{	
var ibArray = document.getElementsByTagName("input");	
for (i=0;i<=ibArray.length-1 ;i++ )	
{		
if(ibArray[i].type == "text" && ibArray[i].id!="ctl00_txtSearch" && ibArray[i].id!="ctl00_Subscribe1_txtEmail")	
{	
if (isNaN(ibArray[i].value))
{

alert("Quantity field excepts only numbers [0-9].")
ibArray[i].focus();
return false;
}
if (ibArray[i].value<=0)
{
	alert("Please enter quantity.")
	ibArray[i].focus();
	return false;
}	
if (ibArray[i].value=="")
{
	alert("Please enter product quantity .")
	txtQuant.focus();
	return false;
}

var strc = ibArray[i].value;
for (var x = 0; x < strc.length; x++)
			{
				var ch = strc.substring(x, x + 1);
			if(!(ch == '0' || ch == '1' || ch == '2' || ch == '3' || ch == '4' || ch == '5' || ch == '6' || ch == '7' || ch == '8' || ch == '9' ))
				{
					alert("Invalid quantity")
					ibArray[i].focus();
		            return false;
				}
			}
			
			
}	
}
}
}




function validateProductQuant()
{
txtQuant=document.getElementById("ctl00_ContentPlaceHolder1_txtQuantity")

if (isNaN(txtQuant.value))
{

alert("Quantity should be numeric.")
txtQuant.focus();
return false;
}
if (txtQuant.value<=0)
{
	alert("Quantity should be greater then 0.")
	txtQuant.focus();
	return false;
}	
if (txtQuant.value=="")
{
	alert("Please enter product quantity .")
	txtQuant.focus();
	return false;
}	
var strc = txtQuant.value;
for (var x = 0; x < strc.length; x++)
			{
				var ch = strc.substring(x, x + 1);
			if(!(ch == '0' || ch == '1' || ch == '2' || ch == '3' || ch == '4' || ch == '5' || ch == '6' || ch == '7' || ch == '8' || ch == '9' ))
				{
					alert("Invalid quantity")
					txtQuant.focus();
		            return false;
				}
			}
}




//Confirm delete shopping cart items
function confirm_delete()
		{
		if (confirm("Are you sure you want to delete this Item?"))
		{
			return true;
		}
		else
		{
			return false; 
		}
		}
		
		function confirm_ClearCart()
		{
		if (confirm("Are you sure you want to clear the cart?"))
		{
			return true;
		}
		else
		{
			return false; 
		}
		}
	
	
	
	
	function validateForgotPass()
{
txtOldEmail=document.getElementById("txtOldEmail")
txtNewMail=document.getElementById("txtNewMail")
txtPass=document.getElementById("txtPassword")
    
    if (txtOldEmail.value=="")
	{
		alert("Email Id should not be blank.")
		txtOldEmail.focus();
		return false;
	}
	if (checkMail(txtOldEmail) == false) 
{
return false;
}

	if (txtPass.value=="")
	{
		alert("Password should not be blank.")
		txtPass.focus();
		return false;
	}
	if (txtOldEmail.value=="")
	{
		alert("Email Id should not be blank.")
		txtOldEmail.focus();
		return false;
	}
		if (checkMail(txtNewMail) == false) 
{
return false;
}

}


function validateForgotPass()
{
txtEmail=document.getElementById("ctl00_ContentPlaceHolder1_txtEmail")
txtconfirmmail=document.getElementById("ctl00_ContentPlaceHolder1_txtconfirmmail")
    
    if (txtEmail.value=="")
	{
		alert("Email Id should not be blank.")
		txtEmail.focus();
		return false;
	}
	if (checkMail(txtEmail) == false) 
{
return false;
}
	
	if (txtconfirmmail.value=="")
	{
		alert("Confirm Email Id should not be blank.")
		txtconfirmmail.focus();
		return false;
	}
		if (checkMail(txtconfirmmail) == false) 
{
return false;
}

if (txtconfirmmail.value!=txtEmail.value)
	{
		alert("Email and Confirm email Address do not match.")
		txtconfirmmail.focus();
		return false;
	}

}


function ValidateUpdtMail()
{
txtOldEmail=document.getElementById("ctl00_ContentPlaceHolder1_txtOldEmail")
txtPassword=document.getElementById("ctl00_ContentPlaceHolder1_txtPassword")
txtNewMail=document.getElementById("ctl00_ContentPlaceHolder1_txtNewMail")
if (checkMail(txtOldEmail) == false) 
{
return false;
}
 
 if (txtPassword.value=="")
	{
		alert("Password should not be blank.")
		txtPassword.focus();
		return false;
	}


if (checkMail(txtNewMail) == false) 
{
return false;
}


if (txtOldEmail.value==txtNewMail.value)
	{
		alert("Old Email Address and New Email Address are same.")
		txtNewMail.focus();
		return false;
	}

}



function DashCoverEmbr()
{

 var txtDashcoveremrfd=document.getElementById("ctl00_ContentPlaceHolder1_Txtletter")
 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";



//if (txtDashcoveremrfd.value=="") 
//	{
//		alert("Please enter the lettering name.")
//		txtDashcoveremrfd.focus();
//		return false;
//	}
	
	var length;
	length=txtDashcoveremrfd.value.length;
	
	for (var i = 0; i < txtDashcoveremrfd.value.length; i++)
	 {
  	if (iChars.indexOf(txtDashcoveremrfd.value.charAt(i)) != -1)
  	 {
  	   
  	    if(length >12)
  	    {
  	    alert("Length should not be greate than 12 character.");
  	    txtDashcoveremrfd.focus();
  	    return false;
  	    
  	    }
  	 	
  	 
  	}
  }

		
}


function JoinEmailValidate()
 {
 var Email = document.getElementById('ctl00_txtjoin')
 
       if (Email.value=="")
       {
       }     
        else
        {        //=============ashish New Email validation===========
        if (Email.value.length<1||!Email.value.match(/[^\s]/))
            {
            alert("Please enter email address.");
            Email.focus();
            return false;
            }
            var testresults
            var str=Email.value
            var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
            if (filter.test(str))
            testresults=true
            else{
            alert("Invalid email format.")
            Email.focus();
            return false;
            }
            
            }
            
        //===========================================

 }
//-----------------------create a function for Tab------Alkish-----------
 
 function nextTab1()
 {
  	var len;
	len = document.getElementById("ctl00_ContentPlaceHolder1_txtphone").value.length;
	if (len == 3)
	{
		document.getElementById("ctl00_ContentPlaceHolder1_txtphone1").focus();
  
 }
 
 }
 
 
function nextTab2()

{
	var len;
	len = document.getElementById("ctl00_ContentPlaceHolder1_txtphone1").value.length;
	if (len == 3)
	{
		document.getElementById("ctl00_ContentPlaceHolder1_txtphone2").focus();
	

}
 
 }
 
 function SnextTab1()
 {
  	var len;
	len = document.getElementById("ctl00_ContentPlaceHolder1_txtsphone").value.length;
	if (len == 3)
	{
		document.getElementById("ctl00_ContentPlaceHolder1_txtsphone1").focus();
  
 }
 
 }
function SnextTab2()

{
	var len;
	len = document.getElementById("ctl00_ContentPlaceHolder1_txtsphone1").value.length;
	if (len == 3)
	{
		document.getElementById("ctl00_ContentPlaceHolder1_txtsphone2").focus();
	

}
 
 }


function ValidateSearch()
     {
     var txtsearch=document.getElementById("ctl00_textfield").value
     
      if (txtsearch=="Search Here")
	   {
		alert("please enter year make model for search.")
		return false;
	   }
 
 
     }
     
     function ValidateSearchDefault()
     {
     var txtsearch=document.getElementById("textfield").value
     
      if (txtsearch=="Search Here")
	   {
		alert("please enter year make model for search.")
		return false;
	   }
 
 
     }
