		function doValidateNumber(vart,vat)
		{
			var valid = "0123456789/"
			var ok = "yes";
			var temp;
			for (var i=0; i<vart.value.length; i++) 
			{
			temp = "" + vart.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") ok = "no";
			}
			if (ok == "no")
			{
			alert(vat + " Invalid! Only numbers are accepted!");
			vart.focus();
			vart.select();
			vart.value="";
			return 1;
			}
			return 2;
		}
		function doValidateAlpha(vart,vat)
		{
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ./ "
			var ok = "yes";
			var temp;
			var vart1 = vart.value;

			for (var i=0; i<vart.value.length; i++) 
			{	
			temp = "" + vart.value.substring(i, i+1);	
			if (valid.indexOf(temp) == "-1") ok = "no";
			}
			
			if (ok == "no")
			{
			alert(vat + " Invalid! Only alphabets are accepted!");
			vart.focus();
			vart.select();
			return 1;
			}
			return 2;
		}
		
		function doValidate()
		{
			var var1 = document.getElementById('txt_t_subject');
			var var2 = document.getElementById('txt_t_message');
			var var3 = document.getElementById('CodeNumberTextBox1');
			if(var1.value == "")
				{
					alert('You have not entered Subject');
					return false;
			    }
			if(var2.value == "")
				{
					alert('You have not entered Message');
					return false;
			    }
			if(var2.value.length > 2000)
				{
					alert('You Can insert only 2000 character');
					return false;
			    } 
			 if(var3.value == "")
			 {
				alert('You have not entered the security code');
				var3.focus();
				return false;
			 }   
			   return true;
		}
				
		function doValidateUnregdUser()
		{
			var var2 = document.getElementById('txt_t_message');
			var var3 = document.getElementById('txtname');
			var var4 = document.getElementById('txtcompany');			
			var var5 = document.getElementById('ddlcountry');
			var var6 = document.getElementById('ddlState');
			var var7 = document.getElementById('ddlCity');
			var var8 = document.getElementById('txtemail');
			var var9 = document.getElementById('txtphone1');
			var var10 = document.getElementById('txtphone2');
			var var11 = document.getElementById('txtphone3');
			var var12 = document.getElementById('txtfax1');
			var var13 = document.getElementById('txtfax2');
			var var14 = document.getElementById('txtfax3');
			

	
			if(var2.value == "")
			{
			alert('You have not entered Message');
			var2.focus();
			return false;
			}
			if(var2.value.length > 2000)
				{
					alert('You Can insert only 2000 character');
					return false;
			    } 
			
			
			if(var3.value == "")
			{
			alert('Pls. specify your name');
			var3.focus();
			return false;
			}
			if(var4.value == "")
			{
			alert('Pls. specify your company name');
			var4.focus();
			return false;
			}
			if(var5.selectedIndex < 1)
			{
			alert('Select Country');
			var5.focus();
			return false;
			}
			if(var6.selectedIndex < 1)
			{
			alert('Select State');
			var6.focus();
			return false;
			}	
			if(var7.selectedIndex < 1)
			{
			alert('Select City');
			var7.focus();
			return false;
			}	
			if(var8.value == "")
			{
			alert('Pls. specify your business e-mail');
			var8.focus();
			return false;
			}
			
			var emailPat = /^.+@.+\..{2,3}$/;
			var reg = new RegExp(emailPat);	    	    

			if(!reg.exec(var8.value))
			{
			alert("Enter a valid Email Id");
			var8.focus();
			return false;
			}	
			
			if(var9.value != "")
			{
			var i= doValidateNumber(var9,'Phone No.');
			if(i == 1) 
			return false;
			}	
			
			if(var10.value != "")
			{
			var i= doValidateNumber(var10,'Phone No.');
			if(i == 1) return false;
			}
			
			if(var11.value != "")
			{
			var i= doValidateNumber(var11,'Phone No.');
			if(i == 1) return false;
			}

			if(var12.value != "")
			{
			var i= doValidateNumber(var12,'Fax No.');
			if(i == 1) return false;
			}
			if(var13.value != "")
			{
			var i= doValidateNumber(var13,'Fax No.');
			if(i == 1) return false;
			}
			if(var14.value != "")
			{
			var i= doValidateNumber(var14,'Fax No.');
			if(i == 1) return false;
			}
			
					
			return true;
		}
		
		function doValidateLogin()
		{
			var var1 = document.getElementById('txUserName');
			var var2 = document.getElementById('txPasswd');
			if(var1.value == "")
			{
			alert("Enter a valid Username");
			return false;
			}
			if(var2.value == "")
			{
			alert("Enter a valid Password");
			return false;
			}	
			return true;
		}
		
					function getObject(obj)
					{
						var theObj;
						if(document.all)
						{
						if(typeof obj=="string")
						{
						return document.all(obj);
						}
						else
						{
						return obj.style;
						}
						}
						if(document.getElementById)
						{
						if(typeof obj=="string")
						{
						return document.getElementById(obj);
						}
						else
						{
						return obj.style;
						}
						}
						return null;
					}

					function Contar(entrada,salida,texto,caracteres)
					{
						var entradaObj=getObject(entrada);
						var salidaObj=getObject(salida);
						var longitud=caracteres - entradaObj.value.length;
						if(longitud <= 0)
						{
						longitud=0;
						texto='<span class="disable"> '+texto+' </span>';
						entradaObj.value=entradaObj.value.substr(0,caracteres);
						}
						salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
					}
					
//********************Start--Shilpi***validation for inquiry basket*****************************************					
					
	function ItemCheck()
	{
		var chk = document.getElementById("chkInquiry");
		//if(chk.checked==false)
		//{
		//	alert(chk.checked);
			//return false;
		//}
		//return true;
		
	}			
					
//********************End--Shilpi***validation for inquiry basket*****************************************					
					
	function FormValidate()
	{
		
//********************Shilpi**************Validation For Alphabet***********************************************
			
//********************Shilpi************** Validation For Subject***********************************************	
			var subject = document.getElementById("txtcompanysubject");
			if(subject.value == "")
			{
				alert("Please Enter the subject");
				subject.focus();
				return false;
			}			
				
//********************Shilpi************** Validation For Message ***********************************************						
			
			var message = document.getElementById("txtcompanymessage");
			
//********************Shilpi*************Start--Validation for blank spaces****************************************
			message.value = message.value.replace(/^\s+|\s+$/g, ''); 
//********************Shilpi*************Start--Validation for blank spaces****************************************

			if(message.value == "")
			{
				alert("Please Enter the message");
				message.focus();
				return false;
			}
			
			
//********************Shilpi************** Validation For User Name ***********************************************						
			
			var name = document.getElementById("txtcompanyusername");
			
//********************Shilpi*************Start--Validation for blank spaces****************************************
			name.value = name.value.replace(/^\s+|\s+$/g, ''); 
//********************Shilpi*************Start--Validation for blank spaces****************************************
			
			if(name.value == "")
			{
				alert("Please Enter Your Name");
				name.focus();
				return false;
			}
			
			if(name.value != "")
			{
			var i= doValidateAlpha(name,'Name');
			if(i == 1) return false;
			}			

			
//********************Shilpi************** Validation For Company Name ***********************************************			
			var company = document.getElementById("txtusercompany");
			
//********************Shilpi*************Start--Validation for blank spaces****************************************
			company.value = company.value.replace(/^\s+|\s+$/g, ''); 
//********************Shilpi*************Start--Validation for blank spaces****************************************
			
			
			if(company.value == "")
			{
				alert("Please Enter Your Company Name");
				company.focus();
				return false;
			}
		
//********************Shilpi************** Validation For Country, State and City ***********************************************			
	
			var country = document.getElementById ("ddlusercountry");
			if(country.selectedIndex == 0)
			{
				alert("Please Select Country Name");
				country.focus();
				return false;
			}	
		
			var state = document.getElementById ("ddluserState");
			if(state.selectedIndex == 0)
			{
				alert("Please Select State Name");
				state.focus();
				return false;
			}
		
			var city = document.getElementById ("ddluserCity");
			if(city.selectedIndex == 0)
			{
				alert("Please Select City Name");
				city.focus();
				return false;
			}	
			
//********************Shilpi**************Validation For E_mail***********************************************
			
			var email = document.getElementById ("txtuseremail");
			if(email.value == "")
			{
				alert("Please Enter Your Mail_Id");
				email.focus();
				return false;
			}
				
			var validemail = document.getElementById ("txtuseremail");
			var emailPat = /^([A-Za-z0-9_\-\.\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 
			
			//"^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$"; 			   
			//var emaildot = "\\(\\)><@,;:\\\\\\\"\\.\\[\\]";			
			// /^.+@.+\..{2,3}$/;
			var reg = new RegExp(emailPat);			
			if(!reg.exec(validemail.value))
			{
				alert("Email Id is not matching");
				validemail.value="";
				validemail.focus();
				return false;
			}
			
//********************Shilpi**************Validation For Contact Numbers***********************************************
			
			var phone1 = document.getElementById ("txtuserphone1");
			var phone2 = document.getElementById ("txtuserphone2");
			var phone3 = document.getElementById ("txtuserphone3");
			
			if((phone1.value!= "") && (phone2.value == "") )
			{
				alert("Please enter the city code");
				phone2.focus();
				return false;
			}
			
			if((phone1.value!= "") && (phone3.value == "") )
			{
				alert("Please enter your phone number");
				phone3.focus();
				return false;
			}
			
			if((phone2.value!= "") && (phone1.value == "") )
			{
				alert("Please enter the country code");
				phone1.focus();
				return false;
			}
			
			if((phone3.value!= "") && (phone1.value == "") )
			{
				alert("Please enter the city code");
				phone1.focus();
				return false;
			}
			
			
			var phone1 = document.getElementById ("txtuserphone1");
			var phone2 = document.getElementById ("txtuserphone2");
			var phone3 = document.getElementById ("txtuserphone3");
			
			if((phone1.value != "") && (phone2.value != "") && (phone3.value != ""))
			{
				var val1 = phone1.value;
				if (!val1.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					phone1.value="";
					phone1.focus();
					return false;
				}
				var val2 = phone2.value;
				if (!val2.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					phone2.value="";
					phone2.focus();
					return false;
				}
				var val3 = phone3.value;
				if (!val3.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					phone3.value="";
					phone3.focus();
					return false;
				}
				
			}
		
			
//********************Shilpi************Validation For Fax Numbers***********************************************				
				
		var fax1 = document.getElementById ("txtuserfax1");
		var fax2 = document.getElementById ("txtuserfax2");
		var fax3 = document.getElementById ("txtuserfax3");
		
		if((fax1.value!= "") && (fax2.value == "") )
			{
				alert("Please enter the city code");
				fax2.focus();
				return false;
			}
			
			if((fax1.value!= "") && (fax3.value == "") )
			{
				alert("Please enter your Fax number");
				fax3.focus();
				return false;
			}
			
			if((fax2.value!= "") && (fax1.value == "") )
			{
				alert("Please enter the country code");
				fax1.focus();
				return false;
			}
			
			if((fax3.value!= "") && (fax1.value == "") )
			{
				alert("Please enter the city code");
				fax1.focus();
				return false;
			}
		
		
		
		if((fax1.value != "") && (fax2.value != "") && (fax3.value != ""))
		{
			
			var val1 = fax1.value;
				if (!val1.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					fax1.value="";
					fax1.focus();
					return false;
				}
			var val2 = fax2.value;
				if (!val2.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					fax2.value="";
					fax2.focus();
					return false;
				}
			var val3 = fax3.value;
				if (!val3.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					fax3.value="";
					fax3.focus();
					return false;
				}
		}
		
		return true;
	}
//*********************** Shilpi Start Validations of Client User Inquiry**************************	
	
	function ClientValidate()
	{
		var name = document.getElementById("txtjoinname");
			if(name.value == "")
			{
				alert("Please Enter Your Name");
				name.focus();
				return false;
			}
			
			var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "; 
			var temp;
			var ok="yes";
			var vart = document.getElementById('txtjoinname');
			for(var i=0;i<vart.value.length;i++)
			{
			temp = "" + vart.value.substring(i,i+1);
			if(valid.indexOf(temp)== "-1")
			ok="no";
			}
			if(ok=="no")
			{
			alert("No special characters and numbers are allowed like 1-9,!@#$-_&% etc.");
			vart.value = "";
			vart.focus();
			return false; 
			}
			
			var company = document.getElementById("txtjoincompanyname");
			if(company.value == "")
			{
				alert("Please Enter Your Company Name");
				company.focus();
				return false;
			}
			var email = document.getElementById ("txtjoinemail");
			if(email.value == "")
			{
				alert("Please Enter Your Mail_Id");
				email.focus();
				return false;
			}
				
			var validemail = document.getElementById ("txtjoinemail");
			var emailPat = /^.+@.+\..{2,3}$/;
			var reg = new RegExp(emailPat);
			
			if(!reg.exec(validemail.value))
			{
				alert("Email Id is not matching");
				validemail.value="";
				validemail.focus();
				return false;
			}
			var address = document.getElementById ("txtjoinaddress");
			if(address.value == "")
			{
				alert("Please Enter Your Address");
				address.focus();
				return false;
			}
			
			var phone1 = document.getElementById ("txtjoinphone1");
			var phone2 = document.getElementById ("txtjoinphone2");
			var phone3 = document.getElementById ("txtjoinphone3");
			
			if((phone1.value!= "") && (phone2.value == "") )
			{
				alert("Please enter the city code");
				phone2.focus();
				return false;
			}
			
			if((phone1.value!= "") && (phone3.value == "") )
			{
				alert("Please enter your phone number");
				phone3.focus();
				return false;
			}
			
			if((phone2.value!= "") && (phone1.value == "") )
			{
				alert("Please enter the country code");
				phone1.focus();
				return false;
			}
			
			if((phone3.value!= "") && (phone1.value == "") )
			{
				alert("Please enter the city code");
				phone1.focus();
				return false;
			}
			
			
			var phone1 = document.getElementById ("txtjoinphone1");
			var phone2 = document.getElementById ("txtjoinphone2");
			var phone3 = document.getElementById ("txtjoinphone3");
			
			if((phone1.value != "") && (phone2.value != "") && (phone3.value != ""))
			{
				var val1 = phone1.value;
				if (!val1.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					phone1.value="";
					phone1.focus();
					return false;
				}
				var val2 = phone2.value;
				if (!val2.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					phone2.value="";
					phone2.focus();
					return false;
				}
				var val3 = phone3.value;
				if (!val3.match(/^[0-9]+$/))
				{
					alert("Please Enter Only Numbers");
					phone3.value="";
					phone3.focus();
					return false;
				}
				
			}
			var fax1 = document.getElementById ("txtjoinfax1");
			var fax2 = document.getElementById ("txtjoinfax2");
			var fax3 = document.getElementById ("txtjoinfax3");
			
			if((fax1.value!= "") && (fax2.value == "") )
				{
					alert("Please enter the city code");
					fax2.focus();
					return false;
				}
				
				if((fax1.value!= "") && (fax3.value == "") )
				{
					alert("Please enter your Fax number");
					fax3.focus();
					return false;
				}
				
				if((fax2.value!= "") && (fax1.value == "") )
				{
					alert("Please enter the country code");
					fax1.focus();
					return false;
				}
				
				if((fax3.value!= "") && (fax1.value == "") )
				{
					alert("Please enter the city code");
					fax1.focus();
					return false;
				}
			
			
			
			if((fax1.value != "") && (fax2.value != "") && (fax3.value != ""))
			{
				
				var val1 = fax1.value;
					if (!val1.match(/^[0-9]+$/))
					{
						alert("Please Enter Only Numbers");
						fax1.value="";
						fax1.focus();
						return false;
					}
				var val2 = fax2.value;
					if (!val2.match(/^[0-9]+$/))
					{
						alert("Please Enter Only Numbers");
						fax2.value="";
						fax2.focus();
						return false;
					}
				var val3 = fax3.value;
					if (!val3.match(/^[0-9]+$/))
					{
						alert("Please Enter Only Numbers");
						fax3.value="";
						fax3.focus();
						return false;
					}
			}
			var memberid = document.getElementById("txtjoinmemberid");
			if(memberid.value == "")
			{
				alert("Please Enter User Name");
				memberid.focus();
				return false;
			}
			var password = document.getElementById("txtjoinpassword");
			if(password.value == "")
			{
				alert("Please Enter Password");
				password.focus();
				return false;
			}
			var repwd = document.getElementById("txtjoinrepassword");
			pass= password.value;
			if(pass.length < 6)
			{
				alert("Minimum character should be 6");
				password.value="";
				repwd.value="";
				password.focus();
				return false;
			}
			
			
			if(repwd.value == "")
			{
				alert("Please Re_type your password");
				repwd.focus();
				return false;
			}
			if (password.value != repwd.value)
			{
				alert("Password do not match");
				password.value="";
				repwd.value="";
				password.focus();
				return false;
			}
		return true;
	}
	
//*********************** Shilpi End Validations of Client User Inquiry**************************	

//*********************Shilpi--Start Validation for Sign In***********************

function doValidateSign()
{
	var member = document.getElementById("txUserName");
	var pwd =  document.getElementById("txPasswd");
	if(member.value == "")
	{
		alert('Please Enter Your Member Id');
		member.value="";
		member.focus();
		return false;		
	}
	if(pwd.value == "")
	{
		alert('Please Enter Your Password');
		pwd.value="";
		pwd.focus();
		return false;
	}
	return true;
}
//*********************Shilpi--End Validation for Sign In***********************

	
