
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);
}
/*function SetTaskStay(pdimageon){  // podium function
  	  switch(pdimageon){
	    case 111445: 
	   	navon = new M_object('M1'); // On state 
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));

		firstbanner = new M_object('b1')
		firstbanner.style.display = "";
	 	break;
	    case 111446: 
		navon = new M_object('M2');
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));

		secondbanner = new M_object('b2')
		secondbanner.style.display = "";	
	 	break;
		case 111447: 
	   	navon = new M_object('M3');
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));

		thirdbanner = new M_object('b3')
		thirdbanner.style.display = "";	
	 	break;
		case 111448: 
	   	navon = new M_object('M4');
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));

		fourthbanner = new M_object('b4')
		fourthbanner.style.display = "";		
	 	break;
	    case 110351: 
	   	navon = new M_object('M5');
		navon.src=navon.getAttribute("oversrc");
		navon.setAttribute("origsrc",navon.getAttribute("oversrc"));	
		
		fivthbanner = new M_object('b5')
		fivthbanner.style.display = "";		
	 	break;	
		
	   	default:
		firstbanner = new M_object('b1')
		firstbanner.style.display = "";
		break;		
	 }
}*/