<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
	<ModulePrefs 
		height="460" 
		title="Hotmail" 
		title_url="http://www.hotmail.com/"
		description="This gadget lets you access your Hotmail account from your Google homepage. Read and send Hotmail emails without leaving Google! All thanks to Hotmail Mobile" 
		author="Ryan" 
		author_email="ryan@remindo.com" 
		author_affiliation="Remindo" 
screenshot="http://db7640c4.fb.joyent.us/Orkut/hotmail.jpg" 
		
scrolling="false" 
		>
		<Require feature="minimessage" />
		<Require feature="setprefs" />
	</ModulePrefs>
	<UserPref name="defaultPage" display_name="Default Page" default_value="Inbox" datatype="enum">
		<EnumValue value="Inbox" />
		<EnumValue value="Folders" />

	</UserPref>
	<UserPref name="refreshInterval" display_name="Refresh interval (BETA)" default_value="Never" datatype="enum">
		<EnumValue value="0" display_value="Never" />
		<EnumValue value="1" display_value="1 minute" />
		<EnumValue value="2" display_value="2 minutes" />
		<EnumValue value="5" display_value="5 minutes" />
		<EnumValue value="10" display_value="10 minutes" />
	</UserPref>
	<UserPref name="seenNews20080221" datatype="hidden" default_value="0" />

	<UserPref name="degree" datatype="hidden" default_value="0" />
  	<Content type="html">
		<![CDATA[ 
		<style>
			.text{ font-family:Arial,sans-serif;font-size:8pt; }
		</style>
		<script type="text/javascript">

			// user preferences
   			var prefs 			= new _IG_Prefs( __MODULE_ID__ );

   			// default page
			var sDefaultPage	= prefs.getString( "defaultPage" );
			var sDefaultURL		= "http://mobile.live.com/hm/folder.aspx?bf=1&folder=ACTIVE&msg=0";
			if( sDefaultPage == "Folders" )
			{
				sDefaultURL		= "http://mobile.live.com/hm/folders.aspx?bf=1";
			}
   			   			
   			// refresh interval
   			var sRefresh 		= parseInt( prefs.getInt( "refreshInterval" ) );
   			var bCancel			= false;
			if( sRefresh != 0 )
			{
				sRefresh		= parseInt( sRefresh * 60 * 1000 );
				window.setInterval( "triggerRefresh__MODULE_ID__()", sRefresh );
			}
			
			function triggerRefresh__MODULE_ID__()
			// triggers the refresh
			{
				bCancel = false;
				_gel( "divCancelRefresh" ).style.visibility = "visible";
				window.setTimeout( "doRefresh__MODULE_ID__( 7 )", 1000 ); // 7 is number of seconds that the cancel box will be displayed. Hardcoded for the moment.
			}
			
			function doRefresh__MODULE_ID__( nTimeout )
			// displays the message and actually performs the refresh
			{
				if( !bCancel )
				{
					if( nTimeout == 0 )
					{
						_gel( "divCancelRefresh" ).style.visibility = "hidden";
						frames["frmHotmail"].location.href = sDefaultURL;
					}
					else
					{
						window.setTimeout( "doRefresh__MODULE_ID__(" + ( nTimeout - 1 ) + ")", 1000 );
					}
				}
			}
		</script>
		<div class="text" style="width:100%;background-color:#ebebfd;padding2px;border-top:1px solid #b498dc;">
			<a style="color:blue" href="javascript:void(null)" onclick="frames['frmHotmail'].location.href='http://mobile.live.com/hm/folder.aspx?bf=1&folder=ACTIVE&msg=0'">Inbox</a> | 
			<a style="color:blue" href="javascript:void(null)" onclick="frames['frmHotmail'].location.href='http://mobile.live.com/hm/c.aspx?rru=folder.aspx%3ffolder%3dACTIVE'">Compose</a> | 
			<a style="color:blue" href="javascript:void(null)" onclick="frames['frmHotmail'].location.href='http://mobile.live.com/hm/folders.aspx?bf=1'">Folders</a> |
			<a style="color:blue" href="javascript:void(null)" onclick="frames['frmHotmail'].location.href='http://mobile.live.com/hm/contacts.aspx?bf=1'">Contacts</a> |
			<a style="color:blue" href="javascript:void(null)" onclick="frames['frmHotmail'].location.href='http://mobile.live.com/wml/signout.aspx'">Sign Out</a> |
		</div>
		<br>
		<script type="text/javascript">
			// iframe with default page
			document.write( '<iframe name="frmHotmail" id="frmHotmail" style="height:367px;width:100%;" frameborder="0" src="' + sDefaultURL + '"></iframe>' );
		</script>
		<div id="divCancelRefresh" class="text" style="visibility:hidden;background-color:#fff4c2;padding:7px;position:absolute;top:24px;left:0px;">
			<b>Refresh is about to happen</b><br>
			<a style="color:blue" href="javascript:void(null)" onclick="bCancel=true;_gel('divCancelRefresh').style.visibility='hidden';//_IG_Analytics( 'UA-1444102-1', '/HotmailGadgetXML/CancelRefresh' );">Cancel Refresh</a>
		</div>

		]]>
	</Content> 
</Module>
