/* Formula 1 - 2010 Calendar */
  
  /*StartCountDown("clock1","3/14/2010 12:00 PM UTC")*/ 		/* Bahrain - Alonso - Ferrari */
  /*StartCountDown("clock2","3/28/2010 8:00 AM UTC")*/	 		/* Astralian - Button - McLaren */
  /*StartCountDown("clock3","4/04/2010 8:00 AM UTC")*/			/* Malaysian - Vettel - Red Bull */
  /*StartCountDown("clock4","4/18/2010 7:00 AM UTC")*/	 		/* Chinese - Button - McLaren */
  /*StartCountDown("clock5","5/09/2010 12:00 PM UTC")*/ 		/* Spanish - Webber - Red Bull */
  /*StartCountDown("clock6","5/16/2010 12:00 PM UTC")*/			/* Monaco - Webber - Red Bull */
  /*StartCountDown("clock7","5/30/2010 13:00 PM UTC")*/			/* Turkey - Hamilton - McLaren */
  /*StartCountDown("clock8","6/13/2010 4:00 PM UTC")*/			/* Canadian - Hamilton - McLaren */
  /*StartCountDown("clock9","6/27/2010 12:00 PM UTC")*/			/* European - Vettel - Red Bull */

/* ----------------------------HALF WAY MARK------------------------------------------------------- */
/*  StartCountDown("clock10","7/11/2010 11:00 AM UTC")*/		/* British - Webber - Red Bull*/
/* ------------------------------------------------------------------------------------------------ */

  /*StartCountDown("clock11","7/25/2010 12:00 PM UTC")*/		/* German - Alonso - Ferrari */
  /*StartCountDown("clock12","8/01/2010 12:00 PM UTC")*/		/* Hungarian - Webber - Red Bull */
  /*StartCountDown("clock13","8/29/2010 12:00 PM UTC")*/		/* Belgian - Hamilton - McLaren */
  StartCountDown("clock14","9/12/2010 12:00 PM UTC")		/* Italian */
  StartCountDown("clock15","9/26/2010 12:00 PM UTC")		/* Singapore */
  StartCountDown("clock16","10/10/2010 6:00 AM UTC")		/* Japanese */
  StartCountDown("clock17","10/24/2010 6:00 AM UTC")		/* Korean */
  StartCountDown("clock18","11/07/2010 3:00 PM UTC")		/* Brazilian */
  StartCountDown("clock19","11/14/2010 1:00 PM UTC")		/* Abu Dhabi */

  /*
  	Author:Robert Hashemian (http://www.hashemian.com/)
  	Modified by:Munsifali Rashid (http://www.munit.co.uk/)
  	Modified by:Tilesh Khatri
       Modified by:Aleks Kruz
  */
  
  function StartCountDown(myDiv,myTargetDate)
  {
    var dthen		= new Date(myTargetDate);
    var dnow		= new Date();
    ddiff		= new Date(dthen-dnow);
    gsecs		= Math.floor(ddiff.valueOf()/1000);
    CountBack(myDiv,gsecs);
  }
  
  function Calcage(secs, num1, num2)
  {
    s = ((Math.floor(secs/num1))%num2).toString();
    if (s.length < 2) 
    {	
      s = "0" + s;
    }
    return (s);
  }
  
  function CountBack(myDiv, secs)
  {
    var DisplayStr;
    var DisplayFormat = "%%D%% Days - %%H%% Hrs - %%M%% Min - %%S%% Sec";
    DisplayStr = DisplayFormat.replace(/%%D%%/g,	Calcage(secs,86400,100000));
    DisplayStr = DisplayStr.replace(/%%H%%/g,		Calcage(secs,3600,24));
    DisplayStr = DisplayStr.replace(/%%M%%/g,		Calcage(secs,60,60));
    DisplayStr = DisplayStr.replace(/%%S%%/g,		Calcage(secs,1,60));
    if(secs > 0)
    {	
      document.getElementById(myDiv).innerHTML = DisplayStr;
      setTimeout("CountBack('" + myDiv + "'," + (secs-1) + ");", 990);
    }
    else
    {
      document.getElementById(myDiv).innerHTML = "GO GO GO!";
    }
  }
