/*
	allows for multiple actions to be added to the window.onload event
	without overwriting the existing event contents

	called as
	addOnLoadAct(functionName);
	NOTE: do not include () in the function name 
*/

//basic browser detection
var isIE=(document.all && navigator.userAgent.toLowerCase().indexOf('msie')!=-1? true : false);
var isOpera=(document.all && navigator.userAgent.toLowerCase().indexOf('opera')!=-1? true : false);
var isSafari=(document.getElementById && !isIE && !isOpera && navigator.userAgent.toLowerCase().indexOf('safari')!=-1? true :false)
var isFF=(document.getElementById && !isIE && !isOpera && !isSafari && navigator.userAgent.toLowerCase().indexOf('firefox')!=-1? true :false)
var isNS=isFF;


var isWin=(navigator.platform.toLowerCase().indexOf('win')!=-1? true: false);
var isMac=(navigator.platform.toLowerCase().indexOf('mac')!=-1? true: false);

function addOnLoadAct(fNewOnLoad){	
	// save the existing onload event(s)
	var fCurrentOnLoad = window.onload;
	// if the existing onload does not have a function ...
	if (typeof window.onload != 'function'){
		// give it this function
		window.onload = fNewOnLoad;
	}else{
		// else add the new function to the existing function
		window.onload = function(){
			fCurrentOnLoad();
			fNewOnLoad();
		}
	}
}

var sTemp;

function getTop(obj){
	yPos = eval(obj).offsetTop;
	tempEl = eval(obj).offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
return yPos;
}

function getLeft(obj){
	xPos = eval(obj).offsetLeft;
	tempEl = eval(obj).offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
return xPos;
}


function imageSwap(objImg, sVer){
	if(sVer.toLowerCase()=='over'){
		objImg.src=objImg.src.replace(/_on|_hv|_nm/i,'_hv');
	}else{
		objImg.src=sTemp
	}
}


function showImgOn(objImg){
	objImg.src=objImg.src.replace(/_on|_hv|_nm/i,'_on');
	sTemp=objImg.src;
}

function showImgOff(objImg){
	objImg.src=objImg.src.replace(/_on|_hv|_nm/i,'_nm');
	sTemp=objImg.src;
}

var popWin;
function openPopWindow(url){
	if(!popWin || popWin.closed){
		popWin=window.open(url,'popWin','width=1064px,height=800px,scrollbars=yes');
	}else{
		popWin.close()
		openPopWindow(url);
	}
	
}