﻿/*
var menuids=["sidebarmenu1"] //Enter id(s) of each Side Bar Menu's main UL, separated by commas
var menuVisible = 0;

function initsidebarmenu(){
	for (var i=0; i<menuids.length; i++){
		var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul");
		for (var t=0; t<ultags.length; t++){
			ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
	  		if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
	   			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
	  		else //else if this is a sub level submenu (ul)
				ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
			ultags[t].parentNode.onmouseover=function(){
				this.getElementsByTagName("ul")[0].style.display="block"
			}
			ultags[t].parentNode.onmouseout=function(){
				this.getElementsByTagName("ul")[0].style.display="none"
			}
		}
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
			ultags[t].style.visibility="visible"
	  		ultags[t].style.display="none"
		}
	}
}

*/
	
String.prototype.trim = function() {
	return this.replace(/^\s*|\s*$/g, '');
}	
	
function newAjax() { 
	var xmlhttp=false; 
	try { // No IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e) { 
		try	{ // IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { 
			xmlhttp = false; 
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); } 
	return xmlhttp; 
}

function trim(cadena) {
	for(i=0; i<cadena.length; )	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(i+1, cadena.length);
		else
			break;
	}

	for(i=cadena.length-1; i>=0; i=cadena.length-1)	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(0,i);
		else
			break;
	}
	
	return cadena;
}

function str_replace(haystack, needle, replacement) {
	var temp = haystack.split(needle);
	return temp.join(replacement);
}

	
function CargaPagina(urlPagina, numPagina, idMaster, total) {	//ID master: en caso de que se requiera pasar un parámetro más, como un id
	var ajax = newAjax();
	urlPagina += ".php?r="+Math.random();
	if (numPagina) { urlPagina += "&pagina=" + numPagina; }
	if (idMaster) { urlPagina += "&id=" + idMaster; }
	if (total) { urlPagina += "&num=" + total; }
	ajax.open("POST", urlPagina, true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send(null);
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4){
			document.getElementById("divContenido").innerHTML = ajax.responseText;
			
			if(typeof comentarioOpinion != 'undefined'){
				setTimeout(function(){
					$(".inline-list li a.opinar").click(comentarioOpinion);				
				}, 1000);
			}
		}	
	}		
}


function CargaPaginaBusqueda(busqueda, urlPagina, numPagina) {	
	var ajax = newAjax();
	urlPagina += ".php?r="+Math.random();
	if (numPagina) { urlPagina += "&pagina=" + numPagina; }
	ajax.open("POST", urlPagina, true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("busqueda="+busqueda);
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4){
			document.getElementById("divContenido").innerHTML = ajax.responseText;			
		}	
	}		
}

function CargaPaginaBusquedan(busqueda, urlPagina, numPagina,fechaini,fechafin,seccion) {	
	var ajax = newAjax();
	urlPagina += ".php?r="+Math.random();
	if (numPagina) { urlPagina += "&paginab=" + numPagina; }
	ajax.open("POST", urlPagina, true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("busqueda="+busqueda+'&fechaini='+fechaini+'&fechafin='+fechafin+'&seccion='+seccion);
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4){
			document.getElementById("divContenido").innerHTML = ajax.responseText;			
		}	
	}		
}


function abreVentana(pagina, ventana, ancho, alto){

	window.open(pagina, ventana, "height="+alto+",width="+ancho+",resizable=no,scrollbars=0,toolbar=no,menubar=no,status=no");
}

function imprimirNoticia(pagina, ventana, ancho, alto){

	window.open(pagina, ventana, "height="+alto+",width="+ancho+",resizable=no,scrollbars=1,toolbar=no,menubar=no,status=no");
}


function centrarVentana() {
	iz=(screen.width-document.body.clientWidth) / 2;
	de=(screen.height-document.body.clientHeight) / 2;
	moveTo(iz,de);
}    

// PARA MODULO DE ENCUESTAS PARA MODULO DE ENCUESTAS PARA MODULO DE ENCUESTAS PARA MODULO DE ENCUESTAS 

	function encuestaClick(valor) {
		document.getElementById("resClickeada").value = valor;
	}
	
	function encuestaVotar(){	
		if (document.getElementById("resClickeada").value != "") {

			var ajax = newAjax();		
			ajax.open("POST", "modules/encuestasRequest.php", true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("idEncuesta="+document.getElementById("idEncuesta").value+"&idEncuestas="+document.getElementById("idEncuestas").value+"&posEncuesta="+document.getElementById("posEncuesta").value+"&idRespuesta="+document.getElementById("resClickeada").value);
			ajax.onreadystatechange = function(){
				if (ajax.readyState == 4) {						
					document.getElementById("cuerpoEncuesta").innerHTML = ajax.responseText;
				}
			}
		}
	}
	
function encuestaRecorre(nDireccion){
	var ajax = newAjax();		
	var nPosicionActual = document.getElementById("posEncuesta").value;
	if (nDireccion < 0) {
		if (nPosicionActual > 0) { nPosicionActual--; }
	} else {
		nPosicionActual++;
	}
	ajax.open("POST", "modules/encuestasRequest.php", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("idEncuestas="+document.getElementById("idEncuestas").value+"&posEncuesta="+nPosicionActual);
	ajax.onreadystatechange = function(){
	if (ajax.readyState == 4) {			
			document.getElementById("cuerpoEncuesta").innerHTML = ajax.responseText;
		}
	}
}
// PARA MODULO DE ENCUESTAS PARA MODULO DE ENCUESTAS PARA MODULO DE ENCUESTAS PARA MODULO DE ENCUESTAS 


/* **************** BÚSQUEDA (GALERÍAS) **************** */

function buscarGaleria() {
	var busqueda = document.getElementById("txtBuscarGaleria").value;
	document.getElementById("divContenido").innerHTML = "<div style='height:400px; width:600px;'><div style='position:relative; top:150px; text-align:center; height:50px; width:300px; margin-top:60px; margin-left:175px;'><img src='images/lb-load.gif'/><br/>Buscando</div></div>"
	var ajax = newAjax();
	ajax.open("POST", "request/galeriasRequest.php", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("busqueda="+busqueda);
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4){
			document.getElementById("divContenido").innerHTML = ajax.responseText;			
		}	
	}		
}

/* ****************BUSQUEDA DE VIDEOS ************************** */
function buscarVideo(){
	
	var busqueda= document.getElementById('txtbuscarvideo').value;	
	var ajax = newAjax();		
		ajax.open("POST", "request/videosRequest.php", true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajax.send('busqueda='+busqueda);						
		ajax.onreadystatechange = function(){
			if (ajax.readyState == 4) {
			
				document.getElementById("divContenido").innerHTML = ajax.responseText;		
			}
			
		}
	
	}
function buscarheader(){
	var buscar = document.getElementById('txtbuscar').value;
	
	if (document.getElementById('rdblinea').checked){
		document.location='index.php?opcion=buscar&modoBusqueda=linea&buscar='+buscar;
	} else {
		document.location='index.php?opcion=buscar&modoBusqueda=google&buscar='+buscar;
	}	
}	
	
function buscarnoticias(){

	var busqueda = document.getElementById('buscar').value;	
	var fechaini = document.getElementById('fechaini').value;	
	var fechafin = document.getElementById('fechafin').value;
	var seccion	 = document.getElementById('cbxseccion').value;

	var fechafin2= fechafin.split('/');
	var fechaini2= fechaini.split('/');
	
	var fechafinult = fechafin2[2]+'-'+fechafin2[1]+'-'+fechafin2[0];
	var fechainiult = fechaini2[2]+'-'+fechaini2[1]+'-'+fechaini2[0];

	
	if (trim(busqueda)==""){
	alert('Ingrese la frase o palabra a buscar');
	document.getElementById("buscar").value='';
	document.getElementById("buscar").focus(true);
	}
	else{
		//document.getElementById("divContenido").innerHTML = '<div style="text-align:center; position:relative; top:50%; left:50%; width:100px; height:60px; margin-left:-30px; margin-top:-30px;"><img src="images/lb-load.gif?v='+Math.random()+'" align="absmiddle" /><br><br>Buscando<div>';
		var ajax = newAjax();			
			ajax.open("POST", "request/buscarRequest.php", true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send('busqueda='+busqueda+'&fechaini='+fechainiult+'&fechafin='+fechafinult+'&seccion='+seccion);						
			ajax.onreadystatechange = function(){
				if (ajax.readyState == 4) {
					document.getElementById("divContenido").innerHTML = ajax.responseText;	
					//document.getElementById("buscar").value='';
					//document.getElementById('cbxseccion').selectedIndex = 0;
				}
				
			}
		
		}	
	}

/* ****************BUSQUEDA DE AUDIOS ************************** */
function buscarAudio(){
	var busqueda= document.getElementById('txtbuscaraudio').value;	
	
		document.getElementById("divContenido").innerHTML = '<div style="text-align:center; position:relative; top:50%; left:50%; width:100px; height:60px; margin-left:-30px; margin-top:-30px;"><img src="images/lb-load.gif?v='+Math.random()+'" align="absmiddle" /><br><br> Buscando:'+busqueda+'<div>';
		
	
	
	var ajax = newAjax();		
		ajax.open("POST", "request/audiosRequest.php", true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajax.send("busqueda="+busqueda);						
		ajax.onreadystatechange = function(){
			if (ajax.readyState == 4) {
			
				document.getElementById("divContenido").innerHTML = ajax.responseText;		
			}
			
		}
	
	}



/* ****************BUSQUEDA DE AUDIOS ************************** */
function buscarPodcast(){
	var busqueda= document.getElementById('txtbuscarpodcast').value;	
	
		document.getElementById("divContenido").innerHTML = '<div style="text-align:center; position:relative; top:50%; left:50%; width:100px; height:60px; margin-left:-30px; margin-top:-30px;"><img src="images/lb-load.gif?v='+Math.random()+'" align="absmiddle" /><br><br> Buscando:'+busqueda+'<div>';
		
	
	
	var ajax = newAjax();		
		ajax.open("POST", "request/podcastRequest.php", true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajax.send("busqueda="+busqueda);						
		ajax.onreadystatechange = function(){
			if (ajax.readyState == 4) {
			
				document.getElementById("divContenido").innerHTML = ajax.responseText;		
			}
			
		}
	
	}
/* ******************  DESCARGAR ARCHIVOS PODCAST ******************* */

function descargaArchivo(tipoArchivo,dirArchivo){
	abreVentana('../windows/descarga_archivo.php?pt='+dirArchivo,'',150,150);
}
function descargaAudio(dirArchivo){
	abreVentana('windows/descarga_archivo.php?pt='+dirArchivo,'',150,150);
}
function descargaPodcast(dirPodcast){  
	
	//// Se recibe encriptado el path del XML, se le quita lo de http y se le concatena el itpc para que abra el Itunes
	var dirPod = "itpc://";
	var str = Base64.decode(dirPodcast);
	//var str = str.replace("http://", "")
	window.location = dirPod+str+'.xml';
	
} 







/* **************** BÚSQUEDA (GALERÍAS) **************** */

function offMensaje() {
	document.getElementById('divTransparente').style.display = "none";
}

function onMensajeGaleria(sTexto) {
	document.getElementById("divFotos").innerHTML = '<div style="text-align:center; position:relative; top:50%; left:50%; width:100px; height:60px; margin-left:-30px; margin-top:-30px;"><img src="../images/lb-load.gif?v='+Math.random()+'" align="absmiddle" /><br><br>'+sTexto+"<div>";
	//document.getElementById('divTransparente').style.display = "block";
}

function onMensajeContactanos(sTexto) {
	//console.log('entro');
	document.getElementById('divContenido2').style.display = "block";
	document.getElementById("divContenido2").innerHTML = '<div style="text-align:center; position:relative; top:50%; left:50%; width:100px; height:60px; margin-left:-30px; margin-top:-30px;"><img src="../images/lb-load.gif?v='+Math.random()+'" align="absmiddle" /><br><br>'+sTexto+"<div>";
	
}

function cargaImagenFotogaleria(galeria, imagen) {	
	var idsFotos = document.getElementById("idsFotos").value;
	onMensajeGaleria("Cargando");
	var ajax = newAjax();
	ajax.open("POST", "galerias.php?id="+galeria+"&pos_gal="+imagen, true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("idsFotos="+idsFotos);
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4){
			document.getElementById("divContenido").innerHTML = ajax.responseText;			
			//offMensaje();
		}	
	}		
}

function borrarCamposComentarioNota(){
	$('#txtNombreCom').attr('value','');
	$('#txtPaginaCom').attr('value','');
	$('#txtCorreoCom').attr('value','');
	$('#textComentario').attr('value','');
}

function comentarioLongitud(){
	maximo = 60; ///maximo de caracteres consecutivos
	separador =/\s/g;
	comentario = $('#textComentario').attr('value').split(separador);
	for(x=0;x<comentario.length;x++){
		if(comentario[x].length>maximo){
			alert("No puedes introducir palabras mayores a 60 caracteres");
			return false;
		}
	}
	return true;	
}

function enviarComentarioNota(nota, loc){
	if(trim($('#txtNombreCom').attr('value')) == ''){
		alert('Escribe tu nombre');
		return;
	}
	
	if(!validaCorreo($('#txtCorreoCom').attr('value')) && trim($('#txtCorreoCom').attr('value')) != ''){
		alert('El correo es invalido');
		return;
	}
	
	if(trim($('#textComentario').attr('value')) == ''){
		alert('Escribe tu comentario');
		return;
	}
	if(trim($('#textComentario').attr('value')) == "''"){
		alert('Escribe un comentario válido'); return;
	}
	
	if(trim($('#txtcaptcha').attr('value')) == ''){
		alert('Escribe el código de verificación');
		return;
	}
		
	if(comentarioLongitud()){
		
		var params = "nota="+nota+"&nombre="+($('#txtNombreCom').attr('value'))+"&url="+($('#txtPaginaCom').attr('value'))+"&correo="+($('#txtCorreoCom').attr('value'))+"&comentario="+($('#textComentario').attr('value'))+"&txtcaptcha="+($('#txtcaptcha').attr('value'));
		var formulario = document.getElementById("divComentariosEnviar").innerHTML;
		document.getElementById("divComentariosEnviar").innerHTML = "<div id='divComentariosMensaje'  style='text-align:center; height:50px; width:300px; margin-top:60px; margin-left:175px;'><img src='images/lb-load.gif'/><br/>Enviando comentario...</div>";
		var urlPOST = (loc == 'win') ? '../request/comentariosRequest.php' : 'request/comentariosRequest.php';
		
		var ajax = newAjax();
		ajax.open("POST", "request/comentariosRequest.php", true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajax.send(params);
		ajax.onreadystatechange = function() {
			if (ajax.readyState == 4){
				if (ajax.responseText == "captcha error") {
					document.getElementById("divComentariosEnviar").innerHTML = formulario;
					document.getElementById('no-captcha').innerHTML = "<b>C&oacute;digo de verificaci&oacute;n incorrecto.</b><br/>Vuelva a intentar";
				}
				if(ajax.responseText == "no EspecialesAZ"){
					document.getElementById("divComentariosEnviar").innerHTML = formulario;
					document.getElementById('no-captcha').innerHTML = "<b>Hay caractéres inválidos en su comentario. Los únicos permitidos son: a-z, A-Z, 0-9 .</b><br/>Vuelva a intentar";
					return;
				}
				if(ajax.responseText.substr(0, 13) == "no Especiales"){
					document.getElementById("divComentariosEnviar").innerHTML = formulario;
					document.getElementById('no-captcha').innerHTML = "<b>Hay caractéres inválidos en su comentario. Los únicos permitidos son: "+ajax.responseText.substr(13, ajax.responseText.length)+"</b><br/>Vuelva a intentar";
				}
				
				else 
					document.getElementById('divComentariosMensaje').innerHTML = "Gracias por su comentario.";
			}	
		}	
	}
	
}

function validaCorreo(valor) {
	var reg = /(^[a-zA-Z0-9._-]{1,30})@([a-zA-Z0-9.-]{1,30}$)/;
	if(reg.test(valor)) {
		return true;
	} else {
		return false;
	}
}

function ltrim(str) { 
	for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
	return str.substring(k, str.length);
}
function rtrim(str) {
	for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
	return str.substring(0,j+1);
}
function trim(str) {
	return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
	var whitespaceChars = " \t\n\r\f";
	return (whitespaceChars.indexOf(charToCheck) != -1);
}

function numeros(e) { 
    tecla = (document.all) ? e.keyCode : e.which; 
    if (tecla==8) return true; //Tecla de retroceso (para poder borrar) 
    if (tecla==40 || tecla ==41 || tecla ==45 || tecla==37 || tecla==39) return true; //Teclas de (  ) - 
    patron = /\d/; // Solo acepta números 
    te = String.fromCharCode(tecla); 
    return patron.test(te);  
}

function ellipsis(value, len, word){
	if(value && value.length > len){
	    if(word){
	        var vs = value.substr(0, len - 2);
	        var index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));
	        if(index == -1 || index < (len - 15)){
	            return value.substr(0, len - 3) + "...";
	        }else{
	            return vs.substr(0, index) + "...";
	        }
	    } else{
	        return value.substr(0, len - 3) + "...";
	    }
	}
	return value;
}


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  Base64 class: Base 64 encoding / decoding (c) Chris Veness 2002-2009                          */
/*    note: depends on Utf8 class                                                                 */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var Base64 = {};  // Base64 namespace

Base64.code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

/**
 * Encode string into Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648]
 * (instance method extending String object). As per RFC 4648, no newlines are added.
 *
 * @param {String} str The string to be encoded as base-64
 * @param {Boolean} [utf8encode=false] Flag to indicate whether str is Unicode string to be encoded 
 *   to UTF8 before conversion to base64; otherwise string is assumed to be 8-bit characters
 * @returns {String} Base64-encoded string
 */ 
Base64.encode = function(str, utf8encode) {  // http://tools.ietf.org/html/rfc4648
  utf8encode =  (typeof utf8encode == 'undefined') ? false : utf8encode;
  var o1, o2, o3, bits, h1, h2, h3, h4, e=[], pad = '', c, plain, coded;
  var b64 = Base64.code;
   
  plain = utf8encode ? str.encodeUTF8() : str;
  
  c = plain.length % 3;  // pad string to length of multiple of 3
  if (c > 0) { while (c++ < 3) { pad += '='; plain += '\0'; } }
  // note: doing padding here saves us doing special-case packing for trailing 1 or 2 chars
   
  for (c=0; c<plain.length; c+=3) {  // pack three octets into four hexets
    o1 = plain.charCodeAt(c);
    o2 = plain.charCodeAt(c+1);
    o3 = plain.charCodeAt(c+2);
      
    bits = o1<<16 | o2<<8 | o3;
      
    h1 = bits>>18 & 0x3f;
    h2 = bits>>12 & 0x3f;
    h3 = bits>>6 & 0x3f;
    h4 = bits & 0x3f;

    // use hextets to index into code string
    e[c/3] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
  }
  coded = e.join('');  // join() is far faster than repeated string concatenation in IE
  
  // replace 'A's from padded nulls with '='s
  coded = coded.slice(0, coded.length-pad.length) + pad;
   
  return coded;
}

/**
 * Decode string from Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648]
 * (instance method extending String object). As per RFC 4648, newlines are not catered for.
 *
 * @param {String} str The string to be decoded from base-64
 * @param {Boolean} [utf8decode=false] Flag to indicate whether str is Unicode string to be decoded 
 *   from UTF8 after conversion from base64
 * @returns {String} decoded string
 */ 
Base64.decode = function(str, utf8decode) {
  utf8decode =  (typeof utf8decode == 'undefined') ? false : utf8decode;
  var o1, o2, o3, h1, h2, h3, h4, bits, d=[], plain, coded;
  var b64 = Base64.code;

  coded = utf8decode ? str.decodeUTF8() : str;
  
  
  for (var c=0; c<coded.length; c+=4) {  // unpack four hexets into three octets
    h1 = b64.indexOf(coded.charAt(c));
    h2 = b64.indexOf(coded.charAt(c+1));
    h3 = b64.indexOf(coded.charAt(c+2));
    h4 = b64.indexOf(coded.charAt(c+3));
      
    bits = h1<<18 | h2<<12 | h3<<6 | h4;
      
    o1 = bits>>>16 & 0xff;
    o2 = bits>>>8 & 0xff;
    o3 = bits & 0xff;
    
    d[c/4] = String.fromCharCode(o1, o2, o3);
    // check for padding
    if (h4 == 0x40) d[c/4] = String.fromCharCode(o1, o2);
    if (h3 == 0x40) d[c/4] = String.fromCharCode(o1);
  }
  plain = d.join('');  // join() is far faster than repeated string concatenation in IE
   
  return utf8decode ? plain.decodeUTF8() : plain; 
}
/*

function menuPrincipalCerrar() {		
	if (menuVisible == 1) { return; }
	document.getElementById("menuPrincipal").style.visibility = "hidden";
	
}

function menuPrincipal(nAccion) { 	
	if (nAccion == 0) {
		menuVisible = 0;
		setTimeout('menuPrincipalCerrar()',1250);			
	} else {
		document.getElementById("menuPrincipal").style.visibility = "visible";
		menuVisible = 1;
	}
}


if (window.addEventListener)
	window.addEventListener("load", initsidebarmenu, false)
else if (window.attachEvent)
	window.attachEvent("onload", initsidebarmenu)
	
	*/

function setPlayerRemoveCallback() {
	window.__flash__removeCallback = function(instance, name) {
		if (instance) instance[name] = null;
	}; 
	window.setTimeout(setPlayerRemoveCallback, 100);
};

function agregarPaginaInicio(pg){
	isIE = document.all ? true : false;
	if (isIE){
		pg.style.behavior='url(#default#homepage)';
		pg.setHomePage('http://www.lineadirectaportal.com');
	}else{
		alert('No aplica para este navegador');
	}
} 