function popLocator(refpage){
	window.open('http://bally.know-where.com/ballyfitness2/','clubLoc',
			'toolbars=1,menubar=1,location=1,scrollbars=1,resizable=1,status=1,height=500,width=700');
}
function popLocatorM(refpage){
	window.open('http://bally.know-where.com/ballyfitness/','clubLoc',
			'toolbars=1,menubar=1,location=1,scrollbars=1,resizable=1,status=1,height=500,width=700');
}
var clubnum;
var clubdist;
var clubname;
var daURL;
var daRoot = 'http://www.ballyfitness.com';

//parent window goes to profile page
//clubloc window closes
//link requires all three arguments as querystrings
function locProfile(clubnum,clubdist,clubname){
	var rgEx = " "
	cname = clubname.replace(rgEx,'%2520')
	cname = cname.replace(rgEx,'%2520')
	daURL = window.document.location;
	var daLink = '/scripts/rdClubLocator.asp?rd=locProfile'
	var qs ='&clubnum=' + clubnum + '&dist=' + clubdist + '&clubname=' + cname + '&locPage=' + escape(daURL);
	//alert(daURL);
	if(!opener){
		//alert(qs);
		document.location.href = daRoot + daLink + qs;
	}else{
		//alert(qs);
		opener.parent.location.href = daRoot + daLink + qs;
		window.close();
	}
}

function locGuestPass(clubnum,clubdist,clubname){
	var rgEx = " "
	cname = clubname.replace(rgEx,"%2520")
	cname = cname.replace(rgEx,'%2520')
	daURL = window.document.location;
	var daLink = '/scripts/rdClubLocator.asp?rd=locGuestPass'
	var qs ='&clubnum=' + clubnum + '&dist=' + clubdist + '&clubname=' + cname + '&locPage=' + escape(daURL);
	if(!opener){
		document.location= daRoot + daLink + qs;
	}else{
		opener.parent.location= daRoot + daLink + qs;
		window.close();
	}
}

//parent window goes to join online
//clubloc window closes
//link only requires first  two arguments as querystrings
function locJoinOnline(clubnum,clubdist,clubname){
	var rgEx = " "
	cname = clubname.replace(rgEx,"%2520")
	cname = cname.replace(rgEx,'%2520')
	daURL = window.document.location;
	var daLink = '/scripts/rdClubLocator.asp?rd=locJoinOnline'
	var qs ='&clubnum=' + clubnum + '&dist=' + clubdist + '&clubname=' + cname + '&locPage=' + escape(daURL);
	if(!opener){
		document.location= daRoot + daLink + qs;
	}else{
		opener.parent.location= daRoot + daLink + qs;
		window.close();
	}
}

//parent window goes to groupx schedules
//clubloc window closes
//link only requires first  two arguments as querystrings
function locGroupx(clubnum,clubdist,clubname){
	var rgEx = " "
	cname = clubname.replace(rgEx,"%2520")
	cname = cname.replace(rgEx,'%2520')
	daURL = window.document.location;
	var daLink = '/scripts/rdClubLocator.asp?rd=locGroupx'
	var qs ='&clubnum=' + clubnum + '&dist=' + clubdist + '&clubname=' + cname + '&locPage=' + escape(daURL);
	if(!opener){
		document.location= daRoot + daLink + qs;
	}else{
		opener.parent.location= daRoot + daLink + qs;
		window.close();
	}
}

/*
//parent window goes to groupx schedules
//clubloc window closes
//link only requires first  two arguments as querystrings
function locGOR(clubnum,clubdist,clubname){
	var rgEx = " "
	clubname = clubname.replace(rgEx,"%20")
	daURL = window.document.location;
	if(!opener){
		document.location='http://www.gorillasports.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
	}else{
		opener.parent.location='http://www.gorillasports.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
		window.close();
	}
}
*/

//parent window goes to groupx schedules
//clubloc window closes
//link only requires first  two arguments as querystrings
function locPIN(clubnum,clubdist,clubname){
	var rgEx = " "
	clubname = clubname.replace(rgEx,"%20")
	daURL = window.document.location;
	if(!opener){
		document.location='http://www.pinnaclefitness.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
	}else{
		opener.parent.location='http://www.pinnaclefitness.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
		window.close();
	}
}

//parent window goes to groupx schedules
//clubloc window closes
//link only requires first  two arguments as querystrings
function locSCC(clubnum,clubdist,clubname){
	var rgEx = " "
	clubname = clubname.replace(rgEx,"%20")
	daURL = window.document.location;
	if(!opener){
		document.location='http://www.sportsclubs.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
	}else{
		opener.parent.location='http://www.sportsclubs.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
		window.close();
	}
}
/*
//parent window goes to groupx schedules
//clubloc window closes
//link only requires first  two arguments as querystrings
function locCrunch(clubnum,clubdist,clubname){
	var rgEx = " "
	clubname = clubname.replace(rgEx,"%20")
	daURL = window.document.location;
	if(!opener){
		document.location='http://www.crunch.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
	}else{
		opener.parent.location='http://www.crunch.com/index.asp?&clubnum=' + clubnum + '&dist=' + clubdist + '&locPage=' + escape(daURL);
		window.close();
	}
}
*/







