// JavaScript Document
// funciones que muestran y ocultan la capa de idioma
function mostrar(){
	if(document.getElementById) {
	document.getElementById('idioma').style.visibility='visible';
	}
	else{
		window.location.href="index.html";
	}
}

function ocultar(){
	if(document.getElementById) {
	document.getElementById('idioma').style.visibility='hidden';
	}
	else{
		window.location.href="index.html";
	}
}

//función que dibuja la tabla de los menús dependiendo del navegador del usuario
function dibuja(url){
		  if (navigator.appName == 'Microsoft Internet Explorer') {
		    document.write("<table border='0' align='left' cellpadding='0' cellspacing='0' height='158' background='"+url+"imgs/fondo_tabla_menu1.gif'>");
		  }
		  else{
		    document.write("<table border='0' align='left' cellpadding='0' cellspacing='0' height='168' background='"+url+"imgs/fondo_tabla_menu2.gif'>");
		  }
}

// función que dibuja la capa que contiene el input para el banner de diccionarios
function dibujaInput(){
		 if (navigator.appName == 'Microsoft Internet Explorer') {
		       document.write("<div id='cuadro_texto' style='position:absolute; left:773px; top:480px; width:0px; height:25px; z-index:3; visibility: visible;'><input type='text' class='diccionario' value='fadsfasd'></div>");
		  }
		  else{
		       document.write("<div id='cuadro_texto' style='position:absolute; left:773px; top:593px; width:0px; height:25px; z-index:3; visibility: visible;'><input type='text' class='diccionario_ns' value='fadsfasd'></div>");		
	      }
}

// función que abre las popups de la aplicación
function ventana(pagina, ancho, largo){
href=window.open(pagina,"Ventana_Popup", "toolbar=no,directories=no,menubar=no,scrollbars=yes,location=no,width="+ancho+",height="+largo+",top=100,left=240");
}

//funciones que cambian las pestañas de producto_activo.html y los iframes de la misma pág
function cambio_pestanha(pestanha_ON, pestanha, pestanha_ON1, pestanha1, pestanha_ON2, pestanha2, pestanha_ON3, pestanha3,actividad){
	if(document.getElementById) 
	{
		if (actividad==0&&pestanha!='mat_act'||actividad==1)
		{
		document.getElementById(pestanha_ON).style.display='none';
		document.getElementById(pestanha).style.display='';
		}
		if (actividad==0&&pestanha1!='mat_act'||actividad==1)
		{
		document.getElementById(pestanha_ON1).style.display='none';
		document.getElementById(pestanha1).style.display='';
		}
		if (actividad==0&&pestanha2!='mat_act'||actividad==1)
		{
		document.getElementById(pestanha_ON2).style.display='none';
		document.getElementById(pestanha2).style.display='';					
		}
		if (actividad==0&&pestanha3!='mat_act'||actividad==1)
		{
		document.getElementById(pestanha_ON3).style.display='none';
		document.getElementById(pestanha3).style.display='';
		}
	}
	else
	{
		document.all['pestanha_ON'].style.display='none';
		document.all['pestanha'].style.display='';
		document.all['pestanha_ON1'].style.display='none';
		document.all['pestanha1'].style.display='';
		document.all['pestanha_ON2'].style.display='none';
		document.all['pestanha2'].style.display='';					
		document.all['pestanha_ON3'].style.display='none';
		document.all['pestanha3'].style.display='';		
	}
}

function llamada_ifreim(ifreim){
	parent.ifr.location.href=ifreim;
	var div = document.getElementById('detalle_metodo');
	div.style.visibility="hidden";	
	div.style.display="none";
}

//funciones que hace el rollover de los menús de la izquierda
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_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_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];}
}

//función que inhabilita un select en recursos_bienvenida.html antes de que el primero esté seleccionado
function seleccion(){
	document.formulario.metodo.disabled=false;
}
