function ponerIdioma(cual){

if (!(readCookie('lang'))){
idioma= cual;
temp="lang = "+ cual;

escrCookie ("lang",cual, 24);

/* document.cookie = temp; */

}else{
idioma= readCookie('lang');
}

for (i=0;i<=5;i++){

con=idioma + i;

if (!document.getElementById(con)){
}else{document.getElementById(con).style.display = "block";}

}

}

function reloadiframe(ifram){

var navegador = navigator.appName

if (navegador == "Microsoft Internet Explorer") {
parent.frames[ifram].window.location.reload();}else{
if (document.getElementById(ifram)){document.getElementById(ifram).contentDocument.location.reload(true);}
}

}


function CambiarIdioma(cual) {

idioma= readCookie('lang');

/*alert(idioma);*/

temp="lang = "+ cual;

escrCookie ("lang",cual, 24);

/*document.cookie = temp ;*/

/*alert(cual);*/


for (j=0;j<=5;j++){

con1= idioma + j;
con2= cual + j;

if (document.getElementById(con1)){document.getElementById(con1).style.display = "none";}

if (document.getElementById(con2)){document.getElementById(con2).style.display = "block";}
}
}

function readCookie(name) {

    var cookiename = name + "=";

    var ca = document.cookie.split(';');

    for(var i=0;i < ca.length;i++)
    {

        var c = ca[i];

        while (c.charAt(0)==' ') c = c.substring(1,c.length);

        if (c.indexOf(cookiename) == 0) return c.substring(cookiename.length,c.length);

    }

    return null;
}


function cargarSWF(direccion,ancho,alto){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ancho+'" height="'+alto+'">');
    document.write('<param name="movie" value="'+direccion+'" /><param name="quality" value="high"><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="'+direccion+'" quality="high" wmode=transparent pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></embed><noembed> <div align="center">Su navegador no dipone de una versión apropiada de flash player. <br> Puede obtenerla gratuitamente <a href="http://www.adobe.com/es/products/flashplayer/">aqui </a> </div> </noembed></object>');
}

function abreIframeantiguo (URL){
window.open(URL,"interno","class=ivent");
}

function abreVent (URL){
window.open(URL, target="_blank");
}

function escrCookie(clave,valor, horas) {
var expirar = "";
if(horas != null) {
expirar = new Date((new Date()).getTime() + horas * 3600000);
expirar = "; expires="+ expirar.toGMTString();
}
escribir = clave+"="+escape(valor)+ expirar;
document.cookie = escribir
} 
