var currenturl=document.URL;
if(currenturl.indexOf("products.geindustrial")!=-1 || currenturl.indexOf("gealnx34.appl.ge.com")!=-1 || currenturl.indexOf("americasweb-stg")!=-1 || currenturl.indexOf("localhost")!=-1) 
	menuBaseHref = "http://www.gepowercontrols.com" ;
else menuBaseHref = "" ;
function validateQuickSearchForm2(obj){
   var charLength = obj.query.value;
   var testRegExp = /[#%<>]/ig  
   if (charLength.length >= 3){
       if(testRegExp.test(charLength)){
         alert('Carattereri speciali non validi per la ricerca');
         return false;
       }else{
     obj.REQUEST.value = "QUICKSEARCHINTERMEDIATE";    
	 if (document.getElementsByName('searchdest')[0].checked == true) {
		if(currenturl.indexOf("teamsite")==-1) {
			obj.action = "http://www.gepowercontrols.com/servlet/SearchITe01z";
			obj.method="get";
			//location.replace("http://www.gepowercontrols.com/servlet/SearchBENLe10?query="+obj.search.value);
			} else {
			obj.action = "http://teamsite-gepc-review.indsys.ge.com/servlet/SearchITe01z";
			obj.method="get";
			//location.replace("http://teamsite-gepc-review.indsys.ge.com/servlet/SearchBENLe10?query="+obj.search.value);
				
			}
			//return false;
	}
	if (document.getElementsByName('searchdest')[1].checked == true) {
		obj.action = "http://products.geindustrial.com/IndustrialProducts/Dispatcher";
		obj.method="post";
		obj.search.value=obj.query.value;
	}
     return true;
       }
   }else{
    alert('Sono necessari almeno 3 caratteri per la ricerca veloce');
    return false;    
   }
}
function validateQuickSearchFormECAT(obj){
   var charLength = obj.search.value;
   var testRegExp = /[#%<>]/ig  
   if (charLength.length >= 3){
       if(testRegExp.test(charLength)){
         alert('Carattereri speciali non validi per la ricerca');
         return false;
       }else{
     obj.REQUEST.value = "QUICKSEARCHINTERMEDIATE";    
	if (document.getElementsByName('searchdest')[0].checked == true) {
		obj.action = "http://products.geindustrial.com/IndustrialProducts/Dispatcher";
		obj.method="post";
	}
     return true;
       }
   }else{
    alert('Sono necessari almeno 3 caratteri per la ricerca veloce');
    return false;    
   }
}
document.write('<!-- row 1 -->');
document.write('<tr valign="top">');
document.write('<td colspan="2" id="mastheadCell">');
document.write('<div id="head">');
document.write('<div id="businessUnit">');
document.write('<table border="0" width="730"><tr>') ;
//document.write('<table border="0" width="100%"><tr><td height="10">&nbsp;</td></tr><tr>') ;
//document.write('<td width="160" height="90" valign="top"><a href="http://www.ge.com/olympicgames/ "><img src="' + menuBaseHref + '/imgs/topnav/ge_olympic_logo_136.gif" width="136" height="77" border="0" alt="GE Worldwide Partner" /></a></td>');
//document.write('<td valign="top">&nbsp;<br /><img style="margin-top:10 px" src="' + menuBaseHref + '/imgs/topnav/businessTitle.gif" alt="GE Consumer & Industrial - Power Protection" width="202" height="38" align="left" /></td>');
if(currenturl.indexOf("products.geindustrial")!=-1  || currenturl.indexOf("gealnx34.appl.ge.com")!=-1 || currenturl.indexOf("americasweb-stg")!=-1) {
 document.write('<td width = "450" valign="top" style="padding-bottom:23px;padding-top:10px;padding-left:4px;"><a href="'+ menuBaseHref +'/it/index.html"><img src="' + menuBaseHref + '/imgs/topnav/GE_Energy_IS_blue2.jpg" border="0" alt="GE Energy Industrial Solutions" style="margin-top:4px;margin-bottom:4px;" align="left" /></a></td>');
 document.write('<td width="60" valign="middle"><img src="' + menuBaseHref + '/imgs/e-catalogo_logo_IT.jpg" border="0" alt="" /></td>');
// ecat logo has to stay left to the search input box in the header
    document.write('<td align="right" width="100" valign="bottom">');
 	document.write('<form action="http://products.geindustrial.com/IndustrialProducts/Dispatcher" id="frmSearch2" name="frmSearch2" method="post" onsubmit="return validateQuickSearchFormECAT(this);">');
	document.write('<input type="hidden" name="REQUEST" />');
	document.write('<input type="hidden" name="CATALOG" value="PP" />');
	document.write('<input type="hidden" name="lang" value="it_IT" />');
	document.write('<table cellspacing="0" cellpadding="0" >');
	document.write('<tr valign="bottom" >');
	document.write('<td colspan="2" align="left" valign="center" style="font-size:9px" ><a href="http://www.gepowercontrols.com/it/search/">Ricerca avanzata - Contenuto Web</a></td>');
//	document.write('<td ></td>');
	document.write('</tr>');
	document.write('<tr valign="bottom" >');
	document.write('<td ><input type="text" class="text" name="search" value="" style="width:120px;"/></td>');
	document.write('<td valign="middle" >&nbsp;<input type="submit"  onclick="return validateQuickSearchFormECAT(document.frmSearch2);" style=" vertical-align:middle !important; padding:1px 0px;" class="search_button_image image" name="btnG" src="/imgs/topnav/button_search.gif" width="58" height="16" border="0" value="Cerca" /></td>');
	document.write('</tr>');
	document.write('<tr valign="top" >');
	//document.write('<td align="left" style="font-size:9px" ><!--input type="radio" value="f" id="searchdest" name="searchdest" checked="checked" /--><input type="radio" value="m" id="searchdest" name="searchdest"  checked="checked" /> In E-catalogue</td>');
	document.write('<td align="left" style="font-size:9px" ><input type="radio" value="f" id="searchdest" name="searchdest" checked="checked" /> Nel Web<!--input type="radio" value="m" id="searchdest" name="searchdest"  checked="checked" /--></td>');

	document.write('</tr>');
	document.write('</table>');
	document.write('</form>');
	document.write('</td>');
} else {
if(currenturl.indexOf("/it/search")==-1) {
	document.write('<td width = "520" align="right" valign="top" style="padding-bottom:23px;padding-top:10px;padding-left:4px;"><a href="'+ menuBaseHref +'/it/index.html"><img src="' + menuBaseHref + '/imgs/topnav/GE_Energy_IS_blue2.jpg" border="0" alt="GE Energy Industrial Solutions" style="margin-top:4px;margin-bottom:4px;" align="left" /></a></td>');
        document.write('<td align="right" width="100" valign="bottom">');
 	document.write('<form action="http://products.geindustrial.com/IndustrialProducts/Dispatcher" id="frmSearch2" name="frmSearch2" method="post" onsubmit="return validateQuickSearchForm2(this);">');
	document.write('<table cellspacing="0" cellpadding="0" >');
	document.write('<tr valign="bottom" >');
	document.write('<td align="center" valign="bottom" style="font-size:9px" ><a href="/it/search">Ricerca avanzata</a></td>');
	document.write('<td ></td>');
	document.write('</tr>');
	document.write('<tr valign="bottom" >');
	document.write('<td ><input type="text" class="text" name="query" id="query" value="" style="width:120px;"/></td>');
	document.write('<td valign="middle" >&nbsp;<input type="submit"  onclick="return validateQuickSearchForm2(document.frmSearch2);" style=" vertical-align:middle !important; padding:1px 0px;" class="search_button_image image" name="btnG" src="/imgs/topnav/button_search.gif" width="58" height="16" border="0" value="Cerca" /></td>');
	document.write('</tr>');
	document.write('<tr valign="top" >');
	document.write('<td colspan="2" style="font-size:9px" align="left"><input type="radio" value="f" id="searchdest" name="searchdest" checked="checked" /> Nel Web &nbsp;&nbsp;&nbsp;<input type="radio" value="m" id="searchdest" name="searchdest" /> In E-catalogue</td>');
	//document.write('<td align="left" style="font-size:9px" ><input type="radio" value="f" id="searchdest" name="searchdest" checked="checked" /> Nel Web<!--input type="radio" value="m" id="searchdest" name="searchdest"  checked="checked" /--></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('<input type="hidden" name="REQUEST" />');
	document.write('<input type="hidden" name="CATALOG" value="PP" />');
	document.write('<input type="hidden" name="lang" value="it_IT" />');
	document.write('<input type="hidden" name="search" id="search" value="" />');
	document.write('</form>');
	document.write('</td>');
} else {
document.write('<td width = "450" valign="top" style="padding-bottom:23px;padding-top:10px;padding-left:4px;"><a href="'+ menuBaseHref +'/it/index.html"><img src="' + menuBaseHref + '/imgs/topnav/GE_Energy_IS_blue2.jpg" border="0" alt="GE Energy Industrial Solutions" style="margin-top:4px;margin-bottom:4px;" align="left" /></a></td>');
}
}
document.write('</div>');
document.write('</div>');
document.write('<!-- navbar table begins -->');
document.write('<div>');
document.write('<table id="nav1" cellspacing="0" cellpadding="0">');
document.write('<tr valign="middle">');
//document.write('<td id="searchCell">');
//if(currenturl.indexOf("products.geindustrial")!=-1 || currenturl.indexOf("gealnx34.appl.ge.com")!=-1 || currenturl.indexOf("americasweb-stg")!=-1) {
//	document.write('<form action="http://products.geindustrial.com/IndustrialProducts/Dispatcher" id="frmSearch" name="frmSearch" method="post" onsubmit="return validateQuickSearchForm2(this);">');
//	document.write('    <input type="hidden" name="REQUEST" />');
//	document.write(' <input type="hidden" name="CATALOG" value="PP" />');
//	document.write('<input type="hidden" name="lang" value="nl_BE" />');
//	document.write('<table cellspacing="0" cellpadding="0">');
//	document.write('<tr valign="middle">');
//	document.write('<td style="text-transform:none;"><input type="text" class="text" name="search" value="" style="width: 45px;"/></td>');
//	document.write('<td id="searchCell" nowrap><a href="#" onclick="if(validateQuickSearchForm2(document.frmSearch)){frmSearch.submit();}">Product Search</a>');
//	document.write('</tr>');
//	document.write('</table>');
//	document.write('</form>');
//}
//document.write('</td>');
document.write('<td width="17%" id="navbarCell_0" valign="top" align="left"><img src="' + menuBaseHref + '/imgs/topnav/nav1Link.gif" id="navbarImg_0" width="9" height="8" border="0" alt="" /><a href="'+menuBaseHref+'/it/index.html">Pagina principale</a></td>');
document.write('<td width="12%" id="navbarCell_1" valign="top" align="left"><img src="' + menuBaseHref + '/imgs/topnav/nav1Link.gif" id="navbarImg_1" width="9" height="8" border="0" alt="" /><a href="'+menuBaseHref+'/it/product_portfolio/index.html">prodotti</a></td>');
document.write('<td width="14%" id="navbarCell_2" valign="top" align="left"><img src="' + menuBaseHref + '/imgs/topnav/nav1Link.gif" id="navbarImg_2" width="9" height="8" border="0" alt="" /><a href="http://products.geindustrial.com/IndustrialProducts/Dispatcher?CATALOG=PP&lang=it_IT" target="_blank">e-catalogue</a></td>');
document.write('<td width="19%" id="navbarCell_3" valign="top" align="left"><img src="' + menuBaseHref + '/imgs/topnav/nav1Link.gif" id="navbarImg_3" width="9" height="8" border="0" alt="" /><a href="'+menuBaseHref+'/it/market_segments/index.html">segmenti di mercato</a></td>');
document.write('<td width="19%" id="navbarCell_4" valign="top" align="left"><img src="' + menuBaseHref + '/imgs/topnav/nav1Link.gif" id="navbarImg_4" width="9" height="8" border="0" alt="" /><a href="'+menuBaseHref+'/it/after_sales/index.html">assistenza e servizi</a></td>');
document.write('<td width="13%" id="navbarCell_5" valign="top" align="left"><img src="' + menuBaseHref + '/imgs/topnav/nav1Link.gif" id="navbarImg_5" width="9" height="8" border="0" alt="" /><a href="'+menuBaseHref+'/it/resources/index.html">risorse</a></td>')
document.write('</tr>');
document.write('</table>');
document.write('</div>');
document.write('<!-- navbar table ended -->');

document.write('</td>');
document.write('</tr>');
document.write('<!-- row 1 ended -->');
document.write('<!-- row 2 -->');
document.write('<tr>');
//document.write('<td id="ecatsearch">&nbsp;</td>');
document.write('<td colspan=2 valign="top">');
document.write('<table width="735" border="0"><tr><td valign="top">');
//document.write('<table width="100%" border="0"><tr><td valign="top">');
document.write('<table><tr><td style="padding:3px 0 0 0">');
//document.write('Text Size:&nbsp;');
document.write('</td><td>');
document.write('<div id="topleft">');
document.write('<a href="javascript:void(0);" onclick="javascript:makeSmall();"><img id="ts" src="' + menuBaseHref + '/imgs/topnav/s.gif"/></a><a href="javascript:void(0);" onclick="javascript:makeMedium();"><img id="tm" src="' + menuBaseHref + '/imgs/topnav/ma.gif"/></a><a href="javascript:void(0);" onclick="javascript:makeBig();""><img id="tb" src="' + menuBaseHref + '/imgs/topnav/b.gif" /></a>');
document.write('</div>');
document.write('</td><td valign="middle">&nbsp;&nbsp;&nbsp;<span style="font-size: 13px"><b>Italia</b></span>');
document.write('</td></tr></table>');
document.write('</td><td valign="top" width="550">');
document.write('<div id="topright">');
//document.write('<a href="http://www.ge.com/eu/consumerindustrial/index.htm?IT" target="_blank">GE Consumer & Industrial</a> | ') ;
document.write('<a href="'+menuBaseHref+'/it/product_portfolio/keywords.html">A-Z</a> | ');
document.write('<a href="'+menuBaseHref+'/it/resources/literature_library/index.html">Documentazione</a> | ');
document.write('<a href="'+menuBaseHref+'/it/contact_us/index.html">Contattaci</a> | ');
document.write('<a href=javascript:confirmsite("http://www.gepowershop.com");>PowerShop</a>&nbsp;');
document.write('</div>');
document.write('</td></tr>');
//document.write('</td></tr></table>');
//document.write('</td>');
//document.write('</tr>');
document.write('<!-- row 2 ended -->');
turnonTab2();
