var onloadHandlers = [];

window.onload = function(){
	for(var i=0;i<onloadHandlers.length;i++){
		eval(onloadHandlers[i]);
	}
}

/*fixes target="_blank" issue!!*/
function setTargets(){
    var anchors = document.getElementsByTagName("a"); 
    for (var i=0; i<anchors.length; i++) { 
       var anchor = anchors[i]; 
       if (anchor.getAttribute("rel") == "ext") {
           anchor.target = "_blank";
       } 
    } 
}	
var targets = null;
onloadHandlers[onloadHandlers.length] ='targets = setTargets()';

function toggle(me){
	me = document.getElementById(me);
	if(me.style.display == "" || me.style.display == "none"){
		me.style.display = 'block';
	}else{
		me.style.display = 'none';
	}
}

function setNav(me){
	document.getElementById(me).style.background='none';
}
var div;
function delay(me){
	div.style.display='block';
	div.style.zoom=1;
}

function showImage(folder, image, orient){
	killLandscape();
	killPortrait();
	if(orient == "landscape"){
		div = document.getElementById('landscape');
	}else{
		div = document.getElementById('portrait');	
	}
	
	div.style.backgroundImage = "url(/images/"+folder+"/"+image+")";
	setTimeout("delay()",1);
	//alert(div.style.backgroundImage);
}

function showCustomImage(folder, image, orient){
	killCustomLandscape();
	killCustomPortrait();
	if(orient == "landscape"){
		div = document.getElementById('custom-landscape');
	}else{
		div = document.getElementById('custom-portrait');	
	}
	
	div.style.backgroundImage = "url(/images/"+folder+"/"+image+")";
	setTimeout("delay()",1);
	//alert(div.style.backgroundImage);
}

var onpage = "";
function setPage(img){
	onpage = img;
	document.getElementById(img).src='/images/presentation/nav/'+img+'-here.gif';
}

function subnavOver(me,img){
	me.src='/images/presentation/nav/'+img+'-here.gif';
}

function subnavOut(me,img){
	me.src='/images/presentation/nav/'+img+'.gif';
	setPage(onpage);
}

function killLandscape(){
	document.getElementById('landscape').style.display='none';
}

function killPortrait(){
	document.getElementById('portrait').style.display='none';
}

function killCustomLandscape(){
	document.getElementById('custom-landscape').style.display='none';
}

function killCustomPortrait(){
	document.getElementById('custom-portrait').style.display='none';
}

function swapEmail(me){
	document.getElementById('image-email').src="/images/contact/"+me+".gif";
}