
//Page initialzation
function initPage() {

	//load sightmax (live chat)
	liveChatShow('sightmax');
	getDate();

}

//Fills in the liveChat script
function liveChatShow(theObject) {
	var object = document.getElementById(theObject); 
	object.innerHTML += "<a href=\"javascript: var e = window.open('http://e-chat.Optrics.com/SightMaxAgentInterface/PreChatSurvey.aspx?accountID=1&siteID=12&queueID=20','chatWindow','width=490,height=404,resizable=0,scrollbars=no,menubar=no,status=no');\" onmouseout=\"top.status=''; return true;\" onmousedown=\"top.status='Chat with an Optrics Customer Service Representative';return true;\" onmouseover=\"top.status='Chat with an Optrics Customer Service Representative';return true;\"><img border=0 src=\"http://e-chat.Optrics.com/SightMaxAgentInterface/chat.smgif?accountID=1&siteID=12&queueID=20\" alt=\"Chat with an Optrics Customer Service Representative\"></a>";
}




function getDate() {
	var now = new Date();
	var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
	function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;}
	//today =  days[now.getDay()] + ", " +
	today =  months[now.getMonth()] + " " +
	date + ", " +
	(fourdigits(now.getYear()));
	
	document.getElementById('theDate').innerHTML=today;
}

