function sobreImagen(imagen){
	var cadena = imagen.src.substring(0,imagen.src.lastIndexOf("."));
	imagen.src= cadena + '.gif';
}

function fueraImagen(imagen){
	var cadena = imagen.src.substring(0,imagen.src.lastIndexOf("."));
	imagen.src= cadena + '.jpg';
}

function cambiarClase(objeto,e){
	if(e.button<2){
		if(objeto.className.length<9){
	  	 objeto.className = objeto.className + "Visited";
		}
	}
}

function cambiarClase2(objeto){
	if(objeto.className.length>9){
	   objeto.className = objeto.className.substring(0,objeto.className.length - 7);
	}
}

function escribeMail2(){
	var nombre = 'mambient';
    var sitio = 'dip-alicante.es';
    document.write('<a href=\"mailto:' + nombre + '@' + sitio + '\" title=\"e-mail &Aacute;rea Medio Ambiente Diputaci&oacute;n Provincial Alicante\" alt=\"e-mail &Aacute;rea Medio Ambiente Diputaci&oacute;n Provincial Alicante\">');
    document.write(nombre + '@' + sitio + '</a>');	
}

function cambiarImagenes(objeto, modo){
	if(modo==0){
		objeto.firstChild.style.background = 'url(images/fondoImagen1.jpg)';
		objeto.lastChild.style.background = 'url(images/fondoImagen2.jpg)';
		objeto.style.background = 'url(images/fondoImagen3.jpg)';
		objeto.firstChild.nextSibling.style.borderColor = '#ddd';
	}else{
		objeto.firstChild.style.background = 'url(images/fondoImagen1.gif)';
		objeto.lastChild.style.background = 'url(images/fondoImagen2.gif)';
		objeto.style.background = 'url(images/fondoImagen3.gif)';
		objeto.firstChild.nextSibling.style.borderColor = '#eee';
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function RandomBanner(){
	n=0;
		carpeta = "../images/";
		previo = "banner";
	for (i=1;i<=12;i++) {
		if(i<10){
  			this[n++]= previo+"0"+i+".jpg";
		}else{
			this[n++]= previo+i+".jpg";
		}
		this.N=n;
	} 
	
}

function banner(){
	var Imagenes=new RandomBanner();
	src= Imagenes[ Math.floor(Math.random() * Imagenes.N) ];
	document.write("<style type='text/css'>#hero{background-image: url("+carpeta+""+src+")}</style>");
}