// JavaScript Document Callery Scripts

var mac = navigator.userAgent.indexOf('Mac'); 
var IE = navigator.userAgent.indexOf('MSIE');
var macIE = (mac != -1) && (IE != -1);
var imageID = -1;

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

//create work around for css hover state on ie for li tags
hoverThumb = function(){
	var thumbControl = document.getElementById("thumbs").getElementsByTagName("IMG");
	for (var i=0; i<thumbControl.length; i++){
		thumbControl[i].onmouseover=function(){
			this.className+="hover";
		}
		thumbControl[i].onmouseout=function(){
			this.className=this.className.replace(new RegExp("hover\\b"), "");
		}
	}
	if(!macIE){sfHover();}
}

//load thumbnail as enlarged image
function loadImage(num){
	document.getElementById('eventImg').src = mockup[num];
	imageID = num;
}

if(macIE){window.onload = hoverThumb;}
else if(window.attachEvent){window.attachEvent("onload", hoverThumb);}

