/* Global JavaScript */

window.onload = function()
{
	try{
	/* Initialise Member Login */
	
	var username = document.getElementById('mem_Usr');
	var password = document.getElementById('mem_Pwd');
	
	username.onfocus = function(){ mem_clear(this); };
	password.onfocus = function(){ mem_clear(this); };
	username.onblur = function(){ mem_unclear(this, 1); };
	password.onblur = function(){ mem_unclear(this, 2); };
	
	/* Initialise Club Login */
	
	var username = document.getElementById('club_Usr');
	var password = document.getElementById('club_Pwd');
	
	username.onfocus = function(){ mem_clear(this); };
	password.onfocus = function(){ mem_clear(this); };
	username.onblur = function(){ mem_unclear(this, 1); };
	password.onblur = function(){ mem_unclear(this, 2); };
	} catch(e){};
};

/**
 * clears the values from the member username field
 * if the value has not been changed.
 *
 * @param o Object
 */
function mem_clear(o)
{
	if ((o.value == 'Username') || (o.value == 'Password'))
		o.value = '';
};

/**
 * unclears the values and resets to the field to
 * its original state when the user doesnt enter
 * a value
 *
 * @param o Object
 * @param type Integer
 */

function mem_unclear(o, type)
{
	if (o.value.length == 0)
		o.value = (type == 1 ? 'Username' : 'Password');
};

/* Pop-up Window with "get lnik" form */

function linkUs()
{
	window.open('/link_to_us.php', 'linkUs', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300');
};