/*****************************************************************
* swaps the imae to make the tollover effect
******************************************************************/
function SimpleSwap(el,which){
	el.src=el.getAttribute(which || "origsrc");
}

/*****************************************************************
* initializes the swap image behaviour
******************************************************************/
function SimpleSwapSetup(){
    var x = document.getElementsByTagName("img");
		
    for (var i=0;i<x.length;i++){
        var oversrc = x[i].getAttribute("oversrc");
		
        if (!oversrc) continue;
        
        x[i].oversrc_img = new Image();
        x[i].oversrc_img.src=oversrc;
		
        x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
        x[i].onmouseout = new Function("SimpleSwap(this);");
			
        x[i].setAttribute("origsrc",x[i].src);
    }
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}

/*****************************************************************
* displays the images specified
******************************************************************/
function viewImage(a_strImg) {
	document.getElementById('imgGal').src = 'img/' + a_strImg;
}

/*****************************************************************
* highlit/unhighlite the button
******************************************************************/
function setColor(a_intLength, a_objLink) {
	for (i=1; i<=a_intLength; i++) {
			('btn' + i == a_objLink.id)?
				a_objLink.className = 'btn-on' : document.getElementById('btn' + i).className = 'btn-off';
	}
}