var url = document.URL;
var flashPlayerVersionToCheck = 8;
var defaultPrefString = 'flash=1';
var baseFolderPath = "";
var legacy={key:"nysgis", style:"padding:.2em; margin:0 auto 5px; width:960px; text-align:center; font-variant:small-caps; font-size:18px;", msg:'<em>please note </em>our web address has changed. remove old bookmarks and link to us at <a href="http://gis.ny.gov" style="font-variant:normal">http://gis.ny.gov</a>'};
if(url.match("dhses.ny.gov")) baseFolderPath = "gis.ny.gov/httpdocs/";

var aURL = url.split("/");
var baseURL = "http://gis.ny.gov/";
if(aURL.length >= 2){
	baseURL = aURL[0]+"//"+aURL[2]+"/"+baseFolderPath;
}
delete aURL;

// GLOBAL FUNCTIONS - THANKS DREAMWEAVER!
	// FINDS ANY OBJECT IN THE DOM AND RETURNS A REFERENCE VARIABLE
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	// CHANGES A PROPERTY OF A DOM OBJECT - USES MM_findObj ABOVE
	function MM_changeProp(objName,x,theProp,theValue) { //v6.0
	  var obj = MM_findObj(objName);
	  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
		if (theValue == true || theValue == false)
		  eval("obj."+theProp+"="+theValue);
		else eval("obj."+theProp+"='"+theValue+"'");
	  }
	}
	function MM_showHideLayers() { //v6.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}
	function MM_callJS(jsStr) { //v2.0
	  return eval(jsStr)
	}
	
// COOKIE MANAGEMENT FUNCTIONS
	// FUNCTION TO GET COOKIES
	function getCookie(c_name){
		if (document.cookie.length>0)
		  {
		  c_start=document.cookie.indexOf(c_name + "=")
		  if (c_start!=-1)
			{ 
			c_start=c_start + c_name.length+1 
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end=document.cookie.length
			return unescape(document.cookie.substring(c_start,c_end))
			} 
		  }
		return null
	}
	// FUNCTION TO SET A COOKIE
	function setCookie(c_name,value,expiredays){
		var exdate=new Date(); 
		exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000));
		document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate);
	}// END FUNCTION

