
<!-- Clock in Java Script .. Cameron Gregory http://www.bloke.com/
// http://www.bloke.com/javascript/Clock/
speed=1000;
//len=28;
len=25;
tid = 0;
num=0;
//clockA = new Array();
//offsetA = new Array();
//clockA = new Array();
//var offsetA;
dd = new Date();

function getfullmth1(mth){
	switch (mth)
	{
	   case 0 :
		  out_mth_no = "Jan";
		  break;
	   case 1 :
		  out_mth_no = "Feb";
		  break;
	   case 2 :
		  out_mth_no = "Mar";
		  break;
	   case 3 :
		  out_mth_no = "Apr";
		  break;
	   case 4 :
		  out_mth_no = "May";
		  break;
	   case 5 :
		  out_mth_no = "Jun";
		  break;
	   case 6 :
		  out_mth_no = "Jul";
		  break;
	   case 7 :
		  out_mth_no = "Aug";
		  break;
	   case 8 :
		  out_mth_no = "Sep";
		  break;
	   case 9 :
		  out_mth_no = "Oct";
		  break;
	   case 10 :
		  out_mth_no = "Nov";
		  break;
	   case 11 :
		  out_mth_no = "Dec";
		  break;
	} 
	return out_mth_no;
}

function IfZero(num) {
	return ((num <= 9) ? ( "0" + num) : num);
}
function check24(hour) {
	return (hour >= 24) ? hour - 24 : hour;
} 

//function doDate(x)
function doDate(offset)
{
  for (i=0;i<num;i++) {
    dt = new Date();
  
  	offsetB = offset;
  	
    //if (offsetB != 0) {
      gt = dt.getTime();
	  gmt_offset = (dt.getTimezoneOffset()*60*1000);
      //gt = gt + offsetA[i];
	  gmt_time = gt + gmt_offset;
      gt1 = gmt_time + offsetB;
      dt.setTime(gt1);
    //}
  
  	if (dt.getHours() > 11){
  	    if (dt.getHours() == 12){
    	    hrformat = dt.getHours();
    	} else {
    	    hrformat = dt.getHours() - 12;
    	}
		daysector = "PM";	
	} else {
    	hrformat = dt.getHours();
		daysector = "AM";
	}
	
  	timeformat = hrformat+":"+IfZero(dt.getMinutes()) + daysector; 
  	//timeformat = hrformat+":"+IfZero(dt.getMinutes()) ; 
	gmtoffsetformat = offsetB/60/60/1000
	
	//rExp = "/-/gi"
	myString = new String(gmtoffsetformat);
	if (myString.indexOf("-") == -1){
		gmtoffsetformat = "+"+gmtoffsetformat;
	} else {
		gmtoffsetformat = gmtoffsetformat;
	}
	
	fullmth = parseInt(dt.getMonth());
	//gmtoffsetformat = offsetA[i]/60/60/1000
    //clockA[i].date.value = dt.toGMTString();
    //clockA[i].date.value = dt.getDate()+"/"+(dt.getMonth()+1)+"/"+dt.getFullYear()+", "+timeformat+" "+"GMT:"+gmtoffsetformat;
 	 var clockA=document.getElementById("timecontainer");
	//clockA.innerHTML = dt.getDate()+"/"+getfullmth(dt.getMonth())+"/"+dt.getFullYear()+", "+timeformat+" "+"(GMT "+gmtoffsetformat+")";
	clockA.innerHTML = IfZero(dt.getDate())+" "+getfullmth1(fullmth)+", "+timeformat; //+" "+"(GMT "+gmtoffsetformat+")";
    }

  tid=window.setTimeout("doDate("+offsetB+")",speed);
}

function start() {
  clockA[num] = document.forms["form"+num];
  //offsetA[num] = 0;
  //window.alert( (new Date()).getTimezoneOffset());
d = new Date();
  if (navigator.appVersion.substring(0,3) == "2.0")
    offsetA[num] = (d.getTimezoneOffset()*60*1000);
  else
    offsetA[num] = -(d.getTimezoneOffset()*60*1000);
  if (num == 0)  
    tid=window.setTimeout("doDate()",speed);
  num++;
}

function startLong(diff) {
  //window.alert("hay" + (new Date()).toGMTString());
  //var clockA=document.getElementById("timecontainer")

  //clockA[num] = document.forms["form"+num];
  //offsetA[num] = (diff - dd.getTimezoneOffset())*60*1000;
  offsetA = (diff)*60*1000;
  //offsetA[num] = (-diff)* 60*1000;
  if (num == 0)  
    tid=window.setTimeout("doDate("+offsetA+")",speed);
  num++;
}

function cleartid() {
  window.clearTimeout(tid);
}
 
// for some reason on some pages this crashes netscape
function Clock()
{
  document.write('<FORM name=form'+num+'><input name=date size=')
  document.write(len)
  document.write(' value="Clock: Requires Javascript"></FORM>')
  start();
}
 
// for some reason on some pages this crashes netscape
function ServerClock(diff)
{
  /*document.write('<FORM name=form'+num+'><textarea name=date class=textbox4 cols=')
  document.write(15);
  document.write(' rows=')
  document.write(2);
  document.write('>Clock: Javascript</textarea></FORM>')*/
  
  document.write('<span id="timecontainer" name="timecontainer" class="text3"><span>')
  startLong(diff);
}

function showclock(diff){
		document.write('<table width="105" height="28" align="center" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr>');
		document.write('<td bgcolor="#000000" align="center" class="clocktext" height="17"><img src="/Swissotel.com/ru/images/time_text.jpg"></td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('<td bgcolor="#000000" align="center" class="text3" height="17">');
		document.write('<span id="timecontainer" name="timecontainer" class="text3"><span>')

			//ServerClock(diff);
			startLong(diff);

		document.write('</td>');
		document.write('</tr>');
		document.write('</table>');
}
// end-->


