<!--
/******Script only uses functions to move the map div******/

/*
function cleanAsHTML(strText){

	// remove spaces
  	out = " "; // replace this
	add = "&#32"; // with this
	temp = strText;

	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}

	// remove apostrophes
	out = "'"; // replace this
	add = "&#39;"; // with this

	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}

	

    return temp;
}
*/

function cleanAsURL(strText){
        temp = strText;
        
        // remove ampersands
        out = "&"; // replace this
        add = "%26"; // with this

        while (temp.indexOf(out)>-1) {
                pos = temp.indexOf(out);
                temp = "" + (temp.substring(0, pos) + add +
                temp.substring((pos + out.length), temp.length));
        }
        
        //remove pound sign
        out = "#"; // replace this
        add = "%23"; // with this
        
        while (temp.indexOf(out)>-1) {
                pos = temp.indexOf(out);
                temp = "" + (temp.substring(0, pos) + add +
                temp.substring((pos + out.length), temp.length));
        }
	
        // remove spaces
  	out = " "; // replace this
	add = "%20"; // with this

	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	
        // remove apostrophes
	out = "'"; // replace this
	add = "%27"; // with this

	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}

    return temp;
}


 /*** Moves map to center of browser window ***/ 
function moveMap(elemID)
{

                if (parseInt(navigator.appVersion)>3) {
                        if (navigator.appName=="Netscape") {
                                winW = window.innerWidth;
                                winH = window.innerHeight;
                        }
                }

                if (navigator.appName.indexOf("Microsoft")!=-1) {
                        winW = document.body.offsetWidth;
                        winH = document.body.offsetHeight;
                }

				//   alert("winH: " + winH + "      winW: " + winW);
		
                        var div = document.getElementById(elemID);
                        div.style.background = "#dedede";
                        div.style.position = "absolute";
                        div.style.top =  (winH- (0.80*winH))/2+ "px";
                        div.style.left =(winW- (0.70*winW))/2 + "px";
				//   alert("top: " + div.style.top + "        Left: " + div.style.left);

				//set width and height for map container
                        div.style.width = (0.70*winW);
                        div.style.height = (0.80*winH);
				
				//set width and height for map
				document.getElementById("googleMap").style.width = (0.70*winW);
				document.getElementById("googleMap").style.height = (0.80*winH) - 50;

				//set width and height for close button area
				document.getElementById("button").style.height = (0.05*winH);
				document.getElementById("close").style.marginTop = (0.20)*(0.05*winH);
	
				

}


function showMap(elemID)  {
moveMap(elemID); 
var h = document.getElementById(elemID).style.height;
var w = document.getElementById(elemID).style.width;

document.getElementById(elemID).style.display = "block";
document.getElementById(elemID).style.borderWidth="2px";

document.getElementById("button").style.display="block";
document.getElementById("myFrame").style.width=w;
document.getElementById("myFrame").style.height=h;
}

function hideMap(elemID){
document.getElementById(elemID).style.display = "none";
}



// Makes window moveable 
var ie = document.all;
var nn6 = document.getElementById &&! document.all;

var isdrag = false;
var x, y;
var dobj;

function movemouse( e ) {

 if( isdrag ) {
   dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
   dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
   return false;
 }
}

function selectmouse( e ) {

 var fobj = nn6 ? e.target : event.srcElement;

 if (fobj.className == "dragme" ) {
   isdrag = true;
   dobj = document.getElementById("mapContainer");

   tx = parseInt(dobj.style.left+0);
   ty = parseInt(dobj.style.top+0);
   x = nn6 ? e.clientX : event.clientX;
   y = nn6 ? e.clientY : event.clientY;
   document.onmousemove=movemouse;
   return false;
  }

}

function stopDrag(){
	isdrag=false;
}
	
	document.onmousedown=selectmouse;
	document.onmouseup=stopDrag;


-->

