﻿function navNota(id, cont,secc) 
{
    self.location = "/Exitos/Actualidad/visorNota.aspx?id=" + id + "&tpCont=" + cont+"&secc="+secc;
}

function navNotaIfrm(id, cont,secc) 
{
    parent.location = "/Exitos/Actualidad/visorNota.aspx?id=" + id + "&tpCont=" + cont+"&secc="+secc;
}

function navBlogIfrm(id) 
{

    self.location = "/Exitos/Actualidad/indexfullnotas.aspx?id=0&tpCont=0&idprg=" + id;
}

var player = null;
function playerReady(thePlayer) {
	player = window.document[thePlayer.id];
}
 
 
function createPlayer(multimedia)
{
  // alert(multimedia);
    var flashvars = {
            file:multimedia,
            autostart:"true"
    }
    var params = {
            allowfullscreen:"false", 
            allowscriptaccess:"always"
    }
    var attributes = {
            id:"player1",  
            name:"player1"
    }
    
    swfobject.embedSWF("/Exitos/recursos/mediaplayer-4.4/player.swf", "placeholder1", "370", "20", "9.0.115", false, flashvars, params, attributes);
}

function playPlayer(mmedia) {
    if (player) {
        player.sendEvent('STOP');
    	player.sendEvent('LOAD', mmedia);

    } else {
        createPlayer(mmedia);
    }
}

    var gMinSize_nv = 8;
    var gNumSizes_nv = 30;
    var gCurSize_nv =14;
    
    var anchoVsbl = 0;
	var altovsVsbl = 0;    
    
    function SetBigger()
    {
	    if (gCurSize_nv < gNumSizes_nv) {
		    gCurSize_nv += 2;
		    //SetSize();
		    cambiarTamano(gCurSize_nv,0);
	    }
    }

    function SetSmaller()
    {
	    if (gCurSize_nv > gMinSize_nv) {
		    gCurSize_nv += -2;
		    //SetSize();
		    cambiarTamano(gCurSize_nv,1);
	    }
    }
    
    function cambiarTamano(tam,masomenos) {
    		document.getElementById('NotaCont').style.fontSize = tam + 'px';
    		parent.tamFuente = tam;
    }


var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
}



var idNota = 0;

function mailMan(idnt) {   
    if(idnt > 0) {
        idNota = idnt;
        showMwdw('MAIL');
    }
}

function showMwdw(valor) {
    var alto = 0;
    var altoifrm = 0;
    var anchoifrm = 0;
    var ruta = '';
    
    if(valor == 'REG') {
        //DIMENSIONAMOS LAS HERRAMIENTAS PARA QUE ENCAJE EN EL REGISTRO
        alto = (myHeight -470) / 2;
        altoifrm = 470;
        anchoifrm = 570;
        ruta = '/Exitos/recursos/herramientas/registro.aspx';

    }
    
    if(valor == 'LGN') {
        //DIMENSIONAMOS LAS HERRAMIENTAS PARA QUE ENCAJE EN EL REGISTRO
        alto = (myHeight -250) / 2;
        altoifrm = 250;
        anchoifrm = 570;
        ruta = '/Exitos/recursos/herramientas/login.aspx';

    }
    
    if(valor == 'MAIL') {
        //DIMENSIONAMOS LAS HERRAMIENTAS PARA QUE ENCAJE EN EL REGISTRO
        alto = (myHeight -270) / 2;
        altoifrm = 270;
        anchoifrm = 570;
        ruta = '/Exitos/recursos/herramientas/EnvioNota.aspx?id=' + idNota;

    }      
    
    if(valor == 'CNT') {
        //DIMENSIONAMOS LAS HERRAMIENTAS PARA QUE ENCAJE EN EL REGISTRO
        alto = (myHeight -410) / 2;
        altoifrm = 410;
        anchoifrm = 570;
        ruta = '/Exitos/recursos/herramientas/contactenos.aspx';

    }    
      
      
    if(valor == 'CLOSEDSE') {
        //DIMENSIONAMOS LAS HERRAMIENTAS PARA QUE ENCAJE EN EL REGISTRO
        alto = (myHeight -410) / 2;
        altoifrm = 410;
        anchoifrm = 570;
        ruta = '/Exitos/recursos/herramientas/CerrarSesion.aspx';

    }   
          
    document.getElementById('centerUp').style.height= alto +'px';
    document.getElementById('centerBtto').style.height= alto +'px';
    
    //DIMENSIONAMOS LAS VENTANAS
    Refnm.location.href = ruta;
    document.getElementById('celdaIfrm').style.height= altoifrm + 'px';
    document.getElementById('celdaIfrm').style.width= anchoifrm + 'px';
    document.getElementById('reg').style.height= altoifrm + 'px';
    document.getElementById('reg').style.width= anchoifrm + 'px';
    document.getElementById('bkgInf').style.zIndex = '99';
    document.getElementById('bkgInf').style.visibility = 'visible';
}

function cerrarReg(valor){
   
   
    
    if(valor == 'RFR') {
        document.location.reload(true);
    } else {
        document.getElementById('centerUp').style.height= '1px';
        document.getElementById('centerBtto').style.height= '1px';
        
        //DIMENSIONAMOS LAS VENTANAS
        Refnm.location.href = '/Exitos/recursos/blank.htm';
        document.getElementById('celdaIfrm').style.height= '1px';
        document.getElementById('celdaIfrm').style.width= '1px';
        document.getElementById('reg').style.height= '1px';
        document.getElementById('reg').style.width= '1px';
        document.getElementById('bkgInf').style.zIndex = '0';
        document.getElementById('bkgInf').style.visibility = 'hidden';        
    }
}

function altoEnc() {

    alert(document.encuesta.offsetHeight+" "+document.getElementById("encuesta").scrollHeight);
    alert(document.encuesta.scrollHeight+" "+document.getElementById("encuesta").offsetHeight);
}

function buscar() {

    var svalue = document.getElementById('sString').value;
    document.location.href = "/Exitos/Actualidad/buscador.aspx?SearchValue=" + svalue;
}

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if ( 
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}
