$(document).ready(function(){if($(".pgbnr") && $(".pgbnr img").height()=="1"){$(".pgbnr img").css("display","none");}});
$(document).ready(function(){SetTaskStay(pdGlobal.currentPages[0].id);});

function SetTaskStay(pdimageon){
//alert(pdimageon);
  	  switch(pdimageon){
	    case 108651: 
	   	navon = new M_object('M1')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
		$(".pgbnr").css("border-bottom","4px solid #8D1120");
	 	break
	    case 110841: 
	    navon = new M_object('M2')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
		$(".pgbnr").css("border-bottom","4px solid #B55101");
	 	break
		case 110869: 
	   	navon = new M_object('M3')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
		$(".pgbnr").css("border-bottom","4px solid #8D9F48");
	 	break
		case 110893: 
	   	navon = new M_object('M4')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
		$(".pgbnr").css("border-bottom","4px solid #1B4F29");
	 	break
	    case 110900: 
	   	navon = new M_object('M5')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
		$(".pgbnr").css("border-bottom","4px solid #629DC2");
	 	break
		case 110903: 
	   	navon = new M_object('M6')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
		$(".pgbnr").css("border-bottom","4px solid #312C67");
	 	break
		//Omnis
		case 110904: 
	   	navon = new M_object('M7')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
	 	break
		case 110907: 
	   	navon = new M_object('M8')
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));
	 	break
	   	default:		
		break
	 }
}

function MS_swap(Mitem,Mtype){
	Mitem.src=Mitem.getAttribute(Mtype || "origsrc");
}

function MS(img_swap){
	img_swap.setAttribute("origsrc",img_swap.src);
	img_swap.setAttribute("onload","");
   	img_swap.oversrc_img = new Image();
  	img_swap.oversrc_img.src=img_swap.getAttribute("oversrc");
    img_swap.onmouseover = new Function("MS_swap(this,'oversrc');");
    img_swap.onmouseout = new Function("MS_swap(this);");
	img_swap.style.cursor = 'pointer';
}

/*ripped from prototype.js*/
function M_object(element) {
	if (arguments.length > 1) {
		for (var i = 0, elements = [], length = arguments.length; i < length; i++)
			elements.push(M_object(arguments[i]));
		return elements;
	}
	if (typeof element == 'string')
		element = document.getElementById(element);
	return element;
}

//Check for added variable to podium url
function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
		}
	} 
	return -100;

}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

function insertFooterCode(){
	var footerContainer = document.createElement("div");
	footerContainer.innerHTML = M_object("podium_footer").innerHTML;
	document.body.appendChild(footerContainer);
}