function getSiblingElement(element){
	for(var i = element.nextSibling; i != null; i = i.nextSibling){
		if(i.nodeType == 1) return i;
	}
}
function toggleMenu(element){
	if(!document.getElementById) return;
	if(element == activeMenu){
		element.className = "inactive";
		getSiblingElement(element).style.display = "none";
		activeMenu = null;
	}else{
		if(activeMenu){
			activeMenu.className = "inactive";
			getSiblingElement(activeMenu).style.display = "none";
		}
		element.className = "active";
		getSiblingElement(element).style.display = "block";
		activeMenu = element;
	}
	return false;
}

var activeMenu = null;

var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;

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 timeValue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds
        timeValue += (hours >= 12) ? " P.M." : " A.M."
		document.all.clock0.innerHTML =
'<b>' + DateString(now) + '<br>' + TimeString(now) + '</b>';
        //document.clock.face.value = timeValue;
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}
function Updateclocks () {
        stopclock();
        showtime();
}

function DateString(dt)
{
var stemp;
var dt_year = dt.getFullYear() ;
var dt_month = dt.getMonth();
var dt_date = dt.getDate() ;
var dt_day = dt.getDay() ;

day = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
month = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
stemp = day[dt_day] + ' ' + month[dt_month] + ' ' + dt_date + ', ' + dt_year;

return stemp ;
}

function TimeString(dt)
{
var stemp, ampm ;
var dt_hour = dt.getHours() ;
var dt_minute = dt.getMinutes() ;
var dt_second = dt.getSeconds() ;

if (0 <= dt_hour && dt_hour < 12)
{
ampm = 'AM' ;
if (dt_hour == 0) dt_hour = 12 ;
} else {
ampm = 'PM' ;
dt_hour = dt_hour - 12 ;
if (dt_hour == 0) dt_hour = 12 ;
}

if (dt_minute < 10)
dt_minute = '0' + dt_minute ;

if (dt_second < 10)
dt_second = '0' + dt_second ;

stemp = dt_hour + ":" + dt_minute + ":" + dt_second + ' ' + ampm ;

return stemp ;
}