var hu = {
	appendEventListener : function(obj,evt,fun,cap) {
		cap = cap?true:false;
		if (obj.addEventListener) {
			obj.addEventListener(evt,fun,cap);
			return true;
		}
		if (obj.attachEvent) {
			obj.attachEvent("on"+evt,fun);
			return true;
		}
		return false;
	},
	load : function() {
		var j;
		if (document.getElementById("home") && GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map"));
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
			var point = new GLatLng(47.6735,-116.767511);
			var address = "1303 Sherman Avenue<br \/> Coeur d' Alene, ID 83814";
			map.setCenter(point, 13);
			var marker = new GMarker(point);
			map.addOverlay(marker);
			marker.openInfoWindowHtml(address);
		}
		var mybody=document.getElementsByTagName("body").item(0);
		j = document.createElement("script");
		j.setAttribute("type","text/javascript");
		j.setAttribute("src","http://www.google-analytics.com/urchin.js");
		mybody.appendChild(j);
		if (!hu.getC("traffic_int")) {
			j = document.createElement("script");
			j.setAttribute("type","text/javascript");
			j.setAttribute("src","/js/urchin.js");
			mybody.appendChild(j);
			j = "";
			mybody = "";
		}
		
	},
	setPersC : function(n,v) {
		var the_date = new Date("December 31, 2020");
		var expiration = the_date.toGMTString();
		document.cookie = n+"="+v+";expires="+expiration;
	},
	clearC : function(n) {
		var expire = new Date();
		expire.setTime(expire.getTime() - 1000);
		document.cookie = n+"=" + "=" + "" + ";expires=" + expire.toUTCString();
	},
	getC : function(n) {
		var all_cookies = document.cookie;
		var cookie_start, cookie_end;
	
		cookie_start = all_cookies.indexOf(n);
	
		if (cookie_start != -1) {
			cookie_start += n.length + 1;
			cookie_end = all_cookies.indexOf(';',cookie_start);
			if (cookie_end == -1) cookie_end = all_cookies.length;
			return all_cookies.substring(cookie_start,cookie_end);
		} else {
			return null;
		}
	}
};
hu.appendEventListener(window,"load",hu.load,false);
