function p_Cancela(){window.close();}

function p_Leer_IP() {
    $.ajax({
        dataType: "html",
        url: "http://www.whatismyip.org/",
        success: function(datos) {
            alert(datos);
        },
        error: function(objeto, quepaso, otroobj) { }
    });
}

function p_Mostrar_Detalle(arr_codigo) {

    if (document.getElementById('cbo_periodo').value == '5') {
        window.top.location.href = 'wf_reg_mun_det.aspx?arrcodigo=' + arr_codigo + '&id_periodo=' + document.getElementById('cbo_periodo').value;
    }

    if (document.getElementById('cbo_periodo').value == '4') {
        window.top.location.href = 'wf_congresistas_det.aspx?arrcodigo=' + '1X' + arr_codigo + '&id_periodo=' + document.getElementById('cbo_periodo').value;
    }
}

function p_Congresista_x_op(id_op_rop, id_org_politica) {

    window.top.location.href = 'wf_congresistas_det.aspx?arrcodigo=' + '2X' + id_op_rop + 'X' + id_org_politica + '&id_periodo=' + document.getElementById('cbo_periodo').value;
}

function p_all_Congresista() {
    window.top.location.href = 'wf_congresistas_det.aspx?arrcodigo=' + '3' + '&id_periodo=' + document.getElementById('cbo_periodo').value;
}

function p_Det() {
    p_Mostrar_Detalle(document.getElementById('hdn_codigo').value);
}

function refresh() { document.getElementById('wf_inicio').submit(); }

function efect_ver(obj, arrcodigo) {
    var arr = obj.coords.split(',');
    $("#pEfecDep").text(obj.alt);
    $("#pEfecDep").css("left", arr[0] + 'px');
    $("#pEfecDep").css("top", arr[1] + 'px');
    $("#pEfecDep").attr("title", 'Haga Click para visualizar las Autoridades');
    document.getElementById('hdn_codigo').value = arrcodigo;
}

function efect_ocultar(obj) {
    return;
    $("#pEfecDep").text('');
    $("#pEfecDep").css("left", 0);
    $("#pEfecDep").css("top", 0);
    $("#pEfecDep").hide();
}


function p_Actualizar_Periodo(obj) {

    if (obj.value == '5' || obj.value == '4') {
        document.getElementById('hdn_bandera').value = obj.value;
        refresh();
    }

    if (obj.value == '6') {
        window.top.location.href = 'wf_presidenciales_det.aspx?id_periodo=' + obj.value;
    }

    if (obj.value == '7') {
        window.top.location.href = 'wf_parlamento_andino_det.aspx?id_periodo=' + obj.value;
    }
    
 
}