    <!-- Begin
    function myage(dd,mm,yy) {
      days = new Date();
      gdate = days.getDate();
      gmonth = days.getMonth();
      gyear = days.getYear();
    
      if (gyear < 2000) gyear += 1900;
        age = gyear - yy;
      
      if ((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
        age = age;
      } else {
        if (mm <= (gmonth)) {
          age = age;
        } else {
          age = age - 1;
        }
      }
     
      if (age == 0)
        age = age;
      
      return age;
    }


    function PageQuery(q) {
      if(q.length > 1) this.q = q.substring(1, q.length);
      else this.q = null;
      this.keyValuePairs = new Array();
      if(q) {
        for(var i=0; i < this.q.split("&").length; i++) {
          this.keyValuePairs[i] = this.q.split("&")[i];
        }
     }
    
     this.getKeyValuePairs = function() { return this.keyValuePairs; }

     this.getValue = function(s) {
        for(var j=0; j < this.keyValuePairs.length; j++) {
          if(this.keyValuePairs[j].split("=")[0] == s)
          return this.keyValuePairs[j].split("=")[1];
        }
        return false;
      }
      
      this.getParameters = function() {
        var a = new Array(this.getLength());
        for(var j=0; j < this.keyValuePairs.length; j++) {
          a[j] = this.keyValuePairs[j].split("=")[0];
        }
        return a;
      }
      this.getLength = function() { return this.keyValuePairs.length; }
    }
    
    function queryString(key){
      var page = new PageQuery(window.location.search);
      if(page.getValue(key))
        return unescape(page.getValue(key));
      else
        return '';
    }
    
	function check_lda(lang){
	    err = '';
		//alert(lang);
		//return false;
	    myForm = document.forms['lda'];
	    lda_day = myForm[lang+'_lda_day'].options[myForm[lang+'_lda_day'].selectedIndex].value;
	    lda_month = myForm[lang+'_lda_month'].options[myForm[lang+'_lda_month'].selectedIndex].value;
	    lda_year = myForm[lang+'_lda_year'].options[myForm[lang+'_lda_year'].selectedIndex].value;
	    lda_prov = myForm[lang+'_lda_prov'].options[myForm[lang+'_lda_prov'].selectedIndex].value;
	    lda_age = myage(lda_day,lda_month,lda_year);
		
		var cDate = new Date ();        		
		cDate.setTime (cDate.getTime() + (1000 * 10 * 60));
		expDate = cDate.toGMTString();

	    // Validate form fields
	    if(lda_day==0)
	      err = err + "  - day\n";
	    if(lda_month==0)
	      err = err + "  - month\n";
	    if(lda_year==0)
	      err = err + "  - year\n";
	    if(lda_prov==0)
	      err = err + "  - province\n";
	    if(err != ''){
	      alert('Please make sure the following fields are filled in:\n\n'+err);
	    }else{  // else proceed with the age check
	      // Alberta, Manitoba and Quebec, lda = 18
	      // all others, lda = 19
	      if(lda_prov == 'AB' || lda_prov == 'MB' || lda_prov == 'QC'){
	        if(lda_age >= 18){
	          //alert("You are over 18\nprov:"+lda_prov+"\nage:"+lda_age)
	          //document.cookie = 'rev_lda=true; expires='+expDate+'; path=/';
			document.cookie = 'rev_lda=true; path=/';	
				if(queryString('target') ==""){
					//alert('no target:/'+lang + '/rev/home')
					//top.location.replace('/'+lang + '/rev/home' );
					document.cookie = 'rev_lda=true; path=/';
			 		 if(document.getElementById('en_lda_leng').value == 2){
						top.location.replace('http://www.misezdelicieux.ca/home.php' );
					}else{
						top.location.replace('/home.php' );
						
					}
				}else{
					//alert('target:/'+queryString('target') );
					//top.location.replace('/'+queryString('target') );
					document.cookie = 'rev_lda=true; path=/';
			  		if(document.getElementById('en_lda_leng').value == 2){
						top.location.replace('http://www.misezdelicieux.ca/home.php' );
					}else{
						//esto lo modifiqé yo, lo tiro a Francés
						top.location.replace('/home.php' );
						
					}
				}
				
				
	          
	        }else{
	          //alert("you must be over 18\nprov:"+lda_prov+"\nage:"+lda_age)
	          top.location.replace('http://www.centurycouncil.org');
	        }
	      } else {
	        if(lda_age >= 19){
	          //alert("You are over 19\nprov:"+lda_prov+"\nage:"+lda_age)
	          //document.cookie = 'rev_lda=true; expires='+expDate+'; path=/';
			  document.cookie = 'rev_lda=true; path=/';
			  if(document.getElementById('en_lda_leng').value == 2){
						top.location.replace('http://www.misezdelicieux.ca/home.php' );
					}else{
						top.location.replace('/home.php' );
						
					}
	        } else {
	          //alert("you must be over 19\nprov:"+lda_prov+"\nage:"+lda_age)
	          top.location.replace('http://www.centurycouncil.org');
	        }
	      }
	    }
	    return false;
	  }
//  End -->

