
/* Base_HeaderFooter_Href variable is used for setting domain for OUTGOING links. 
Primarily to make teamsite testing stay in teamsite */
if (window.location.host.indexOf('team') != -1 ||
    window.location.host.indexOf('inftw') != -1) {
	var Base_HeaderFooter_Href = "";
} else {
	var Base_HeaderFooter_Href = "http://www.geappliances.com";
}

/* Base_Support variable is used for SUPPORT FILE CALLS. Images, css, js files.
Maintains proper protocol whether http or https */
if (window.location.host.indexOf('team') != -1 ||
    window.location.host.indexOf('inftw') != -1) {
	var Base_Support = "";
} else {
	var Base_Support = document.location.protocol + "//www.geappliances.com";
}


/******************************/
/**** Tab Selection Stuff *****/
/******************************/

var tabGroups = new Array();

// Products
tabGroups[0] = new Array("/products/", "ApplProducts");
// Service & Support
tabGroups[1] = new Array("/service_and_support/", "answers.geappliances.com");
// Design Center
tabGroups[2] = new Array("/design_center/");

// Sniff uppermost URL to determine which, if any, tab should be selected.
var ourUrl = document.location.href + "";
var tabChosen = "none";
for (var i in tabGroups) {
	arry = tabGroups[i];
	for (var j in arry) {
		if (ourUrl.indexOf(arry[j]) != -1) {
			tabChosen = i;
		}
	}
}

// Function for search.
// (a clone is on the home page)
function fnMastheadSearch(fm) {
	fld = fm.textToSearch;
	val = fld.value;
	//extra validation if wanting use & care manuals
	if (fm.selSearchCategory.selectedIndex==3) {
		if (val=="") { alert("Please enter model number."); fld.focus(); return false; }
		if (val.length<3) { alert("Please enter at least 3 characters."); fld.select(); return false; }
	}
	//begin "regular" validation...
	if (val=="") { alert("Please enter search term(s)"); fld.focus(); return false; }
	//default to products search if no option selected
	if (fm.selSearchCategory.selectedIndex==0) {
		fm.selSearchCategory.selectedIndex=1;
	}
	//handle the 3 possibilities
	if (fm.selSearchCategory.selectedIndex==1) {  //products
		fm.action = "http://genet.geappliances.com/geasearch/Dispatcher?REQUEST=GETSEARCHRESULT";
		fm.SITEID.value="GEAPPLIANCES";
	}
	if (fm.selSearchCategory.selectedIndex==2) {  //service and support
		fm.action = "http://genet.geappliances.com/geasearch/Dispatcher?REQUEST=GETSEARCHRESULT";
		fm.SITEID.value="GEACAPPL";
	}
	if (fm.selSearchCategory.selectedIndex==3) {  //use & care manuals
		fm.action = "http://genet.geappliances.com/DocSearch/Dispatcher?REQUEST=SEARCHWITHURLCONNECTION";
		fm.SITEID.value="GEA";
		fm.SKU.value=val;
	}
	return true; //submits the form
}


// Function for language link.
// (a clone is on the home page)
function switchLanguage() {
	oh=new Array();tsd=new Array();
	tsh='espanol.geappliances.com';
	oh[0]='shop.homeappliances.com';tsd[0]='/enes/sdshop/dhomeappliances/';
	oh[1]='products.geappliances.com';tsd[1]='/enes/sdproducts/'; 
	oh[2]='customernet.geappliances.com';tsd[2]='/enes/sdcustomernet/';
	oh[3]='genet.geappliances.com';tsd[3]='/enes/sdgenet/';
	oh[4]='www.geappliances.com';tsd[4]='/enes/';
	idx=window.top.location.href.indexOf(tsh);
	if(idx==-1){
		for (i=0;i<oh.length;i++){ 
			idx=window.top.location.href.indexOf(oh[i]);
			if(idx>-1) break;
		}
		idx=idx+oh[i].length;hname=tsh+tsd[i];
	}else{
		for (i=0;i<tsd.length;i++){ 
			idx=window.top.location.href.indexOf(tsd[i]);
			if(idx>-1) break;
		}
		idx=idx+tsd[i].length;hname=oh[i];
	}
	path=window.top.location.href.substring(idx);
	hend=hname.charAt(hname.length-1);pstart=path.charAt(0);
	if(hend=='/' && pstart=='/')path=path.substring(path.indexOf('/')+1);
	if(hend!='/' && pstart!='/')path='/'+path;
	window.top.location.href = window.top.location.protocol+'//'+hname+path;
	return false;
}




var geaheader_string =
	'<style type="text/css"> \n\
		#geaheader { width: 756px; padding-bottom: 20px; } \n\
		#geaheader, #geaheader a { \n\
			font-family: arial, helvetica, sans-serif; \n\
			font-size: 10px; \n\
			font-weight: normal; \n\
			font-style: regular; \n\
			font-variant: normal; \n\
		} \n\
		#geaheader input, #geaheader table { font-size: 100%; } \n\
		#geaheader_navigation a { color: #666666; text-decoration: none; } \n\
		#geaheader_navigation a:hover { color: #a9b8df; text-decoration: underline; } \n\
		#geaheader_searchform input { font-size: 10px; } \n\
		#geaheader_searchform a { color: #3b73b9; } \n\
		#geaheader_searchform a:hover { color: #a9b8df; } \n\
		/* id selectors need to be used in these next two rules due to specificity */ \n\
		#geaheader_navigation .geaheader_selected a { color: #000000; } \n\
		#geaheader_navigation .geaheader_selected a:hover { color: #000000; } \n\
		#geaheader_navigation ul { margin: 0; padding: 0; list-style: none;} \n\
		#geaheader_navigation li { \n\
			background-repeat: no-repeat; \n\
			background-position: center left; \n\
			padding-left: 10px; \n\
			background-image: url("'+Base_Support+'/images/right_pointer.gif"); \n\
		} \n\
		/* id selector needs to be used here as well, also because of specificity */ \n\
		#geaheader_navigation .geaheader_selected li { background-image: url("'+Base_Support+'/images/down_pointer.gif"); } \n\
		#geaheader_link_H {padding:3px 0 3px 18px; width: 164px;} \n\
		#geaheader_link_0 {width: 180px;} \n\
		#geaheader_link_1 {width: 237px;} \n\
		#geaheader_link_2 {} \n\
		#geaheader_shopping { padding-top: 4px; text-align: right; color: #666666; } \n\
		#geaheader_shopping, \n\
		#geaheader_shopping a { \n\
			font-family: arial, helvetica, sans-serif; \n\
			font-size: 11px; \n\
			font-weight: normal; \n\
			font-style: regular; \n\
			font-variant: normal; \n\
		} \n\
		#geaheader_shopping a { color: #3b73b9; } \n\
		#geaheader_shopping a:hover { color: #89abd5; } \n\
		#geaheader_shopping a, #geaheader_shopping a:link, #geaheader_shopping a:visited { \n\
			text-decoration: underline; \n\
		} \n\
		#geheader_search { padding-top: 4px; color: #666666; font-family: arial, helvetica, sans-serif; \n\
			font-size: 11px; vertical-align: middle; text-align: right; } \n\
		#geheader_search select { font-size: 11px; font-family: arial, helvetica, sans-serif; }  \n\
	</style> \n\
	<div id="geaheader"> \n\
	<div style="padding: 0 0 0 24px;"> \n\
		<map name="geaheader_logos_map"> \n\
			<area shape="rect" coords="1,14,70,47" target="_top" href="http://www.ge.com/olympicgames/" alt="Click for more information about GE\'s Olympic Partnership."> \n\
			<area shape="rect" coords="85,9,125,49"> \n\
		</map> \n\
		<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;"> \n\
		<tr valign="top"> \n\
		<td width="311" height="99" valign="top"><a target="_top" href="'+Base_HeaderFooter_Href+'/"><img src="'+Base_Support+'/images/ge_logo_stainless.gif" alt="Click to go to GE Appliances Home Page." border="0" style="margin-top:21px;" /></a></td> \n\
		<td valign="bottom" style="padding-bottom: 15px;"> \n\
			<div id="geheader_search"> \n\
				<!-- mp_trans_remove_start --> \n\
				<form action="http://genet.geappliances.com/geasearch/Dispatcher?REQUEST=GETSEARCHRESULT" name="SiteSearchForm" id="geaheader_searchform" style="margin:0;padding:0;" onsubmit="return fnMastheadSearch(this)" method="post" target="_top"><span style="padding: 0 4px 0 0;">SEARCH</span> <select name="selSearchCategory" style="vertical-align: middle;"> \n\
				<option value="0" selected>Select Category</option> \n\
				<option value="1">Products</option> \n\
				<option value="2">Service &amp; Support</option> \n\
				<option value="3">Use &amp; Care Manuals</option> \n\
				</select>\n\
				<input type="text" name="textToSearch" style="vertical-align: middle; margin-left:4px; width: 91px;" /> \n\
				<input type="hidden" name="SITEID" value="GEAPPLIANCES"> \n\
				<input type="hidden" name="offset" value="0"> \n\
				<!-- these 3 used if a docsearch --> \n\
				<input type="hidden" name="MASK" value="Approved Models_SalesNet"> \n\
				<input type="hidden" name="TYPE" value="PDF"> \n\
				<input type="hidden" name="SKU" value=""> \n\
				<input type="image" src="'+Base_Support+'/images/btn_go_new_blue.gif" name="go" alt="go" width="27" height="19" border="0" align="top" style="padding-bottom: 1px; display:inline; vertical-align: middle;" /> \n\
				</form>\n\
				<!-- mp_trans_remove_end --> \n\
			</div>\n\
			<div id="geaheader_shopping"> \n\
				<a href="'+Base_HeaderFooter_Href+'/buy/" target="_top">Where To Buy</a> \n\
				&nbsp;|&nbsp; \n\
				<a mporgnav target="_top" href="http://espanol.geappliances.com/enes/" onclick="return switchLanguage();">en espa&ntilde;ol</a> \n\
			</div> <!-- id="geaheader_shopping" --> \n\
		</td> \n\
		</tr> \n\
		</table> \n\
		<div id="geaheader_navigation" style="border: solid 1px #cccccc; background-color: #f7f7f7; padding: 4px 5px 4px 5px;"> \n\
			<table border="0" cellspacing="0" cellpadding="0"> \n\
			<tr valign="baseline"> \n\
			</td> \n\
			<td id="geaheader_link_H"> \n\
				<ul><li><a href="'+Base_HeaderFooter_Href+'/" target="_top">HOME</a></li></ul> \n\
			</td> \n\
			<td id="geaheader_link_0"' + ((tabChosen == 0) ? ' class="geaheader_selected"' : '') + '> \n\
				<ul><li><a href="'+Base_HeaderFooter_Href+'/products/" target="_top">PRODUCTS</a></li></ul> \n\
			</td> \n\
			<td id="geaheader_link_1"' + ((tabChosen == 1) ? ' class="geaheader_selected"' : '') + '> \n\
				<ul><li><a href="'+Base_HeaderFooter_Href+'/service_and_support/" target="_top">SERVICE &amp; SUPPORT</a></li></ul> \n\
			</td> \n\
			<td id="geaheader_link_2" ' + ((tabChosen == 2) ? ' class="geaheader_selected"' : '') + '> \n\
				<ul><li><a href="'+Base_HeaderFooter_Href+'/design_center/" target="_top">DESIGN CENTER</a></li></ul> \n\
			</td> \n\
			</tr> \n\
			</table> \n\
		</div> <!-- id="geaheader_navigation" --> \n\
	</div> \n\
	</div> <!-- id="geaheader" --> \n\
';
document.write(geaheader_string);


