
if(typeof TELON_MODOOCULTAR=="undefined"){
	var TELON_MODOOCULTAR="automatico"; //"click"
}
if(typeof TELON_NOMBREDIVOCULTAR=="undefined"){
	var TELON_NOMBREDIVOCULTAR="telon_cargando";
}
if(typeof TELON_NOMBREDIVMOSTRAR=="undefined"){
	var TELON_NOMBREDIVMOSTRAR="telon_cargado";
}

function telonLoaded(){
	switch(TELON_MODOOCULTAR){
		case "automatico":
			telonOcultar();
		case "click":
			telonCambiarDisplayDiv(TELON_NOMBREDIVOCULTAR,"none");
			telonCambiarDisplayDiv(TELON_NOMBREDIVMOSTRAR,"block");

	}
}
function telonOcultar(){
	if(parent){
		if(parent.document){
			if(parent.document.body){
				//IE only compatible (los atributos propios enmozilla no los levanta el dom hay que consultarlos desde attributes
				//if(parent.document.body.rowstelonoculto){
				//	parent.document.body.rows=parent.document.body.rowstelonoculto;
				//}				
				if(parent.document.body.attributes["rowstelonoculto"]){
					parent.document.body.rows=parent.document.body.attributes["rowstelonoculto"].value;
				}				
			}
		}
	}
}
function telonMostrar(){
	if(parent){
		if(parent.document){
			if(parent.document.body){
				if(parent.document.body.rowstelonvisible){
					parent.document.body.rows=parent.document.body.rowstelonvisible;
				}
			}
		}
	}
}
function telonCambiarDisplayDiv(nombrediv,disp){
	if(document.getElementById(nombrediv)){
		document.getElementById(nombrediv).style.display=disp;
	}
}
function telonDisclaimerMostrar(){
	if(leerCookie('adulto')=="S")return;

	if(parent){
		if(parent.document){
			if(parent.document.body){
				if(parent.document.body.rowstelonvisible){
					parent.document.body.rows=parent.document.body.rowstelonvisible;
					top.document.getElementById('telon').src='/scripts/app/framework.php?FRAME=telon&telon[html]=disclaimer.html';
				}
			}
		}
	}
}

/***************************************************************************/
function insertarCookie(nombre, valor, expira){
	var expiracion = "";
	if (expira) expiracion = "; expires=" + expira.toGMTString();
	document.cookie = nombre + "=" + escape(valor) + expiracion;
}

function leerCookie(nombre){
	var buscar;null
	var com;
	var fin;
	buscar = nombre+"=";
	if (document.cookie.length > 0){
		com = document.cookie.indexOf(buscar);
		if (com != -1){
			com += buscar.length;
			fin = document.cookie.indexOf(";", com);
			if (fin == -1){
				fin = document.cookie.length;
			}
			return unescape(document.cookie.substring(com, fin));
		}
	}
}

function setCookieAdulto(idioma){
	insertarCookie('adulto', 'S', null);
	if (idioma)
		top.location="/scripts/index.php?telon_telon[html]=telon.html&telon_FWK[idioma]="+idioma+"&principal_FWK[idioma]="+idioma;
	else
		telonOcultar();
}