// header.js


function myobjSection(strSectionName, strSectionURL, strSectionAltName, strSectionMenuNumber)
{
	//object for website sections
	this.strSectionName = strSectionName;
	this.strSectionURL = strSectionURL;
	this.strSectionAltName = strSectionAltName;
	this.strSectionMenuNumber = strSectionMenuNumber;//this attribute should be phased out in 
				// the next site redesignto use just the strSectionName+'_menu'. the number is too cryptic.
	
}



function myIPIHeader(strSelectedSection)
{
	var arySectionNames = [
						   'news',
						   'about',
						   'products',
						   'solutions',
						   'services',
						   'partners',
						   'support'
						   ];
	
	var arySectionURLs = [
						   '/news/newsEvents_home.html',
						   '/about/company/company_home.html',
						   '/products/products_home.html',
						   '/solutions/solutions_home.html',					
						   '/services/services_home.html',
						   '/partners/partners_home.html',
						   '/support/support_home.html'
						  ];
	
	var arySectionAltNames = [
							  'News/Events',
							  'About',
							  'Products',
							  'Solutions',
							  'Services',
							  'Partners',
							  'Support'
							  ];
	
	var arySectionMenus = [
						   '1',
						   '7',
						   '2',
						   '8',
						   '6',
						   '3',
						   '4'
						   ];
	
	
	var aryobjSections = new Array();
	
	for(var iIndex = 0; iIndex < arySectionNames.length; iIndex++)
	{
		aryobjSections[iIndex] = new myobjSection(arySectionNames[iIndex], 
								                  arySectionURLs[iIndex], 
												  arySectionAltNames[iIndex],
												  arySectionMenus[iIndex]);
	}
	
	strSelectedSection = strSelectedSection.toLowerCase();
	
	document.write('<div class="header-box">');
	document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%">');
	document.write('   <tr>');
    document.write('      <td width="250" height="85"><a href="/index.html">');
	document.write('	     <img src="/images/logo.gif" alt="IP Infustion" class="header-logo" /></a>');
	document.write('      </td>');
    document.write('      <td align="right" valign="top">');
	
	document.write('         <form name="search" method="get" action="http://search.atomz.com/search/" class="header-form">');
	document.write('         <input type="hidden" name="sp-a" value="sp10038d4a">');
   	document.write('         <input type="hidden" name="sp-f" value="iso-8859-1">');
 	document.write('		 <input type="hidden" name="sp-k" value="">');
	
	myIPIHeaderContact();
	

	document.write('		</form><br/>');
	
	//##### Menu Buttons table begins #####
	
	document.write('		<table cellspacing="0" cellpadding="0" border="0" class="menu_buttons">');
	document.write('			<tr>');
	
	//loop through to write table data cells for menu buttons
	for(var iIndex = 0; iIndex < arySectionNames.length; iIndex++)
	{
		var strMenuName = 'menu' + aryobjSections[iIndex].strSectionMenuNumber;
		var strMenuImg = 'img' + aryobjSections[iIndex].strSectionMenuNumber;

		var strSelectedImage = '';
		if(aryobjSections[iIndex].strSectionName == strSelectedSection)
		{	
				strSelectedImage = '_select';
		}//end if
		
		var strMenuButtonCell = ('<td><a href="' + aryobjSections[iIndex].strSectionURL + '" ');
		strMenuButtonCell += ('onMouseover="dropdownmenu(this, event, ' + strMenuName + ', ');
		strMenuButtonCell += ('\'150px\', \'' + aryobjSections[iIndex].strSectionName + '\', ');
		strMenuButtonCell += ('\'' + strSelectedSection + '\')" ');
		strMenuButtonCell += ('onMouseout="delayhidemenu()">');
		strMenuButtonCell += ('<img id="' + strMenuImg + '" name="' + strMenuImg + '" ');
		strMenuButtonCell += ('src="/images/menu_' + aryobjSections[iIndex].strSectionName + strSelectedImage);
		strMenuButtonCell += ('.gif"  border="0" ');
		strMenuButtonCell += ('alt="' + aryobjSections[iIndex].strSectionAltName + '"></a></td>');
		
		document.write(strMenuButtonCell);		
	}//end for
	
	document.write('            </tr>');
	document.write('      </table>');
	
	<!-- end table for menu buttons -->
	
	document.write('      </td>');
    document.write('   </tr>');
    document.write('</table>');
	document.write('</div>');		   
}//end function



function myIPIHeaderContact()
{
	document.write('<input type="image" name="imageField" src="/images/search_button.gif" alt="Search" class="search_button">');
	document.write('<input name="sp-q" id="search" type="text" value="Search" size="20" class="search_box" onClick="value=\'\';">');
	document.write('<span class="contact_header">Contact IP Infusion at 877-699-3267 (877-MY-ZEBOS)<br>or email us at: info@ipinfusion.com.</span>');
}//end function



function ZZZipiHeaderSearch()
{
	document.write('<div id="ipiHeaderSearch-box">');
	document.write('<form action="http://www.ipinfusion.com/search-results.html" id="cse-search-box">');
	document.write('<div id="ipiHeaderSearch-form">');
	document.write('<input type="hidden" name="cx" value="001705412006488670629:bhltvwdxuuc" />');
	document.write('<input type="hidden" name="cof" value="FORID:10;NB:1" />');
	document.write('<input type="hidden" name="ie" value="UTF-8" />');
	document.write('<input type="text" name="q" size="20" style="font-family:monospace;" value=" " />');
	//onClick="this.value=\'\';"
	document.write('<input type="image" name="sa" src="/images/search_button.gif" class="search_button"/>');	
	document.write('</div>');
	document.write('</form>');
	document.write('<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>');
	document.write('<center><div align="center"><span id="ipiHeaderSearch-contact">Contact IP Infusion at 877-699-3267 (877-MY-ZEBOS)<br>or email us at: info@ipinfusion.com.</span></div></center>');
	document.write('</div>');	
}//end function



function YYYipiHeaderSearch()
{
	document.write('<div id="ipiHeaderSearch-box">');
	document.write('<table cellspacing="0" cellpadding="3" border="0"><tr>');
	document.write('<td align="center" height="40"><span id="ipiHeaderSearch-contact">Contact IP Infusion at 877-699-3267 (877-MY-ZEBOS)<br>or email us at: info@ipinfusion.com.</span></td>');
	document.write('<td>&nbsp;&nbsp;&nbsp;</td>');
	document.write('<form action="http://www.ipinfusion.com/search-results.html" id="cse-search-box">');
	document.write('<td height="40"><input type="hidden" name="cx" value="001705412006488670629:bhltvwdxuuc" /><input type="hidden" name="cof" value="FORID:10;NB:1" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="20" style="font-family:monospace;" value=" " /></td>');
	document.write('<td height="40"><input type="image" name="sa" src="/images/search_button.gif" class="search_button" /><script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script></td>');
	document.write('</form>');
	document.write('<td>&nbsp;</td>');
	document.write('</tr></table>');
	document.write('</div>');	
}//end function



function ipiHeaderSearch()
{
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{
		var ieversion=new Number(RegExp.$1);
		if (ieversion<=7)
 		{
 			document.write('<div id="ipiHeaderSearch-box">');
			document.write('<table cellspacing="0" cellpadding="3" border="0"><tr>');
			document.write('<td align="center" height="40"><span id="ipiHeaderSearch-contact">Contact IP Infusion at 877-699-3267 (877-MY-ZEBOS)<br>or email us at: info@ipinfusion.com.</span></td>');
			document.write('<td>&nbsp;&nbsp;&nbsp;</td>');
			document.write('<form action="http://www.ipinfusion.com/search-results.html" id="cse-search-box">');
			document.write('<td height="40"><input type="hidden" name="cx" value="001705412006488670629:bhltvwdxuuc" /><input type="hidden" name="cof" value="FORID:10;NB:1" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="20" style="font-family:monospace;" value=" " /></td>');
			document.write('<td height="40"><input type="image" name="sa" src="/images/search_button.gif" class="search_button" /><script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script></td>');
			document.write('</form>');
			document.write('<td>&nbsp;</td>');
			document.write('</tr></table>');
			document.write('</div>');
		}
		else {
			document.write('<div id="ipiHeaderSearch-box">');
			document.write('<form action="http://www.ipinfusion.com/search-results.html" id="cse-search-box">');
			document.write('<div id="ipiHeaderSearch-form">');
			document.write('<input type="hidden" name="cx" value="001705412006488670629:bhltvwdxuuc" />');
			document.write('<input type="hidden" name="cof" value="FORID:10;NB:1" />');
			document.write('<input type="hidden" name="ie" value="UTF-8" />');
			document.write('<input type="text" name="q" size="20" style="font-family:monospace;" value=" " />');
			document.write('<input type="image" name="sa" src="/images/search_button.gif" class="search_button"/>');	
			document.write('</div>');
			document.write('</form>');
			document.write('<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>');
			document.write('<center><div align="center"><span id="ipiHeaderSearch-contact">Contact IP Infusion at 877-699-3267 (877-MY-ZEBOS)<br>or email us at: info@ipinfusion.com.</span></div></center>');
			document.write('</div>');
		}
	}
	else
	{
		document.write('<div id="ipiHeaderSearch-box">');
		document.write('<form action="http://www.ipinfusion.com/search-results.html" id="cse-search-box">');
		document.write('<div id="ipiHeaderSearch-form">');
		document.write('<input type="hidden" name="cx" value="001705412006488670629:bhltvwdxuuc" />');
		document.write('<input type="hidden" name="cof" value="FORID:10;NB:1" />');
		document.write('<input type="hidden" name="ie" value="UTF-8" />');
		document.write('<input type="text" name="q" size="20" style="font-family:monospace;" value=" " />');
		document.write('<input type="image" name="sa" src="/images/search_button.gif" class="search_button"/>');	
		document.write('</div>');
		document.write('</form>');
		document.write('<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>');
		document.write('<center><div align="center"><span id="ipiHeaderSearch-contact">Contact IP Infusion at 877-699-3267 (877-MY-ZEBOS)<br>or email us at: info@ipinfusion.com.</span></div></center>');
		document.write('</div>');
	}
}//end function
