<html>

<head><title>newclock</title>

<!--Moddified by Jose Sampo (Kevlar)

http://www.facebook.com/jsampo

Version 1.7 Released 1-28-11 -->

<style>

body {

	background-color: black;

	margin: 0;

	padding: 10px 0 0 0;

	height: 480px;

	width: 320px;

}

 

SPAN#clock

{

	font-family: Helvetica;

	font-weight: bold; 

	color: #d1d1d1; 

	text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.7);	

	/*text-shadow: #FFFFFF 0px 1px 0px;*/

	font-size: 26px;

}



SPAN#ampm

{

	font-family: Helvetica;

	font-weight: bold; 

	color: #d1d1d1; 

	text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.7);	

	/*text-shadow: #FFFFFF 0px 1px 0px;*/

	font-size: 15px;

	display:none;

}



TD#dateString

{

	font-family: Helvetica;

	font-weight: bold; 

	color: #d1d1d1; 

	text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.7);	

	/*text-shadow: #FFFFFF 0px 1px 0px;*/

	font-size: 11px;

	text-align:center;

}



TABLE#CalendarTable

{

	font-family: Helvetica;

	font-weight: bold; 

	color: #d1d1d1; 

	text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.7);	

	/*text-shadow: #FFFFFF 0px 1px 0px;*/

	font-size: 11px;

	text-align:center;

	margin-top:6px;

}



SPAN#calendar 

{

	font-family: Helvetica;

	font-weight: bold;

	color: #d1d1d1; 

	text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.7);	

	/*text-shadow: #FFFFFF 0px 1px 0px;*/

	font-size: 14px;

	position:absolute;

	top:162px;

	text-align:right;

	width:300px;

	

}

</style>

<script type="text/javascript" src="configureMe.js"></script>	

<base href="Private/"/>

<script type="text/javascript">

var this_weekday_name_array = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")

var this_month_name_array = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")	//predefine month names

    

var this_date_timestamp = new Date()	



var this_weekday = this_date_timestamp.getDay()    

var this_date = this_date_timestamp.getDate()	

var this_month = this_date_timestamp.getMonth()    

var this_year = this_date_timestamp.getYear()	



if (this_year < 1000)

    this_year+= 1900;

if (this_year==101)

    this_year=2001;	   



var this_date_string = this_weekday_name_array[this_weekday] + " " + this_date + " " + this_month_name_array[this_month]//concat long date string



function init ( )

{

  timeDisplay = document.createTextNode ( "" );

  document.getElementById("clock").appendChild ( timeDisplay );



}



function updateClock ( )

{

	

  var TwentyFourHourClock = false  

  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );

  var currentMinutes = currentTime.getMinutes ( );

  var currentSeconds = currentTime.getSeconds ( );



  // Pad the minutes and seconds with leading zeros, if required

  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;

  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;



if (TwentyFourHourClock == false){



  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"

  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

if (timeOfDay == "PM"){

document.getElementById("ampm").src="pm.png"

}

else

{

document.getElementById("ampm").src="am.png"

}

}

  // Compose the string for display

  var currentTimeString = currentHours + ":" + currentMinutes;



  // Update the time display

  currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;



document.getElementById("hr1").src="Digits/"+currentHours.charAt(0)+".png";

document.getElementById("hr2").src="Digits/"+currentHours.charAt(1)+".png";

document.getElementById("min1").src="Digits/"+currentMinutes.charAt(0)+".png";

document.getElementById("min2").src="Digits/"+currentMinutes.charAt(1)+".png";

}



function init2 ( )

{

  timeDisplay = document.createTextNode ( "" );

  document.getElementById("ampm").appendChild ( timeDisplay );

}



function amPm ( )

{

  var currentTime = new Date ( );



  var currentHours = currentTime.getHours ( );



  // Choose either "AM" or "PM" as appropriate

  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";



  // Convert the hours component to 12-hour format if needed

  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;



  // Convert an hours component of "0" to "12"

  currentHours = ( currentHours == 0 ) ? 12 : currentHours;



  // Compose the string for display

  var currentTimeString = timeOfDay;



  // Update the time display

  document.getElementById("ampm").firstChild.nodeValue = currentTimeString;

}



function init3 ( )

{

  timeDisplay = document.createTextNode ( "" );

  document.getElementById("calendar").appendChild ( timeDisplay );

}



function daysInMonth(iMonth, iYear)

{

	return 32 - new Date(iYear, iMonth, 32).getDate();

}



function zeroPad(num,count)

{

var numZeropad = num + '';

while(numZeropad.length < count) {

numZeropad = "0" + numZeropad;

}

return numZeropad;

}



function calendarDate ( )

{

var this_weekday_name_array = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")

var this_month_name_array = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")	  //predefine month names

    

  var this_date_timestamp = new Date()	  



  var this_weekday = this_date_timestamp.getDay()    

  var this_date = this_date_timestamp.getDate()  

 

  var this_month = this_date_timestamp.getMonth()    

Current_Month = this_month

document.getElementById("calendar").firstChild.nodeValue = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date 

}

</script>

<script type="text/javascript" src="translation.js"></script>

<script type="text/javascript">

var MiniIcons =

[

	"tstorm3",		//0	tornado

	"tstorm3",		//1	tropical storm

	"tstorm3",		//2	hurricane

	"tstorm3",		//3	severe thunderstorms

	"tstorm3",		//4	thunderstorms

	"sleet",		//5	mixed rain and snow

	"sleet",		//6	mixed rain and sleet

	"sleet",		//7	mixed snow and sleet

	"sleet",		//8	freezing drizzle

	"light_rain",		//9	drizzle

	"sleet",		//10	freezing rain

	"shower3",		//11	showers

	"shower3",		//12	showers

	"snow1",		//13	snow flurries

	"snow2",		//14	light snow showers

	"snow4",		//15	blowing snow

	"snow4",		//16	snow

	"hail", 	//17	hail

	"sleet",		//18	sleet

	"mist", 	//19	dust

	"fog",		//20	foggy

	"fog",		//21	haze

	"fog",		//22	smoky

	"windy",		//23	blustery

	"windy",		//24	windy

	"windy",		//25	cold

	"overcast",		//26	cloudy

	"cloudy4_night",		//27	mostly cloudy (night)

	"cloudy4",		//28	mostly cloudy (day)

	"cloudy1_night",		//29	partly cloudy (night)

	"cloudy1",		//30	partly cloudy (day)

	"sunny_night",		//31	clear (night)

	"sunny",		//32	sunny

	"fair_night",		//33	fair (night)

	"fair", 	//34	fair (day)

	"hail", 	//35	mixed rain and hail

	"hot",		//36	hot

	"tstorm1",		//37	isolated thunderstorms

	"tstorm2",		//38	scattered thunderstorms

	"tstorm2",		//39	scattered thunderstorms

	"shower1",		//40	scattered showers

	"snow5",		//41	heavy snow

	"snow3",		//42	scattered snow showers

	"snow5",		//43	heavy snow

	"cloudy1",		//44	partly cloudy

	"tstorm3",		//45	thundershowers

	"snow2",		//46	snow showers

	"tstorm1",		//47	isolated thundershowers

	"dunno",		//3200	not available

]





function constructError (string)

{

	return {error:true, errorString:string};

}



function findChild (element, nodeName)

{

	var child;

	

	for (child = element.firstChild; child != null; child = child.nextSibling)

	{

		if (child.nodeName == nodeName)

			return child;

	}

	

	return null;

}




function fetchWeatherData(callback, zip) {
		varUnit = isCelsius ? 'c' : 'f';

		//url = "http://xml.weather.yahoo.com/forecastrss/" //u=Farenheit, because accuWeather sucks
		url = 'http://weather.service.msn.com/data.aspx?wealocations=wc%3a' + zip + '&culture=en-US&weadegreetype=' + varUnit.toUpperCase() + '&src=outlook';
		
		var xml_request = new XMLHttpRequest();
		xml_request.onload = function(e) {
			xml_loaded(e, xml_request, callback);
		}

		xml_request.open("GET", url);
		xml_request.setRequestHeader("Cache-Control", "no-cache");
		xml_request.send(null);

		return xml_request;
	}

	function xml_loaded(event, request, callback) {
		
		if (request.responseXML) {
			var xml = request.responseXML;
			var obj = {
				error : false,
				errorString : null
			};

			obj.city = xml.getElementsByTagName("weather")[0].getAttribute("weatherlocationname");
			
			var current = xml.getElementsByTagName("current")[0];
			obj.realFeel = current.getAttribute("feelslike");
			obj.temp = current.getAttribute("temperature");
			obj.icon = current.getAttribute("skycode");
			obj.description = current.getAttribute("skytext");
			
			// we don't have sunset information
			obj.sunset = "00:00";
			obj.sunsethr = "00";
			obj.sunsetmin = "00";

			var forecasts = xml.getElementsByTagName("forecast");
			
			obj.Today = forecasts[0].getAttribute("shortday");
			obj.TodayHi = forecasts[0].getAttribute("high");
			obj.TodayLo = forecasts[0].getAttribute("low");
			obj.TodayCode = forecasts[0].getAttribute("skycodeday");

			obj.Day1 = forecasts[1].getAttribute("shortday");
			obj.Day1Hi = forecasts[1].getAttribute("high");
			obj.Day1Lo = forecasts[1].getAttribute("low");
			obj.Day1Code = forecasts[1].getAttribute("skycodeday");
			
			obj.Day2 = forecasts[2].getAttribute("shortday");
			obj.Day2Hi = forecasts[2].getAttribute("high");
			obj.Day2Lo = forecasts[2].getAttribute("low");
			obj.Day2Code = forecasts[2].getAttribute("skycodeday");
			
			obj.Day3 = forecasts[3].getAttribute("shortday");
			obj.Day3Hi = forecasts[3].getAttribute("high");
			obj.Day3Lo = forecasts[3].getAttribute("low");
			obj.Day3Code = forecasts[3].getAttribute("skycodeday");
			
			obj.Day4 = forecasts[4].getAttribute("shortday");
			obj.Day4Hi = forecasts[4].getAttribute("high");
			obj.Day4Lo = forecasts[4].getAttribute("low");
			obj.Day4Code = forecasts[4].getAttribute("skycodeday");

			forecastTag = "";

			callback(obj);

		} else {

			callback({
				error : true,
				errorString : "XML request failed. no responseXML"
			});

		}

	}



function validateWeatherLocation (location, callback)

{

	var obj = {error:false, errorString:null, cities: new Array};

	obj.cities[0] = {zip: location}; //Not very clever, are we?

	callback (obj);

}



var LangTranslate = English // or Italian

var stylesheet = 'myopiaAlt' //'originalBubble'|'myopia'|'iconOnly'|'split'

var iconSet = "HTC" //'klear'|'tango'|null (null makes iconSet = stylesheet)

var iconExt = ".png" //'.png'|.'gif' etc.

var source = 'yahooWeather' //'appleAccuweatherStolen'|'yahooWeather'

</script>



<script type="text/javascript">

var postal;



if(iconSet == null || iconSet == 'null'){

	var iconSet = stylesheet;

}



var headID = document.getElementsByTagName("head")[0];	      

var styleNode = document.createElement('link');

styleNode.type = 'text/css';

styleNode.rel = 'stylesheet';

styleNode.href = 'Stylesheets/'+stylesheet+'.css';

headID.appendChild(styleNode);



var scriptNode = document.createElement('script');

scriptNode.type = 'text/javascript';

scriptNode.src = 'Sources/'+source+'.js';

headID.appendChild(scriptNode);



function onLoad(){

	//document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+"dunno"+iconExt;

	validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal)

	setInterval('fetchWeatherData(dealWithWeather,postal)', 1000*60*updateInterval);

}





function setPostal(obj){

	

	if (obj.error == false){

		if(obj.cities.length > 0){

			postal = escape(obj.cities[0].zip).replace(/^%u/g, "%")

			fetchWeatherData(dealWithWeather,postal);

		}else{

			document.getElementById("city").innerText="Not Found";

		}

	}else{

		document.getElementById("city").innerText=obj.errorString;	

	}

}







function dealWithWeather(obj){



	if (obj.error == false){

		document.getElementById("city").innerText=obj.city.substring(0,11);

		

		if (LangTranslate == English)

		{

		document.getElementById("desc").innerText=obj.description; //+" ("+obj.icon+")";

		}

		else

		{

		document.getElementById("desc").innerText = LangTranslate[obj.icon*1];		}

		if(useRealFeel == true){

			tempValue = obj.realFeel;

		}else{

			tempValue = obj.temp;

		}



		var currentTime = new Date ( );

		var currentHours = currentTime.getHours ( );

		var currentMinutes = currentTime.getMinutes ( );

		if(obj.sunsethr < currentHours){

		obj.TOD = "Tonight"

		}

		else if(obj.sunsethr < currentHours)

		{

		obj.TOD = "Tonight"

		}

		else if(currentHours < 2)

		{

		obj.TOD = "Tonight"

		}

		else

		{

		obj.TOD = "Today"

		}



		if (isCelsius == true) {

			document.getElementById("temp").innerHTML=tempValue+ "&#176; C";

		} else {

			document.getElementById("temp").innerHTML=tempValue+ "&#176; F";

		}

		document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+obj.icon+iconExt;

		

		if (showBackground == false){

			document.getElementById("mainbk").src="Icon Sets/mnidhk"+"/"+obj.icon+iconExt;

			}

	

		if (showForecast == true){

		document.getElementById("Today").innerHTML=ForecastDayNames(obj.TOD);

		document.getElementById("TodayIcon").src="Icon Sets/"+iconSet+"/"+obj.TodayCode+'_small'+iconExt;

		document.getElementById("TodayHiLo").innerHTML=obj.TodayHi+ "&#176; / <font color=#a8a8a8>"+obj.TodayLo+ "&#176;</font>";

				

		document.getElementById("Day1").innerHTML=ForecastDayNames(obj.Day1);

		document.getElementById("Day1Icon").src="Icon Sets/"+iconSet+"/"+obj.Day1Code+'_small'+iconExt;

		document.getElementById("Day1HiLo").innerHTML=obj.Day1Hi+ "&#176; / <font color=#a8a8a8>"+obj.Day1Lo+ "&#176;</font>";

		
		  document.getElementById("Day2").innerHTML=ForecastDayNames(obj.Day2);

		document.getElementById("Day2Icon").src="Icon Sets/"+iconSet+"/"+obj.Day2Code+'_small'+iconExt;

		document.getElementById("Day2HiLo").innerHTML=obj.Day2Hi+ "&#176; / <font color=#a8a8a8>"+obj.Day2Lo+ "&#176;</font>";



		document.getElementById("Day3").innerHTML=ForecastDayNames(obj.Day3);

		document.getElementById("Day3Icon").src="Icon Sets/"+iconSet+"/"+obj.Day3Code+'_small'+iconExt;

		document.getElementById("Day3HiLo").innerHTML=obj.Day3Hi+ "&#176; / <font color=#a8a8a8>"+obj.Day3Lo+ "&#176;</font>";



		document.getElementById("Day4").innerHTML=ForecastDayNames(obj.Day4);

		document.getElementById("Day4Icon").src="Icon Sets/"+iconSet+"/"+obj.Day4Code+'_small'+iconExt;

		document.getElementById("Day4HiLo").innerHTML=obj.Day4Hi+ "&#176; / <font color=#a8a8a8>"+obj.Day4Lo+ "&#176;</font>";
		
		}



  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );

  var currentMinutes = currentTime.getMinutes ( );

  var currentSeconds = currentTime.getSeconds ( );



  // Pad the minutes and seconds with leading zeros, if required

  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;

  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;



  // Choose either "AM" or "PM" as appropriate

  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";



  // Convert the hours component to 12-hour format if needed

  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;



  // Convert an hours component of "0" to "12"

  currentHours = ( currentHours == 0 ) ? 12 : currentHours;



  // Compose the string for display

  var currentTimeString = currentHours + ":" + currentMinutes;	    

	    

	var Conditions =	["thunderstorm",

				"rain",

				"rain",

				"thunderstorm",

				"thunderstorm",

				"sleet",

				"sleet",

				"sleet",

				"sleet",

				"showers_cloud",

				"sleet",

				"showers_cloud",

				"showers_cloud",

				"snow",

				"snow",

				"snow",

				"snow",

				"hail",

				"sleet",

				"fog",

				"fog",

				"Haze",

				"fog",

				"wind",

				"wind",

				"frost",

				"cloud",

				"partlymoon",

				"partlysunny",

				"partlymoon",

				"partlysunny",

				"moon",

				"sun",

				"partlymoon",

				"partlysunny",

				"sleet",

				"sun",

				"thunderstorm",

				"thunderstorm",

				"thunderstorm",

				"thunderstorm",

				"snow",

				"snow",

				"snow",

				"cloud",

				"thunderstorm",

				"snow",

				"thunderstorm",

				"blank"];

if (showWeatherAni == true){

		document.getElementById("animationFrame").src="Animations/"+Conditions[obj.icon]+".html";

		//debugging weather codes / animations

		//document.getElementById("desc").innerText=obj.description +" ("+obj.icon+")" + " / ("+Conditions[obj.icon] +")"

}







	}

	

	

}



</script>

</head>

<body onLoad="onLoad()" style="margin-left: 0; background-color:black">

<div id="weatherFrame">

	    <iframe id="animationFrame" name="animation" src="Animations/blank.html" width="320" height="480" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>

	</div>

<script type="text/javascript">

if (showBackground == false){

document.write("<img name=\"mainbk\" id=\"mainbk\" height=\"480\" width=\"320\" style=\"position: absolute; top: 0px; left: 0px; z-index:-1;\">");

} else {

document.write("<img name=\"mainbk\" id=\"mainbk\" src=\"../LockBackground.png\" height=\"480\" width=\"320\" style=\"position: absolute; top: 0px; left: 0px; z-index:-1;\">");	

}

</script>



<img src="bg.png" style="position: absolute; z-index:-1;top:25; left: 0px;" height="186" width="320">



<img src="" id="ampm" style="position: absolute; z-index:-1;top:135; left: 40px;" width="20">

<table border=0 style="position: absolute; z-index:-1;top:47; left: 37px;"><tr><td><img src="" width="49" height="80" border=0 id="hr1"></td><td><img src="" width="49" height="80" border=0 id="hr2"></td>

<td width=30></td>

<td><img src="" width="49" height="80" border=0 id="min1"></td><td><img src="" width="49" height="80" border=0 id="min2"></td>

</tr>

</table>

<span id="calendar" align=right>

	<script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script>

	</span>

    <span id="clock">

	<script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span> <span id="ampm">

    </span>

<div id="WeatherContainer">

<div id="TextContainer">

<img id="weatherIcon" src="" height=108 width=114 style="position:absolute; top:115px;left:103px;z-index:1;">

<a id="city"></a><a id="desc"></a><a id="temp"></a>



<script type="text/javascript">

	if (showForecast == true){

	document.write("<img src=\"forecast-bg.png\" style=\"position: absolute; z-index:-1;top:225; left: 0px;\" width=\"320\">");

	} 

	

</script>



<table cellpadding=0 cellspacing=0 style="position:absolute; top:210px; left:20px;z-index:1" width="280" align=center>

	<tr>

		<td align=center><img id="TodayIcon" height=50 src=""/></td>

		<td align=center><img id="Day1Icon" height=50 src=""/></td>



		<td align=center><img id="Day2Icon" height=50 src=""/></td>

		<td align=center><img id="Day3Icon" height=50 src=""/></td>

		<td align=center><img id="Day4Icon" height=50 src=""/></td>



	</tr>

</table>



<table cellpadding=0 cellspacing=0 style="position:absolute; top:250px; left:20px" width="280" align=center>

	<tr>

		<td align=center><a id="TodayHiLo"></a></td>

		<td align=center><a id="Day1HiLo"></a></td>



		<td align=center><a id="Day2HiLo"></a></td>

		<td align=center><a id="Day3HiLo"></a></td>

		<td align=center><a id="Day4HiLo"></a></td>



	</tr>

	<tr>



		<td align=center><a id="Today"></a></td>

		<td align=center><a id="Day1"></a></td>

		<td align=center><a id="Day2"></a></td>



		<td align=center><a id="Day3"></a></td>

		<td align=center><a id="Day4"></a></td>

	</tr>

</table>

<a id="time" style="position:absolute; top:105px; width:299px;z-index:-1;font-size:8px;display:none;"></a>

</div>

</div>	

</body>

</html>