/* weather.js */

// Copyright (c) 2006 pdxstump
// All rights reserved

var curURL = satURL;
function setSatImg (count,img,text) {
	curURL = "/weather/downloads/processed/t." + img + (count + 1) + ".png";
	document.getElementById('satBox').style.backgroundImage = "url(" + curURL + ")";

	document.getElementById('satBox').style.backgroundPosition = "center left";

	document.getElementById('satWords').innerHTML  = text;
}

function resetSatImg () {
	setSat(satURL,satWords);
}

function setSat (url,words) {
	curURL = url;
	document.getElementById('satBox').style.backgroundImage = "url(" + url + ")";
	document.getElementById('satBox').style.backgroundPosition = "center center";
	document.getElementById('satWords').innerHTML  = words;

}

function toggleSatImg () {
	if (curURL != satURL) {
		resetSatImg();
	} else {
		if (curURL == irURL) {
			setSat(visURL,visWords);
		} else {
			setSat(irURL,irWords);
		}
	}

}

var satURL = "/weather/downloads/sat_ir.png";
var satWords = "infrared satellite";
var irURL = "/weather/downloads/sat_ir.png";
var irWords = "infrared satellite";
var visURL = "/weather/downloads/sat_vis.png";
var visWords = "visible satellite";
var loopURL = "/weather/downloads/pnwloop.gif";
var loopWords = "pnw sattelite loop";


function loader () {
	// document.s.query.focus();
	Spry.Effect.AppearFade('welink',{duration: 500 * timer,from: 0,to: 100});
	 	Spry.Effect.AppearFade('forecastDetail',{duration: 700 * timer,from: 0,to: 100}); 

}


var wwToggles = new Array();
function toggleWW (ID) {
	Spry.Effect.Blind('desc0', {duration: 1000, from: '200px', to: '0px', toggle: true});

	if (wwToggles[ID] == null) {
		wwToggles[ID] = true;
	}
	if (!wwToggles[ID]) {
		document.getElementById(ID).style.overflow = 'auto';
		//document.getElementById(ID).style.paddingRight = '.5em'; 
		wwToggles[ID] = true; 
	} else {
		document.getElementById(ID).style.overflow = 'hidden'; 
		//document.getElementById(ID).style.paddingRight = 0; 
		wwToggles[ID] = false;
	}
}


