function topSearch()
{
	if(document.getElementById('txtsearchtop').value.replace(/^\s+|\s+$/,'') == "")
	{
		alert("Please Enter Search Keyword.");
		document.getElementById('txtsearchtop').focus();
		return false;
	}
}
function joinMail()
{
	var flag = chkEmail(document.frmemail.txtjoinmail.value);
	if(flag == "false")
	{
		document.frmemail.txtjoinmail.select();
		return false;
	}
	
}


function topEduction()
{
	if((document.frmEducationNew.cmbEducation.value == ""))
	{
		alert("Please Enter Search Keyword.");
		document.frmEducationNew.cmbEducation.focus();
		return false;
	}
	else
		document.frmEducationNew.action = "search.php?ECID=" + document.frmEducationNew.cmbEducation.value;
}

function nextPage(pageno, title, pageTitle)
{
	httprequest = HttpObject()
	if (httprequest == null)  
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	if(pageTitle == "E")
		var url = "addon/search_education.php?start=" + pageno + "&title=" + title;
	if(pageTitle == "T")
		var url = "addon/search_tourism.php?start=" + pageno + "&title=" + title;
	
	
	httprequest.onreadystatechange = stateChangeFirst;
	httprequest.open("GET", url, true);
	httprequest.send(null);
}

function stateChangeFirst() 
{
	if((httprequest.readyState == 4) || (httprequest.readyState == "complete"))
	{ 
		document.getElementById("dvindexeducation").innerHTML = httprequest.responseText;
		getmg();
	}
}

function topTourism()
{
	if((document.getElementById('txttourism').value == ""))
	{
		alert("Please Enter Search Keyword.");
		document.getElementById('txttourism').focus();
		return false;
	}
	// if(document.getElementById('cmbTourismDist').value != "")
	// {
		// if(document.getElementById('cmbTourismDist').value == "3")
			// window.location = "tourism_in_almora.php";
		// if(document.getElementById('cmbTourismDist').value == "4")
			// window.location = "tourism_in_bageshwar.php";
		// if(document.getElementById('cmbTourismDist').value == "2")
			// window.location = "tourism_in_champawat.php";
		// if(document.getElementById('cmbTourismDist').value == "1")
			// window.location = "tourism_in_nainital.php";
		// if(document.getElementById('cmbTourismDist').value == "5")
			// window.location = "tourism_in_pithoragarh.php";
		// if(document.getElementById('cmbTourismDist').value == "6")
			// window.location = "tourism_in_udham_singh_nagar.php";
	// }
	if(document.getElementById('txttourism').value.replace(/^\s+|\s+$/,'') != "")
		window.location = "search.php?TID=" + document.getElementById('txttourism').value;
}

function HttpObject()
{
	var http_req = null;
	try
	{	
		// Firefox, Opera 8.0+, Safari
		http_req = new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			http_req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			http_req = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return http_req;
}