function setBodyClass() {
	var time = new Date();
	var h = time.getHours();

	if(h > 6 && h < 18) {
		document.body.className += ' day';
		//document.getElementById("clockBg").className = 'clockBg_day';
	} else {
		document.body.className += ' night';
		//document.getElementById("clockBg").className = 'clockBg_night';
	}
}

// add leading 0s when necessary
function lead0(val) {
	return val < 10 ? "0" + val.toString() : val;
}

function getTime() {
	var time = new Date()
	var ampm = " am"
	var h = time.getHours()
	
	// fix military time and determine ampm
	if (h > 12) {
		h = h - 12;
		ampm = " pm";
	}  

	return h + ":" + lead0(time.getMinutes()) + ampm;
}


function showAjax() {
	var time = new Date()
	var h=time.getHours()
	var xmlHttp;
	
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		try { // Internet Explorer
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support Ajax!");
				return false;
			}      
		}    
	}

	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4)
			document.getElementById("AjaxLayer").innerHTML = xmlHttp.responseText;
	}

	var url = "clocktips.asp";
	url = url + "?h=" + h + "&h2=" + getTime();  
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);  
}
