function AgeChecker()
{
    if (age == 0)
    {
        return false;
    }
	  
	
    if (age >= 21)
    {
         showRossi();
    
    }
    
}

function userServerAge()
{
      if((age==0)||(age> 20))
      {
            return true;
      }
      else
      {
            return false;
      }
}




function doCheck(){

      if (document.getElementById("bmonth").value < 1){
            alert("Please select your birth Month");
            document.ageCheck.bmonth.focus();
            return false;
            }
      if (document.getElementById("bday").value < 1){
            alert("Please select your birth Day");
            document.ageCheck.bday.focus();
            return false;
            }
      if (document.getElementById("byear").value < 1){
            alert("Please select your birth Year");
            document.ageCheck.byear.focus();
            return false;
            }
			
			

var birthDate=new Date(document.getElementById("byear").value, document.getElementById("bmonth").value-1, document.getElementById("bday").value);
var curDate=new Date();
var userClientAge=curDate.getFullYear()-birthDate.getFullYear();

if(curDate.getMonth() < birthDate.getMonth())
{
      userClientAge--;    
}
else if((curDate.getMonth() == birthDate.getMonth()) && (curDate.getDate() < birthDate.getDate()))
{
      userClientAge--;    
}

if(userClientAge>= 21)
{
   if(userServerAge())
   {
            if (confirm("Thanks. Your birthday is "+(birthDate.getMonth()+1)+"/"+birthDate.getDate()+"/"+birthDate.getFullYear()+", correct?"))
      {
         document.cookie= 'rossiok=1;expires="Fri, 20 Jun 2008 12:00:01 UTC";';
         showRossi();
      }
         else
         {
            return false;
         }

   }
   else
   {
       alert("Not only are you too young, but you're not the brightest. It says you must be 21 to enter.");
   }
}
else
{
        alert("Not only are you too young, but you're not the brightest. It says you must be 21 to enter.");
}

      } // doCheck

function preCheck(){
      var f_cookie= document.cookie;
      // alert(f_cookie)
      if (f_cookie.search(/rossibad/)>=0){
            window.location = "http://www.myspace.com/";
      } else if (f_cookie.search(/rossiok/)>=0){
            showRossi();
            var h_form=document.getElementById("age_check");
            h_form.innerHTML="";
      } else {
            document.ageCheck.bday.focus();
      }
      }//preCheck
function showRossi()
{
	var h_form=document.getElementById("age_check");
	var h_aboutme=document.getElementById("linkQuizContainer");
	var h_linkquiz=document.getElementById("linkQuiz");
	
	h_form.style.visibility="hidden";
	h_form.style.display="none";
	
	h_aboutme.style.visibility="visible";
	h_aboutme.style.display="block";
	
	h_linkquiz.style.visibility="visible";
	h_linkquiz.style.display="block";
	
}


