
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 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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_changeImage3D(theImage,ind) { //v2.0
  tmp_img=document.getElementById('imagenGrande');
  tmp_img.innerHTML='<a id="link" href="" rel="lightbox"><img id="grande" src="" onMouseOver="" onMouseOut="" width="370px" height="300px"></a>';
  tmp_img_aux=document.getElementById('grande');
  tmp_img_aux.src=gallery_normal_grande[ind].src;
  tmp_img_aux.onmouseover=function() {this.src=gallery_wire_grande[ind].src;}
  tmp_img_aux.onmouseout=function() {this.src=gallery_normal_grande[ind].src;}
  tmp_img_aux2=document.getElementById('link');
  tmp_img_aux2.href=gallery_grande_grande[ind].src;
  
}

function MM_changeImage(thePath,theDir,theImage) { //v2.0
  //document.images["grande"].src=theImage;
  if(theDir=="fotografia"){
  		tmp_img=document.getElementById('imagenGrande');
  		theImageAux=theImage;
  		theImageAux2=theImage;
  			theImageAux=theImageAux.replace(".jpg","1.jpg");
  			theImageAux2=theImageAux2.replace(".jpg","");
  		objeto ='<a href="/imagenes/ampliacion/'+theDir+'/'+theImageAux2+'/'+theImageAux+'" rel="lightbox[gallery]" title="'+theImageAux2+'" ><img name="grande" src="'+thePath+'" width="370px" alt="Pinche sobre la imagen para acceder a la galeria" ></a>';
  		for(i=2;i<9;i++){
  			theImageAux=theImage;
  			theImageAux2=theImage;
  			theImageAux=theImageAux.replace(".jpg",i+".jpg");
  			theImageAux2=theImageAux2.replace(".jpg","");
  		objeto =objeto+'<a href="/imagenes/ampliacion/'+theDir+'/'+theImageAux2+'/'+theImageAux+'" rel="lightbox[gallery]" title="'+theImageAux2+'"></a>';
  		}
  		tmp_img.innerHTML=objeto;
  	}
  	else {
  		  tmp_img=document.getElementById('imagenGrande');
 		 var length_tmp=theImage.length;
		  tmp_img.innerHTML='<a href="/imagenes/ampliacion/'+theDir+'/'+theImage+'" rel="lightbox"><img name="grande" src="'+thePath+'" width="370px" ></a>';
  		}
}

function MM_changeImageWWW(theImage,theLink) { //v2.0
  //document.images["grande"].src=theImage;
  tmp_img=document.getElementById('imagenGrande');
  tmp_img.innerHTML='<a href=http://'+theLink+' target="_blank"> <img name="grande" src="'+theImage+'" width="370px"></a>';
  }

function MM_changeFlash(theFlash) { //v2.0
  	//document.embeds["flash"].LoadMovie(0, theFlash);
  	tmp_flash=document.getElementById('imagenGrande');
	//tmp_flash.innerHTML='<param name="movie" value="multimedia/preLoader.swf?content='+theFlash+'"> <embed id="flash" wmode="transparent"  src="multimedia/preLoader.swf?content='+theFlash+'" width="370px" height="300px"></embed>';
	tmp_flash.innerHTML='<embed src="/multimedia/mediaplayer.swf" width="360" height="300" allowscriptaccess="always" allowfullscreen="true" flashvars="file=/'+theFlash+'&autostart=true&backcolor=0x000000&screencolor=0x000000&shownavigation=false&width=360&height=300&bufferlength=10&repeat=true"/>';

	
}

function MM_changeFlv(theFlv) { //v2.0
  	//document.embeds["flash"].LoadMovie(0, theFlash);
  	tmp_flv=document.getElementById('imagenGrande');
	tmp_flv.innerHTML='<embed src="/multimedia/mediaplayer.swf" width="360" height="300" allowscriptaccess="always" allowfullscreen="true" flashvars="file=/'+theFlv+'&autostart=true&backcolor=0x000000&screencolor=0x000000&shownavigation=false&width=360&height=300&bufferlength=10&repeat=true"/>';
}

function MM_changeAudio(theAudio) { //v2.0
  	//document.embeds["flash"].LoadMovie(0, theFlash);
  	tmp_audio=document.getElementById('imagenGrande');
	objeto='<object type="application/x-shockwave-flash" data="imagenes/graficos_grandes/publicidad/player/player_mp3.swf" width="0" height="0">';
	objeto=objeto+'<param name="movie" value="imagenes/graficos_grandes/publicidad/player/player_mp3.swf" />';
	objeto=objeto+'<param name="FlashVars"';
	objeto=objeto+' value="mp3='+theAudio+'&amp;autoplay=1&amp;bgcolor1=ffffff&amp;bgcolor2=cccccc&amp;buttoncolor=999999&amp;buttonovercolor=0&amp;';
	objeto=objeto+'slidercolor1=cccccc&amp;slidercolor2=999999&amp;sliderovercolor=666666&amp;textcolor=0" /><p>Texte alternatif</p></object>';
	objeto=objeto+'<img name="grande" width=370px" src="imagenes/graficos_grandes/publicidad/player/publicidad_radio.jpg">';

	tmp_audio.innerHTML=objeto;
}

function MM_changeGallery(thePart) {
     var tmp=new String(window.location);
     var length_tmp=tmp.length;
     if(tmp.substring(length_tmp-6,length_tmp-3)=="gal"){
     	tmp=tmp.substring(0,length_tmp-7)+'&gal='+thePart;
     	window.location=tmp;
     }else {
     window.location=window.location+'&gal='+thePart;
     }
	}
	
function MM_mouseOver(ind){
	ind=ind+1;
	img='img'+ind;
	tmp_img=document.getElementById(img);
	tmp_img.src=gallery_over[ind-1].src;
}

function MM_mouseOut(ind){
	ind=ind+1;
	img='img'+ind;
	tmp_img=document.getElementById(img);
	tmp_img.src=gallery_normal[ind-1].src;
}

function MM_changeEvents(ind,act) {
	act_aux=act+1;
	img_aux='img'+act_aux;
	if(act>=0){
	tmp_img_aux=document.getElementById(img_aux);
	tmp_img_aux.src=gallery_normal[act].src;
	tmp_img_aux.onmouseout=function() {MM_mouseOut(act);}
	}
	ind=ind+1;
	img='img'+ind;
	act_aux=ind;
	tmp_img=document.getElementById(img);
	tmp_img.onmouseout=stopEvent;
    tmp_img.src=gallery_over[ind-1].src;
    return act_aux-1;
}

function stopEvent(e) {    if (!e) e = window.event;    if (e.stopPropagation) {        e.stopPropagation();    } else {        e.cancelBubble = true;    }}

function changeArrowUp(){
	tmp_flechas=document.getElementById("flechas");
	tmp_flechas.src="imagenes/flechas_texto_up.jpg";
}

function changeArrowDown(){
	tmp_flechas=document.getElementById("flechas");
	tmp_flechas.src="imagenes/flechas_texto_down.jpg";
}

function restoreArrow(){
	tmp_flechas=document.getElementById("flechas");
	tmp_flechas.src="imagenes/flechas_texto.jpg";
}

function scrollUp(){
		tmp_div=document.getElementById("texto");	
		tmp_div.scrollTop =  tmp_div.scrollTop-5;
}
function scrollDown(){
		tmp_div=document.getElementById("texto");
		tmp_div.scrollTop = tmp_div.scrollTop+5;
}