function mainheader(item)
{
	//function for displaying the main header with the logo, ads and main menu options in the tabs
	
	var header = "<center>" +
"<table width='780' border='0' cellpadding='0' cellspacing='0' background='/apportal/Images/Topbanner.jpg'>" +
"<tr><a name='#TOP'></a>" +
"<td valign='top'  width='680' height='80'><td>" +
"<td valign='top' align='center'> " +
"<form name='searchform' method='post' action='/apportal/search/advancedsearch.asp?pageno=10' onsubmit='javascript:formvalidate_submit()'>" +
"&nbsp;<input type='text' name='text' size='12' value='Search' class='category'>" +
"<a href='javascript:formvalidate_submit()'><img src='/apportal/Images/go.gif' width='21' border='0' height='18' align='absmiddle'></a><br><br>" +
"<a href='/teluguportal/index.asp'><img src='/apportal/Images/telugu.gif' height='20' align='center' border='0'></a></form>" +
"</td>" +
"</tr></table></center>" +
"<center><table width='780' border='0' cellpadding='1' cellspacing='1' bordercolor='#ffffff' bgcolor='#ffffff'>" + 
"<tr>";
    header = header + ((item=="home") ? "<td ><a href='/apportal/index.asp' ><img src='/apportal/Images/mh_home.gif' class='blackborder'></a></td>" : "<td><a href='/apportal/index.asp'><img src='/apportal/Images/mh_home.gif' border='0' ></a></td>")
	header = header + ((item=="contgov") ? "<td ><a href='/apportal/contact/contacthome.html'><img src='/apportal/Images/mh_contactGov.gif' class='blackborder' ></a></td>" :  "<td ><a href='/apportal/contact/contacthome.html'><img src='/apportal/Images/mh_contactgov.gif' border='0' ></a></td>")
	header = header + ((item=="dept") ? "<td ><a href='/apportal/departments/listofOrgsbyDepts.asp'><img src='/apportal/Images/mh_departments.gif' class='blackborder' ></a></td>" :  "<td><a href='/apportal/departments/listofOrgsbyDepts.asp'><img src='/apportal/Images/mh_departments.gif' border='0'></a></td>")
	header = header + ((item=="citizen") ? "<td ><a href='/apportal/lifecycle/lifecycle.html'><img src='/apportal/Images/mh_ecitizen.gif' class='blackborder' ></a></td>" : "<td ><a href='/apportal/lifecycle/lifecycle.html'><img src='/apportal/Images/mh_ecitizen.gif' border='0' ></a></td>") 
	header = header + ((item=="services") ? "<td ><a href='/apportal/UserInterface/citizen/RegistrationDispatcher.aspx?Action=ShowServices'><img src='/apportal/Images/mh_myservices.gif' class='blackborder' ></a></td>" : "<td ><a href='/apportal/UserInterface/citizen/RegistrationDispatcher.aspx?Action=ShowServices'><img src='/apportal/Images/mh_myservices.gif' border='0' ></a></td>") 
	header = header + ((item=="press") ? "<td ><a href='/apportal/Press%20Releases/census.html'><img src='/apportal/Images/mh_publications.gif' class='blackborder' ></a></td>" : "<td ><a href='/apportal/Press%20Releases/census.html'><img src='/apportal/Images/mh_publications.gif' border='0' ></a></td>") 
	header = header + ((item=="webdir") ? "<td ><a href='/apportal/webdirectory/webdirectory.aspx'><img src='/apportal/Images/mh_webDirectory.gif' class='blackborder'></a></td>" : "<td ><a href='/apportal/webdirectory/webdirectory.aspx'><img src='/apportal/Images/mh_webDirectory.gif' border='0'></a></td>")
	header = header + ((item=="site") ? "<td ><a href='/apportal/sitemap/sitemap.html'><img src='/apportal/Images/mh_siteMap.gif' class='blackborder' ></a></td>" : "<td ><a href='/apportal/sitemap/sitemap.html'><img src='/apportal/Images/mh_sitemap.gif' border='0'></a></td>") 
	header = header + "</tr></table></center>"
	
	document.write(header);
}




// function used in search functionality for validation of the string entered
function formvalidate_submit(){
var flag=0;
     if ((document.searchform.text.value == "" )||(document.searchform.text.value==" "))
	     {  
			alert("Enter the TEXT/TITLE to be searched");
		    document.searchform.text.focus();
	 	  } 
     else    
   	     document.searchform.submit();
}
