//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 GetL2(id){
	var menuString = "<div id='menu-holder'>";
	for(var i = 0; i < pageList.length; i++){
		if(pageList[i].parentID == id && pageList[i].level == 2){
			target = ""
			if(pageList[i].target) target = " target=\"_blank\"";
			menuString += "<a class='subMenuItems' href='" + pageList[i].pageURL + "'" + target + "><span>" + pageList[i].pageName + "</span></a>";
		}
	}
	menuString += "</div>";
	$("#L1_"+id+" #L2_holder").append(menuString);
}

function setPhoto(id){
	if(!isNaN(id)){
		$("#photo").css("background","url(/ftpimages/370/podium/style652/photo_"+id+".jpg) top right no-repeat");
		$("#L1_"+id).addClass("on");
		$("#L1_"+id+" #L2_holder #menu-holder").css("padding-top",(204-$("#L1_"+id+" #L2_holder #menu-holder").height()));
	}else{
		$("#photo").css("background","url(/ftpimages/370/podium/style652/photo_default.jpg) top right no-repeat");
		$("#L1_140728").addClass("on");
	}	
}

$(document).ready(function(){
	switch(pdGlobal.currentPages[0].id){
		case 112035: setPhoto(112035); break;
		case 112036: setPhoto(112036); break;
		//case 140728: setPhoto(140728); break;
		case 112037: setPhoto(112037); break;
		case 112232: setPhoto(112232); break;
		case 112038: setPhoto(112038); break;
		default:setPhoto("default"); break;
	}
	swfobject.embedSWF("/flash/bannerMenu_v3.swf", "flashmenu", "354", "245", "9.0.0","", flashvars, params, attributes);
	
	
	var pgTitleTag, 
	pageTitle;
	if((pdGlobal.currentPages[2] && pdGlobal.currentPages[2].id == 118)) {
		$("#footer div").css("display","none"); 
	}else{
		switch(pdGlobal.currentPages[0].id){
			case 112035: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/112035.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			case 112036: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/112036.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			case 112037: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/112037.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			case 112232: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/112232.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			case 112038: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/112038.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			case 140728: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/140728.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			case 112039: 
				pageTitle = "<img src='/ftpimages/370/podium/style652/L1titles/112039.png' alt='"+pdGlobal.currentPages[0].title+"' height='28' width='290' border='0'>"; 
				break;
			default:
				pageTitle = ""; 
				break;
		}
		pgTitleTag = pageTitle; 
		$("#footer div").html(pgTitleTag);
	}
});

function hideLeftCol(){
	$('.sitepg').css('border-left','1px solid #DADADA');
	$('.sitepg').css('border-right','1px solid #DADADA');
	$('#eng').css('width','951px');
}
	
function showLeftCol(){
	$('.sitepg').css('border-left','none');
	$('.sitepg').css('border-right','1px solid #DADADA');
}
pageType = pdGlobal.currentPages[pdGlobal.currentPages.length-1].type;
currentID = pdGlobal.currentPages[pdGlobal.currentPages.length-1].id;
if(pdGlobal.currentPages[0].type == "content"){
	document.write("<style>.sitelcol {display: none;}</style>");
	document.write("<style>.leftcolimg {display: none;}</style>");
	hideLeftCol();
}else{
	document.write("<style>.sitelcol {border-left:1px solid #DADADA;}</style>");
	document.write("<style>.sitelcol {display:'';}</style>");
	document.write("<style>.leftcolimg {display:'';}</style>");
	showLeftCol();
}
