function ClientValidation(source,args)
			{
				args.IsValid=document.all["termsConditions1"].checked;
			}
			
			function createCookie(name,value,days)
			{
				if (days)
				{
					var date = new Date();
					date.setTime(date.getTime()+(days*24*60*60*1000));
					var expires = "; expires="+date.toGMTString();
				}
				else var expires = "";
				document.cookie = name+"="+value+expires+"; path=/";
		}

		function readCookie(name)
		{
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++)
			{
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
		return null;
	}
	function eraseCookie(name)
	{
		createCookie(name,"",-1);
	}
	
	function loadValues()
	{
		
		this.createCookie("userName",document.frmRegistration.username_txt.value,1);
		this.createCookie("fName",document.frmRegistration.fname_txt.value,300);
		this.createCookie("lName",document.frmRegistration.lname_txt.value,300);
		this.createCookie("email",document.frmRegistration.email_txt.value,300);
		this.createCookie("address1",document.frmRegistration.add1_txt.value,300);
		this.createCookie("address2",document.frmRegistration.add2_txt.value,300);
		this.createCookie("address3",document.frmRegistration.add3_txt.value,300);
		this.createCookie("city",document.frmRegistration.town_txt.value,300);
		this.createCookie("postCode",document.frmRegistration.pcode_txt.value,300);
		
		
		this.createCookie("phoneNo",document.frmRegistration.phone_txt.value,300);
		this.createCookie("mobileNo",document.frmRegistration.mobile_txt.value,300);
	
				
	}
	function eraseCookieValues()
	{
		eraseCookie("userName");
		eraseCookie("fName");
		eraseCookie("lName");
		eraseCookie("email");
		eraseCookie("address1");
		eraseCookie("address2");
		eraseCookie("address3");
		eraseCookie("city");
		eraseCookie("postCode");
		
		eraseCookie("phoneNo");
		eraseCookie("mobileNo");
		
	}
	function showValues()
	{
	var userName,fName,lName,email,address1,address2,address3,city,postCode,countryIndex,phoneNo,mobileNo,day,month,year,securityQ,securityA;
	
	userName=readCookie("userName");
	fName=readCookie("fName");
	lName=readCookie("lName");
	email=readCookie("email");
	address1=readCookie("address1");
	address2=readCookie("address2");
	address3=readCookie("address3");
	city=readCookie("city");
	postCode=readCookie("postCode");
	phoneNo=readCookie("phoneNo");
	mobileNo=readCookie("mobileNo");
		
	if(userName!=null)
	{
	document.frmRegistration.username_txt.value=userName;
	}

	if(fName!=null)
	{
		document.frmRegistration.fname_txt.value=readCookie("fName");
	}
	if(lName!=null)
	{
	document.frmRegistration.lname_txt.value=lName;
	}
	if(email!=null)
	{
		document.frmRegistration.email_txt.value=readCookie("email");
	}
	if(address1!=null)
	{
	document.frmRegistration.add1_txt.value=address1;
	}
	if(address2!=null)
	{
		document.frmRegistration.add2_txt.value=readCookie("address2");
	}
	if(address3!=null)
	{
	document.frmRegistration.add3_txt.value=address3;
	}
	if(city!=null)
	{
		document.frmRegistration.town_txt.value=readCookie("city");
	}
	if(postCode!=null)
	{
	document.frmRegistration.pcode_txt.value=postCode;
	}
	if(phoneNo!=null)
	{
		document.frmRegistration.phone_txt.value=readCookie("phoneNo");
	}
	if(mobileNo!=null)
	{
	document.frmRegistration.mobile_txt.value=mobileNo;
	}
	}
	//Form validation
	function validateField()
	{
		var user=document.frmRegistration.username_txt
		var password=document.frmRegistration.txtPassword
		var conPassword=document.frmRegistration.confirm_password_txt
		var firstName=document.frmRegistration.fname_txt
		var email=document.frmRegistration.email_txt
		var country=document.frmRegistration.country_cmb
		var phone=document.frmRegistration.lblPhoneNo
		var mobile=document.frmRegistration.mobile_txt
		var day=document.frmRegistration.dobDay_cmb
		var month=document.frmRegistration.dobMonth_cmb
		var year=document.frmRegistration.dobYear_cmb
		var terms=document.frmRegistration.termsConditions1
		
		if(user.value=="")
		{
			alert("User Name Required!");
			user.focus();
			return false;
		}
		else if(password.value=="")
		{
			alert("Password Field Required!");
			password.focus();
			return false;
		}
		else if(password.value.length<6)
		{
			alert("Password Length should be atleast 6 characters!");
			password.focus();
			return false;
		}
		else if(conPassword.value!=password.value)
		{
			alert("Confirm Password doesn't match!");
			conPassword.focus();
			return false;
		}
		else if(firstName.value=="")
		{
			alert("First Name Required!");
			firstName.focus();
			return false;
		}
		else if(email.value=="")
		{
			alert("Email Address Required!");
			email.focus();
			return false;
		}
		
		else if(country.value=="Select a Country")
		{
			alert("Please Select a Country!");
			country.focus();
			return false;
		}
		else if(day.value=="Day")
		{
			alert("Please Select a Day!");
			day.focus();
			return false;
		}
		else if(month.value=="Month")
		{
			alert("Please Select a month!");
			month.focus();
			return false;
		}
		else if(year.value=="Year")
		{
			alert("Please Select a Year!");
			year.focus();
			return false;
		}
			else if(document.getElementById("termsConditions1").checked==false)
		{
			
			alert("Please Agree our terms and condition!");
			document.getElementById("termsConditions1").focus();
			return false;
		}
		else if(email.value!="")
		{
			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))
			{
				alert("Please input a valid email address!")
				email.focus()
				return false
			}
			
		}
		else
		{
			return true;
		}
	}