// JavaScript Document
var dominio_podcast = 'podcasts.unmundomagico.com.mx';
var xml_itunes_video_podcast_esp = 'videos-ipod-unmundomagico-esp.html';

function ObjetoporId( id ) 
{ 
    if (document.getElementById) 
        var returnVar = document.getElementById(id); 
    else if (document.all) 
        var returnVar = document.all[id]; 
    else if (document.layers) 
        var returnVar = document.layers[id]; 
    return returnVar; 
}

function aves_oculta_todos() {
    oculta_lyr('stats');
    oculta_lyr('origenes');
    oculta_lyr('aves_cultura');
    oculta_lyr('turismo_ornit');
    oculta_lyr('codigo');
}

function divs_oculta_todos(pre,todos) {
    var i = 0;
    
    for (i=1;i<=todos;i=i+1) {
        oculta_lyr(pre + i.toString());
    }
}

function oculta_lyr(valor) {
      var obj1 = ObjetoporId(valor);
      obj1.style.display = "none";
}

function aves_muestra(valor) {
    var obj1 = ObjetoporId(valor);
    
    obj1.style.display = "block";
}

function muestra_lyr(valor) {
    var obj1 = ObjetoporId(valor);
    
    obj1.style.display = "block";
}

function suscribe_itunes_video_podcast_esp () {
    location.href='itpc://' + dominio_podcast + '/' + xml_itunes_video_podcast_esp;
}

function suscribe_general_video_podcast_esp () {
    location.href='http://' + dominio_podcast + '/' + xml_itunes_video_podcast_esp;
}

function cambia_destino_tarifas(control) {
    var d = control.options[control.selectedIndex].value;
    var pstr = window.location.pathname;
    var url = '';
    
    url= window.location.protocol + "//" + window.location.host + pstr + '?d=' + d;
    location.href = url;
}

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll,tamano){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=' + tamano
win = window.open(mypage,myname,settings)
}

