/* This file was compressed using MbCompression library. http://blog.mironabramson.com */ 
(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
{if(string.match(_escapeable))
{return'"'+string.replace(_escapeable,function(a)
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);
(function(e){if(!e||!(e.toJSON||Object.toJSON||window.JSON)){throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!")}var f={},b={jStorage:"{}"},g=null,i=e.toJSON||Object.toJSON||(window.JSON&&(JSON.encode||JSON.stringify)),d=e.evalJSON||(window.JSON&&(JSON.decode||JSON.parse))||function(j){return String(j).evalJSON()};function h(){if(window.localStorage){try{b=window.localStorage}catch(k){}}else{if(window.globalStorage){try{b=window.globalStorage[window.location.hostname]}catch(j){}}else{g=document.createElement("link");if(g.addBehavior){g.style.behavior="url(#default#userData)";document.getElementsByTagName("head")[0].appendChild(g);g.load("jStorage");var l="{}";try{l=g.getAttribute("jStorage")}catch(n){}b.jStorage=l}else{g=null;return}}}if(b.jStorage){try{f=d(b.jStorage)}catch(m){b.jStorage="{}"}}else{b.jStorage="{}"}}function c(){try{b.jStorage=i(f);if(g){g.setAttribute("jStorage",b.jStorage);g.save("jStorage")}}catch(j){}}function a(j){if(!j||(typeof j!="string"&&typeof j!="number")){throw new TypeError("Key name must be string or numeric")}return true}e.jStorage={version:"0.1.3",set:function(j,k){a(j);f[j]=k;c();return k},get:function(j,k){a(j);if(j in f){return f[j]}return typeof(k)=="undefined"?null:k},deleteKey:function(j){a(j);if(j in f){delete f[j];c();return true}return false},flush:function(){f={};c();if(window.localStorage){try{localStorage.clear()}catch(j){}}return true},storageObj:function(){function j(){}j.prototype=f;return new j()}};h()})(window.jQuery||window.$);

var STOCKWATCH=STOCKWATCH||{};STOCKWATCH=function(){if(typeof jQuery!='undefined'){jQuery.expr[':'].asp=function(elem,i,match){return(elem.id&&elem.id.match(match[3]+"$"));};}
return{namespace:function(name,separator,container){var ns=name.split(separator||'.'),o=container||window,i,len;for(i=0,len=ns.length;i<len;i++){o=o[ns[i]]=o[ns[i]]||{};}
return o;}}}();STOCKWATCH.namespace("STOCKWATCH.util");STOCKWATCH.namespace("STOCKWATCH.notifications");STOCKWATCH.notifications=function(){var _username,_currentNotificationId,_notificationId,_quickstart,_settingsStorageKey;_quickstart=true;_notificationId=0;function removeOldCookie(username){var cookieName="stockwatchQuickstart-"+username;var cookieDate=new Date();cookieDate.setTime(cookieDate.getTime()-1);document.cookie=(cookieName+"=; expires="+cookieDate.toGMTString());}
function showQuickStart(){var result=false;var value=$.jStorage.get(_settingsStorageKey);if(!value){removeOldCookie(_username);}
result=(!value)?true:value.quickstart;return result;}
function showNotification(){var result=false;var $notifySystem=$("#notify-system");$notifySystem.hide();if($notifySystem.hasClass("notify-system")){var settings=$.jStorage.get(_settingsStorageKey);if(!settings){result=true;}
else if(parseInt(settings.notifications)<_currentNotificationId){result=true;}}
else if($notifySystem.attr("class")){result=true;}
if(result){setTimeout(function(){$notifySystem.fadeIn("def");},1);}}
function updateSettings(quickstartValue,notifyListValue){var settingsData={quickstart:quickstartValue,notifications:notifyListValue};$.jStorage.set(_settingsStorageKey,settingsData);}
return{init:function(username,currentNotificationId){if(username.length>0){_username=username;_settingsStorageKey="stockwatch-settings-"+username;_currentNotificationId=currentNotificationId;}
$(document).ready(function(){showNotification();});},closeNotification:function(notifyId){var settings=$.jStorage.get(_settingsStorageKey);_quickstart=(settings!=null)?settings.quickstart:_quickstart;_notificationId=notifyId;updateSettings(_quickstart,_notificationId);return false;},closeQuickStart:function(){var settings=$.jStorage.get(_settingsStorageKey);_notificationId=(settings!=null)?settings.notifications:_notificationId;_quickstart=false;updateSettings(_quickstart,_notificationId);},showQuickStart:function(){return showQuickStart();},resetNotificationSettings:function(){$.jStorage.deleteKey(_settingsStorageKey);}}}();STOCKWATCH.util=function(){var a2a_config=a2a_config||{};var oldText=$("#sharing-tool-id").html();var showOnce=true;function addToAny(){a2a_config=a2a_config||{};a2a_config.no_3p=1;a2a_config.track_links='ga';a2a_linkname="StockWatch: Share Trading Game, Play Now!";a2a_linkurl="http://www.stockwatch.com.au";a2a_show_title=true;$.getScript("http://static.addtoany.com/menu/page.js",function(event){$(".a2a_dd").mouseover();$("#a2apage_border").css("width","314px");$("#sharing-tool-id").html(oldText);showOnce=false;});}
function getScript(filename){var script=document.createElement('script')
script.setAttribute("type","text/javascript")
script.setAttribute("src",filename)
if(typeof script!="undefined")
document.getElementsByTagName("head")[0].appendChild(script)}
function checkJQueryReady(time_elapsed){if(typeof $=="undefined"){if(time_elapsed<=5000){setTimeout(function(){checkJQueryReady(time_elapsed+200)},200);}}
else{addToAny();}}
var timeLocal=new Date();var time_diff=timeLocal-remoteServerTime;var clockIncrement=60000;var tickingClock=function(remoteServerTime,remoteServerTimeZoneAbbreviation,elTime,elStatusText,elStatusIcon){var clockText="";var marketStatusText="";var marketStatusCss="market-indicator-open";var cDate=new Date();clockText=cDate.getTime();cDate.setTime(cDate.getTime()-time_diff);var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var curr_hours=cDate.getHours();var curr_minutes=cDate.getMinutes();var curr_seconds=cDate.getSeconds();var curr_days=cDate.getDate();var curr_months=cDate.getMonth();var curr_years=cDate.getFullYear();if(curr_hours>=10&&curr_hours<16){marketStatusText="open";marketStatusCss="market-indicator-open";}
else{marketStatusText="closed";marketStatusCss="market-indicator-closed";}
var changeMarketStatus=false;if(curr_hours==10||curr_hours==16){if(curr_minutes<5){changeMarketStatus=true;}}
var ap="AM";if(curr_hours>11){ap="PM";}
if(curr_hours>12){curr_hours=curr_hours-12;}
if(curr_hours==0){curr_hours=12;}
if(curr_hours<10){curr_hours="0"+curr_hours};if(curr_minutes<10){curr_minutes="0"+curr_minutes};if(curr_days<10){curr_days="0"+curr_days};clockText="<strong>"+curr_hours+":"+curr_minutes+" "+ap+"</strong>, "+curr_days+" "+montharray[curr_months]+" "+curr_years+" (AUS "+remoteServerTimeZoneAbbreviation+")";document.getElementById(elTime).innerHTML=clockText;if(changeMarketStatus){document.getElementById(elStatusText).innerHTML="The market is currently "+marketStatusText;document.getElementById(elStatusText).className="status-text "+marketStatusText;document.getElementById(elStatusIcon).className="status-icon "+marketStatusCss;}
var newClockIncrement=clockIncrement-(cDate.getTime()%clockIncrement);setTimeout(function(){tickingClock(remoteServerTime,remoteServerTimeZoneAbbreviation,elTime,elStatusText,elStatusIcon);},newClockIncrement);}
var display_timeout=0;return{clockUpdate:function(remoteServerTime,remoteServerTimeZoneAbbreviation,elTime,elStatusText,elStatusIcon){tickingClock(remoteServerTime,remoteServerTimeZoneAbbreviation,elTime,elStatusText,elStatusIcon);},competitionSwitcher:function(){document.getElementById("gameStatusIndicator").innerHTML="Switching game...";document.getElementById("gameStatusIndicator").style.visibility="visible";},menuSwitcher:function(){switch(arguments.length){case 0:noArgs();break;case 1:oneArg(arguments[0]);break;}
function noArgs(){document.getElementById("gameStatusIndicator").innerHTML="Loading...";document.getElementById("gameStatusIndicator").style.visibility="visible";}
function oneArg(menuId){var menu=document.getElementById(menuId);var menuItems=menu.getElementsByTagName("LI");for(var i=0;i<menuItems.length;i++){var as=menuItems[i].getElementsByTagName('a');as[0].onclick=function(){document.getElementById("gameStatusIndicator").innerHTML="Loading...";document.getElementById("gameStatusIndicator").style.visibility="visible";};}}},sharingTool:function(jqueryResource){$("#sharing-tool-id").hover(function(){if(showOnce){$("#sharing-tool-id").width("108px");$("#sharing-tool-id").html("Loading...");}
if(display_timeout!=0){clearTimeout(display_timeout);}
var this_element=this;display_timeout=setTimeout(function(){display_timeout=0;addToAny();},500);},function(){if(display_timeout!=0){clearTimeout(display_timeout);}
$("#sharing-tool-id").html(oldText);});}};}();
