var timer;
var timeContent;
var tCDuration = 10000;		// 10 seconds
var itemCount = 2;
var currentItem = 1;
var lastIndex = -1;

var locations = new Array();
locations[0] = 'omaha';
locations[1] = 'blair';
locations[2] = 'fremont';
locations[3] = 'bellevue';
locations[4] = 'elkhorn';
locations[5] = 'lavista';
	
var locLong = new Array();
locLong[0] = "Omaha, NE";
locLong[1] = "Blair, NE";
locLong[2] = "Fremont, NE";
locLong[3] = "Bellevue, NE";
locLong[4] = "Elkhorn, NE";
locLong[5] = "La Vista, NE";

function switchTemp() {
	lastIndex++;
	if (lastIndex > (locations.length - 1)) {
		lastIndex = 0;
	}
	try {
	    $("#temp").fadeOut(150);
		$.ajax({
			url: "weatherproxy.php?loc=" + locations[lastIndex],
			dataType: ($.browser.msie) ? "text" : "xml",
			success: function(data) {
				var xml;
				if (typeof data == "string") {
					xml = new ActiveXObject("Microsoft.XMLDOM");
					xml.async = false;
					xml.loadXML(data);
				} else {
					xml = data;
				}
				$(xml).find("temp_f").each(function() {
					var toInt = Math.round($(this).text());
					$("#temp").html(locLong[lastIndex] + " " + toInt + "&deg;F");
					$("#temp").fadeIn(500);
				});
			}
		});
	}
	catch (e) { }
	// setInterval("switchTemp()",5000);
}

(function($) {
	$(function() { //on DOM ready
		//switchTemp();
		//setInterval("switchTemp()",5000);
		$("#csr").mouseover(function() { 
	    	$(this).attr("src", "/homepage/images/staffcomm_button_over.gif");
	    })
	    $("#csr").mouseout(function() {
	    	$(this).attr("src", "/homepage/images/staffcomm_button.gif");
		});
		// Resize columns
		var leftHeight = $("#left").height();
		var rightHeight = $("#right").height();
		var newHeight = leftHeight > rightHeight ? leftHeight : rightHeight;
		$("#left").height(newHeight);
		$("#right").height(newHeight);
		$('input[title!=""]').hint();
	});
})(jQuery);




