﻿var WindowObjectReference = null;
//Region Time Display Function
/*Time Display Function for all Website pages*/
    var worldtime = new Array()
    
    worldtime[0]="Hong Kong,8"

    var hours
    var shifthours
    var minutes
    var seconds
    var localhours
    function showTime()
    {
        for (i=0; i<=worldtime.length-1;i++) 
        {
		    thisplace=worldtime[i].split(",")
		    thistime= new Date()
		    hours=thistime.getUTCHours()
		    hours=eval(hours)
		    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}
    		    

		       
//		        if(document.getElementById('hdate')!=null && thisplace[0]=='Hong Kong')
//		            document.getElementById('hdate').innerText = thistime.toLocaleDateString()+ ' ' + localhours+":"+minutes;
        }
        
            setTimeout("showTime()",1000)
    }
    
        
    //showTime();
    

function TimeDemo(){
   var d = new Date();;
   var date = d.toLocaleDateString();
   var hours = d.getHours();
   var minutes = d.getMinutes();
   if(hours < 10){
	  hours = "0" + hours;
   }
   if(minutes < 10){
	  minutes = "0" + minutes;
   }
  var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  
   var s = d.getDate()+ ' ' + m_names[d.getMonth()] + ' ' + d.getFullYear()  + ' ' + hours + ":" + minutes;
   document.getElementById('rtime').innerHTML = s;
 }

window.onload=function() 
{
var fullURL = parent.document.URL ;
var MenuID = fullURL.substring(fullURL.indexOf('?')+5, fullURL.indexOf('?')+8) ;

//if ( MenuID != "275" )
//  {
    TimeDemo();
//  }
}
//End Region Time Display Function

