e='in'+'form'+'aci'+'on@c'+'ampi'+'nasde'+'jaen'+'.es';

function enviarya(f) {
  f.toEmail.value=e;
  f.submit();
}

function enviarsorteo(f) {
  f.toEmail.value='sorteo@c'+'ampi'+'nasde'+'jaen'+'.es';
  f.submit();
}
top.enviarsorteo = enviarsorteo;

////////////////////// TITULOS ///////////////////////
function capital() {
  var tag = contenido.document.getElementsByTagName("h4");
  for (i=0;i<tag.length;i++) {
    var titulo = tag[i].innerHTML;
    titulolimpio = titulo.replace(/(\n\s*)|(^\s*)|(¿\s*)|(&iquest;\s*)/g,'');
    var letra = titulolimpio.charAt(0);
    var l = letra.toLowerCase();
    tag[i].style.backgroundImage='url(/img/letra/'+l+'.gif)';
  }
}


////////////////////// MENU ///////////////////////


// muestra un class ON en el menú de la sección elegida
function estadoinicial(seccion) {
  var cuantosId=new Array('aceite','agricultor','consejo','contacto','empresas','enlaces','intranet','marcas','noticias');
  for (i=0;i<cuantosId.length;i++) {
    document.getElementById(cuantosId[i]).className='menu-off';
  }
  document.getElementById(seccion).className='menu-on';
}


////////////////////// MARCOS ///////////////////////

// fuerza la incrustación del marco en la página principal
function indice() {
  if (top.location.search!='') {
    var i=location.search.split('pag=')[1];
    if (i) {
      top.contenido.location.replace(i);
    }
  }
  else {
    top.contenido.location='/es/consejo.html';
  }
}


////////////////////// RECORTES DE PRENSA ///////////////////////
function foto(c,w,h,f) {
  w=w+25;
  l=(screen.width)?(screen.width-w)/2:0;
  if (h>screen.height) {
    h=screen.availHeight;
    t=0;
  }
  else if (f) {
    h=h+60;
    t=(screen.height)?(screen.height-h)/2-30:0;
  }
  else {
    h=h+10;
    t=(screen.height)?(screen.height-h)/2-30:0;
  }
  x=window.open('','zoom','height='+h+',width='+w+',top='+t+',left='+l+',toolbar=0,location=0,directories=0,status=0,scrollbars=1,menubar=0');
  x.document.open();
  x.document.write('<html><head><title>Campi&ntilde;as de Ja&eacute;n</title>');
  x.document.write('<link href="/css/general.css" rel="stylesheet" type="text/css"/></head>');
  x.document.write('<body onload="this.focus()" style="overflow:auto;background-color:#ffffff">');
  x.document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellpadding="0"><tr><td align="center">');
  x.document.write('<a href="javascript:window.close()"><img src="/img/'+c+'" border="0"/></a></td></tr>');
  if (f) x.document.write('<tr><td class="piefoto">'+f+'</td></tr>');
  x.document.write('</table></body></html>');
  x.document.close();
}



/* /////////////////////// FICHAS EMPRESAS ///////////////////////////
 function cerrarficha() {
  document.getElementById('ficha').style.display='none';
  document.getElementById('ficha-fondo').style.display='none';
}
function abrirficha(cual) {
  var e=document.getElementsByTagName("span");
  for(var i=0;i<e.length;i++){
    e[i].style.display='none';
  }
  document.getElementById('ficha').style.display='';
  document.getElementById('ficha-fondo').style.display='';
  var fichaempresa=cual.options[cual.selectedIndex].value;
  document.getElementById(fichaempresa).style.display='';
} */
