
/*

Listado de funciones:

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)

// funciones para manipular cadenas
function TrimLeft( str )	// quita los espacios a la izquierda de la cadena
function TrimRight( str )	// quita los espacios a la derecha de la cadena
function Trim( str )		// quita los espacios a la izquierda y la derecha de la cadena
function Contiene(texto, cadena) // indica si la cadena contiene algun caracter


// funciones standard de mmacromedia
// para cambiar una imagen por otra al pasar el mouse y al salir el mouse de la imagen, 
// que se regrese a la original
function MM_swapImgRestore() 	//v3.0
function MM_preloadImages()		//v3.0
function MM_findObj(n, d)		//v4.01
function MM_swapImage()			//v3.0



// funciones para dimenciones de ventana
// funciones pedidas por el sunco 19/07/2007
function FF()			// Ver si el navegador es Firefox o no
function ScrollX()		// Ver cuanto avance tiene el Scroll (sirve para cuando quieres posicionar algo y quieres saber cuanto esta movida la ventana)
function ScrollY() 		// Ver cuanto avance tiene el Scroll (sirve para cuando quieres posicionar algo y quieres saber cuanto esta movida la ventana)
function AnchoVentana() // Ver cuanto mide el Ancho dentro de la ventana
function AltoVentana()	// Ver cuanto mide el Alto dentro de la ventana

// Centrar Popups (del tipo window.open)
function CentrarAlto(valor)
function CentrarAncho(valor) 



// funciones de editores
function mostrar_editor(tipo_editor,id_contenido)			// muestra el editor de contenido HTML
function mostrar_editor_publicaciones(key_seccion,accion,id)// muestra el editor de publicaciones
function mostrar_contactanos(para)							// muestra el contactanos para enviar mails
function mostrar_seleccionar(catalogo)						// muestra un catalogo para seleccionar un registro
function mostrar_audio(id_audio)							// muestra un audio
function mostrar_video(id_video)							// muestra un video
function SondeosAnteriores()								// muestra los sondeos anteriores


// funciones ajax de espera
mostrar_espera()
ocultar_espera()



*/







// Java Document
/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
 

// 2-juil-2010 -mf
function VentanaEmergente(url,ancho,alto){
	window.open( url, 'chat', 'width='+ancho+', height='+alto+', left=' + CentrarAncho(ancho) + ', top=' + CentrarAlto(alto) + ', status=no, toolbar=no, menubar=no, resizable=no');
}

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function




function TrimLeft( str ) {
	var resultStr = "";
	var i = len = 0;
	if (str+"" == "undefined" || str == null)	
		return null;
	str += "";

	if (str.length == 0) 
		resultStr = "";
	else {	
		len = str.length;
  		while ((i <= len) && (str.charAt(i) == " "))
			i++;
  		resultStr = str.substring(i, len);
  	}
  	return resultStr;
 }


function TrimRight( str ) {
	var resultStr = "";
	var i = 0;
	if (str+"" == "undefined" || str == null)	
		return null;
	str += "";
	if (str.length == 0) 
		resultStr = "";
	else {
  		i = str.length - 1;
  		while ((i >= 0) && (str.charAt(i) == " "))
 			i--;
  		resultStr = str.substring(0, i + 1);
  	}
  	return resultStr;  	
}

function Trim( str ) {
	var resultStr = "";
	
	resultStr = TrimLeft(str);
	resultStr = TrimRight(resultStr);
	
	return resultStr;
}
  
function Contiene(texto, cadena) {
	var Temp = cadena;
	
	if (Temp.indexOf(texto) != "-1") {
		return true;
	} else {
		return false;
	}
}  
  
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];}
}





// Ver si el navegador es Firefox o no
// Uso : if (FF()) { ...
function FF() {
	if (typeof window.pageXOffset != 'undefined') {
		return true;
	} else {
		return false;
	}
}

// Ver cuanto avance tiene el Scroll (sirve para cuando quieres posicionar algo y quieres saber cuanto esta movida la ventana)
// Uso : alert(ScrollX());
function ScrollX() {
	if (typeof window.pageXOffset != 'undefined') {
		if (window.pageXOffset != 0) { 
			return window.pageXOffset + 9;
		} else {
			return window.pageXOffset;
		}
	} else {
		if (document.documentElement.scrollLeft != 0) {
			return document.documentElement.scrollLeft + 10;
		} else {
			return document.documentElement.scrollLeft;
		}
	}
}

// Ver cuanto avance tiene el Scroll (sirve para cuando quieres posicionar algo y quieres saber cuanto esta movida la ventana)
// Uso : alert(ScrollY());
function ScrollY() {
	if (typeof window.pageYOffset != 'undefined') {
	  return window.pageYOffset - 17;
	} else {
	  return document.documentElement.scrollTop;
	}
}
 
// Ver cuanto mide el Ancho dentro de la ventana
// Sirve para por ejemplo ver si el navegador lo hisieron mas pequeño y asi ajustar ciertas cosas como DIV's
function AnchoVentana() {
	if (FF()) {
		return window.innerWidth;
	}
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		return document.documentElement.clientWidth;
	}
	else {
		return document.getElementsByTagName('body')[0].clientWidth;
	}
}
 
// Ver cuanto mide el Alto dentro de la ventana
// Sirve para por ejemplo ver si el navegador lo hisieron mas pequeño y asi ajustar ciertas cosas como DIV's
function AltoVentana() {
	if (FF()) {
		return window.innerHeight;
		//return window.innerHeight + window.scrollMaxY;
	}
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		return document.documentElement.clientHeight;
		//return document.documentElement.scrollHeight
	}
	else {
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

function AltoVentanaSuscripciones() {
	if (FF()) {
		if (window.scrollMaxY) {
			// ff
			return window.innerHeight + window.scrollMaxY;
		} else {
			// chrome
			return window.innerHeight + window.scrollY;
		}
	}
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		return document.documentElement.scrollHeight
	}
	else {
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

// Centrar Popups (del tipo window.open)
function CentrarAlto(valor)
{
	Medida = ((screen.height / 2) - (valor / 2));
	return Medida - 30;
}
function CentrarAncho(valor) 
{
	Medida = ((screen.width / 2) - (valor / 2));
	return Medida - 10;
}


// muestra el editor de contenido HTML
function mostrar_editor(tipo_editor,id_contenido)
{
	switch( tipo_editor )
	{
	case 1:
		window.open('admin_contenidos.php?id_contenido='+id_contenido+'','editor_contenidos','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=yes, left=' + CentrarAncho(640) + ' top=' + CentrarAlto(480));
		break;
	}
}

// muestra el editor de publicaciones
function mostrar_editor_publicaciones(tipo,accion,id,seccion,publicacion) 
{
	switch( tipo )
	{
	case 1:
		window.open('admin_publicaciones.php?accion='+accion+'&id='+id+'&id_seccion='+seccion,'editor_publicaciones','width=820, height=600, status=no, toolbar=no ,menubar=no, resizable=no, scrollbars=yes, left=' + CentrarAncho(820) + ', top=' + CentrarAlto(600));
		break;
	case 11:
		window.open('admin_publicaciones_defensor.php?accion='+accion+'&id='+id+'','editor_publicaciones_defensor','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
		break;
	case 12:
		window.open('admin_publicaciones_videos.php?accion='+accion+'&id='+id+'&id_seccion='+seccion+'&publicacion='+publicacion,'editor_publicaciones_videos','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
		break;
	case 13:
		window.open('admin_publicaciones_audios.php?accion='+accion+'&id='+id+'&id_seccion='+seccion+'&publicacion='+publicacion,'editor_publicaciones_audios','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
		break;
	case 14:
		window.open('admin_publicaciones_fotos.php?accion='+accion+'&id='+id+'&id_seccion='+seccion+'&publicacion='+publicacion,'editor_publicaciones_fotos','width=660, height=480, status=no, toolbar=no ,menubar=no, resizable=no, scrollbars=yes, left=' + CentrarAncho(660) + ', top=' + CentrarAlto(480));
		break;
	}
}

// muestra el contactanos para enviar mails
function mostrar_contactanos(para)
{
	window.open('contactanos.php?para='+para,'mail','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
}

// mostrar el editor de comentarios
function mostrar_comentarios(publicacion)
{
	window.open('comentarios.php?publicacion='+publicacion,'comentarios','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
}

// mostrar imrpirmir publicacion
function mostrar_imprimir_publicacion(publicacion)
{
	window.open('publicaciones_imprimir.php?publicacion='+publicacion,'imprimir_publicacion','width=660, height=480, status=no, toolbar=no ,menubar=no, resizable=no, scrollbars=yes, left=' + CentrarAncho(660) + ', top=' + CentrarAlto(480));
}

// muestra un catalogo para seleccionar un registro
function mostrar_seleccionar(catalogo,parametros)
{
	switch( catalogo )
	{
	case "autores":
		ventana = window.open('admin_autores.php?seleccionar=true','admin_autores','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
		break;
	case "fotografos":
		ventana = window.open('admin_fotografos.php?seleccionar=true','admin_fotografos','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
		break;
	case "seccion":
		ventana = window.open('admin_secciones.php?seleccionar=true&'+parametros,'admin_secciones','width=640, height=480, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480));
		break;		
	}
}



// muestra un audio
function mostrar_audio(id_audio)
{
	window.open('ver_audios.php?id='+id_audio+'','ver_audio','width=800, height=650, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(800) + ', top=' + CentrarAlto(650));
	//window.open('ver_audios.php?id='+id_audio+'','ver_audio','width=800, height=625, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(800) + ', top=' + CentrarAlto(625));
}

// muestra un video
function mostrar_video(id_video)
{
	//window.open('ver_videos.php?id='+id_video+'','ver_video','width=800, height=625, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(800) + ', top=' + CentrarAlto(625));
	window.open('ver_videos.php?id='+id_video+'','ver_video','width=800, height=650, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(800) + ', top=' + CentrarAlto(650));
}

// muestra un video
function mostrar_galeria(id_galeria,id_foto)
{
	window.open('ver_fotos.php?id='+id_galeria+'&foto='+id_foto,'ver_fotos','width=800, height=685, status=no, toolbar=no ,menubar=no, resizable=no, left=' + CentrarAncho(800) + ', top=' + CentrarAlto(685));
}

// muestra una fotonota
function mostrar_fotonota(id_publicacion)
{
	window.open('ver_fotonota.php?id_publicacion='+id_publicacion,'ver_fotonota','width=540, height=580, status=no, toolbar=no ,menubar=no, scrollbars=yes, resizable=no, left=' + CentrarAncho(540) + ', top=' + CentrarAlto(580));
}

// muestra una fotonota
function mostrar_foto(id_foto)
{
	window.open('ver_fotonota.php?id_foto='+id_foto,'ver_foto','width=640, height=640, status=no, toolbar=no ,menubar=no, scrollbars=yes, resizable=no, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(640));
}

// muestra sondeos anteriores
function mostrar_sondeos_anteriores()
{
	window.open('sondeos_anteriores.php','sondeos','width=700, height=500, status=no, toolbar=no, menubar=no, scrollbars=yes, resizable=no, left=' + CentrarAncho(700) + ', top=' + CentrarAlto(500));
}

function cuadro_negro() {
  el_div_espera_2.style.height = AltoVentana() + "px";
  el_div_espera_2.style.width = AnchoVentana() + "px";
   
  el_div_espera_2.style.display = "block";
  
  el_div_espera_2.style.top = ScrollY() + "px";
    
  window.onscroll = mostrar_espera_2;
  window.onresize = mostrar_espera_2;
}

function mostrar_espera() {
  el_div_espera_1.style.top = parseInt((parseInt(AltoVentana() / 2) - 100) + ScrollY()) + "px";
  el_div_espera_1.style.left = parseInt(parseInt(AnchoVentana() / 2) - 145) + "px";
  
  el_div_espera_1.style.visibility = "visible";
  
  el_div_espera_2.style.height = AltoVentana() + "px";
  el_div_espera_2.style.width = AnchoVentana() + "px";
   
  el_div_espera_2.style.display = "block";
  
  el_div_espera_2.style.top = ScrollY() + "px";
    
  window.onscroll = mostrar_espera_2;
  window.onresize = mostrar_espera_2;
}

function mostrar_espera_2() { 
  el_div_espera_1.style.top = parseInt((parseInt(AltoVentana() / 2) - 100) + ScrollY()) + "px";
  el_div_espera_1.style.left = parseInt(parseInt(AnchoVentana ()/ 2) - 145) + "px";
  
  el_div_espera_2.style.height = AltoVentana() + "px";
  el_div_espera_2.style.width = AnchoVentana() + "px";
  
  el_div_espera_2.style.top = ScrollY() + "px";
}


function ocultar_espera() {
  el_div_espera_1.style.visibility = "hidden";
  el_div_espera_2.style.display = "none";
  
  window.onscroll = null;
  window.onresize = null;
}

function editarRetratoId(id) {
  // no te sirve de nada si no eres Administrador, asi que no intentes nada
  window.open("admin_retratos.php?accion=editar&id=" + id, 'admin_retratos','width=640, height=480, left=' + CentrarAncho(640) + ', top=' + CentrarAlto(480) + ', scrollbars=yes, status=no, toolbar=no, menubar=no, resizable=no');
}

function eliminarRetratoId(id) {
  // no te sirve de nada si no eres Administrador, asi que no intentes nada
  if (confirm("¿ Seguro de eliminar este Retrato ?")) {
    document.location.href = "retratos.php?&e=" + id;
  }
}

//---------------------------------

// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
			//alert("flashVer="+flashVer);
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------

var tieneFlash = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

function revisaFlash() {
  if (!tieneFlash) {
    oItems = document.getElementsByTagName("span");
    for (px = 0; px <= oItems.length; px ++) {
	  try {
		nombrepx = oItems[px].id;
		if (nombrepx.substring(0,6) == "Flash_") {
	      document.getElementById(nombrepx).innerHTML = "<a href='http://www.adobe.com/go/getflashplayer' target='_blank'><img src='images/flash.jpg' border='0'></a>";
		}
	  } catch(e) { } 
	}
  }
}

function makeDoubleDelegate(function1, function2) {
  return function() {
    
	try {
	if (function1)
      function1();
	} catch(e) { }
	
	try {
    if (function2)
      function2();
	} catch(e) { }
	  
  }
}

function leeCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
  begin = dc.indexOf(prefix);
  if (begin != 0) return null;
  } else {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) {
    end = dc.length;
  }
  
  return unescape(dc.substring(begin + prefix.length, end));
}

window.onload = makeDoubleDelegate(window.onload, revisaFlash);
