function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  }

/* Onclick submit form for Top Section Search */
function SubSearch(){
document.searchForm.submit();
}


function checkValue(theForm)
{
	var description 	= theForm.description.value;
	var name		= theForm.name.value;
	var email		= theForm.email.value;	
	var imageCode		= theForm.imageCode.value;

	
	if(name.length==0)
	{
		alert("Please enter name!");
		theForm.name.focus();
		return false;
	}
	if(email.length==0)
	{
		alert("Please enter email!");
		theForm.email.focus();
		return false;
	}
	if(checkEmail(email) == false)
	{
		alert("Invalid e-mail address! Please re-enter.");
		theForm.email.select();
		return false;
	}
	
	if(description.length==0)
	{
		alert("Please enter description!");
		theForm.description.focus();
		return false;
	}

	if(imageCode.length==0)
	{
		alert("Please enter Verification Code!");
		theForm.imageCode.focus();
		return false;
	}
	return true;
}
function checkEmail(email) 
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
	{
		return (true);
	}
	return false;
}

var xmlHttp ;

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


function formValidator(){
	
	var city = document.getElementById('city_id').value;
/*	var section = document.getElementById('section_id_name').value;
*/	
	var email = document.getElementById('email').value;
	if(checkEmail(email) == false)
	{
	   alert("Invalid e-mail ID! Please re-enter!");
	   document.getElementById('email').focus();
	   return false;                  
	}
/*	if(section  == "Select area")
	{
		alert("Please select the section");
		document.getElementById('section_id_name').focus();
		return false;
	}
*/	if(city == "")
	{
		
		alert("Please select the City");
		document.getElementById('city_id').focus();
		return false;
	}
	
		var url= "http://megha.local.www.local109.in/function.php?subscribe=yes";
		url=url+ "&email=" + email;   
		//url=url+ "&section_id_name=" + section;   
		url=url+ "&city_id=" + city;   
		url=url+"&sid="+Math.random();

		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		
		xmlHttp.onreadystatechange=onformValidator
		xmlHttp.open("GET",url,true) 
		xmlHttp.send(null) 

}

function onformValidator()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(xmlHttp.responseText != '')
		{
			document.getElementById('subscription_message').innerHTML=xmlHttp.responseText;
		}
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

  }


