/*
	OPENING POP UP WINDOW
*/
function popupWindow(popupLocation, windowName, popupWidth, popupHeight, statusBarOn) {
	var heightspeed = 15; 	// vertical speed
	var widthspeed 	= 15;  	// horizontal speed
	var leftdist 	= (screen.width - popupWidth) / 2;    	// distance to left edge of window
	var topdist 	= (screen.height - popupHeight) / 2;   	// distance to top edge of window
	if (document.all) {
		if (statusBarOn) {
			var popUpWin = window.open("", windowName, "left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes,menubar=no");
		} else { 
			var popUpWin = window.open("", windowName, "left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=no,status=no,menubar=no");
		}
		for (sizeheight = 1; sizeheight < popupHeight; sizeheight += heightspeed) {
			popUpWin.resizeTo("1", sizeheight);
		}
		for (sizewidth = 1; sizewidth < popupWidth; sizewidth += widthspeed) {
			popUpWin.resizeTo(sizewidth, sizeheight);
		}	
		popUpWin.resizeTo(popupWidth, popupHeight);
		popUpWin.location = popupLocation;
	} else {
		var popUpWin = window.open(popupLocation, windowName, "left=" + leftdist + ",top=" + topdist + ",width=" + popupWidth + ",height=" + popupHeight + ",scrollbars=no");
	}
}

/*
	ADD TO BOOKMARKS FROM THE WEB HOMEPAGE
*/
function AddToBookmarks (url,title) 
{ 
	window.external.AddFavorite(url,title); 
}

/*
	ADJUST PAGE CONTENT HEIGHT
*/
function adjustContentHeight()
{
	// get height
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) 
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}	
	else
	{
	}
	
	var elID = document.getElementById('pageContent');
	elID.style.height = myHeight - 20 - 193 - 46;
}

function updateUserDOB(formObj)
{
	formObj.userDateOfBirth.value = formObj.userDayOfBirth.value + "/" + formObj.userMonthOfBirth.value + "/2005";
}

function displayJoinForm()
{
	var myElement = document.getElementById('tblMembership');

	if ( myElement.style.display == 'none' )
	{
		myElement.style.display = 'block';
	} 
	else
	{
		myElement.style.display = 'none';
	}
}


