// JavaScript Document
/*************************************************
These scripts are specific to the calendar tool
*************************************************/
eventID = null;
//this unction splits the GET part of the location url
function getURLVar(urlVarName)
{
	//divide the URL in half at the '?'
	var urlHalves = String(document.location).split('?');
	var urlVarValue = '';
	if(urlHalves[1])
	{
		//load all the name/value pairs into an array
		var urlVars = urlHalves[1].split('&');
		//loop over the list, and find the specified url variable
		for(var i=0; i<=(urlVars.length); i++)
		{
			if(urlVars[i])
			{
				//load the name/value pair into an array
				var urlVarPair = urlVars[i].split('=');
				if (urlVarPair[0] && urlVarPair[0] == urlVarName)
				{
				//I found a variable that matches, load it's value into the return variable
				urlVarValue = urlVarPair[1];
				}
			}
		}
	}
	return urlVarValue;
}
//bookmark function
function bookmarkPage(url, title)
{
	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion)
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) // ie 4+
	{
		window.external.AddFavorite(url, title);
	}
		
	else // ie
	{
		window.document.location.href = url + "&title=" + title;
		//window.document.title = title;
		alert("Click 'Control D' on a PC or 'Command D' on a MAC to add to your bookmarks");
		//window.sidebar.addPanel(title, url, "");
	}
}
//write title function
function writeTitle()
{
	var title = getURLVar("title");
	if(title != undefined && title != null && title != "")
	{
		window.document.title = unescape(title);
	}
	
}