function getRefresh()
{
	return refresh++;
}

function ScoreCard()
{
	window.location = "scoreCardSport.aspx";
}

function Leaderboard()
{
	window.location = "Leaderboard.aspx";
}

function GroupPlay()
{
	window.location = "MyGroups.aspx";
}

function Prizes()
{
	window.location = "PrizeMain.aspx";
}

function SportPrizes(sportID)
{
	window.location = "PrizeSport.aspx?SportID=" + sportID;
}

function gotoPrize(sportID)
{
	window.location = "PrizeSport.aspx?SportID=" + sportID;
}

function userLogin()
{
	window.location = "userLogin.aspx?bringToFront=true&refresh=" + getRefresh();
	//window.open("popups/userLogin.aspx?bringToFront=true&refresh=" + getRefresh(), "UserLoginWindow", "width=220,height=" + popupHeight + ",directories=0,menubar=0,status=0,location=0,scrollbars=1,resizable=0");
}


function getFlash()
{
	window.open("popups/getFlash.cfm?bringToFront=true&refresh=" + getRefresh(), "GetFlashWindow", "width=260,height=" + popupHeight + ",toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=1,resizable=0");
}

function userLogout()
{
	window.location = "logout.aspx";
}



function editUser( userID )
{
	var editURL = "EditUser.aspx?bringToFront=true&refresh=" + getRefresh();
	if( userID > 0 )
	{
		editURL += "&action=edit&userID=" + userID;
	}
	else
	{
		editURL += "&action=new";
	}
	window.location = editURL;
	//window.open(editURL, "EditUserWindow", "width=300,height=" + popupHeight + ",toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=1,resizable=0");
}


function editGroup(groupID)
{	  
	
	var groupURL ="Popups/EditGroup.aspx?GroupID=" + groupID;
	window.location = groupURL;
	window.open(groupURL, "EditGroupWindow", "width=300,height=" + popupHeight + ",toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=1,resizable=1");
}

function joinGroup(groupID){
	var groupURL ="Popups/JoinGroup.aspx?GroupID=" + groupID;
	window.location = groupURL;
	window.open(groupURL, "JoinGroupWindow", "width=300,height=" + popupHeight + ",toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=1,resizable=1");

}

function launchAboutUs( primary )
{
	window.location = "aboutUs.aspx?bringToFront=true&gotoAnchor=" + primary + "&refresh=" + getRefresh();
}

function getAcrobat() {
	window.open("popups/getAcrobat.cfm?bringToFront=true&refresh=" + getRefresh(), "AboutUsWindow", "width=400,height=400,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=1,resizable=1");
}


function launchRules()
{
	window.location = "popups/rules.aspx?bringToFront=true&refresh=" + getRefresh()
}

function launchFAQ( primary, secondary )
{
	window.location = "help.aspx";
}


function gotoBallot( sportID )
{
	if(IsPrep(sportID))
	{
		gotoMainLocation( "PrepSportMain.aspx?sportID=" + sportID + "&refresh=" + getRefresh() );
	}
	else 
	{
		gotoMainLocation( "PlayBallot.aspx?sportID=" + sportID + "&refresh=" + getRefresh() );
	
	}
}
function IsPrep(SportID)
{
	prepSportArray = prepSport.split(',');
	for(var i  = 0; i < prepSportArray.length; i++)
	{	
		if(SportID == prepSportArray[i])
		{
			return true;
		}
	}
	return false;
}

function gotoMainLocation( strURL )
{
	window.location = strURL;
}

function gotoHomePage()
{	
	if(appRoot  == '')
	{
		window.location = '/';
	}
	else
	{
		window.location = appRoot;
	}
}



function ReferAFriend()
{
	window.location = "ReferAFriend.aspx";
}
	
function notLoggedIn()
{
	alert("You must be logged in to access this feature.");
	return false;

}

	
