//<![CDATA[
var nav4 = window.Event ? true : false;
$(document).ready(function () {
    $("div[class='WEB_CONTE_botonIzq1']").hover(function () {
        $(this).addClass("WEB_CONTE_botonIzq2").find("div:first").addClass("WEB_CONTE_botonIzq2a");
    }, function () {
        $(this).removeClass("WEB_CONTE_botonIzq2").find("div:first").removeClass("WEB_CONTE_botonIzq2a");
    });
    $("div[class='WEB_CONTE_botonMed1']").hover(function () {
        $(this).addClass("WEB_CONTE_botonMed2");
    }, function () {
        $(this).removeClass("WEB_CONTE_botonMed2");
    });
    $("div[class='WEB_CONTE_botonDer1']").hover(function () {
        $(this).addClass("WEB_CONTE_botonDer2").find("div:last").addClass("WEB_CONTE_botonDer2a");
    }, function () {
        $(this).removeClass("WEB_CONTE_botonDer2").find("div:last").removeClass("WEB_CONTE_botonDer2a");
    });
    $("#div_idioma").hover(function () {
        $(this).addClass("WEB_CONTE_idiomaBoton2");
        $(this).find("div:first").addClass("WEB_CONTE_idiomaBotonIzq2");
        $(this).find("div:last").addClass("WEB_CONTE_idiomaBotonDer2");
    }, function () {
        $(this).removeClass("WEB_CONTE_idiomaBoton2");
        $(this).find("div:first").removeClass("WEB_CONTE_idiomaBotonIzq2");
        $(this).find("div:last").removeClass("WEB_CONTE_idiomaBotonDer2");
    });
    $(".COM_iconoSubir").anclaAPS({
        velocidad: 1000
    })
    $(".COM_iconoSubirInterna").anclaAPS({
        velocidad: 1000
    })
});
function fnc_Enter(evt, id) {
    var key = nav4 ? evt.which : evt.keyCode;
    if (key == '13') {
        evt = null;
        validarTextoBuscar(id);
    }
}
function validarTextoBuscar(id) {
    var a = 0;
    var cajaTexto = document.getElementById(id);
    cajaTexto.value = trim(cajaTexto.value);
    if (noVacio(cajaTexto) == false) {
        alert('No ha ingresado texto para buscar');
        cajaTexto.focus();
        a = 1;
        return;
    }
    if (cajaTexto.value.length < 3) {
        alert('El texto debe contener al menos 3 letras');
        cajaTexto.focus();
        a = 1;
        return;
    }
    if (a == 0) {
        var id_buscar = document.getElementById("hid_BtnBuscar").value;
        __doPostBack(id_buscar, '');
    }
}
function agregarFavorito() {
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
        var url = document.location;
        var titulo = document.title;
        window.external.AddFavorite(url, titulo);
    } else {
        if (navigator.appName == "Netscape")
            window.sidebar.addPanel(document.title, location.href, "");
    }
}
$(function () {
    String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, '') }
    $(".WEB_CONTE_bannerPrincipal").find("img").pngfix();
    $(".WEB_CONTE_logo").find("img").pngfix();
    $("#id_noticias").jcarousel({
        scroll: 1,
        animation: 250,
        auto: 5,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
    $("#id_slide").jcarousel({
        scroll: 1,
        animation: 250,
        initCallback: mycarousel_initCallback
    });

    $('#id_bloque1').cycle({
        fx: 'scrollVert',
        speed: 'slow',
        timeout: 0,
        next: '#next1',
        prev: '#prev1'
    });

    $('#id_bloque2').cycle({
        fx: 'scrollVert',
        speed: 'slow',
        timeout: 0,
        next: '#next2',
        prev: '#prev2'
    });

    $('#id_bloque3').cycle({
        fx: 'scrollVert',
        speed: 'slow',
        timeout: 0,
        next: '#next3',
        prev: '#prev3'
    });

    $('#id_bloque4').cycle({
        fx: 'scrollVert',
        speed: 'slow',
        timeout: 0,
        next: '#next4',
        prev: '#prev4'
    });

    $('#id_bloque5').cycle({
        fx: 'scrollVert',
        speed: 'slow',
        timeout: 0,
        next: '#next5',
        prev: '#prev5'
    });

    $('#id_bloque6').cycle({
        fx: 'scrollVert',
        speed: 'slow',
        timeout: 0,
        next: '#next6',
        prev: '#prev6'
    });

});
function mycarousel_initCallback(carousel) {
    carousel.buttonNext.bind('click', function () {
        carousel.startAuto();
        $(".jcarousel-skin-2 .jcarousel-next").removeClass('jcarousel-next-horizontal').addClass('jcarousel-next-horizontal2');
    });
    carousel.buttonPrev.bind('click', function () {
        carousel.startAuto();
    });
    carousel.clip.hover(function () {
        carousel.stopAuto();
    }, function () {
        carousel.startAuto();
    });
};
function mycarousel_initCallback2(carousel) {
    carousel.buttonNext.bind('click', function () {
        carousel.startAuto();
    });
    carousel.buttonPrev.bind('click', function () {
        carousel.startAuto();
    });
    carousel.clip.hover(function () {
        carousel.stopAuto();
    }, function () {
        carousel.startAuto();
    });
};
//]]>
