		function ValidateFaq()
			{
				var strd;
					if (document.frmFaq.search11.value == "")
					{
						strd=document.frmFaq.MF1.value;
						alert (strd);
						document.frmFaq.search11.focus();
						return false;
					}
					return true;
			}
		//Validation for Contact Us
		function clearTip(field)
			{
				if(field.defaultValue == field.value)
				field.value = "";
			}
		function ValidateSearch()
		{
			if (document.frmsearch.Nsearch.value=="" || document.frmsearch.Nsearch.value=="Search here....")
			{
				alert("Please enter search string to search.");
				document.frmsearch.Nsearch.focus();
				return false;
			}	
		}	
		function writeTip(field)
			{
				if(field.value == "")
				field.value = field.defaultValue;
			}	
			
			function Contactusvalidation()
			{	
				var strd;
				if (document.frmContactUs.txtFirstName.value == " " || document.frmContactUs.txtFirstName.value == "First Name")
				{
					strd=document.frmContactUs.MRF11.value;
					alert(strd);
					document.frmContactUs.txtFirstName.focus();
					return false;
				}
				if (document.frmContactUs.txtLastName.value == " " || document.frmContactUs.txtLastName.value == "Last Name")
				{
					strd=document.frmContactUs.MRF22.value;
					alert(strd);
					document.frmContactUs.txtLastName.focus();
					return false;
				}
				if (document.frmContactUs.txtEmail.value == " ")
				{
					strd=document.frmContactUs.MRF33.value;
					alert(strd);
					document.frmContactUs.txtEmail.focus();
					return false;
				}
				else
				{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
					var matchArray = frmContactUs.txtEmail.value.match(emailPat);
					if (matchArray == null)
					{
						strd=document.frmContactUs.MRF44.value;
						alert (strd);
						document.frmContactUs.txtEmail.focus();
						return false;
					}					
				}
				if (document.frmContactUs.cmbCountry.value == " " || document.frmContactUs.cmbCountry.value == "Select Country")
				{
					strd=document.frmContactUs.MRF55.value;
					alert(strd);
					document.frmContactUs.cmbCountry.focus();
					return false;
				}
				
			}
			
			function popupContact(url)
			{
				
				width = 270;
				height = 145;
				xx = window.screen.width;
				yy = window.screen.height;
				xx = (xx/2) - (width/2);
				yy = (yy/2) - (height);
				style = 'left = ' +  xx + ',top = ' + yy + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no';
				newwindow=window.open(url,'name',style);
				if (window.focus) {newwindow.focus()}
			}
		function popitupContact(url)
		{
			newwindow=window.open(url,'name','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=270,height=145,left = 350,top = 400');
			if (window.focus) {newwindow.focus()}
		}
				
				//Validation for Contact Us Ends
				
		//Validation for Suggestions		
				
		function validateSuggestion()
			{	
				var strd;
				if (document.abc.txtFirstName.value == "")
				{
					alert("PLease Enter your Name");
					document.abc.txtFirstName.focus();
					return false;
				}
				if (document.abc.txtEmail.value == "")
				{
					alert("Please Enter Email Address");
					document.abc.txtEmail.focus();
					return false;
				}
				else
				{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
					var matchArray = abc.txtEmail.value.match(emailPat);
					if (matchArray == null)
					{
						alert ("Please enter your valid email address.");
						document.abc.txtEmail.focus();
						return false;
					}					
				}
			
			}
			
			//Validations for Unsubscribe
			
				function validateUnsubscribe()
			{
				var strd;
				if (document.frmContactUs.txtEmail.value == "")
				{
					strd=document.frmContactUs.MRF1.value;
					alert(strd);
					document.frmContactUs.txtEmail.focus();
					return false;
				}
				else
				{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
					var matchArray = frmContactUs.txtEmail.value.match(emailPat);
					if (matchArray == null)
					{
						strd=document.frmContactUs.MRF2.value;
						alert (strd);
						document.frmContactUs.txtEmail.focus();
						return false;
					}					
				}	
			}

//Validation for MyAccount

	function validAccount()
		{
			if (document.abc.txtFirstName.value=="")
			{
				alert('Please enter first name');
				document.abc.txtFirstName.focus();
				return false;
			}
			if (document.abc.txtLastName.value=="")
			{
				alert('Please enter last name');
				document.abc.txtLastName.focus();
				return false;
			}
			var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
			var matchArray = document.abc.txtEmail.value.match(emailPat);
			if (matchArray == null)
			{
				alert('Please enter valid email address');
				document.abc.txtEmail.focus();
				return false;
			}	
			if (document.abc.txt_address1.value=="")
			{
				alert('Please enter Address.');
				document.abc.txt_address1.focus();
				return false;
			}
			if (document.abc.txtPostalCode.value=="")
			{
				alert('Please enter postal Code');
				document.abc.txtPostalCode.focus();
				return false;
			}
		
			if(document.getElementById("cmbstate").value==":: Select State ::")
				{
					alert('Please Select  State');
					document.abc.cmbstate.focus();
					return false;
				}
			if(document.getElementById("cmbstate").value=="Others")
				{
					if (document.abc.txtState.value=="")
					{
						alert('Please enter your State');
						document.abc.txtState.focus();
						return false;
					}
				}
			if (document.abc.cmbCountry.value=="")
			{
				alert('Please select country name');
				document.abc.cmbCountry.focus();
				return false;
			}
			if (document.abc.txtPhone.value=="")
			{
				alert('Please enter phone number');
				document.abc.txtPhone.focus();
				return false;
			}
			var anum2=/(^\d+$)|(^\d+\\d+$)/
				if (!anum2.test(document.abc.txtPhone.value))
				{
					alert("please enter phone number only in figures.");
					document.abc.txtPhone.focus();
					return false;
				}
			if (document.abc.txtpassword.value=="")
			{
				alert('Please enter your password');
				document.abc.txtpassword.focus();
				return false;
			}
			if (document.abc.txtpasswordconfm.value=="")
			{
				alert('Please enter confirm password');
				document.abc.txtpasswordconfm.focus();
				return false;
			}
			if (document.abc.txtpasswordconfm.value!=document.abc.txtpassword.value)
			{
				alert('Password & confirm password must be same.');
				document.abc.txtpasswordconfm.focus();
				return false;
			}
			
			if (document.abc.ddlQuestion.value == "1")
			{
				alert('Please select Question.');
				document.abc.ddlQuestion.focus();
				return false;
			}
			
			if (document.abc.txtAns.value == "")
			{
				alert('Please select Answer.');
				document.abc.txtAns.focus();
				return false;
			}
			return true;
		}		
		
		
		//Validate Login
		
		  function validateLogin()
			  {	
					
					if (document.frmlogin.TxtUserName.value == "")
					{
						alert('Please enter UserName');
						document.frmlogin.TxtUserName.focus();
						return false;
					}	
				   if (document.frmlogin.TxtPassword.value == "")
					{
						alert("Please enter password");
						document.frmlogin.TxtPassword.focus();
						return false;
					}		
			  return true;						
	   	     }	
	   	     
	   	     
	   	     
	   	     //Validation for new user Registration
	   	     
	   	     
	   	 function validateNewUser()
			{	
				var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
				var matchArray = document.frmregister.txtEmail.value.match(emailPat);
				var anum2=/(^\d+$)|(^\d+\\d+$)/
				if (document.frmregister.txtusername.value=="")
				{
					alert('Please enter User name');
					document.frmregister.txtusername.focus();
					return false;
				}
				if (document.frmregister.txtFirstName.value=="")
				{
					alert('Please enter first name');
					document.frmregister.txtFirstName.focus();
					return false;
				}
				if (document.frmregister.txtLastName.value=="")
				{
					alert('Please enter last name');
					document.frmregister.txtLastName.focus();
					return false;
				}
				if (document.frmregister.txtEmail.value=="")
				{
					alert('Please enter Email');
					document.frmregister.txtEmail.focus();
					return false;
				}
				if (matchArray == null)
				{
					alert('Please enter valid email address');
					document.frmregister.txtEmail.focus();
					return false;
				}	
				if (document.frmregister.txtPhone.value=="")
				{
					alert('Please enter phone number');
					document.frmregister.txtPhone.focus();
					return false;
				}
				
				if (!anum2.test(document.frmregister.txtPhone.value))
				{
					
					alert("please enter numeric phone number.");
					document.frmregister.txtPhone.focus();
					return false;
				}
				if (document.frmregister.txtAddress1.value=="")
				{
					alert('Please enter address');
					document.frmregister.txtAddress1.focus();
					return false;
				}
				//if (document.frmregister.txtPostalCode.value=="")
				//{
				//	alert('Please enter PostalCode Code');
				//	document.frmregister.txtPostalCode.focus();
				//	return false;
				//}
				//if(document.getElementById("cmbstate").value==":: Select State ::")
				//{
				//	alert('Please Select  State');
				//	document.frmregister.cmbstate.focus();
				//	return false;
				//}
				//if(document.getElementById("cmbstate").value=="Others")
				//{
				//	if (document.frmregister.txtState.value=="")
				//	{
				//		alert('Please enter your State');
				//		document.frmregister.txtState.focus();
				//		return false;
				//	}
				//}
					
				/*if (document.frmregister.txtCity.value=="")
				{
					alert('Please enter City name');
					document.frmregister.txtCity.focus();
					return false;
				}*/
				if (document.frmregister.cmbCountry.value==":: Select Country ::")
				{
					alert('Please select country name');
					document.frmregister.cmbCountry.focus();
					return false;
				}
				if (document.frmregister.txtpassword.value=="")
				{
					alert('Please enter your password');
					document.frmregister.txtpassword.focus();
					return false;
				}
				if (document.frmregister.txtcpassword.value=="")
				{
					alert('Please enter confirm password');
					document.frmregister.txtcpassword.focus();
					return false;
				}
				if (document.frmregister.txtcpassword.value!=document.frmregister.txtpassword.value)
				{
					alert('Password & confirm password must be same.');
					document.frmregister.txtcpassword.focus();
					return false;
				}
				
				if (document.frmregister.ddlQuestion.value == "1")
				{
					alert('Please select Question.');
					document.frmregister.ddlQuestion.focus();
					return false;
				}
				
				if (document.frmregister.txtAns.value == "")
				{
					alert('Please select Answer.');
					document.frmregister.txtAns.focus();
					return false;
				}
				return true;
			}
			
			function checkstate()
			{
				if(document.getElementById("cmbstate").value=="Others")
				{
					//document.frmregister.txtState.Enabled=true;
					document.getElementById("txtState").disabled=false
				}
				else
				{
					document.getElementById("txtState").disabled=true;
				}
				return true;
			}
			
			function checkbillingstate()
			{
				if(document.getElementById("drp_billstate").value=="Others")
				{	
					document.getElementById("txt_otherbillstate").disabled=false
				}
				else
				{
					document.getElementById("txt_otherbillstate").disabled=true;
				}
				return true;
			}
			
			function checkshippingstate()
			{
				if(document.getElementById("drp_ShippingState").value=="Others")
				{	
					document.getElementById("txt_othershipstate").disabled=false
				}
				else
				{
					document.getElementById("txt_othershipstate").disabled=true;
				}
				return true;
			}
			
			
		//Validation For LoginManage	
			function checkPass()
			{
				
					if (document.Form1.txtPassword.value == "")
					{
						alert("Please, Enter your Password.");
						document.Form1.txtPassword.focus();
						return false;
					}
					if (document.Form1.txtPassword.value != document.Form1.txtConfirmPass.value)
					{
						alert("Password and Confirm Password should be same.");
						document.Form1.txtConfirmPass.value = "";
						document.Form1.txtConfirmPass.focus();
						return false;
					}
					return true;
				
			}
		
		
		//Validation for Advance Search
		
			function validateAdvSearch()
			{	
				var strd;
			/*	if (document.Form1.txtsearchcriteria.value == "" || document.Form1.txtsearchcriteria.value == "Enter Search Criteria")
				{
					//strd=document.Form1.MRF11.value;
					alert('Please enter search Criteria...');
					document.Form1.txtsearchcriteria.focus();
					return false;
				}*/
				
				var anum=/(^\d+$)|(^\d+\.\d+$)/
				if (document.Form1.txtpfrom.value  != "" )
				{
					if (!anum.test(document.Form1.txtpfrom.value))
					{
						alert('Invalid Price')
						document.Form1.txtpfrom.focus();
						return false;
					}
				}
				if (document.Form1.txtto.value  != "" )
				{	
					if (!anum.test(document.Form1.txtto.value))
					{
						alert('Invalid Price')
						document.Form1.txtto.focus();
						return false;
					}
				}	
				
			}	
			
			function validatsearch()
			{
				var strd;
					if (document.frm.search.value == "")
					{
						strd=document.frm.MRF1.value;
						alert (strd);
						document.frm.search.focus();
						return false;
					}
			}
			
			
			//Validation for shipping info
			
			function validateShippingInfo()
			{
				var strd;
				if (document.Form1.txt_FirstName.value=="")
				{
					strd=document.Form1.MRF11.value;
					alert(strd);
					document.Form1.txt_FirstName.focus();
					return false;
				}
				
				if (document.Form1.txt_LastName.value=="")
				{
					strd=document.Form1.MRF22.value;
					alert(strd);
					document.Form1.txt_LastName.focus();
					return false;
				}
				
				if (document.Form1.txt_Email.value=="")
				{
					strd=document.Form1.MRF33.value;
					alert(strd);
					document.Form1.txt_Email.focus();
					return false;
				}
				
				var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
				var matchArray = document.Form1.txt_Email.value.match(emailPat);
				if (matchArray == null)
				{   
					strd=document.Form1.MRF44.value;
					alert(strd);
					document.Form1.txt_Email.focus();
					return false;
				}
				
				if (document.Form1.txt_address1.value=="")
				{
					strd=document.Form1.MRF55.value;
					alert(strd);
					document.Form1.txt_address1.focus();
					return false;
				}
				
				if (document.Form1.txt_billCity.value==" ")
				{
					strd=document.Form1.MRF56.value;
					alert(strd);
					document.Form1.txt_billCity.focus();
					return false;
				}	
				
				//if (document.Form1.txt_billpostalcode.value=="")
				//{
				//	strd=document.Form1.MRF57.value;
				//	alert(strd);
				//	document.Form1.txt_billpostalcode.focus();
				//	return false;
				//}	
				
				if (document.Form1.txt_Phone.value=="")
				{
					strd=document.Form1.MRF58.value;
					alert(strd);
					document.Form1.txt_Phone.focus();
					return false;
				}	
				
				//if (document.Form1.drp_billstate.value=="")
				//{
				//	strd=document.Form1.MRF59.value;
				//	alert(strd);
				//	document.Form1.drp_billstate.focus();
				//	return false;
				//}	
				
				if (document.Form1.drp_billcountry.value=="")
				{
					strd=document.Form1.MRF60.value;
					alert(strd);
					document.Form1.drp_billcountry.focus();
					return false;
				}	
				
				if (document.Form1.drp_shippingmethod.value=="")
				{
					strd=document.Form1.MRF61.value;
					alert(strd);
					document.Form1.drp_shippingmethod.focus();
					return false;
				}
				
				if (document.Form1.txt_shiptoname.value=="")
				{
					strd=document.Form1.MRF62.value;
					alert(strd);
					document.Form1.txt_shiptoname.focus();
					return false;
				}
				
				if (document.Form1.txt_address.value=="")
				{
					strd=document.Form1.MRF63.value;
					alert(strd);
					document.Form1.txt_address.focus();
					return false;
				}	
				
				if (document.Form1.txt_city.value=="")
				{
					strd=document.Form1.MRF56.value;
					alert(strd);
					document.Form1.txt_city.focus();
					return false;
				}	
				
				//if (document.Form1.txt_pincode.value=="")
				//{
				//	strd=document.Form1.MRF57.value;
				//	alert(strd);
				//	document.Form1.txt_pincode.focus();
				//	return false;
				//}
				
				if (document.Form1.drp_Country.value=="")
				{
					strd=document.Form1.MRF60.value;
					alert(strd);
					document.Form1.drp_Country.focus();
					return false;
				}	
				
				return true;					
			}
			
// Search Validation
function ValidateSearch()
{
	if (document.frmsearch.Nsearch.value=="")
	{
		alert("Please enter search string to search.");
		document.frmsearch.Nsearch.focus();
		return false;
	}	
}
function HeaderEmailValidation()
{
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray =document.newsletter.m_txtNewsLetter.value.match(emailPat);
	if(document.newsletter.m_txtNewsLetter.value=="Enter Email here...")
	{
		alert("Enter Email address.");
		document.newsletter.m_txtNewsLetter.focus();
		return false;
	}
	else if (matchArray == null)
	{
		alert("Invalid Email format.");
		document.newsletter.m_txtNewsLetter.value="";
		document.newsletter.m_txtNewsLetter.focus();
		return false;
	}
}

//Popups for Reports

function popup(url)
			{
				width = 270;
				height =300;
				xx = window.screen.width;
				yy = window.screen.height;
				xx = (xx/2) - (width/2);
				yy = (yy/2) - (height);
				style = 'left = ' +  xx + ',top = ' + yy + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no';
				newwindow=window.open(url,'name',style);
				if (window.focus) {newwindow.focus()}
			}
function popitup(url)
{
	newwindow=window.open(url,'name','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=650,left = 100,top =20');
	if (window.focus) {newwindow.focus()}
}
