<!-- IMAGE SWAP BY Ivan Morales
function loadImages(){var image=new Image();var img,s;for(i=0;i<document.images.length;i++){if(s=document.images[i].getAttribute("swap")){img=document.images[i];img.id='swapImg'+i;img.onmouseover = new Function("swap('"+img.id+"','"+s+"');");img.onmouseout = new Function("swap('"+img.id+"','"+img.src+"');");image.src=img.getAttribute("swap");}}initPopup();
	if(typeof(loadMaps)!='undefined')
		loadGoogleMap();
}
function swap(objID,s){document.getElementById(objID).src=s;}
window.onload=loadImages;//-->

function changeWeather(zip){
	document.getElementById('weather').style.backgroundImage='url(http://ivan.tomrowe.com/weather2.aspx?zip='+zip+'&bg=D3D3D3)';
}

function showMap(num){
	var p=document.getElementById('mapPopup');
	p.style.top=posy+4+'px';
	p.style.left=posx+4+'px';
	if(p.style.display!='block')
		p.style.display='block';
	p.innerHTML=document.getElementById('map'+num).innerHTML;
	mapBlah=setTimeout('showMap('+num+')',10);
}
function killMap(){document.getElementById('mapPopup').style.display='none';clearTimeout(mapBlah);}
var posx=0,posy=0;
var mapBlah;


var blah;
var usingDumbBrowser=false;
if (navigator.appVersion.indexOf("MSIE")!=-1)
	usingDumbBrowser = true;

function initPopup(){
	var a;
	for(i=0;i<document.links.length;i++){
		if(document.links[i].getAttribute("popup")){
			a=document.links[i];
			a.id=a.getAttribute("popup")+'-id';
			a.onmouseover=new Function("popup('"+a.getAttribute("popup")+"');");
			a.onmouseout=new Function("killpopup('"+a.getAttribute("popup")+"');");
			if((p=document.getElementById(a.getAttribute("popup")+'-popup'))){
				p.style.display='none';
			}
		}
	}
}

function popup(objID){
	var padding=0;
	var a=document.getElementById(objID+'-id');
	var p=document.getElementById(objID+'-popup');
	if(typeof blah == 'undefined'){
		clearTimeout(blah);
	}	
	if(p.style.display!='none')
		clearTimeout(blah);
	if(a.firstChild.id.indexOf("swapImg")!=-1){
		temp = a.firstChild.getAttribute("src");
		p.onmouseover=function() {
			clearTimeout(blah);
			popup(objID);
			swap(a.firstChild.id,a.firstChild.getAttribute("swap"));
			};
		p.onmouseout=function() {
			killpopup(objID);
			swap(a.firstChild.id,temp);
			};
	} else {
		p.onmouseover=new Function("clearTimeout(blah);");
		p.onmouseout=new Function("killpopup('"+objID+"')");
	}
	p.style.zIndex = 100;
	p.style.display="block";
	p.style.width=a.firstChild.width-6+'px';
	p.style.left=findPosX(a)+'px';
	iePadding=(usingDumbBrowser?7:-3);
	p.style.top=findPosY(a)+a.offsetHeight+iePadding+'px';
}

function killpopup(objID){
	document.getElementById(objID+'-popup').style.zIndex--;
	blah=setTimeout("document.getElementById('"+objID+"-popup').style.display='none';",100);
}

function makeEquipment(str){
	var p=document.getElementById('equipmentImage');
	var q=document.getElementById('equipmentFrame');
	p.src='images/equipment/'+str+'.jpg';
	q.src=str+'.htm';
}

function findPosX(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}else if(obj.x){curleft+=obj.x;}return curleft;}
function findPosY(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}else if(obj.y){curtop += obj.y;}return curtop;}
function doSomething(e){if(!e) var e=window.event||window.Event;if('undefined'!=typeof e.x){posy=e.clientY;posx=e.clientX}else{posx=e.clientX;posy=e.clientY;}posx+=document.documentElement.scrollLeft;posy+=document.documentElement.scrollTop;}
function findPosY(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}else if(obj.y){curtop += obj.y;}return curtop;}
if(window.Event && document.captureEvents) document.captureEvents(Event.MOUSEMOVE); document.onmousemove = doSomething;
function output(str){document.getElementById('test').innerHTML=str;}
