/* To add a popup instructions window, linked next to the searchbox */

var thisWinNum = 0;

function openCentered (width, height, featureString) {
	thisWinNum = thisWinNum+1;
	var windowName = 'jobhint'+thisWinNum.toString();
	if (!featureString) featureString = '';
	var listIndent = 20;
	if (document.all) { //IE adjustments
		height = height + 55;
		listIndent = 0;
	}
	var x = Math.round((screen.availWidth - width) / 2); 
	var y = Math.round((screen.availHeight - height) / 2); 
	if (x < 0) x = 0;
	if (y < 0) y = 0;
	featureString = 'left='+x+',top='+y+',width='+width+',height='+height+','+featureString;
	//url += '&amp;autoplay=1';
	var newWin = window.open('#', windowName, featureString);
	newWin.document.write ('<head><title>Find a Job Faster</title><style>#popwrapper{font:bold 12px arial,sana-serif;padding:3px 10px 10px;text-align:center;border:1px solid #0a3371;background-color:#b6c8df;}ol{padding-left:'+listIndent+';}li{text-align:left;padding:0;}</style></head>');
	newWin.document.write ('<body style="margin:3px;padding:3px;" onclick="window.close();">');
	newWin.document.write ('<div id="popwrapper"><p>Welcome to our new online special section.<br/> There are two ways to search for jobs:</p>');
	newWin.document.write ('<ol><li>Leaf page by page through this special section to read each company&rsquo;s jobs, benefits and what they can offer you. Once you click on an ad it will open to reveal links to the employer&rsquo;s website and email.<p style="text-align:center">OR</p></li>');
	newWin.document.write ('<li>Enter the type of job \(engineering, sales, etc.\) you&rsquo;re looking for in the Ad Keywords box to the left and go directly to a list companies offering the positions you want. </li></ol>');
	newWin.document.write ('<p>We’re confident you will enjoy our new online, <br/>multimedia way to look for a job!</p><p style="font-style:italic;">Good Luck in your job search.</p><p style="font-size:10px;color:#143b6f;margin-top:10px;">\(click to close\)</p></div>');
	newWin.document.write ('</body>');
	newWin.document.close();
	newWin.window.focus();
	return true;
}

function addArchiveLink() {
	var subnavButtons = document.getElementById('left');
	var appendedTxt = '<ul><li class="t-archbutton"><a href="../ss/tiles.aspx?type=employment">View Archived Sections</a></li></ul>';
	subnavButtons.innerHTML = subnavButtons.innerHTML + appendedTxt;
}

if(curPath.match('/ss/')) {
	//alert(curPath);
	var srchDiv = document.getElementById('searchbar');
	var linkTxt = '<div id="popWinIns"><a href="#" onclick="this.blur();openCentered(500, 320, \'resizable=no,scrollbars=no,status=no\');return false;">Find a Job faster - <span>click here</span></a></div>';
	var srchFrm = document.getElementById('search');
	var srchBox = document.getElementById('searchbox');
	srchFrm.style.right = '180px';
	srchBox.style.width = '115px';
	srchDiv.innerHTML = srchDiv.innerHTML + linkTxt;
	addArchiveLink();
}