/* Formula 1 - 2011 Calendar */
  
  /*StartCountDown("clock1","3/13/2011 12:00 PM UTC")*/			/* Bahrain -  Cancelled */
  /*StartCountDown("clock2","3/27/2011 8:00 AM UTC")*/	 		/* Astralian - Vettel - Red Bull */
  /*StartCountDown("clock3","4/10/2011 8:00 AM UTC")*/			/* Malaysian - Vettel - Red Bull */
  /*StartCountDown("clock4","4/17/2011 7:00 AM UTC")*/			/* Chinese - Hamilton - McLaren */

  StartCountDown("clock5","5/8/2011 1:00 PM UTC")			/* Turkey - */
  StartCountDown("clock6","5/22/2011 12:00 PM UTC")			/* Spanish - */
  StartCountDown("clock7","5/29/2011 12:00 PM UTC")			/* Monaco - */
  StartCountDown("clock8","6/12/2011 4:00 PM UTC")			/* Canadian - */
  StartCountDown("clock9","6/26/2011 12:00 PM UTC")			/* European - */
  StartCountDown("clock10","7/10/2011 11:00 AM UTC")			/* British - */

/* ----------------------------HALF WAY MARK------------------------------------------------------- */

  StartCountDown("clock11","7/24/2011 12:00 PM UTC")			/* German - */
  StartCountDown("clock12","7/31/2011 12:00 PM UTC")			/* Hungarian - */
  StartCountDown("clock13","8/28/2011 12:00 PM UTC")			/* Belgian - */
  StartCountDown("clock14","9/11/2011 12:00 PM UTC")			/* Italian - */
  StartCountDown("clock15","9/25/2011 12:00 PM UTC")			/* Singapore - */
  StartCountDown("clock16","10/09/2011 6:00 AM UTC")			/* Japanese - */
  StartCountDown("clock17","10/16/2011 6:00 AM UTC")			/* Korean - */
  StartCountDown("clock18","10/30/2011 6:00 AM UTC")			/* Indian - */
  StartCountDown("clock19","11/13/2011 1:00 PM UTC")			/* Abu Dhabi - */
  StartCountDown("clock20","11/27/2011 3:00 PM UTC")			/* Brazilian - */
  
/* ------------------------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------------------ */
/* 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 - Alonso - Ferrari */
  /*StartCountDown("clock15","9/26/2010 12:00 PM UTC")*/		/* Singapore - Alonso - Ferrari*/
  /*StartCountDown("clock16","10/10/2010 6:00 AM UTC")*/		/* Japanese - Vettel - Red Bull */
  /*StartCountDown("clock17","10/24/2010 6:00 AM UTC")*/		/* Korean - Alonso - Ferrari */
  /*StartCountDown("clock18","11/07/2010 3:00 PM UTC")*/		/* Brazilian - Vettel - Red Bull */
  /*StartCountDown("clock19","11/14/2010 1:00 PM UTC")*/		/* Abu Dhabi - Vettel - Red Bull */

  /*
  	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!";
    }
  }
   

