function popup(url, name, width, height)
{
	if (arguments.length == 5)
	{
		styles = arguments[4];
	}
	else
	{
		styles = "toolbar=0,scrollbars=1,resizable=1";
	}
	
	var w = window.open(url, name, 'width='+width+',height='+height+','+styles);
	w.focus();
}

function go(url)
{
	document.location.href = url;
}


function httpRequest(url)
{
	var ua = navigator.userAgent.toLowerCase();
   	if (!window.ActiveXObject)
   	{
    	request = new XMLHttpRequest();
   	}
   	else if (ua.indexOf('msie 5') == -1)
   	{
     	request = new ActiveXObject("Msxml2.XMLHTTP");
   	}
   	else
   	{
   		request = new ActiveXObject("Microsoft.XMLHTTP");
   	}

	// the request variable holds an XMLHttpRequest 
	// object instance
	request.open("GET", url, false);
	request.send("");

	var result = "";

	if ( request.status == 200 )
	{
		result = request.responseText;
	}
	else
	{
		result = "<span style='color:red;font-weight:bold'>Error retrieving data</span>";
	}
	
	return result;	
}

function todayLong()
{
	var monthNames = new Array(
	"January","February","March","April","May","June","July",
	"August","September","October","November","December");

	var now = new Date();

	var today = now.getDate() + " " + monthNames[now.getMonth()] + " " + now.getFullYear();
	
	return today;
}

function basename(str)
{
	var idx = str.lastIndexOf('\\');
	if (idx == -1)
	{
		idx = str.lastIndexOf('/');
	}
	
	if (idx == -1) return str;
	
	return str.substring(idx + 1);
}

// script used for popup events
function popupEvent(event)
{
  var url = 'http://admin.spring-mar.org/calendar/cal_popup.php?op=view&id='+event+'&uname=' ;
  window.open(url,'Calendar','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=1000,height=600');
}