﻿
var prp = 1;

function programa(){
    divA = eval("document.getElementById('prgM')");
    cad = prp;
    if(cad==1) {
        divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/btn_programacion3.png')";
        prp = 0;
        Act.open();
    }
    
     if(cad==0) {
        divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/transparent.png')";
        prp = 1;
        Act.close();
    }
}

var optSel = 0;
var optSelP = 0;

function selec(valo) {
    if(optSel != valo ) {
        divA = eval("document.getElementById('opt" + optSel + "')");
        divS = eval("document.getElementById('opt" + valo + "')");
        
        if(valo == 0) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/escuchado_lomas.png')";
        }
        
        if(optSel == 0) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/escuchado_lomas2.png')";
        }    
        
        if(valo == 1) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/visto_lomas.png')";
        }
        
        if(optSel == 1) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/visto_lomas2.png')";
        }  
        
        if(valo == 2) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/comentado_lomas.png')";
        }
        
        if(optSel == 2) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/comentado_lomas2.png')";
        } 
        
        if(valo == 3) {
            divS.style.backgroundImage = "url('/recursos/imagenes/ultimos_clips2.png')";
        }
        
        if(optSel == 3) {
            divA.style.backgroundImage = "url('/recursos/imagenes/ultimos_clips.png')";
        }                                  
 
        
        optSel = valo;
   }
   
}


function selecP(valo) {
    if(optSelP != valo ) {
        divA = eval("document.getElementById('optP" + optSelP + "')");
        divS = eval("document.getElementById('optP" + valo + "')");
        
        if(valo == 0) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/programas.png')";
        }
        
        if(optSelP == 0) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/programas2.png')";
        }    
        
        if(valo == 1) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/fundacion_unionradio2.png')";
        }
        
        if(optSelP == 1) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/fundacion_unionradio.png')";
        }  
        
        if(valo == 2) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/micros2.png')";
        }
        
        if(optSelP == 2) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/micros.png')";
        } 
        
        if(valo == 3) {
            divS.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/centro_de_noticias2.png')";
        }
        
        if(optSelP == 3) {
            divA.style.backgroundImage = "url('/ActualidadUR/recursos/imagenes/centro_de_noticias.png')";
        }                                   
 
        vitProg.showPanel(valo);
        optSelP = valo;
   }
   
}



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("/ActualidadUR/recursos/mediaplayer-4.4/player.swf", "placeholder1", "295", "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 -420) / 2;
        altoifrm = 420;
        anchoifrm = 570;
        ruta = '/ActualidadUR/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 = '/ActualidadUR/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 = '/ActualidadUR/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 = '/ActualidadUR/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 = '/ActualidadUR/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 = '/ActualidadUR/recursos/herramientas/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 = "/actualidad/buscador.aspx?SearchValue=" + svalue;
}
