// Copyright (c) 2011 Relative Data, Inc.
// All Rights Reserved

// You may copy this script into your site by following these instructions:
//
// 1) add this file rdmc.js into the same folder as your webpage
//
// 2) add the following HTML into your webpage where you want the timer:
// <script src="rdmc.js"></script><span id="rdCntdT"></span>
// 
// 3) in the <body> tag of your webpage add
// onload="rdMayanStart()"
// it will then look something like
// <body onload="rdMayanStart()"   ..... 
// 
// 4) add some link back to our site such as the following:
// Mayan Countdown Script by <a href="http://relativedata.com">Relative Data, Inc.</a>
// 
// 5) Let us know and we'll add a link back to your site too, if you want
//
// Thank you!
// Relative Data, Inc.

function rdMayanStart() { 
  var d1 = new Date(2012,11,21,11,12,0);
  var d0 = new Date();
  var s = Math.floor((d1.getTime()-d0.getTime())/1000);
  s -= d0.getTimezoneOffset()*60;
  var m = Math.floor(s/60); s-=60*m;
  var h = Math.floor(m/60); m-=60*h;
  var d = Math.floor(h/24); h-=24*d;
  var e = document.getElementById('rdCntdT');
  e.innerHTML = d+' Days '+h+' Hours '+m+' Minutes '+s+' Seconds';
  setTimeout('rdMayanStart()',500);
}

