/*  	
	Brown Paper Bab - Web Studio - Web Design - Web Creation - Web Hosting - Internet - Intranet
	Version 1.1
	Created: 19th Feb 2006
	By: info@brownpaperbag.com.au
	Modified: 
		23rd Feb 2006 RB Added HighlightNav function
*/

/* For findPos() */
/* Image Swapper */
var current = null;

Event.observe(window, 'load', SetUpHoverBtns);

function SetUpHoverBtns(){
    //var myArray = $$('.BtnHover');
    $$('.BtnHover').each(function(item){
        
        item.onmouseover = function(){ImgSwp(item);};
        item.onmouseout = function(){ImgSwp(item);};
    });
	$$('a.nw').each(function(el) {
	  
		el.onclick = function() { return (window.open(this.href,"childWindow")) ? false : false; };
		el.onkeypress = function() {return (window.open(this.href,"childWindow")) ? false : false; };
	});
}

function ImgSwp(oButton) {  // Image swapper
	var ext = oButton.src.substring(oButton.src.lastIndexOf("."), oButton.src.length)
	var path = oButton.src.substring(0, oButton.src.lastIndexOf("/")+1)
	var file = oButton.src.substring(oButton.src.lastIndexOf("/")+1,oButton.src.lastIndexOf("."))
	if (oButton != current){
		oButton.src = (((i = file.indexOf("_ovr")) >= 0) || ((i = file.indexOf("_on")) >= 0)) ? path + file.substring(0, file.lastIndexOf("_")) + ext : path + file + "_ovr" + ext;
	}
};

