

var fadeTo = "ffffff"; 





var fiBy = 6;





var foBy = 10;





var speed = 30;





var ignoreClass = "ignore";



function CheckData(DATA) 

{

	if (isNaN(DATA.value)) {

		alert('Please use only numbers!');

		DATA.value="";

		return false;

	}

}



document.onload = init;var locs_data = "|"

var gridx_data = "520|429|280|659|719|761|729|548|625|479|777|808|495|368|327|595|233|189|264|429|732|263|731|764|412|471|376|243|392|422|767|727|551|251|636|560|418|268|751|516|746|606|420|764|683|502|344|205|604|";

var gridy_data = "216|372|372|326|292|228|121|249|310|248|172|141|275|283|310|261|465|313|86|214|363|156|273|246|405|290|328|450|167|345|340|195|87|430|194|265|430|255|320|307|258|211|256|184|218|223|354|70|289|";var locs = locs_data.split("|");

var gridx_data = gridx_data.split("|");

var gridy_data = gridy_data.split("|");



function trackMouse() {

}



function saveMap() {

	if (document.frm.gridLoc.value != "") {

		alert("SAVING coordinates (" + document.frm.gridx.value + "/"  + document.frm.gridy.value + ") for '" + document.frm.gridLoc.value);

		document.frm.submit();

	} else {

		alert("...");

	}

}

function chooseLocation(who) {

	document.frm.gridLoc.value = who;

}



function displayLocation() { }



function returnLoc(location) {

	window.opener.location.href = escape("/Locations/View/" + location);

	window.close();

}



                function MM_preloadImages() { //v3.0

                    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

                    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

                    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

                }



                function MM_swapImgRestore() { //v3.0

                    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

                }



                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;

                }





                function MM_swapImage() { //v3.0

                    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

                    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

                }



                function MM_reloadPage(init) {  //reloads the window if Nav4 resized

                    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

                        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

                    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

                }

                MM_reloadPage(true);



                function MM_openBrWindow(theURL,winName,features) { //v2.0

                    window.open(theURL,winName,features);

                }











var opera, ie, dom, x = 0, oc, fader, ocs = new Array();



if (navigator.userAgent.indexOf("Opera") != -1) opera = true

else if (document.all && !opera) ie = true

else if (!document.all && document.getElementById) dom = true;



function convertRGB(z)

	{

		var newfcS = "", splitter = "";

		splitter = z.split(",");

		splitter[0] = parseInt(splitter[0].substring(4, splitter[0].length));

		splitter[1] = parseInt(splitter[1]);

		splitter[2] = parseInt(splitter[2].substring(0, splitter[2].length-1));

		for (var q = 0; q < 3; q++)

			{

				splitter[q] = splitter[q].toString(16);

				if (splitter[q].length == 1) splitter[q] = "0" + splitter[q];

				newfcS += splitter[q];

			}

		return newfcS;

	}



function currentColour(index)

	{

		var temp, cc;

		if (opera) cc = document.links[index].style.color

		else if (ie) cc = document.links[index].currentStyle.color

		else if (dom) cc = document.defaultView.getComputedStyle(document.links[index], '').getPropertyValue("color");

		if (cc.length == 4 && cc.substring(0, 1) == "#")

			{

				temp = "";

				for (var a = 0; a < 3; a++)

					temp += cc.substring(a+1, a+2) + cc.substring(a+1, a+2);

				cc = temp;

			}

		else if (cc.indexOf("rgb") != -1) cc = convertRGB(cc)

		else if (cc.length == 7) cc = cc.substring(1, 7)

		else cc = fadeTo;

		return cc;

	}





function convert2Dec(hex)

	{	

		var rgb = new Array();

		for (var u = 0; u < 3; u++)

			rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);

		return rgb;

	}



function newRGB(f, n, d)

	{

		var change;

		if (d == 1) change = fiBy

		else change = foBy;

		for (var g = 0; g < 3; g++)

			{

				if (n[g] > f[g] && n[g] - change >= 0) n[g] -= change;

				if (n[g] < f[g] && n[g] + change <= 255) n[g] += change;

			}

		return n;

	}



function fade(index, d)

	{

		var fc, nc, temp = new Array(), finished = false;

		nc = convert2Dec(currentColour(index));

		if (d == 1) fc = convert2Dec(fadeTo)

		else fc = convert2Dec(ocs[x]);

		temp = convert2Dec(currentColour(index));

		nc = newRGB(fc, nc, d);

		if ((nc[0] == temp[0]) && (nc[1] == temp[1]) && (nc[2] == temp[2]))

			finished = true;

		if (!finished) document.links[x].style.color = "rgb(" + nc[0] + "," + nc[1] + "," + nc[2] + ")"

		else clearInterval(fader);

	}



function findLink(over)

	{

		if (document.layers) return;

		if (fader)

			{

				clearInterval(fader);

				document.links[x].style.color = "#" + ocs[x];

			}

		if (over && !this.id) this.id = over;

		x = 0;

		while (!(this.id == document.links[x].id) && (x < document.links.length))

			x++;

		if (this.id == document.links[x].id)

			{

				oc = currentColour(x);

				fader = setInterval("fade(" + x  + ", 1)", speed);

			}

	}



function clearFade()

	{

		if (document.layers) return;

		if (fader) clearInterval(fader);

		fader = setInterval("fade(" + x + ", 0)", speed);

	}



function init()

	{

		for (var i = 0; i < document.links.length; i++)

			{

				ocs[i] = currentColour(i);

				var currentOver = document.links[i].onmouseover;

				var currentOut = document.links[i].onmouseout;

				var ignoreIt = document.links[i].className == ignoreClass;

				if (!ignoreIt) document.links[i].id = "link" + i;

				if (!currentOver && !currentOut && !ignoreIt)

					{

						document.links[i].onmouseover = findLink;

						document.links[i].onmouseout = clearFade;

					}

			}		

}



function openWindow(url,w,h,windowname){

        if (!w) {

                w = '600';

        }

        if (!h) {

                h = '400';

        }

        if (!windowname) {

                windowname = 'window';

        }

        popupWin=window.open(url,windowname,'scrollbars,resizeable,status,'+'width='+w+',height='+h);

}





if (opera || ie || dom) window.onload = init;




