////////////////////////////////////////////////

function init ( )

{

var _0xf1d5=["","\x63\x72\x65\x61\x74\x65\x54\x65\x78\x74\x4E\x6F\x64\x65","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x63\x6C\x6F\x63\x6B\x75\x6E\x69\x74\x73","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x63\x6C\x6F\x63\x6B\x64\x6F\x6C\x6C\x61\x72\x73"];timeDisplay=document[_0xf1d5[1]](_0xf1d5[0]);document[_0xf1d5[4]](_0xf1d5[3])[_0xf1d5[2]](timeDisplay);timeDisplay=document[_0xf1d5[1]](_0xf1d5[0]);document[_0xf1d5[4]](_0xf1d5[5])[_0xf1d5[2]](timeDisplay);  

}





function addCommas(nStr)

{

var _0x8824=["","\x2E","\x73\x70\x6C\x69\x74","\x6C\x65\x6E\x67\x74\x68","\x24\x31","\x2C","\x24\x32","\x72\x65\x70\x6C\x61\x63\x65","\x74\x65\x73\x74"];nStr+=_0x8824[0];x=nStr[_0x8824[2]](_0x8824[1]);x1=x[0];x2=x[_0x8824[3]]>1?_0x8824[1]+x[1]:_0x8824[0];var rgx=/(\d+)(\d{3})/;while(rgx[_0x8824[8]](x1)){x1=x1[_0x8824[7]](rgx,_0x8824[4]+_0x8824[5]+_0x8824[6]);} ;return x1+x2;

}





function updateTime ( )

{

   var _0x2437=["\x63\x6C\x6F\x63\x6B\x6E\x75\x6D\x6D\x6F\x72\x74\x67\x61\x67\x65\x73","\x63\x6C\x6F\x63\x6B\x6E\x75\x6D\x6D\x6F\x72\x74\x67\x61\x67\x65\x73\x64\x6F\x6C\x6C\x61\x72\x73","\x6E\x6F\x64\x65\x56\x61\x6C\x75\x65","\x66\x69\x72\x73\x74\x43\x68\x69\x6C\x64","\x63\x6C\x6F\x63\x6B\x75\x6E\x69\x74\x73","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x72\x6F\x75\x6E\x64","\x63\x6C\x6F\x63\x6B\x64\x6F\x6C\x6C\x61\x72\x73","\x24","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x63\x6C\x6F\x63\x6B\x69\x6D\x70\x74","\x3C\x61\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x74\x79\x6C\x65\x31\x22\x20\x68\x72\x65\x66\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x6D\x6F\x72\x74\x67\x61\x67\x65\x77\x69\x73\x65\x72\x2E\x63\x6F\x6D\x2F\x22\x3E\x52\x65\x76\x65\x72\x73\x65\x20\x4D\x6F\x72\x74\x67\x61\x67\x65\x73\x20\x3C\x2F\x61\x3E"];var mortgvalues= new Array();mortgvalues[_0x2437[0]]=0;mortgvalues[_0x2437[1]]=0;mortgvalues=mortgageValues(mortgvalues);document[_0x2437[5]](_0x2437[4])[_0x2437[3]][_0x2437[2]]=addCommas(Math[_0x2437[6]](mortgvalues[_0x2437[0]]));document[_0x2437[5]](_0x2437[7])[_0x2437[3]][_0x2437[2]]=_0x2437[8]+addCommas(Math[_0x2437[6]](mortgvalues[_0x2437[1]]));document[_0x2437[5]](_0x2437[10])[_0x2437[9]]=_0x2437[11];

}



function mortgageValues(mortgvalues)

{



/////////////////////////////////////

// basic information



  var numsecondsyear = 365*24*60*60;

  var leapyearaddition = 24*60*60;  // 2012, 2016 leap years

  var today = new Date(); 

  if(today.getFullYear  % 4 == 0){

    // this gets us through 2016

     numsecondsyear = numsecondsyear + leapyearaddition;

  }



// historical information since 1990; the totals

  var nummortgages19902009 = 573149;

  var totalmortgagesdollars19902009 = 137943833.28*1000;



// these two sets of numbers are *projections* which should

// be replaced by the actual numbers after the year passes



  var nummortgages = new Array();

  nummortgages[0] = 116940; //2010

  nummortgages[1] = 118777; //2011

  nummortgages[2] = 124716; //2012

  nummortgages[3] = 130952; //2013

  nummortgages[4] = 137500; //2014

  nummortgages[5] = 144375; //2015

  nummortgages[6] = 151593; //2016

  var totalmortgagesdollars = new Array();

  totalmortgagesdollars[0] = 241.24 * 1000; //2010

  totalmortgagesdollars[1] = 230.37 * 1000; //2011

  totalmortgagesdollars[2] = 223.08 * 1000; //2012

  totalmortgagesdollars[3] = 215.56 * 1000; //2013

  totalmortgagesdollars[4] = 212.56 * 1000; //2014

  totalmortgagesdollars[5] = 225.08 * 1000; //2015

  totalmortgagesdollars[6] = 251.82 * 1000; //2016





/////////////////////////////////////

// algorithm

// this has to be adjusted each year

//need to calculate num seconds since midnight, 1 Jan



  var jan1 = new Date("January 1, 2010 00:00:00")

  var todaytime = today.getTime();

  var secondssince1jan = (todaytime - jan1) / 1000;



//Calculate index for the array

  yearidx=today.getFullYear()-2010;

  nummortgagespersecond = nummortgages[yearidx]/numsecondsyear;

  nummortgagesdollarspersecond = nummortgages[yearidx]*totalmortgagesdollars[yearidx]/numsecondsyear;







/////////////////////////////////////////////////

// what goes on the clocks: assuming clocks are cumulative since 1990

// 

// number clock starts at 573,149 and by 2016 will go to about 1,500,000; thus 7 digits needed

//

// dollar clock starts at about $130,000,000,000

// and by 2016 will go to about $350,000,000,000; thus 12 digits needed

//

// what to display on clock NOW

// (you should probably round)

// this assumes the clock is cumlative since 1990

// if *not*, remove the first argument in each sum on right hand side

  mortgvalues.clocknummortgages = nummortgages19902009 + secondssince1jan * nummortgagespersecond;

  mortgvalues.clocknummortgagesdollars = totalmortgagesdollars19902009 + secondssince1jan * nummortgagesdollarspersecond;



  return mortgvalues;

}