<!--//


var dm='http://www.gymuser.co.uk/';

var g_on = new Image(); g_on.src="/img/gu_logo_rollover2.gif";
var g_off = new Image(); g_off.src="/img/gu_logo_rollover1.gif";

function roll(me,op)
{
	eval('document.images.' + me +'.src = ' + me + '_' + op + '.src');
}

function extras(func)
{
	var theurl = new String('')
	var go = new Number(0)

	if (func=='tellafriend')
	{
		theurl='http://www.gymuser.co.uk/tellafriend.asp?refer=http%3A%2F%2Fwww%2Egymuser%2Eco%2Euk%2Fnutrition%2Fnutrition%2Ehtm&h1=Nutrition';
		go=1;
	}
	else if (func=='printpage')
	{
		theurl='http://www.gymuser.co.uk/nutrition/nutrition.htm?printpage=1';
		go=1;
	}
	else if (func=='fia')
	{
		theurl='http://www.gymuser.co.uk/fia.htm';
		go=1;
	}
	else if (func=='alive')
	{
		theurl='http://www.gymuser.co.uk/alive.htm';
		go=1;
	}
	else if (func=='promo1')
	{
		theurl='http://www.gymuser.co.uk/promo1.htm';
		go=1;
	}
	else if (func=='newsletter')
	{
		theurl='http://www.gymuser.co.uk/email_address.asp';
		XT = window.open(theurl,null,'height=320,width=320,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='gymsearchadvertisehere')
	{
		theurl='http://www.gymuser.co.uk/premiumpopup.htm';
		XT = window.open(theurl,null,'height=600,width=650,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='callback')
	{
		var args=extras.arguments;
		theurl='http://www.gymuser.co.uk/callback.asp?chainid=' + args[1] + '&gymid=' + args[2];
		XT = window.open(theurl,null,'height=330,width=420,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='emailgym')
	{
		var args=extras.arguments;
		theurl='http://www.gymuser.co.uk/emailgym.asp?gymid=' + args[1];
		XT = window.open(theurl,null,'height=330,width=420,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='gymerror')
	{
		var args=extras.arguments;
		theurl='http://www.gymuser.co.uk/gymerror.asp?gymid=' + args[1];
		XT = window.open(theurl,null,'height=330,width=420,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='suggestgym')
	{
		var args=extras.arguments;
		theurl='http://www.gymuser.co.uk/suggestgym.htm';
		XT = window.open(theurl,null,'height=330,width=420,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='calc')
	{
		var args=extras.arguments;
		theurl='http://www.gymuser.co.uk/calculators.asp?iCalc=' + args[1];
		XT = window.open(theurl,null,'height=430,width=520,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
	else if (func=='premium')
	{
		var args=extras.arguments;
		theurl='http://www.gymuser.co.uk/premiumpay.asp?id=' + args[1];
		XT = window.open(theurl,null,'height=470,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}

	if (go==1)
	{
		XT = window.open(theurl,null,'height=300,width=301,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no');
		XT.focus();
	}
}

function searchboxes(inp,defaultText,isFocus)
{
	if (isFocus==1)
	{
		if (inp.value==defaultText){inp.value='';}
	}
	else
	{
		if (inp.value==''){inp.value=defaultText;}
	}
}

function doForm(theform)
{
	if (theform.elements['searchTown'].value.length==0 && theform.elements['searchPC1'].value.length==0 && theform.elements['searchPC2'].value.length==0 && theform.elements['searchClub'].value.length==0){alert('Please enter your search criteria.');return false;}
	else if (theform.elements['searchPC2'].value.length > 0 && theform.elements['searchPC1'].value.length==0){alert('Please use at least the first part of the postcode by which you wish to search.');return false;}
	else if (theform.elements['searchTown'].value.length > 0 && theform.elements['searchPC1'].value.length > 0){alert('To ensure the accuracy of our search facility you cannot search by both town and postcode.\nPlease search using either one or the other.');return false;}
	else if (theform.elements['searchClub'].value.length > 0 && theform.elements['searchTown'].value.length==0 && theform.elements['searchPC1'].value.length==0){alert('You must enter a town or postcode in which to search for the club you have specified.');return false;}
	else
	{
		if(theform.elements['searchTown'].value.length > 0){theform.elements['directoryresultsearch'].value = theform.elements['searchTown'].value;}
		else{theform.elements['directoryresultsearch'].value = theform.elements['searchPC1'].value + theform.elements['searchPC2'].value;}

		theform.action='/search/results.htm';
		return true;
	}
}

function initIFR(sID)
{
       var winH = 575;
       var winW = 550;
       var sVirtualPathToCallback = 'gyms/chain/david/enquire.htm';
       var iID = parseInt(sID.shave('ifr'),10);
       var sFinalPath = dm + sVirtualPathToCallback + '?id=' + iID;
       omWin(sFinalPath, winH, winW, 1);
}

//-->