///////////////////////////////////////////////////
//HELPER BROWSER FUNCTIONS
function setPanelSize() {
	document.getElementById("content").style.height = window.getSize().y+"px";
	var subtractHeight = 246;
	if(Browser.Engine.gecko) { //Mozilla
		subtractHeight = 213;
	}
	else if(Browser.Engine.trident) { //IE
	    var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null) {
			rv = parseFloat(RegExp.$1);
			if(rv >= 8) {
				subtractHeight = 213;
			}
			else {
				subtractHeight = 222;
			}
		}
	}
	else if(Browser.Engine.webkit) {
		subtractHeight = 213;
	}
	else if(Browser.Engine.presto) { //Opera
		subtractHeight = 215;
	}
	else { //assumed Firefox 3.6
		subtractHeight = 213;
	}
	document.getElementById("results").style.height = (window.getSize().y - subtractHeight )+"px";
}

function setAboutPanelSize() {
	document.getElementById("abouttext").style.height = window.getSize().y+"px";
	var subtractHeight = 145;
	if(Browser.Engine.gecko) { //Mozilla
		subtractHeight = 112;
	}
	else if(Browser.Engine.trident) { //IE
	    var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null) {
			rv = parseFloat(RegExp.$1);
			if(rv >= 8) {
				subtractHeight = 112;
			}
			else {
				subtractHeight = 112;
			}
		}
	}
	else if(Browser.Engine.webkit) {
		subtractHeight = 112;
	}
	else if(Browser.Engine.presto) { //Opera
		subtractHeight = 114;
	}
	else { //assumed Firefox 3.6
		subtractHeight = 112;
	}
	document.getElementById("aboutphoto").style.height = (window.getSize().y - subtractHeight )+"px";
}


function preLoadImages(images) {
	if (document.images) {
		for(var i = 0; i < images.length;i++) {
			var img = new Image();
			img.src = images[i];
		}
	}

}

function loadAboutPanel() {
	setAboutPanelSize();
	setAboutLat49();
}

//END BROWSER STUFF
////////////////////////////////////////////////////

//LAT49 About Stuff
function setAboutLat49() {
	try { //Wrap the Lat49 calls to avoid exceptions if the server is blocked
		var container = document.getElementById("directionsmap");
		var startPoint = new GLatLng(37.6929893493652, -97.3350067138672);
        map = new GMap2(container);
		map.setCenter(startPoint, 5);
		Lat49.initAds(835);
		
	    var bnds = map.getBounds();
    	var center = bnds.getCenter();
    	var lat = center.lat();
    	var lon = center.lng();
    
        var zoomlevel = Lat49.Tile.convertGMap2Zoom(map.getZoom());
        Lat49.updateAdByLatLon("mapad", lat, lon, zoomlevel);
    }
	catch (e) {
	}
}

