function rtc()
{
  var type, i, top, obj, clocks;  
  //document.login.checksaveid.checked = ((document.login.id.value = getCookie("saveid")) != "");  
  clocks = new Array();
  for (i = 0, top = 0; i < rtc.arguments.length; i += 2) 
  {
  	obj = eval('document.'+rtc.arguments[i]);
    	if (obj == null) continue;
    	clocks[top++] = obj;
  }
  clocks.str_ampm   = new Array('AM', 'PM');
  if (top > 0) 
  {
    document.chk_clocks = clocks;
    chk_clock();
  }
}

function chk_clock()
{
  var i, clocks, str1, str2, ampm, now;
  var year, month, day, hour, min, sec;
  clocks = document.chk_clocks;
  for (i = 0; i < clocks.length; i += 2) {
	ampm = 0;
	obj  = clocks[i];
	now  = new Date();
	year = now.getYear();
	month = now.getMonth()+1;
	day = now.getDate();
        hour = now.getHours();
		if (hour >= 12) ampm = 1;
		if (hour == 0) hour = 12;
		if (hour >= 13) hour -= 12;
        min = now.getMinutes();
        sec = now.getSeconds();
	str1 = year+'/'+((month<10) ? '0'+ month:month) +'/'+ ((day<10) ? '0'+ day:day);
	str2 = ((hour<10) ? '0'+ hour:hour) +':'+ ((min<10) ? '0'+ min:min) +':'+ ((sec<10) ? '0'+ sec:sec);
	obj.value = str1 + ' ' + clocks.str_ampm[ampm]+ ' ' + str2 +' ';
  }
  window.setTimeout("chk_clock();");
}


