function gotoURL(u)
{
	document.location = u;
}

function turnon(i)
{
	if (document.getElementById || (document.all && !document.GetElementById))
	{
		i.style.backgroundColor = "#96A5C3";
		i.style.cursor = "hand";
	}
}
	
function turnoff(i)
{
	if (document.getElementById || (document.all && !document.GetElementById))
	{
		i.style.backgroundColor = "#425C92";
		i.style.cursor = "";
	}
}

function showMenu(tr, menu_id)
{
  var menu = document.getElementById(menu_id);
  if (tr != null)
  {
    rowOn(tr);
  }
  if (menu == null) return;
  if (tr != null)
  {
    menu.style.left = ns_pageX(tr) + tr.offsetWidth + menu_left;
    menu.style.top = ns_pageY(tr) + menu_top;
  }
  menu.style.visibility = 'visible';
}
  
function hideMenu(tr, menu_id)
{
  var menu = document.getElementById(menu_id);
  if (tr != null)
  {
    rowOff(tr);
  } 
  if (menu == null) return;
  menu.style.visibility = 'hidden';
}
  
function rowOn(tr)
{
  tr.className = 'MenuRowActive';
}
  
function rowOff(tr)
{
  tr.className = 'MenuRow';
}

// Calculates the absolute page x coordinate of any element
function ns_pageX(element)
{
  var x = 0;
  do 
  {
    if (element.style.position == 'absolute') 
    {
      return x + element.offsetLeft; 
    }
    else
    {
      x += element.offsetLeft;
      if (element.offsetParent) 
        if (element.offsetParent.tagName == 'TABLE') 
          if (parseInt(element.offsetParent.border) > 0)
          {
            x += 1; 
          }
    }
  }
  while ((element = element.offsetParent));
  return x; 
}
    
// Calculates the absolute page y coordinate of any element
function ns_pageY(element)
{
  var y = 0;
  do 
  {
    if (element.style.position == 'absolute') 
    {
      return y + element.offsetTop; 
    }
    else
    {
      y += element.offsetTop;
      if (element.offsetParent) 
        if (element.offsetParent.tagName == 'TABLE') 
          if (parseInt(element.offsetParent.border) > 0)
          {
            y += 1; 
          }
    }
  }
  while ((element = element.offsetParent));
  return y; 
}

startList = function() 
{
  if (document.all && document.getElementById) 
  {
    navRoots = document.getElementsByName("nav");
    for (navCount=0; navCount < navRoots.length; navCount++)
    {
      navRoot = navRoots[navCount];
      for (i=0; i<navRoot.childNodes.length; i++) 
      {
        node = navRoot.childNodes[i];
        if (node.nodeName=="LI") 
        {
          node.onmouseover=function() 
          {
            this.className+=" over";
          }
          node.onmouseout=function() 
          {
            this.className=this.className.replace(" over", "");
          }
        }
      }
    }
  }
}
window.onload=startList;

//tere try something

var timerID = null;
var timerRunning = false;
function stopclock (){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}

function startclock () {
        // Make sure the clock is stopped
        stopclock();
        showtime();
}

function showtime () {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();

        var date = now.getDate();
        var month = now.getMonth() + 1;
        var year = now.getYear();
        if (year < 1000)
         year+=1900
        
        var timeValue = "" + ((hours < 10 ) ? "0" : "") + hours
        // var timeValue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds
        // timeValue += (hours >= 12) ? " P.M." : " A.M."
        
        


         if (seconds == 0) {
        window.status = "New minute!";
        document.clock.face.value = "New minute!";
         }
        if (minutes == 0 && seconds == 0) {
        window.status = "New hour!";
        document.clock.face.value = "New hour!";
        
         }
        if (hours == 0 && minutes == 0 && seconds == 0) {
        window.status = "Midnight!";
        document.clock.face.value = "Midnight!";
         }

       else if (seconds > 0) {
        document.clock.face.value = timeValue;    
  
        //window.status = date + "/" + month + "/" + year + " " + timeValue;
                       }
 
        nextXmas = new Date("December 25, 2000")
        nextXmas.setYear(year)
        msPerDay = 24 * 60 * 60 * 1000 ; // Number of milliseconds per day
        daysLeft = (nextXmas.getTime() - now.getTime()) / msPerDay;
        daysLeft = Math.round(daysLeft);
        //document.Frame2.Xmas.value =  daysLeft + " days until Christmas Eve!";
        
        nextXmas = new Date("December 31, 2000")
        nextXmas.setYear(year)
        msPerDay = 24 * 60 * 60 * 1000 ; // Number of milliseconds per day
        daysLeft = (nextXmas.getTime() - now.getTime()) / msPerDay;
        daysLeft = Math.round(daysLeft);
        //document.Frame3.NewYear.value = daysLeft + " days until New Years Eve!";
                    
        timerID = setTimeout("showtime()",1000);

        timerRunning = true;
}

