﻿// JScript File


 var timerID = null;
 var timerRunning = false;

 function stopclock (){
     if(timerRunning)
        clearTimeout(timerID);
     timerRunning = false;
 }

 function showtime () {
 var now = new Date();
 var hours = now.getHours();
 var minutes = now.getMinutes();
 var seconds = now.getSeconds()

 var year = now.getYear()
 if(year<1900) year += 1900
 var month = now.getMonth()+1
 var day = now.getDate()

 var timeValue="";

 //timeValue += " " + ((hours >12) ? hours -12 :hours)
 timeValue += day;
 timeValue += "/" +month;
 timeValue += "/" +year;

 timeValue += " " +hours;
 timeValue += ((minutes < 10) ? ":0" : ":") + minutes
 timeValue += ((seconds < 10) ? ":0" : ":") + seconds
 timeValue += (hours >= 12) ? " P.M" : " A.M"

 if(document.getElementById("timedate")){
 var idclock = document.getElementById("timedate")
 idclock.innerHTML = timeValue;
 }


 timerID = setTimeout("showtime()",1000);
 timerRunning = true;
 }

 function startclock (){
 // Make sure the clock is stopped
 stopclock();
 showtime();
 }

 function init(){
 startclock();
 timerONE=window.setTimeout;
 }

// End get time
 function addLoadEvent(func){
 var oldload = window.onload;
 if(typeof window.onload != 'function'){
 window.onload = func;
 }else{
 window.onload = function(){
 oldload();
 func();
 }
 }
 }

 function linkpage(linkto, param){

 var file
 if(param){
 linkto=linkto+"&"+param;
 }

 file = "default.aspx?id="+linkto;

 page(file,'body_home_page');

 }

 showtime()

