// 
// EWNHeader.js
// Modification of writeHeader.js.
//
// Enterprise Web Navigation Header for Labor and Industries
//
// This JavaScript is used to generate standard HTML for web pages.
// The HTML is put into outText, and then some modification is made using
// JavaScript .replace, and the modified HTML is written to the browser.
//
// Changes between environments: substitution value for varLNIWebNav-.
//  and
// The var "ewnNavCommon' must be defined prior to calling this script!
if (!ewnNavCommon) ewnNavCommon="../";

// NOTE: CODE NEEDS TO BE MODIFIED FOR DIFFERENCES BETWEEN HOME PAGE AND SECTION PAGES

// Starting HTML is put into outText.
var outText = ' \
<!-- Beginning of Labor and Industries Header --><div id="refresh"><a href="/refresh"><b>CHANGE IS COMING</b><p>See a tour of upcoming changes to L&amp;I&#39;s Web site.</p></a></div><a href="#ContentArea" title="Skip to main content."></a> \
<div id="headerLayout" name="BannerSetting">&nbsp;</div> \
<!--TOPIC INDEX AND SEARCH--> \
<div id="topicSearch" style="white-space:nowrap;"> \
<form name="gs" method="GET" action="varLNISearch/search"> \
<a href="varLNIHome/spanish/default.asp"><span>Information in Spanish</span></a><span style="padding:0 10px; color:#676200">|</span><a href="varLNIHome/Main/TopicIndex.asp"><span>Topic Index</span></a><span style="padding:0 10px; color:#676200">|</span><a href="varLNIHome/Main/ContactInfo/"><span>Contact Info</span></a><span style="padding:0 10px; color:#676200">|</span><input class="searchBox" id="q" name="q" maxlength="255" type="text" size="20" /><input class="btnG" type="submit" name="btnG" value="Search" /> \
<input type="hidden" name="entqr" value="0" />\
<input type="hidden" name="ud" value="1" />\
<input type="hidden" name="sort" value="date:D:L:d1" />\
<input type="hidden" name="output" value="xml_no_dtd" />\
<input type="hidden" name="oe" value="UTF-8" />\
<input type="hidden" name="ie" value="UTF-8" />\
<input type="hidden" name="client" value="default_frontend" />\
<input type="hidden" name="proxystylesheet" value="default_frontend" />\
</form> \
</div> \
 \
<!--MAIN TOPIC TABS--> \
<div id="mainTabs"> \
<ul> \
<li id="hmStyle"><a href="varLNIHome" title="Labor and Industries home page"><span>Home</span></a></li> \
<li id="saStyle"><a href="varLNIHome/Safety/default.asp" title="Workplace safety and health rules"><span>Safety</span></a></li> \
<li id="ciStyle"><a href="varLNIHome/ClaimsIns/default.asp" title="What to do if you are injured; Medical providers; Workers comp insurance; Filing quarterlies; Crime victim assistance; and more"><span>Claims &amp; Insurance</span></a></li> \
<li id="wrStyle"><a href="varLNIHome/WorkplaceRights/default.asp" title="Worker rights, Employer responsibilities; Minimum wage; Breaks and more"><span>Workplace Rights</span></a></li> \
<li id="tlStyle"><a href="varLNIHome/TradesLicensing/default.asp" title="Electrical, Permits, Apprenticeship; Manufactured homes and more"><span>Trades &amp; Licensing</span></a></li> \
</ul> \
</div> \
 \
<span name="goHome" title="Go to home page" style="position:absolute; left:6px; top:31px; z-index:15;"><a href="varLNIHome/default.asp"><img style="width:200px; height:50px;" src="varLNIWebNav-Images/1pixel.gif" /></a></span> \
<!--GLOBAL BUTTONS--> \
<!--div style="background:#FCF9DF; height:32px; width:100%;"><img src="varLNIWebNav-Images/1pixel.gif" /><p style="font:bold 8pt Trebuchet MS, Helvetica, sans-serif; color:red;margin:8px 0px 0px 0; padding:0 15px;"><img src="/common/images/cautionicon.gif" alt=" " style="vertical-align:middle;"/>&nbsp;Scheduled maintenance may cause intermittent outages of L&I online services between 11:30 p.m. July 10 and 5:30 a.m. July 11.</p></div--> \
<div id="globalButtons" style="background:white; white-space:nowrap;"> \
<div style="background:transparent url(varLNIWebNav-Images/1pixel.gif);"> \
<span style="background:transparent url(varLNIWebNav-Images/1pixel.gif); width:196px; padding-left:196px;"></span> \
<a href="varLNIHome/LawRule/default.asp"> \
<span class="lrstyle">Find a Law (RCW) or Rule (WAC)</span></a><span style="padding-left:10px;"></span><a href="varLNIHome/FormPub/default.asp"><span class="fpstyle">Get a form or publication</span></a><span style="padding-left:166px;"></span><a href="varLNIHome/help/default.asp"> \
<span class="helpStyle"><img src="varLNIWebNav-Images/help-NEW.gif" alt="" align="absmiddle">&nbsp;Help</span></a> \
</div> \
</div> \
<!-- End of Labor and Industries Header --> \
';

// This edits the HTML, using regexp.
// Set variables to the correct path. May differ between environments!

// The next 4 lines must be switched before publishing this file.
// Uncomment the first two and comment the next two, publish, then switch them back again.

// rExp = /varLNIHome/gi;
// outText = outText.replace(rExp,'http://www.lni.wa.gov');

rExp = /varLNIHome/gi;
outText = outText.replace(rExp,'');

rExp = /varLNISearch/gi;
outText = outText.replace(rExp,'http://198.187.3.14');

rExp = /varLNIWebNav-/gi;
//outText = outText.replace(rExp,'http://webnavigation.unit-test.wads.wa.gov');
outText = outText.replace(rExp,ewnNavCommon);

// The section variable is used to highlight the header tab.
// If not specified, or invalid, highlight the Home tab.
if (!section) section="none";
switch(section) 
{
case(section="hm"): 
	rExp = /hmStyle/gi; newVal = "currentTab";
	break;
case(section="sa"): 
	rExp = /saStyle/gi; newVal = "currentTab";
	break;
case(section="ci"): 
	rExp = /ciStyle/gi; newVal = "currentTab";
	break;
case(section="wr"): 
	rExp = /wrStyle/gi; newVal = "currentTab";
	break;
case(section="tl"): 
	rExp = /tlStyle/gi; newVal = "currentTab";
	break;
case(section="lr"): 
	rExp = /lrStyle/gi; newVal = "current";
	break;
case(section="fp"): 
	rExp = /fpStyle/gi; newVal = "current";
	break;
case(section="help"): 
	rExp = /helpStyle/gi; newVal = "current";
	break;
default: // if invalid or not set, set to NO currentTab  CHANGED BY BORS235 - MAY 14 
rExp = /hmStyle/gi; newVal = "";
};
outText = outText.replace(rExp,newVal);

document.write(outText);