
var t;
var p;
function getWeather(index)
{
	window.clearTimeout(t);	
	
	var divMain = document.getElementById('divWeather');
	var image = document.getElementById('miniLoc');	
	var divImageText = document.getElementById('divImageText');
	//divImageText.style.visibility = "hidden";
	
	var Top = "0px";
	var Left = "0px";
	var forcast = new Array();
		
	image.src = '';
	
	//display weather from rss feed	
	if(index == 1)
	{
		forcast[1] = document.getElementById('rss1').value;
	}
	else if(index == 2)
	{
		forcast[2] = document.getElementById('rss2').value;
	}
	else if(index == 3)
	{
		forcast[3] = document.getElementById('rss3').value;
	}
	else if(index == 4)
	{
		forcast[4] = document.getElementById('rss4').value;
	}
	else if(index == 5)
	{
		forcast[5] = document.getElementById('rss5').value;
	}
	else if(index == 6)
	{
		forcast[6] = document.getElementById('rss6').value;
	}
	else if(index == 7)
	{
		forcast[7] = document.getElementById('rss7').value;
	}
	else if(index == 8)
	{
		forcast[8] = document.getElementById('rss8').value;
	}
	else if(index == 9)
	{
		forcast[9] = document.getElementById('rss9').value;
	}
	else if(index == 10)
	{
		forcast[10] = document.getElementById('rss10').value;
	}
	
	document.getElementById("divWeatherText").innerHTML = forcast[index];
	if(index == 1)
	{
		Left = "42px";
		Top = "-214px";
		image.src = "/images/locations/sugarland_sm.jpg";			
	}
	else if(index == 2)
	{
		Left = "102px";
		Top = "-372px";
		image.src = "/images/locations/rockford_sm.jpg";		
	}
	else if(index == 3)
	{
		Left = "184px";
		Top = "-364px";
		image.src = "/images/locations/pittsburgh_sm.jpg";		
	}
	else if(index == 4)
	{
		Left = "188px";
		Top = "-354px";
		image.src = "/images/locations/morgantown_sm.jpg";
	}
	else if(index == 5)
	{
		Left = "194px";
		Top = "-310px";
		image.src = "/images/locations/greensboro_sm.jpg";
	}
	else if(index == 6)
	{
		Left = "233px";
		Top = "-434px";
		image.src = "/images/locations/stalbans_sm.jpg";
	}
	else if(index == 7)
	{
		Left = "279px";
		Top = "-111px";
		image.src = "/images/locations/caguas_sm.jpg";
	}	
	else if(index == 8)
	{
		Left = "239px";
		Top = "-379px";
		image.src = "/images/locations/woodbridge_sm.jpg";
	}	
	else if(index == 9)
	{
		Left = "218px";
		Top = "-348px";
		image.src = "/images/locations/washington_sm.jpg";
	}	
	else if(index == 10)
	{
		Left = "233px";
		Top = "-373px";
		image.src = "/images/locations/bedminster_sm.jpg";
	}
	
	divMain.style.top = Top;
	divMain.style.left = Left;		
	
	t = window.setTimeout(showWeather, 400);
	
}

function showWeather()
{
	window.clearTimeout(t);
	var divMain = document.getElementById('divWeather');
	var image = document.getElementById('miniLoc');	
	var divImageText = document.getElementById('divImageText');
	
	divImageText.style.visibility = "visible"	
	image.style.visibility = "visible";		
	divMain.style.visibility = "visible";
}

function hideWeather()
{
	window.clearTimeout(t);
	
	var divMain = document.getElementById('divWeather');
	divMain.style.visibility = "hidden";
	
	var image = document.getElementById('miniLoc');
	image.src = '';
	image.style.visibility = "hidden";
	
	var divImageText = document.getElementById('divImageText');
	divImageText.style.visibility = "hidden";
	
	var divWeatherText = document.getElementById('divWeatherText');
	divWeatherText.innerHtml = "";	
	
}

function clearWeather()
{
	hideWeather();
	//window.setTimeout(hideWeather, 400);
}

//Function to display School events

function showEvents(me, tagName, tagName2, strDate)
{
	me.style.cursor='hand'
	
	var divEvents = document.getElementById('divEvents');
	divEvents.style.visibility = "visible";	
	
	var divEventText = document.getElementById(tagName);
	divEventText.style.visibility = "visible";
	
	var divEventText2 = document.getElementById(tagName2);
	divEventText2.style.visibility = "visible";	
	
}

function hideEvents(me, tagName, tagName2)
{	
	me.style.cursor='default';
	
	var divEvents = document.getElementById('divEvents');
	divEvents.style.visibility = "hidden";
	
	var divEventText = document.getElementById(tagName);
	divEventText.style.visibility = "hidden";
	
	var divEventText2 = document.getElementById(tagName2);
	divEventText2.style.visibility = "hidden";	
	
}

function printThisPage()
{
	window.print();
	//if(navigator.platform == "MacPPC")
	//{
		//p = window.setTimeout(PrintGoBack, 200);
	//}		
}

function PrintGoBack()
{
	window.location.reload(true);
	window.clearTimeout(p);	
}

function page_email()
{	
	if(document.location.toString().indexOf("/email_page.aspx") == -1)
	{
		var loc = document.location;

		//alert(loc);
		//convert object to string
		loc = loc + "";

		if(loc == "")
		{
			loc = window.document.domain;
		}
		
		//make qs friendly
		loc = loc.replace(/&/g, "%26").replace(/ /g, "%20");

		//window.navigate("/email_page.aspx?url=" + loc);
		//works with more browsers.
		window.location = "/email_page.aspx?url=" + loc;
		return true;
	}		
}

function LoadFlash(_Id, _FlashPath, _width, _height, _align, _WMode, _BGColor)
{
	var FlashMode=0;
		// check for flash 5, netscape compatible browsers and mac both 
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin) {
		// find version
			plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 5;
			FlashMode=1;			
		}
		// windows IE
		else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
		   && (navigator.platform == "Win95" || navigator.platform == "Win98" || navigator.platform == "WinNT" || navigator.platform == "Win32")) {
			document.writeln('<script language="VBScript"\> \n');
			document.writeln('on error resume next \n');
			document.writeln('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
			document.writeln('</script\> \n');
			FlashMode=plugin;
		}
		
		//if(FlashMode)
		//{
			GetFlash(_Id, _FlashPath, _width, _height, _align, _WMode, _BGColor);
		//}
		//else
		//{						
			//document.writeln('Flash is required to view this website. <br>Please click <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" class="white" target="_blank">here</a> to download the latest version of Flash Media player.');
		//}
}


function GetFlash(_Id, _FlashPath, _width, _height, _align, _WMode, _BGColor)
{	
	document.write('<OBJECT id="'+_Id+'" codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" type="application/x-shockwave-flash" height="'+_height+'" width="'+_width+'" align="'+_align+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>');
	document.write('<PARAM NAME="_cx" VALUE="4022">' + 
		'<PARAM NAME="_cy" VALUE="12674">' + 
		'<PARAM NAME="FlashVars" VALUE="">' + 
		'<PARAM NAME="Movie" VALUE="'+_FlashPath+'">' +
		'<PARAM NAME="Src" VALUE="'+_FlashPath+'">' +
		'<PARAM NAME="WMode" VALUE="'+_WMode+'">' + 
		'<PARAM NAME="Play" VALUE="-1">' +
		'<PARAM NAME="Loop" VALUE="-1">' + 
		'<PARAM NAME="Quality" VALUE="High">' + 
		'<PARAM NAME="SAlign" VALUE="">' + 
		'<PARAM NAME="Menu" VALUE="-1">' + 
		'<PARAM NAME="Base" VALUE="">' + 
		'<PARAM NAME="AllowScriptAccess" VALUE="always">' + 
		'<PARAM NAME="Scale" VALUE="ShowAll">' +
		'<PARAM NAME="DeviceFont" VALUE="0">' + 
		'<PARAM NAME="EmbedMovie" VALUE="0">' + 
		'<PARAM NAME="BGColor" VALUE="'+_BGColor+'">' + 
		'<PARAM NAME="SWRemote" VALUE="">' + 
		'<PARAM NAME="MovieData" VALUE="">' + 
		'<PARAM NAME="SeamlessTabbing" VALUE="1">' + 
		'<PARAM NAME="Profile" VALUE="0">' + 
		'<PARAM NAME="ProfileAddress" VALUE="">' + 
		'<PARAM NAME="ProfilePort" VALUE="0">' + 
	'<EMBED src="'+_FlashPath+'" Movie="'+_FlashPath+'" quality="high" bgcolor="'+_BGColor+'" WIDTH="'+_width+'" HEIGHT="'+_height+'" NAME="'+_Id+'" mode="'+_WMode+'" ALIGN="'+_align+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE=http://www.macromedia.com/go/getflashplayer></EMBED></OBJECT>');
	
}
function sshow_mti2()
{
window.open('/flash/locations/mti2_sshow.html','','scrollbars=no,menubar=no,height=400,width=600,resizable=no,toolbar=no,location=no,status=no');
}

