var days=new Array(8); days[1] = "Sun"; days[2] = "Mon"; days[3] = "Tues"; days[4] = "Wed"; days[5] = "Thur"; days[6] = "Fri"; days[7] = "Sat";
var months=new Array(13); 
months[1] = "Jan."; 
months[2] = "Feb."; 
months[3] = "March";
months[4] = "April";  
months[5] = "May"; 
months[6] = "June"; 
months[7] = "July"; 
months[8] = "August"; 
months[9] = "Sept."; 
months[10] = "Oct."; 
months[11] = "Nov."; 
months[12] = "Dec.";

var dateObj=new Date();	var wday=days[dateObj.getDay() + 1];
var lmonth=months[dateObj.getMonth() + 1]; var date=dateObj.getDate();
var suffix = "";
if ((date == 01) || (date == 21) || (date ==31))
{ suffix = "st" }
else 
	{
	if ((date == 03) || (date ==23))
	{ suffix = "rd" }
	else
		{
		if ((date == 02) || (date ==22)) 
		{ suffix = "nd" }
		else
			{ suffix = "th" }
		}
	}
var year=dateObj.getYear();

/**
 * openWindow
 * opens a window of specified width and height
 */
function openWindow(url, name) {
	var newWindow;	
	var features = 'toolbar=yes,location=no,dependent=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,top=1,left=1,width=750,height=400';
	newWindow = window.open(url,name,features);
}

function openHImageWindow(url, name) {
	var newWindow;	
	var features = 'toolbar=yes,location=no,dependent=no,status=no,menubar=yes,scrollbars=no,resizable=no,top=1,left=1,width=520,height=400';
	newWindow = window.open(url,name,features);
}
function openVImageWindow(url, name) {
	var newWindow;	
	var features = 'toolbar=yes,location=no,dependent=no,status=no,menubar=yes,scrollbars=no,resizable=no,top=1,left=1,width=420,height=555';
	newWindow = window.open(url,name,features);
}

function openMapWindow(url, name) {
	var newWindow;	
	var features = 'toolbar=yes,location=no,dependent=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,top=1,left=1,width=500,height=500';
	newWindow = window.open(url,name,features);
}

/**
 * closeWindow
 * closes the current window
 */
function closeWindow() {
	window.close();
}

function contact(address) {
	document.write("<a" + " href=\"ma" + "ilto:" + address + "@tiscali.c" + "o.u" + "k\"" + "class=\"navbodylinksmall\"" + ">" + "the metta centre p" + "ost box" + "</a>");
}	
function getFile(file)
{
	var http = getHTTPRequest();

	if (http)
	{
		url = file + "?ms=" + new Date().getTime();
		http.open('GET', url, false);
		http.send(null);
		
		return http.responseText;
	}
}

function getHTTPRequest() 
{
	var xmlhttp = false;

	try 
	{
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	} 
	catch (e) 
	{
		try 
		{
			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		} 
		catch (E) 
		{
			xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
	{
		xmlhttp = new XMLHttpRequest();
	}

	return xmlhttp;
}
