function clearCals (y,mID) {
	var z = 0;
	while (y > z) {
		z++
		var m = mID + z;
		hideEventDiv(m)
	}
}

function toggle(x,y,m,Cook){
    clearCals (y,m);
    showEventDiv(x);
    if (Cook!='no') setCookie(m,x,1);
}

function showEventDiv(x) {
	document.getElementById(x).style.display = 'block'
}

function hideEventDiv(x) {
	document.getElementById(x).style.display = 'none'
}

function setCookie(c_name,value,expiredays) {
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate)+
	";path=/"
}

function getCookie(c_month) {
	if (document.cookie.length>0) {
	  c_start=document.cookie.indexOf(c_month + "=")
	  if (c_start!=-1){ 
		c_start=c_start + c_month.length+1 
		c_end=document.cookie.indexOf(";",c_start)
		if (c_end==-1) c_end=document.cookie.length
		return unescape(document.cookie.substring(c_start,c_end))
	  } 
	}
    return null
}


/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

function makeTheDiv() {
	document.write('<div id="traildiv"></div>');
}

function showTrail(copy) {
	document.getElementById('traildiv').innerHTML = copy;
	document.getElementById('traildiv').style.visibility="visible";
	document.onmousemove=followmouse

}

function gettrailobj(){
	return document.getElementById("traildiv").style
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail(){
gettrailobj().visibility="hidden"
document.onmousemove=""

}

function followmouse(e){

var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]
if (typeof e != "undefined"){
	xcoord+=e.pageX
	ycoord+=e.pageY
}
else if (typeof window.event !="undefined"){
	xcoord+=truebody().scrollLeft+event.clientX
	ycoord+=truebody().scrollTop+event.clientY
	}
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		gettrailobj().display=""
		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
}
/* END TRAIL SCRIPT */

