	function cleartext(tname){
		var tid=document.getElementById(tname);
		tid.value='';
		tid.style.color='#000000';
		tid.style.border='';
	}
	function clearselect(tname){
		var tid=document.getElementById(tname);
		tid.style.border='1px solid';
		
	}
function CheckForm() 
{
	var form1=document.getElementById("contact_form1");
  var msg='';
  var state=e1=e2=c1=c2=ck1=f1=l1=ct=ag=0;
	if (form1.email1.value=='')
 	{
		if (msg == ''){
			msg = msg + "E-mail field can not be null!";
		}else{
			msg = msg + "\r\nE-mail field can not be null!";
		}
 		state=1;
 		e1=1;
 	}
 	 	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form1.email1.value)))
	{
		if (msg == ''){
			msg = msg + "Invalid ‘E-mail’ format!";
		}else{
			msg = msg + "\r\nInvalid ‘E-mail’ format!";
		}
		state=1;
		e2=1;
	}
 	if (form1.chkemail1.value=='')
 	{
 		if (msg == ''){
			msg = msg + 'Confirm Email field can not be null!';
		}else{
			msg = msg + '\r\nConfirm Email field can not be null!';
		}
 		
 		state=1;
 		c1=1;
 	}
 	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form1.chkemail1.value)))
	{
		 if (msg == ''){
			msg = msg + "Invalid ‘Confirm E-mail’ format!";
		}else{
			msg = msg + "\r\nInvalid ‘Confirm E-mail’ format!";
		}
		state=1;
		c2=1;
	}
	if (form1.email1.value != form1.chkemail1.value)
 	{
		if (msg == ''){
			msg = msg + 'Please check and confirm your E-Mail address!';
		}else{
			msg = msg + '\r\nPlease check and confirm your E-Mail address!';
		}
 		state=1;
 		ck1=1;
 	}
 	if (form1.firstname.value=='' || form1.firstname.value=='First Name')
 	{
		if (msg == ''){
			msg = msg + '‘First Name’ field can not be null!';
		}else{
			msg = msg + '\r\n‘First Name’ field can not be null!';
		}
 		state=1;
 		f1=1;
 	}
	
	if (form1.lastname.value=='' || form1.lastname.value=='Last Name')
 	{
		if (msg == ''){
			msg = msg + '‘Last Name’ field can not be null!';
		}else{
			msg = msg + '\r\n‘Last Name’ field can not be null!';
		}
 		state=1;
 		l1=1;

 	}
 	if (form1.country.value=='')
 	{
		if (msg == ''){
			msg = msg + 'Please select your ‘Country’!';
		}else{
			msg = msg + '\r\nPlease select your ‘Country’!';
		}
 		state=1;
 		ct=1;
 	}
 	if (!form1.agreement.checked )
 	{
		if (msg == ''){
			msg = msg + 'Please accept Arenui newsletter ‘Terms of Use’!';
		}else{
			msg = msg + '\r\nPlease accept Arenui newsletter ‘Terms of Use’!';
		}
 		state=1;
 		ag=1;
 	}
 	if (state==1){
 		alert(msg);
 		if (e1==1 || e2==1){
 			//form1.email1.style.border='1px solid red';
 			form1.email1.style.color='red';
 		}
 		if (form1.email1.value==''){
 			//form1.email1.style.border='1px solid red';
 			form1.email1.value='Email Address';
 		}
 		if (c1==1 || c2==1){
 			//form1.chkemail1.style.border='1px solid red';
 			form1.chkemail1.style.color='red';
 		}
 		if (form1.chkemail1.value==''){
 			//form1.chkemail1.style.border='1px solid red';
 			form1.chkemail1.value='Confirm Email Address';
 		}
 		if (ck1==1){
 			//form1.chkemail1.style.border='1px solid red';
 			form1.chkemail1.style.color='red';
 		}
 		if (form1.chkemail1.value==''){
 			//form1.chkemail1.style.border='1px solid red';
 			form1.chkemail1.value='Confirm Email Address';
 		}
 		if (f1==1){
 			//form1.firstname.style.border='1px solid red';
 			form1.firstname.style.color='red';
 		}
 		 if (form1.firstname.value==''){
 		 	//form1.firstname.style.border='1px solid red';
 			form1.firstname.value='First Name';
 		}
 		if (l1==1){
 			//form1.lastname.style.border='1px solid red';
 			form1.lastname.style.color='red';
 		}
 		 if (form1.lastname.value==''){
 		 	//form1.lastname.style.border='1px solid red';
 			form1.lastname.value='Last Name';
 		}
 		if (ct==1){
 			//form1.country.style.border='1px solid red';
 		}
 		if (ag==1){
 			//form1.agreement.style.border='1px solid red';
 		}
 		return false;
 	}
 form1.submit();

}

