function TurnStuffOn(){
	if(pdGlobal.currentPages[0]){
		if(pdimageon = pdGlobal.currentPages[0].id){
			CurrentOn = pdimageon;
			switch(pdimageon){
				case 111868:$('#L1_111868').css("background-position","-219px -300px");break;
				case 111869:$('#L1_111869').css("background-position","-330px -300px");break;
				case 111870:$('#L1_111870').css("background-position","-453px -300px");break;
				case 111871:$('#L1_111871').css("background-position","-562px -300px");break;
				case 111872:$('#L1_111872').css("background-position","-659px -300px");break;
				case 111873:$('#L1_111873').css("background-position","-775px -300px");break;
				case 111874:$('#L1_111874').css("background-position","-859px -300px");break;
				default:
			}
		}
	}
}

//*************************** Self Managed Banner Function ***********************
	function showBanner(photoID) {
		if(photoID==-999){
			document.getElementById("bannerPhotoContainer").innerHTML = "<img src='/ftpimages/354/podium/style623/images/selfManagedImage.jpg' height='153' width='687' border='0'>"
		}
		else {
			photoBannerString = "/managedBannerPhotos.asp?photoID=" + photoID;
			tempString = "<script type='text/javascript' src='" + photoBannerString + "'><\/script>";
			document.write(tempString);
		}

	//IE "forgets" to render absolute position elements in certain circumstances - here we jog it's memory
	//Using addLoadEvent, we force all browsers to add style "display:block;" to element after the page has fully loaded - in theory (and hopefully in practice) this will force IE to render the element every time
	addLoadEvent(function() {
	  $('#contentPageTop').css("display","block");
	});

	//setTimeout('forceIEdisplay()',2000);	//this works but is still subject to page load times - will force IE to render the element only if page has fully loaded in time
	}

/*	function forceIEdisplay(){
		$('#contentPageTop').css("display","block");
	}
*/

//The assumed reasoning for IE's "memory loss" is that the unholy 'hasLayout' property, even when widths, heights, etc are set, is sometimes marked as false by the browser based on
//the surrounding elements' properties (such as floats and other positioned elements). IE knows that the element should have a true 'hasLayout' property, but needs to be reminded to
//set this after other elements surrounding the element in question have been loaded. Setting or resetting ANY, even fake css properties will cause IE to set the element's 'hasLayout' to true.

//This is technically a hack to overcome another IE shortcoming, but it works

//*************************** Podium Search Functions *****************************
	function submitSearch(){
		parent.window.location = "/podium/default.aspx?t=52392&q="+document.getElementById("search").value+"&pt=Bishop Guertin High School - Site Search";
	}
	function SubmitOnEnter(evt){
		var charCode = (evt.which) ? evt.which : event.keyCode
		if(charCode == "13" || charCode == "26"){
			submitSearch();
			return false;
		}
	}

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);
}