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 trim (s) {
	s = s.replace(/\s+/gi, ' '); //sacar espacios repetidos dejando solo uno
	s = s.replace(/^\s+|\s+$/gi, ''); //sacar espacios blanco principio y final
	return s;
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if (trim(val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- <'+nm+'> debe ser un e-mail\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- <'+nm+'> debe ser un número\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- <'+nm+'> debe ser un numero entre '+min+' y '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- debe completar <'+nm+'>\n'; }
    } if (errors) alert('Error:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
function mostrar(nombreCapa) {
	document.getElementById(nombreCapa).style.display="";
}
function ocultar(nombreCapa) {
	document.getElementById(nombreCapa).style.display="none";
}
function vLink (n) {
	doc = document.getElementById(n);
	if (doc.options[doc.selectedIndex].value != 7) ocultar('link');
	else mostrar('link');
}
function vAni(n) {
	doc = document.getElementById(n);
	switch (doc.options[doc.selectedIndex].value) {
		case '1': mostrar('imagenes'); ocultar('animacion'); break;
		case '2': ocultar('imagenes'); mostrar('animacion'); ocultar('mas'); ocultar('h'); ocultar('h2'); ocultar('h3'); break;
		case '3': mostrar('imagenes'); mostrar('animacion'); mostrar('mas'); mostrar('h'); mostrar('h2'); mostrar('h3'); break;
	}
}
function vAni2(n) {
	switch (n) {
		case '1': mostrar('imagenes'); ocultar('animacion'); break;
		case '2': ocultar('imagenes'); mostrar('animacion'); ocultar('mas'); ocultar('h'); ocultar('h2'); ocultar('h3'); break;
		case '3': mostrar('imagenes'); mostrar('animacion'); mostrar('mas'); mostrar('h'); mostrar('h2'); mostrar('h3'); break;
	}
}
function izqDer (s1, s2, max) {
	sel1 = document.getElementById(s1);
	sel2 = document.getElementById(s2);
	if (sel1.selectedIndex >= 0) {
		t = sel1.options[sel1.selectedIndex].text;
		v = sel1.options[sel1.selectedIndex].value;
		if (sel2.length < max) {
			sel1.options[sel1.selectedIndex] = null;
			sel2.options[sel2.length] = new Option(t,v);
		}
	}
}
function derIzq (s1, s2) {
	sel1 = document.getElementById(s1);
	sel2 = document.getElementById(s2);
	if (sel2.selectedIndex >= 0) {
		t = sel2.options[sel2.selectedIndex].text;
		v = sel2.options[sel2.selectedIndex].value;
		sel2.options[sel2.selectedIndex] = null;
		sel1.options[sel1.length] = new Option(t,v);
	}
}
function arriba (s) {
	sel = document.getElementById(s);
	si = sel.selectedIndex;
	if(si != 0) {
		tv = sel.options[si-1].text;
		vv = sel.options[si-1].value;
		tn = sel.options[si].text;
		vn = sel.options[si].value;
		sel.options[si].text = tv;
		sel.options[si].value = vv;
		sel.options[si-1].text = tn;
		sel.options[si-1].value = vn;
		selectNada(s);
		sel.options[si-1].selected = true;
	}
}
function abajo (s) {
	sel = document.getElementById(s);
	si = sel.selectedIndex;
	if(si+1 != sel.length) {
		tv = sel.options[si+1].text;
		vv = sel.options[si+1].value;
		tn = sel.options[si].text;
		vn = sel.options[si].value;
		sel.options[si].text = tv;
		sel.options[si].value = vv;
		sel.options[si+1].text = tn;
		sel.options[si+1].value = vn;
		selectNada(s);
		sel.options[si+1].selected = true;
	}
}
function selectTodo(s) {
	sel = document.getElementById(s);
	for (i=0;i<sel.length;i++) sel.options[i].selected = true;
}
function selectNada(s) {
	sel = document.getElementById(s);
	for (i=0;i<sel.length;i++) sel.options[i].selected = false;
}
function borraForm() {
	n = document.forms[0].elements.length;
	for (i=0;i<n;i++) document.forms[0].elements[i].value = "";
}
function ani (a, p, t, c, d) {
	var f = document.formswf;
	mostrar('gris');
	swfobject.embedSWF(a, 'swf', '600', '450', '8.0.0');
	f.swfp.value = p;
	f.swft.value = t;
	f.swfc.value = c;
	f.swfd.value = d;
	document.getElementById('containermh').style.overflowY = 'hidden';
}
function cerrarAni() {
	ocultar('gris');
	document.getElementById('containermh').style.overflowY = 'auto';
	document.getElementById('containermh').style.overflowX = 'hidden';
}
function resetFiltros() {
	args = resetFiltros.arguments;
	for(i=0;i<args.length;i++) document.getElementById(args[i]).options[0].selected = true;
}
function preview(ncli, ndv, cli, dv) {
	document.getElementById(ncli).innerHTML = document.getElementById(cli).options[document.getElementById(cli).selectedIndex].text;
	document.getElementById(ndv).innerHTML = document.getElementById(dv).value;
}




function showMenu(divName) {
	if (document.getElementById) {
		document.getElementById(divName).style.display = 'block';
	}
}

function hideMenu(divName) {
	if (document.getElementById) {
		document.getElementById(divName).style.display = 'none';
	}
}


            function ocultarTodo()    { 
                indicadores = document.getElementById("menu22").getElementsByTagName("div"); 
                for (var i = 0; i < indicadores.length; i ++) 
                    indicadores[i].style.display = "none"; 

            } 