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

    if (age < 18)
    {
        alert ('Tienes que tener mas de 18 años para ver este sitio. Ahora vas a ser dirigido a MySpace.com.');
        window.location = "http://www.myspace.com";    
    }
    if (age >= 18)
    {
         showRossi();
         //startRandomVideoId();
         //return false;
    }
    
}

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

function doCheck(){

      if (document.getElementById("bmonth").value < 1){
            alert("por favor, seleciona tu mes de nacimiento");
            document.rossiChk.bmonth.focus();
            return false;
            }
      if (document.getElementById("bday").value < 1){
            alert("por favor, seleciona tu dia de nacimiento");
            document.rossiChk.bday.focus();
            return false;
            }
      if (document.getElementById("byear").value < 1){
            alert("Por favor, seleciona tu año de nacimiento");
            document.rossiChk.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>= 18)
{
   if(userServerAge())
   {
            if (confirm("Gracias. Tu fecha de nacimiento es "+(birthDate.getMonth()+1)+"/"+birthDate.getDate()+"/"+birthDate.getFullYear()+", cierto?"))
      {
         document.cookie= 'rossiok=1;expires="Fri, 20 Jun 2008 12:00:01 UTC";';
         showRossi();
         //startRandomVideoId();
      }
         else
         {
            return false;
         }

   }
   else
   {
	   alert('Tienes que tener mas de 18 años para ver este sitio.       Ahora vas a ser dirigido a MySpace.com.');

        window.location = "http://www.myspace.com/";
   }
}
else
{
		alert('Tienes que tener mas de 18 años para ver este sitio.       Ahora vas a ser dirigido a MySpace.com.');

        window.location = "http://www.myspace.com/";
}

      } // 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.rossiChk.bday.focus();
      }
      }//preCheck
function showRossi(){

        var h_profile_topnav=document.getElementById("topnav");     

        var h_profile_footer=document.getElementById("footer");

        if(!h_profile_footer)

        h_profile_footer=document.getElementById("footerWarpper");

if(h_profile_footer){

        h_profile_footer.style.visibility="visible";

        h_profile_footer.style.display="block";

        var h_form=document.getElementById("age_check");

        var h_aboutme=document.getElementById("rossprofile");

        var h_profile_friends=document.getElementById("profileBottom");

        var h_profile_blog=document.getElementById("blogContainer");   

      h_profile_topnav.style.visibility="visible";

          h_profile_topnav.style.display="block"; 

      h_profile_footer.style.visibility="visible";

      h_profile_footer.style.display="block";

      h_form.style.visibility="hidden";

      h_form.style.display="none";  

      h_aboutme.style.visibility="visible";

      h_aboutme.style.display="block";    

      h_profile_friends.style.visibility="visible";

      h_profile_friends.style.display="block";  

      h_profile_blog.style.visibility="visible";

      h_profile_blog.style.display="block";  

      }//showRossi

}


