/*var time = {
	'utc': new Date('17 Mar 2008 18:36:39'),
	'start': new Date()
}

time.diff = time['utc'].getTime() - time['start'].getTime();

time.getUTC = function() {
	var now = new Date();
	now.setTime(now.getTime() + time.diff);
	return now;
}

var towns = [
	{
		'city': 'ÌÎÑÊÂÀ',
		'timezone': +3,
		'id': 'm',
		'label': 1
	},
	{
		'city': 'ÍÎÂÎÑÈÁÈÐÑÊ',
		'timezone': +6,
		'id': 'n',
		'label': 2
	},
	{
		'city': 'ÂËÀÄÈÂÎÑÒÎÊ',
		'timezone': +10,
		'id': 'v',
		'label': 3
	}	
];

var SetTimeInTown = function(params) {
	var utc = time.getUTC();
	// set values
	var timezone = params['timezone'] | 0;
	//alert(timezone);
	var id = params['id'];
	var label = params['label'];
	// set time
	document.getElementById('time'+ id).innerHTML = label+'='+utc.getHours()+'|'+timezone;
	
	utc.setHours(utc.getHours() + timezone);	
	var hours = utc.getHours();
	var minutes = utc.getMinutes();
	var seconds = utc.getSeconds();
	var ampm = (hours>12)? 'PM' : 'AM';
	var hoursampm = (hours>12)? hours-12 : hours;
	// format time
	if (hours<10) hours = '0' + hours.toString();
	if (hoursampm<10) hoursampm = '0' + hoursampm.toString();
	if (minutes<10) minutes = '0' + minutes.toString();
	if (seconds<10) seconds = '0' + seconds.toString();
	var paramtime = 'hours=' + hours + '&seconds=' + seconds + '&minuts='+ minutes;
	var spantime = hours + ':' + minutes;
	// set <span> content
	document.getElementById(id).innerHTML = spantime;
	// set flash object
	var fl = document.getElementById('flash'  + label);	
	
	if (fl.innerHTML == '') {	  
    var tag = new FlashTag('/files/Flash/a'+ label +'.swf', 62, 62); // last two arguments are height and width
    tag.setFlashvars(paramtime);
    tag.write_inner(fl);    
	}	
}

var SetTime = function() {
	for (var i=0; i<towns.length; i++)
		SetTimeInTown(towns[i]);
	setTimeout(SetTime, 1000);
}*/


var worldtime = new Array();
worldtime[0]="ÌÎÑÊÂÀ,3,m,1";
worldtime[1]="ÍÎÂÎÑÈÁÈÐÑÊ,6,n,2";
worldtime[2]="ÂËÀÄÈÂÎÑÒÎÊ,10,v,3";

var hours;
var shifthours;
var minutes;
var seconds;
var localhours;
var pause = 2000;
var thisplace;
var thisline = "";
var showmenu=1;

function showtime() {

 for (i=0; i<=worldtime.length-1;i++) {
  thisplace=worldtime[i].split(",");
  thistime= new Date();
  hours=thistime.getUTCHours();
  hours=eval(hours)+1;
  shifthours=eval(thisplace[1]);
  localhours=eval(shifthours+hours);
  if (localhours <0) {localhours=24+localhours};
  if (localhours >=24) {localhours=localhours-24};
 
  minutes=thistime.getUTCMinutes();
  seconds=thistime.getUTCSeconds();
 
  if (thisplace[0]=='Delhi') {
   minutes=eval(minutes+30);
   if (minutes>=60) {
    minutes=eval(minutes-60);
    localhours=eval(localhours+1);
   }
  }
  if (eval(minutes) < 10) {
    minutes="0"+minutes;
  }
  if (eval(seconds) < 10) {
    seconds="0"+seconds;
  }
  if (eval(localhours) < 10) {
    localhours="0"+localhours;
  }
  
  thisline = localhours + ":" + minutes;
  var paramtime = 'hours=' + localhours + '&seconds=' + seconds + '&minuts='+ minutes;
  
  var id = 'time' + thisplace[2];
	var label = thisplace[3];
  // set <span> content
	document.getElementById(id).innerHTML = thisline;
	// set flash object
	var fl = document.getElementById('flash'  + label);	
	
	if (fl.innerHTML == '') {	  
    var tag = new FlashTag('/files/Flash/a'+ label +'.swf', 62, 62); // last two arguments are height and width
    tag.setFlashvars(paramtime);
    tag.write_inner(fl);    
	}
  
 } 

}