<!-- Begin Javascript
// FRAME ELIMINATOR
// Checks to see if the site is being framed, and pulls the site out.
if (window.location!=top.location) {
	top.location = window.location;
}


// OPEN WINDOW FUNCTION
// pulls in customized link, width, height, scrollability
function popUpNew(Page, Width, Height, Scroll) {
window.open(Page,"popUpWindow",'width='+Width+',height='+Height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+Scroll+',copyhistory=no,resizable=yes');
  }
// the rest...
// toolbar - icons;  location - URL address bar;  directories - links bar;   status - progress bar at bottom;
// menubar - File, Edit, etc;  copyhistory - retains history list from parent window;  resizable - allows resizing



// FIX N4 CSS ISSUE	
// Netscape 4 has a nasty bug of forgetting an external stylesheet is attached when the browswer is resized
// This script compensates for Netscape's shortsightedness
if (document.layers) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	}

function reloadPage () {
	if (innerWidth != origWidth || innerHeight != origHeight) {
		location.reload();
		}
	}

if (document.layers) onresize = reloadPage;




// SCROLLBAR CHANGES COLOR  
// Makes the color of the scrollbars match the background, if color entered correctly
function changeScrollbarColor(C) {
   if (document.all) {
      document.body.style.scrollbarBaseColor = C;
   }
}

  
// SWAP IMAGE
function swapImage (name, source) {
	var image;
	image = findDOMimage(name);
	image.src = source;
}  



//SET NEW Z-INDEX LEVEL
//Change a DIVs Z Level on the page
function setZIndex(objectName, newIndex) {
	var refObject = findDOM(objectName,1);
	refObject.zIndex = newIndex;

}

//DROPDOWN URL CHANGER
function chgURL(frm) {
			var url = frm.options[frm.selectedIndex].value;
			var ext = ".shtml";
			window.location.href = url + ext;
}

	
// ANTI-SPAM1
	function antispam(name,domain) {
    	document.write = "mailto:" + name + "@" + domain;
	}


//Hide Email from SPAMMERs
//Usage1 (Display same as Email): <script language="JavaScript" type="text/javascript">document.write(hideEmail("username","state.de.us","",""));</script> 
//Usage2 (Display different than Email): <script language="JavaScript" type="text/javascript">document.write(hideEmail("user","state.de.us","","Firstname Lastname"));</script> 
//Note: It is recommended not to use the subject attribute of mailto: however if one must be used use the following example: <script language="JavaScript" type="text/javascript">document.write(hideEmail("username","state.de.us","Suject of Email",""));</script> 
	function hideEmail(usr,dom,sub,dis) {
	var user = usr;
	var domain = dom;
	var subj = sub;
	var display = dis;
	if (dis != '') {
	display = dis;
	}else{
	display = user + '@' + domain;
	}
	if (subj != '') {
	return ('<a href="mailto:'+user + '@' + domain +'?subject=' + subj + '">' + display + '</a>');
	}else{
	return ('<a href="mailto:'+user + '@' + domain + '">' + display + '</a>');
	 }
	}


//External Link Confirm
//Usage: <a onclick="javascript:nonState('http://www.domain.gov'); return false;" href="http://www.domain.gov">test</a>
	function nonState(url) {
	 if (confirm("The link you selected points to a \n non-State of Delaware website. \n Do you want to continue?"))
	 window.location = url;
	 else 
	 return false;   
	}

	
//LOWER BROWSER BORDER FIX
//Remove the blue border around linked images
//Ensure / is replaced with actual path to root or go button will not display
	function submitbuttonwithborderfix() {
		document.write('<label for="goButton" title="Submit Your Search">');
//		document.write('<input type="image" src="/private/images/button-go.gif" alt="Submit Your Search" id="goButton" align="middle" onclick="javascript:if (getElementById(\'qt\').value==\'Your Search...\') getElementById(\'qt\').value=\'\';" onmouseover="this.src=\'/private/images/button-go-over.gif\';" onmouseout="this.src=\'/private/images/button-go.gif\';" tabindex="10" accesskey="G"');
		document.write('<input type="image" src="/private/images/button-go.gif" alt="Submit Your Search" id="goButton" align="middle" onclick="javascript:if (getElementById(\'qt\').value==\'Your Search...\') document.forms.seek1.action=\'http://www.delaware.gov/search/\';" onmouseover="this.src=\'/private/images/button-go-over.gif\';" onmouseout="this.src=\'/private/images/button-go.gif\';" tabindex="11" accesskey="G"');
		if (ns4) {
		document.write(' border = "0"');
		}
		document.write('>');
		document.write('</label>');
	}



// End Javascript -->

