today=new Date();
offset=today.getTimezoneOffset()*60000;
var selcity=""
var zone=32400000;
var start=0;
ctArray=new Array("-5","0","+1","+8","+3","-8")
impCity = new Array("0","2","10","1","5","8","9","5.5","7","8","9","10","10","-8","-8","-5")

var time_store = new Array("","","","","","","","","","","","","","","")
var temp_day ;

function localTime()
{
	start=1;
	selcity=document.time.city.options[document.time.city.selectedIndex].value;
	if (selcity=="none") {
		start=0;
	} 
	else {
		zone=selcity.substring(selcity.indexOf('|')+1,selcity.length)
		zone*=3600000;
	}
}

function localTime2(selcity)
{
	start=1;
	zone = selcity * 3600000;
}

function timeLoad()
{
	today=new Date();
	today.setTime(today.getTime()+zone+offset);

	var year=today.getFullYear()
	var month=today.getMonth()+1
	var day=today.getDate()
	var hour=today.getHours()
	var minute=today.getMinutes()
	var second=today.getSeconds()

	var temp1=""+year+"³â "+((month<10)?" ":"")+month+"¿ù "+((day<10)?"  ":"")+day+"ÀÏ "
	var temp2=((hour<10)?"0":"")+hour+((minute<10)?":0":":")+minute+((second<10)?":0":":")+second
	
	var temp = temp1 + temp2

	here_today=new Date();
	here_today.setTime(here_today.getTime()+(9*3600000)+offset);

	var seoul_year=here_today.getFullYear()
	var seoul_month=here_today.getMonth()+1
	var seoul_day=here_today.getDate()
	var seoul_hour=here_today.getHours()
	var seoul_minute=here_today.getMinutes()
	var seoul_second=here_today.getSeconds()

	var seoul_temp1=""+seoul_year+"³â "+((seoul_month<10)?" ":"")+seoul_month+"¿ù "+((seoul_day<10)?"  ":"")+seoul_day+"ÀÏ "
	var seoul_temp2=((seoul_hour<10)?"0":"")+seoul_hour+((seoul_minute<10)?":0":":")+seoul_minute+((seoul_second<10)?":0":":")+seoul_second
	
	var here = seoul_temp1 + seoul_temp2

	if (start) {
		document.time.time.value=temp;
		document.time.here.value=here;

		var i , j;
		
		for(i=0; i<15; i++) {
			temp_day=new Date();
			j = impCity[i] *3600000;
			temp_day.setTime(temp_day.getTime()+j+offset);
	
			var temp_hour=temp_day.getHours()
			var temp_minute=temp_day.getMinutes()
			var temp_second=temp_day.getSeconds()
			
			time_store[i] = ((temp_hour<10)?"0":"")+temp_hour+((temp_minute<10)?":0":":")+temp_minute+((temp_second<10)?":0":":")+temp_second
		}
			document.time.London.value = time_store[0]
			document.time.Istanbul.value = time_store[1]
			document.time.khabarobsk.value = time_store[2]
			document.time.Frankfurt.value = time_store[3]
			document.time.Tashkent.value = time_store[4]
			document.time.Beijing.value = time_store[5]
			document.time.Seoul.value = time_store[6]
			document.time.Newdelhi.value = time_store[7]
			document.time.Bangkok.value = time_store[8]
			document.time.Singapore.value = time_store[9]
			document.time.Tokyo.value = time_store[10]
			document.time.saipan.value = time_store[11]
			document.time.sydney.value = time_store[12]
			document.time.sanfrancisco.value = time_store[13]
			document.time.LosAngeles.value = time_store[14]
			document.time.Newyork.value = time_store[15]

	}
	else {
		document.time.time.value='¿ÞÂÊ µµ½Ã¸¦ ¼±ÅÃÇÏ¼¼¿ä.'
		document.time.here.value=here;
		
		var i , j;
		
		for(i=0; i<16; i++) {
			temp_day=new Date();
			j = impCity[i] *3600000;
			temp_day.setTime(temp_day.getTime()+j+offset);
	
			var temp_hour=temp_day.getHours()
			var temp_minute=temp_day.getMinutes()
			var temp_second=temp_day.getSeconds()
			
			time_store[i] = ((temp_hour<10)?"0":"")+temp_hour+((temp_minute<10)?":0":":")+temp_minute+((temp_second<10)?":0":":")+temp_second
		}
			document.time.London.value = time_store[0]
			document.time.Istanbul.value = time_store[1]
			document.time.khabarobsk.value = time_store[2]
			document.time.Frankfurt.value = time_store[3]
			document.time.Tashkent.value = time_store[4]
			document.time.Beijing.value = time_store[5]
			document.time.Seoul.value = time_store[6]
			document.time.Newdelhi.value = time_store[7]
			document.time.Bangkok.value = time_store[8]
			document.time.Singapore.value = time_store[9]
			document.time.Tokyo.value = time_store[10]
			document.time.saipan.value = time_store[11]
			document.time.sydney.value = time_store[12]
			document.time.sanfrancisco.value = time_store[13]
			document.time.LosAngeles.value = time_store[14]
			document.time.Newyork.value = time_store[15]
	}
	setTimeout("timeLoad()", 1000);
}

