/*function TurnStuffOn(){
	if(pdGlobal.currentPages[0]){
		switch(pdGlobal.currentPages[0].id){
			case 112612: $('#L1_112612').css("background-position","0px -28px"); $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/bannerL1_1.jpg").attr("alt","Chandler School - About Us").attr("title","Chandler School - About Us"); break;
			case 112613: $('#L1_112613').css("background-position","-122px -28px"); $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/bannerL1_2.jpg").attr("alt","Chandler School - Admissions").attr("title","Chandler School - Admissions"); break;
			case 112614: $('#L1_112614').css("background-position","-250px -28px"); $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/bannerL1_3.jpg").attr("alt","Chandler School - Programs").attr("title","Chandler School - Programs"); break;
			case 112615: $('#L1_112615').css("background-position","-370px -28px"); $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/bannerL1_4.jpg").attr("alt","Chandler School - Around Campus").attr("title","Chandler School - Around Campus"); break;
			case 112616: $('#L1_112616').css("background-position","-538px -28px"); $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/bannerL1_5.jpg").attr("alt","Chandler School - Giving").attr("title","Chandler School - Giving"); break;
			case 112617: $('#L1_112617').css("background-position","-632px -28px"); $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/bannerL1_6.jpg").attr("alt","Chandler School - Alumni").attr("title","Chandler School - Alumni"); break;
			default: $("#bannerPhoto").attr("src","/ftpimages/359/podium/style656/images/defaultBannerImage.jpg"); break;
		}
	}
}*/

$(document).ready(function(){
	var weatherStationHTML = "";
	weatherStationHTML += "<link rel='stylesheet' type='text/css' href='http://img.weather.weatherbug.com/Style/stickers/v2/Stickers_300x250.css' />" 
	weatherStationHTML += "<div class='wXbody'>";
		weatherStationHTML += "<iframe id='WeatherBugSticker_300x250_v2' src='http://weather.weatherbug.com/desktop-weather/web-widgets/getSticker.html?ZipCode=91101&ZCode=z5545&Size=300x250&StationID=PSDNC&units=0&Version=2' width='284' height='172' frameborder='0' scrolling='no' allowtransparency='yes'></iframe>";
		weatherStationHTML += "<div class='wXlinks'>";
			weatherStationHTML += "<span class='link'><a href='http://weather.weatherbug.com/CA/Pasadena-weather/local-forecast/7-day-forecast.html?zcode=z5545&units=0' target='_blank'>Forecast</a></span>";
			weatherStationHTML += "<span class='link'><a href='http://weather.weatherbug.com/CA/Pasadena-weather/local-radar/doppler-radar.html?zcode=z5545&units=0' target='_blank'>Radar</a></span>";
			weatherStationHTML += "<span class='link'><a href='http://weather.weatherbug.com/CA/Pasadena-weather/weather-cams/local-cams.html?zcode=z5545&units=0' target='_blank'>Cameras</a></span>";
			weatherStationHTML += "<span class='link'><a href='http://community-weather.weatherbug.com/community/weather-photos/photo-gallery.html?zcode=z5545&units=0&zip=91101' target='_blank'>Photos</a></span>";
		weatherStationHTML += "</div>";
		weatherStationHTML += "<div class='footer'>";
			weatherStationHTML += "<a href='http://weather.weatherbug.com/CA/Pasadena-weather.html?zcode=z5545&units=0' target='_blank'><img src='http://img.weather.weatherbug.com/images/stickers/v2/300x250/wxbug-logo.jpg' id='logo' border='0' alt='WeatherBug' /></a>";
			weatherStationHTML += "<a href='http://weather.weatherbug.com/CA/Pasadena-weather.html?zcode=z5545&units=0' target='_blank'><img src='http://img.weather.weatherbug.com/images/stickers/v2/300x250/local.jpg' border='0' id='location' alt='WeatherBug' /></a>";
		weatherStationHTML += "</div>";
		weatherStationHTML += "<div class='footertext'>Your weather just got better.</div>";
	weatherStationHTML += "</div>";
	
	$("#personalWX").css("width","100%").css("text-align","center").html(weatherStationHTML);
	$(".wXbody").css("margin","10px auto 5px").html(weatherStationHTML);
	
	//load photos
	$photo = $("#mainphoto");
	switch(pdGlobal.currentPages[0].id){
 	 	case 112612:GetPhotos(16981,$photo); break;
 	 	case 112613:GetPhotos(16982,$photo); break;
 	 	case 112614:GetPhotos(16983,$photo); break;
 	 	case 112615:GetPhotos(16984,$photo); break;
 	 	case 112616:GetPhotos(16985,$photo); break;
		case 112617:GetPhotos(16986,$photo); break;
 	 	default:GetPhotos(16987,$photo); break;
 	 }
});

function GetPhotos(pID,$container){	
	$.ajax({
		type: "GET",
		url: "/xml/default.asp?sid=359&type=photo&id="+pID,
		dataType: "xml",
		success: function(xml) {
			$(xml).find('image:first').each(function(){
			   	$container.css("background","url("+$(this).find("path").text()+") no-repeat");
			});
		},
		error: function(request,tStatus,eThrown){
			//alert("Cant Get Photos");
		}
	});		
}