var timeoutID;

function SwapInPhoto(imgSrc){
	newImgLink = new String(imgSrc);
	newImgLink = newImgLink.replace(/m\.jpg/g, "b.jpg");
	if (timeoutID)
		window.clearTimeout(timeoutID);
	document.images['MainImage'].src = imgSrc;
	document.getElementById('ImageLink').href = newImgLink;
}

function SwapOutPhoto(imgSrc){
	if (timeoutID)
		window.clearTimeout(timeoutID);

	newImgLink = new String(imgSrc);
	newImgLink = newImgLink.replace(/m\.jpg/g, "b.jpg");
	var imgString = "document.images['MainImage'].src = \'"+imgSrc+"\'; document.getElementById('ImageLink').href = \'"+newImgLink+"\'";
	timeoutID = window.setTimeout(imgString, 2000);
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400');");
}

function switchMenu(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {el.style.display = 'none';}
	else {el.style.display = '';}
}



// tabs
var 
	ids=new Array('tab1','tab2','tab3','tab4');
function switchid(id){	
	hideallids();
	showdiv(id);
}
function hideallids(){
	//loop through the array and hide each element by id
	for (
	var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
