function show_hide_opt()
{
	if(eval(document.contactus.hear[4].checked) == true) 
	{
		document.getElementById("other_hear").style.display = '';
	}
	if(eval(document.contactus.hear[4].checked) == false) 
	{
		document.getElementById("other_hear").style.display = 'none';
	}
}

function validateMyForm() 
{ 
	if (Trim(document.contactus.txtname.value) == "")
	{  
		alert('Please enter Your Name...');
		document.contactus.txtname.value = '';
		document.contactus.txtname.focus();
		return false;
	}
	if (Trim(document.contactus.txtmail.value) == "")
	{
		alert('Email can not be null');
		document.contactus.txtmail.value = '';
		document.contactus.txtmail.focus();
		return false;
	}
	if(!isValidEmail(document.contactus.txtmail.value))
	{
		document.contactus.txtmail.focus();
		document.contactus.txtmail.select();		
		return false;
	}
	
	if(document.contactus.selopt.value == 1)
	{
		if (Trim(document.contactus.txtusername.value) == "")
		{
			alert('Please enter your User name.');
			document.contactus.txtusername.value = '';
			document.contactus.txtusername.focus();
			return false;
		}
		if (Trim(document.contactus.txtprid.value) == "")
		{
			alert('Please enter the press release ID.');
			document.contactus.txtprid.value = '';
			document.contactus.txtprid.focus();
			return false;
		}
		if (Trim(document.contactus.txtprtitle.value) == "")
		{
			alert('Please enter title of press release.');
			document.contactus.txtprtitle.value = '';
			document.contactus.txtprtitle.focus();
			return false;
		}
	}
	if(document.contactus.selopt.value == 2)
	{
		if (Trim(document.contactus.txtusername.value) == "")
		{
			alert('Please enter your User name.');
			document.contactus.txtusername.value = '';
			document.contactus.txtusername.focus();
			return false;
		}
		if (Trim(document.contactus.txtcomname.value) == "")
		{
			alert('Please enter the company name.');
			document.contactus.txtcomname.value = '';
			document.contactus.txtcomname.focus();
			return false;
		}
	}
	if(document.contactus.selopt.value == 3)
	{
		if (Trim(document.contactus.txtusername.value) == "")
		{
			alert('Please enter your User name.');
			document.contactus.txtusername.value = '';
			document.contactus.txtusername.focus();
			return false;
		}
	}
	
	if (Trim(document.contactus.txtotherdetails.value) == "")
	{
		alert('Please Enter your message');
		document.contactus.txtotherdetails.value = '';
		document.contactus.txtotherdetails.focus();
		return false;
	}
	/*
	if(!(document.contactus.hear[0].checked) && !(document.contactus.hear[1].checked) && !(document.contactus.hear[2].checked) && !(document.contactus.hear[3].checked) && !(document.contactus.hear[4].checked))
	{
		alert('Please tell us how did you here about us?');
		document.contactus.hear[0].focus();
		return false;
	}
	if(eval(document.contactus.hear[4].checked) == true) 
	{ 
		if(Trim(document.contactus.txtcomment.value) == '')
		{
			alert('Please Fill the box to tell us how did you here about us?');
			document.contactus.txtcomment.value = '';
			document.contactus.txtcomment.focus();
			return false;
		}
	}
	*/
	if(document.contactus.txtimagenumber.value == "")
	{
		alert('Please enter the number/letter within the picture to confirm');
		document.contactus.txtimagenumber.value = '';
		document.contactus.txtimagenumber.focus();
		return false;
	}
	
	if(document.contactus.txtimagenumber.value != document.contactus.imagecode.value)
	{
		alert('Please enter the number/letter within the picture to confirm');
		document.contactus.txtimagenumber.value = '';
		document.contactus.txtimagenumber.focus();
		return false;		
	}
	
	document.contactus.temp.value = 1;

	//return true; 
	
	// Send AJax Request To third page.
	
	ajaxObj=GetXmlHttpObject()
	if (ajaxObj==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	txtname = document.contactus.txtname.value
	txtcompany = document.contactus.txtcompany.value
	txtphone = document.contactus.txtphone.value 
	txtcell = document.contactus.txtcell.value 
	txtmail = document.contactus.txtmail.value 

	section = document.contactus.selopt.value;

	var passData = 'section='+section+'&txtname='+txtname+'&txtcompany='+txtcompany+'&txtphone='+txtphone+'&txtcell='+txtcell+
	'&txtmail='+txtmail;

	if(section == 1)
	{
		txtusername = document.contactus.txtusername.value 
		txtprid = document.contactus.txtprid.value 
		txtprtitle = document.contactus.txtprtitle.value 
		txtprurl = document.contactus.txtprurl.value
		
		passData = passData+'&txtusername='+txtusername+'&txtprid='+txtprid+'&txtprtitle='+txtprtitle+'&txtprurl='+txtprurl;
	}
	if(section == 2)
	{
		txtusername = document.contactus.txtusername.value 
		txtcomid = document.contactus.txtcomid.value 
		txtcomname = document.contactus.txtcomname.value 
		txtcomurl = document.contactus.txtcomurl.value
		
		passData = passData+'&txtusername='+txtusername+'&txtcomid='+txtcomid+'&txtcomname='+txtcomname+'&txtcomurl='+txtcomurl;
	}
	if(section == 3)
	{
		txtusername = document.contactus.txtusername.value 
		txtprid = document.contactus.txtprid.value 
		txtprtitle = document.contactus.txtprtitle.value 
		txtpaygateway = document.contactus.txtpaygateway.value 
		txttransid = document.contactus.txttransid.value 
		txttransdate = document.contactus.txttransdate.value 
		txttransamt = document.contactus.txttransamt.value	
		
		passData = passData+'&txtusername='+txtusername+'&txtprid='+txtprid+'&txtprtitle='+txtprtitle+'&txtpaygateway='+txtpaygateway+'&txttransid='+txttransid+
				   '&txttransdate='+txttransdate+'&txttransamt='+txttransamt;
	}
	
	txtotherdetails = document.contactus.txtotherdetails.value 
	
	/*len = document.contactus.hear.length;

	for(cnt = 0 ; cnt < len ; cnt++)
	{
		if (document.contactus.hear[cnt].checked)
		{
			var hear = document.contactus.hear[cnt].value;
		}
	}

	txtcomment = document.contactus.txtcomment.value 
	
	passData = passData+'&txtotherdetails='+txtotherdetails+'&hear='+hear+'&txtcomment='+txtcomment;
	*/
	passData = passData+'&txtotherdetails='+txtotherdetails;
	
	document.getElementById("step2data").innerHTML='<table width=100%><tr><td valign=top><img src="images/loading.gif"></td></table>';
	document.getElementById("step2dataprocess").innerHTML='';

	my_ajax_url = "ajax-contactus-2.php";
	ajaxObj.open("POST", my_ajax_url, true);
	ajaxObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxObj.onreadystatechange = Finaldata
	ajaxObj.send(passData); 
}

function Finaldata()
{
	if (ajaxObj.readyState == 4 || ajaxObj.readyState == "complete")
	{ 
		document.getElementById("step2data").innerHTML='';
		document.getElementById("step2dataprocess").innerHTML=ajaxObj.responseText
	}      
}


function validateMyReset() 
{ 
	document.contactus.txtname.focus();
	return true;
} 