//Function Time
function changeText(el, t) {
	el.firstChild.data = t;
}

function padZ(n){
	return (n<10)? '0'+n:''+n;
}

function t() {
	stoday = pp;
	var bxx = document.getElementById('stime'),
	h = padZ(stoday.getHours()),
	m = padZ(stoday.getMinutes()),
	s = padZ(stoday.getSeconds());
	
	bxx.firstChild.data = h + ":" + m + ":" + s;
	stoday.setTime(stoday.getTime()+1000);
	
	var ltime = document.getElementById('ltime'),
	today = new Date(),
	h = padZ(today.getHours()),
	m = padZ(today.getMinutes()),
	s = padZ(today.getSeconds());
	ltime.firstChild.data = h + ":" + m + ":" + s;
	
	// Estimate when to call it next, about 50ms after
	// next whole second
	var ms = today.getMilliseconds();
	var lag = 1050 - ms;
	
	window.setTimeout("t();", lag);
} 

// Function for the sub-menu
function show(id) {
	var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {
			document.getElementById('smenu'+i).style.display='none';
		}
	}
	if (d) {
		d.style.display='block';
	}
} 

//Function for the styles
function set_read(v){  
	window.open("/scripts/setcss.php?css_read="+v,'_self');
}	
	
window.onload=show;