/* PLC Java Script */
function isIE()
{
	return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}

function establishMap(){
	myMap = document.getElementById("mapContainer");
	myMap.style.display = "none";
}

function begin(){
	
	if(isIE()){
		//alert('IE!');
		var oLink = document.createElement("link")
		oLink.href = "/css/ieFix.css";
		oLink.rel = "stylesheet";
		oLink.type = "text/css";
		document.body.appendChild(oLink);
		sfHover();
	}
}


sfHover = function() {
	var sfEls = document.getElementById("main").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function openMap(){
	var screenW = 900, screenH = 500;
		if (parseInt(navigator.appVersion)>3) {
		 screenW = screen.width;
		 screenH = screen.height;
		}
		else if (navigator.appName == "Netscape" 
			&& parseInt(navigator.appVersion)==3
			&& navigator.javaEnabled()
		   ) 
		{
		 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		 var jScreenSize = jToolkit.getScreenSize();
		 screenW = jScreenSize.width;
		 screenH = jScreenSize.height;
		}
		NewWindow('http://piedmontland.org/map/fullscreenMap.php','mywin',screenW, screenH,'yes','center');
}
