//Start Increment date
//var mydate=new Date("May 15, 2009 5:58 AM"); //global date variable that holds the initial date at the time the page loads
//var mydate=new Date("May 15, 2009 5:58 AM"); //global date variable that holds the initial date at the time the page loads
//alert (mydate);
//var det= new Date(yy,mm,dd)
var MyDate="2009-05-15 00:58:39.577";
//alert (det);
MD_Y=MyDate.substring(0,4);
//alert (MD_Y);
MD_M=MyDate.substring(5,7) -1 ; // Jan-Dec=01-12
//alert (MD_M);
MD_D=MyDate.substring(8,10);
//alert (MD_D);

MD_H=MyDate.substring(11,13);
//alert (MD_H);
MD_N=MyDate.substring(14,16);
//alert (MD_N);
MD_S=MyDate.substring(17,19);
//alert (MD_S);

var mydate=new Date(MD_Y, MD_M, MD_D, MD_H, MD_N, MD_S);

//alert (mydate);
//var mydate=new Date(May 15, 2009);
//alert (mydate);

function getthedate(){
 //alert("inside file");
  //mydate.setMinutes(mydate.getMinutes() + 1); //increment minutes by 1
  mydate.setSeconds(mydate.getSeconds() + 1); //increment seconds by 1
  var year=mydate.getFullYear();
  var day=mydate.getDay();
  var month=mydate.getMonth();
  var daym=mydate.getDate();
  var hours=mydate.getHours();
  var minutes=mydate.getMinutes();
  var seconds=mydate.getSeconds();

  //other codes here but no need for the timezone codes
 //document.getElementById('time').innerHTML = day+":"+month+":"+year+" "+hours+":"+minutes+":"+seconds ;

	var v3= "am";
	if (hours > 12)
	{
		hours = hours-12;
		v3 = "pm";
	}
	else if (hours == 12)
	{
		v3 = "pm";
	}
	else if (hours == 0)
	{
		hours = hours+12;
	}

 	if (hours < 10)
 	{
 		hours = "0" + hours;
 	}

 	if (minutes < 10)
	 	{
	 		minutes = "0" + minutes;
 	}

 	if (seconds < 10)
	 	{
	 		seconds = "0" + seconds;
 	}
  document.getElementById('time').innerHTML =hours+":"+minutes+":"+seconds + " " +  v3;
	setTimeout("getthedate()", 1000);	
}
//setInterval("getthedate()", 1000);
//window.onload = getthedate();




//Start Decrement date
//var mydate=new Date("May 15, 2009 5:58 AM"); //global date variable that holds the initial date at the time the page loads
//var mydate=new Date("May 15, 2009 5:58 AM"); //global date variable that holds the initial date at the time the page loads
//alert (mydate);

var MyDate1="2009-05-23 00:58:39.577";
//alert (MyDate);
MD_Y1=MyDate1.substring(0,4);
//alert (MD_Y);
MD_M1=MyDate1.substring(5,7) -1 ; // Jan-Dec=01-12
//alert (MD_M);
MD_D1=MyDate1.substring(8,10);
//alert (MD_D);

MD_H1=MyDate1.substring(11,13);
//alert (MD_H);
MD_N1=MyDate1.substring(14,16);
//alert (MD_N);
MD_S1=MyDate1.substring(17,19);
//alert (MD_S);

var mydate1=new Date(MD_Y1, MD_M1, MD_D1, MD_H1, MD_N1, MD_S1);

//alert (mydate);
//var mydate=new Date(May 15, 2009);
//alert (mydate);

function getthedate_decrement(){
 //alert("inside file");
  mydate1.setSeconds(mydate1.getSeconds() - 1); //decrement seconds by 1
   var year1=mydate1.getFullYear();
  var day1=mydate1.getDay();
  var month1=mydate1.getMonth();
  var daym1=mydate1.getDate();
  var hours1=mydate1.getHours();
  var minutes1=mydate1.getMinutes();
  var seconds1=mydate1.getSeconds();

  //other codes here but no need for the timezone codes
 //document.getElementById('time').innerHTML = day+":"+month+":"+year+" "+hours+":"+minutes+":"+seconds ;

	var v3= "am";
	if (hours1 > 12)
	{
		hours1 = hours1-12;
		v3 = "pm";
	}
	else if (hours1 == 12)
	{
		v3 = "pm";
	}
	else if (hours1 == 0)
	{
		hours1 = hours1+12;
	}

 	if (hours1 < 10)
 	{
 		hours1 = "0" + hours1;
 	}

 	if (minutes1 < 10)
	 	{
	 		minutes1 = "0" + minutes1;
 	}

 	if (seconds1 < 10)
	 	{
	 		seconds1 = "0" + seconds1;
 	}
 //document.getElementById('time_show').innerHTML =hours1+":"+minutes1+":"+seconds1;
 
 //hours = "" + hours;
 //minutes += "";
 //decrement first clock
 var h11 = hours1.toString();
 //alert(h11);
 document.getElementById('h11').innerHTML = h11.substring(0,1);
 document.getElementById('h21').innerHTML = h11.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m11 = minutes1.toString();
 document.getElementById('m11').innerHTML = m11.substring(0,1);
 document.getElementById('m21').innerHTML = m11.substring(1,2);
 document.getElementById('_seconds1').innerHTML = seconds1; 
 
 //decrement second clock
 var h112 = hours1.toString();
 //alert(h11);
 document.getElementById('h12').innerHTML = h112.substring(0,1);
 document.getElementById('h22').innerHTML = h112.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m112 = minutes1.toString();
 document.getElementById('m12').innerHTML = m112.substring(0,1);
 document.getElementById('m22').innerHTML = m112.substring(1,2);
 document.getElementById('_seconds2').innerHTML = seconds1; 
 
 //decrement third clock
 var h113 = hours1.toString();
 //alert(h11);
 document.getElementById('h13').innerHTML = h113.substring(0,1);
 document.getElementById('h23').innerHTML = h113.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m113 = minutes1.toString();
 document.getElementById('m13').innerHTML = m113.substring(0,1);
 document.getElementById('m23').innerHTML = m113.substring(1,2);
 document.getElementById('_seconds3').innerHTML = seconds1;
 
 //decrement 4th clock
 var h114 = hours1.toString();
 //alert(h11);
 document.getElementById('h14').innerHTML = h114.substring(0,1);
 document.getElementById('h24').innerHTML = h114.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m114 = minutes1.toString();
 document.getElementById('m14').innerHTML = m114.substring(0,1);
 document.getElementById('m24').innerHTML = m114.substring(1,2);
 document.getElementById('_seconds4').innerHTML = seconds1;
 
 //decrement 5th clock
 var h115 = hours1.toString();
 //alert(h11);
 document.getElementById('h15').innerHTML = h115.substring(0,1);
 document.getElementById('h25').innerHTML = h115.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m115 = minutes1.toString();
 document.getElementById('m15').innerHTML = m115.substring(0,1);
 document.getElementById('m25').innerHTML = m115.substring(1,2);
 document.getElementById('_seconds5').innerHTML = seconds1;
 
  //decrement 6th clock
 var h116 = hours1.toString();
 //alert(h11);
 document.getElementById('h16').innerHTML = h116.substring(0,1);
 document.getElementById('h26').innerHTML = h116.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m116 = minutes1.toString();
 document.getElementById('m16').innerHTML = m116.substring(0,1);
 document.getElementById('m26').innerHTML = m116.substring(1,2);
 document.getElementById('_seconds6').innerHTML = seconds1;
 
  //decrement 7th clock
 /*var h117 = hours1.toString();
 //alert(h11);
 document.getElementById('h17').innerHTML = h117.substring(0,1);
 document.getElementById('h27').innerHTML = h117.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m117 = minutes1.toString();
 document.getElementById('m17').innerHTML = m117.substring(0,1);
 document.getElementById('m27').innerHTML = m117.substring(1,2);
 document.getElementById('_seconds7').innerHTML = seconds1;
 
  //decrement 8th clock
 var h118 = hours1.toString();
 //alert(h11);
 document.getElementById('h18').innerHTML = h118.substring(0,1);
 document.getElementById('h28').innerHTML = h118.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m118 = minutes1.toString();
 document.getElementById('m18').innerHTML = m118.substring(0,1);
 document.getElementById('m28').innerHTML = m118.substring(1,2);
 document.getElementById('_seconds8').innerHTML = seconds1; 
 
 //decrement 9th clock
 var h119 = hours1.toString();
 //alert(h11);
 document.getElementById('h19').innerHTML = h119.substring(0,1);
 document.getElementById('h29').innerHTML = h119.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m119 = minutes1.toString();
 document.getElementById('m19').innerHTML = m119.substring(0,1);
 document.getElementById('m29').innerHTML = m119.substring(1,2);
 document.getElementById('_seconds9').innerHTML = seconds1;
 
  //decrement 10th clock
 var h1110 = hours1.toString();
 //alert(h11);
 document.getElementById('h110').innerHTML = h1110.substring(0,1);
 document.getElementById('h210').innerHTML = h1110.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m1110 = minutes1.toString();
 document.getElementById('m110').innerHTML = m1110.substring(0,1);
 document.getElementById('m210').innerHTML = m1110.substring(1,2);
 document.getElementById('_seconds10').innerHTML = seconds1;
 
  //decrement 11th clock
 var h1111 = hours1.toString();
 //alert(h11);
 document.getElementById('h111').innerHTML = h1111.substring(0,1);
 document.getElementById('h211').innerHTML = h1111.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m1111 = minutes1.toString();
 document.getElementById('m111').innerHTML = m1111.substring(0,1);
 document.getElementById('m211').innerHTML = m1111.substring(1,2);
 document.getElementById('_seconds11').innerHTML = seconds1;
 
  //decrement 12th clock
 var h1112 = hours1.toString();
 //alert(h11);
 document.getElementById('h112').innerHTML = h1112.substring(0,1);
 document.getElementById('h212').innerHTML = h1112.substring(1,2);
 //h = hours.substring(1,1);
// alert (h);
 var m1112 = minutes1.toString();
 document.getElementById('m112').innerHTML = m1112.substring(0,1);
 document.getElementById('m212').innerHTML = m1112.substring(1,2);
 document.getElementById('_seconds12').innerHTML = seconds1;*/

	setTimeout("getthedate_decrement()", 1000);
	
}
//setInterval("getthedate()", 1000);
//window.onload = getthedate();

