function showEvents(dt) {
	window.location = "/thisis/calendar/index.asp?VIEW=main&DATE=" + dt ;
}

function selRightPage(n) {
	var d = document ;	
		
	if (n == "1") {
		d.getElementById("rightmenuitem1").className = "rightmenuitemselected" ;
		d.getElementById("rightmenuitem2").className = "rightmenuitem" ;
			
		d.getElementById("rightpage1").style.display = "block" ;
		d.getElementById("rightpage2").style.display = "none" ;
	}
	else if (n == "2") {
		d.getElementById("rightmenuitem1").className = "rightmenuitem" ;
		d.getElementById("rightmenuitem2").className = "rightmenuitemselected" ;
			
		d.getElementById("rightpage1").style.display = "none" ;
		d.getElementById("rightpage2").style.display = "block" ;	
	}
}  

function get_small_calendar(c_date) {
	var d = document ;
	var xml = GetXmlHttpObject() ;
	
	var url = "/thisis/wsunews/xmlfeeder/small_calendar.asp?c_date=" + c_date ;
	url = url + "&sid=" + Math.random() ;

	xml.onreadystatechange = function() {
		if (xml.readyState == 4) {
			d.getElementById("cal1div").innerHTML = xml.responseText ;
		}
	} ;

	xml.open("GET", url, true) ;
	xml.send(null) ;		
}

var date_displaying = "" ;

function get_small_calendar_events(c_date) {
	var d = document ;
	var scded = d.getElementById("small_calendar_show_events_div") ;

	if (date_displaying == "") {
		date_displaying = c_date ;
	}
	else {
		if (date_displaying != c_date) {
			date_displaying = c_date ;	
			scded.style.display = "none" ;
		}
		else {
			return ;
		}
	}
	
	var WinWidth = 0, WinHeight = 0, elewidth = 0, eleheight = 0 ;
	var TipWidth = 0, TipHeight = 0 ;

	WinWidth = document.body.offsetWidth;
	WinHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;

	d.getElementById("cur_date_hl").innerHTML = c_date ;
	d.getElementById("small_calendar_show_events_iframe").src = "/thisis/wsunews/spitevent/?cd=" + c_date ;
	
	scded.style.display = "block" ;

	elewidth = scded.offsetWidth;
	eleheight = scded.offsetHeight;

	TipWidth = mx + elewidth + 20;
	TipHeight = my + eleheight + 20;
	var phx = 0, phy = 0 ;
	if (window.event) {		if (d.documentElement.scrollLeft) 			phx = (TipWidth >= WinWidth) ? (mx - 10 - elewidth) + d.documentElement.scrollLeft : mx + 10 + d.documentElement.scrollLeft ;		else 			phx = (TipWidth >= WinWidth) ? (mx - 10 - elewidth) + d.body.scrollLeft : mx + 10 + d.body.scrollLeft ;
		
		if (d.documentElement.scrollTop) 			phy = (TipHeight >= WinHeight) ? (my - 10 - eleheight) + d.documentElement.scrollTop : my + 10 + d.documentElement.scrollTop ;
		else 			phy = (TipHeight >= WinHeight) ? (my - 10 - eleheight) + d.body.scrollTop : my + 10 + d.body.scrollTop ;
	}
	else {
		phx = (TipWidth >= WinWidth) ? (mx - 10 - elewidth) + window.scrollX : mx + 10 + window.scrollX ;		phy = (TipHeight >= WinHeight) ? (my - 10 - eleheight) + window.scrollY : my + 10 + window.scrollY ;	
	}
		scded.style.left = phx + "px" ;
	scded.style.top = phy + "px" ;
}

var mx = 0, my = 0 ;
document.onmousemove = function (evt) {move (evt)};

move = function (evt) {	if (window.event) {
		mx = window.event.clientX;
		my = window.event.clientY;
		
	} else {
		mx = evt.clientX;
		my = evt.clientY;	
	}
}