// This function is used in all protected page to check if the users age is OK
function CheckAgeValid(AgeGatePage, destURL, SorryPage, NoCookiePage)
{
		// return -1 : The use age is unknown and we need one to access the site
		// return 0 : The user is under age or an error occured
		// return 2 : The user browser refuse cookie
		switch(isAgeOK())
		{
			case -1 : location.href = AgeGatePage + "?destURL=" + destURL;
								break;
			case 0 :  location.href = SorryPage;
							  break;
			case 2 :  location.href = NoCookiePage;
								break;
		}
}


// This page is used only in the Get Birthday Page
function CheckAgeGateOK(IndexPage, SorryPage, NoCookiePage)
{
		// return 0 : The user is under age or an error occured
		// return 1 : The user has the right to see the page or there is no AgeGate
		// return 2 : The user browser refuse cookie
		switch(isAgeOK())
		{
			case 0 : location.href = SorryPage;
							 break;
			case 1 : location.href = IndexPage;
							 break;
			case 2 : location.href = NoCookiePage;
							 break;
		}
}
