DaysofWeek = new Array();
DaysofWeek[0] = "Sun";
DaysofWeek[1] = "Mon";
DaysofWeek[2] = "Tue";
DaysofWeek[3] = "Wed";
DaysofWeek[4] = "Thu";
DaysofWeek[5] = "Fri";
DaysofWeek[6] = "Sat";

Months = new Array();
Months[0] = "Jan";
Months[1] = "Feb";
Months[2] = "Mar";
Months[3] = "Apr";
Months[4] = "May";
Months[5] = "Jun";
Months[6] = "July";
Months[7] = "Aug";
Months[8] = "Sep";
Months[9] = "Oct";
Months[10] = "Nov";
Months[11] = "Dec";

var tick = 0;
var day = 0;
var month = 0;
var am_pm = null;
var year = 0;
var month = 0;
var date = 0;
var hours = 0;
var minutes = 0;
var seconds = 0;
var latest = 0;
var subPage = null;
function upclock(){
  var today = new Date(clock_feed);
  today.setTime(today.getTime() + ((tick++) * 1000));

  day = today.getDay();
  day = DaysofWeek[day];
  year = today.getFullYear();
  month = today.getMonth();
  month = Months[month];
  date = today.getDate();
  hours = today.getHours();
  minutes = today.getMinutes();
  seconds = today.getSeconds();
  
  if (12 <= hours) {
    am_pm=" PM";
    hours -=12;
  }else{
    am_pm=" AM";
  }

  if (hours == 0) hours = 12;
  if (hours <= 9) hours="0"+hours;
  if (minutes <= 9) minutes="0"+minutes;
  if (seconds <= 9) seconds="0"+seconds;
  try{
	document.getElementById("clock").innerHTML = day+", "+date+" "+month+" "+year+" "+hours+":"+minutes+":"+seconds+" "+am_pm+" IST";
  }catch(e){}
}
setInterval("upclock();", 1000);
 
