function idioma(codigo) {
location.href = '../' + codigo + location.href.substring(location.href.lastIndexOf('/'), location.href.length);
}

function muestra_id(id) {
	window.status=id;
	return true
}

function oculta_id() {
	window.status='';
	return true
}

//window.onload="stripe('tabla_resultados', '#FCFCFA', '#F7F4E1');"

  // this function is need to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#eee";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

	    // avoid rows that have a class attribute
        // or backgroundColor style
	    if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
 
         // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
	        if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
        
		      mytd.style.backgroundColor = even ? evenColor : oddColor;
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }


function toggleLayer(whichLayer)
{
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"none";
}


function abrir(imagen,titulo)
{
//	var ventana = window.open(imagen,'','width=780, height=580, left=32, top=32, statusbar=no, resizable=yes, scrollbars=yes');	
	var ventana = window.open(imagen,'','statusbar=no, resizable=yes, scrollbars=yes');	
	var msg= "<HTML>";
	msg += "<HEAD><TITLE>"+ titulo +"</TITLE></HEAD>";
	msg += "<BODY>";
	msg += '<img border="0" src="images/capturas/' + imagen +'">';
	msg += "</BODY>";
	msg += "</HTML>";
	ventana.document.write(msg);
}

function abrir_swf(swf)
{
	var source=swf;
	window.open(source, 'memorias', 'width=1024, height=768, left=8, top=8, statusbar=no, resizable=yes, scrollbars=yes');
}

function abrir_2k(imagen,titulo)
{
//	var ventana = window.open(imagen,'','width=620, height=440, left=32, top=32, statusbar=no, resizable=yes, scrollbars=yes');	
	var ventana = window.open(imagen,'','resizable=yes, scrollbars=yes');	
	var msg= '<HTML><HEAD><TITLE>';
	msg += titulo;
	msg += '</TITLE></HEAD><BODY topmargin="0" leftmargin="0" bgcolor="#336699"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%"><tr><td width="100%" valign="middle"><p align="center">';
	msg += '<img border="0" src="images/';
	msg += imagen;
	msg += '" width="800" height="560"></td></tr></table></center></div></BODY></HTML>';
	ventana.document.write(msg);
}


// Universal transparent-PNG enabler for MSIE/Win 5.5+
// http://dsandler.org
// From original code: http://www.youngpup.net/?request=/snippets/sleight.xml
// and background-image code: http://www.allinthehead.com/retro/69
// also:
//  * use sizingMethod=crop to avoid scaling PNGs (who would do such a thing?)
//  * only do this once, to make it compatible with CSS rollovers

//if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
//	window.attachEvent("onload", enableAlphaImages);
//}

function enableAlphaImages(){
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	if (itsAllGood) {
		for (var i=0; i<document.all.length; i++){
			var obj = document.all[i];
			var bg = obj.currentStyle.backgroundImage;
			var img = document.images[i];
			if (bg && bg.match(/\.png/i) != null) {
				var img = bg.substring(5,bg.length-2);
				var offset = obj.style["background-position"];
				obj.style.filter =
				"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
				obj.style.backgroundImage = "url('images/spacer.gif')";
				obj.style["background-position"] = offset; // reapply
			} else if (img && img.src.match(/\.png$/i) != null) {
				var src = img.src;
				img.style.width = img.width + "px";
				img.style.height = img.height + "px";
				img.style.filter =
				"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='crop')"
				img.src = "images/spacer.gif";
			}
		}
	}
}


function expandir_menu(indices)
{
	var indice = indices.split(",");
	for(i = 0; i < indice.length; i++){
		toggleLayer('m_' + indice[i]);
	}
}