
//if (window == window.top) document.location.href="index.htm";


//Llista pel butlleti quinzenal

function comprovaEmail() {
	var ie=true;
   	var ns=false;
   	if (navigator.appName=="Netscape"){
   	  ns=true;
   	  ie=false;
    	}
    	var formulari="formButlleti";
   	if (ns){
   	 formulari="document.formButlleti";
   	}
    	email = eval(formulari+".email.value");
    	if (email.indexOf("@") < 1) {
    		alert("L´adreça de correu electrònic no és vàlida");
    		return false;
    	}
    	if (email.lastIndexOf(".") < email.indexOf("@")+2) {
    		alert("L´adreça de correu electrònic no és vàlida");
    		return false;
    	}


    	if (email.lastIndexOf(".") > (email.length-3)) {

    		alert("L´adreça de correu electrònic no és vàlida");
    		return false;
    	}
    	if (email.lastIndexOf(".") < (email.length-5)) {
    		alert("L´adreça de correu electrònic no és vàlida");
    		return false;
    	}
    	return true;
}


function FinestraButlleti()	{
    	if (comprovaEmail()){
   	 window.open("http://www.feec.org/intro_email_list.php?email=" + document.formButlleti.email.value,"","toolbar=0,status=0,menubars=0,scrollbars=0,resizable=0,location=0,directories=0,width=350, height=20");
	document.formButlleti.email.value="";
   	}
}

function esborraEmail() {
	email=document.formButlleti.email.value;
	flag=document.formButlleti.flagemail.value;
	if(flag==0){
		document.formButlleti.email.value="";
		document.formButlleti.flagemail.value=1;
	}
}


function Item(){
      this.length = Item.arguments.length
       for (var i = 0; i < this.length; i++)
        this[i] = Item.arguments[i]
}

function Fecha() {
      var ndia  = new Item('Diumenge', 'Dilluns', 'Dimarts', 'Dimecres', 'Dijous', 'Divendres', 'Dissabte')
      var nmes  = new Item('de gener', 'de febrer', 'de març', 'd&#39;abril', 'de maig', 'de juny', 'de juliol', 'd&#39;agost', 'de setembre', 'd&#39;octubre', 'de novembre', 'de desembre')
      var ahora
      var fecha = new Date()
      var ano   = fecha.getYear()
      var mes   = fecha.getMonth()
      var dia   = fecha.getDay()
      var aux   = "" + fecha
      if (ano<10) {
        ano2 = "200" + eval(ano)
      }
        else if (ano<80) {
  // ano tiene 2 dígitos 19xx (más de 80)
        ano2 = "20" + ano
      }
       else if (ano<=99) {
  // ano tiene 2 dígitos 20xx (menor de 80)
        ano2 = "19" + ano
      }
    else if (ano<1000) {
  // ano tiene 3 dígitos (100 es 2000)
        ano2 = eval(ano) + eval(1900)
      }
    else {
        ano2 = ano
   // ano tiene 4 dígitos
      }
      ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " " + nmes[mes] + " " + "de" + " " + ano2
        return ahora
}


<!-- 
function MM_reloadPage(init) {
    //reloads the window if Nav4 resized
      if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
// -->


function fonsEmail() {
     var fons= "background=\"Images/titols/feecorg.jpg\"";
     if ((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==4)) {
     fons="";
     }
     return fons;
}


// TAMANY CASELLES FORMULARI
function tamanycela(cela) {
	var ie=true;
   	var ns=false;

   	//if (navigator.appName=="Netscape"){
	if((browser.casella_curta)==true){
   	  ns=true;
   	  ie=false;
    	}

   	if (cela=="cerca"){
		var tamanycela=17;
		if (ns) {
		tamanycela=9;
		}
   	}

   	if (cela=="noticia"){
		var tamanycela=15;
		if (ns) {
		tamanycela=8;
		}
   	}

   	if (cela=="butlleti"){
		var tamanycela=12;
		if (ns) {
		tamanycela=7;
		}
   	}

   	if (cela=="envia_amic"){
		var tamanycela=50;
		if (ns) {
		tamanycela=25;
		}
   	}

   	if (cela=="usermail"){
		var tamanycela=12;
		if (ns) {
		tamanycela=7;
		}
   	}

   	if (cela=="pswdmail"){
		var tamanycela=10;
		if (ns) {
		tamanycela=6;
		}
   	}
	return tamanycela;
}

