var worldtime = new Array();
worldtime[0]="Москва,2,moskva,1";
worldtime[1]="Екатеринбург,5,ekb,2";
worldtime[2]="Новосибирск,6,novosib,3";
worldtime[3]="Иркутск,8,irkutsk,4";
worldtime[4]="Владивосток,10,vladivostok,5";

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


function showtime() {

 var summer_time = 0;
 
 for (i=0; i<=worldtime.length-1;i++) {
  thisplace=worldtime[i].split(",");
  thistime= new Date();
  hours=thistime.getUTCHours();
  hours=eval(hours);
  shifthours=eval(eval(thisplace[1]) + eval(summer_time));
  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 =    thisplace[2];
	var label = thisplace[3];
  // set <span> content
	//document.getElementById(id).innerHTML = thisline;
	// set flash object
	//alert('flash_' + id);
	var fl = document.getElementById( 'flash_' + id );	
	
	if (fl.innerHTML == '') {	  
    var tag = new FlashTag('/themes/site/flash/a'+ label +'.swf', 38, 38); // last two arguments are height and width
    tag.setFlashvars(paramtime);
    tag.write_inner(fl);    
	}
  
 } 

}
