
function VisorCategoriaActual_ClientEndPageChange(s, e) {
    var jqVisorItems = $(s.get_ArticulosContainer()).find(".VistaReducidacategoriaActual");
    
    jqVisorItems.find(".info").hide();

    jqVisorItems.bind ("mouseenter", function() { $(this).find(".info").fadeIn("fast");});
    jqVisorItems.bind ("mouseleave", function() { $(this).find(".info").fadeOut("fast");});

}

function VistaNovedadesCorporativas_ClientEndPageChange(s, e) {
    var jqVisorItems = $(s.get_ArticulosContainer()).find(".VistaNovedadesCorporativas");
    
    jqVisorItems.find(".info").hide();

    jqVisorItems.bind ("mouseenter", function() { $(this).find(".info").fadeIn("fast");});
    jqVisorItems.bind ("mouseleave", function() { $(this).find(".info").fadeOut("fast");});

}





//ASP.NET AJAX
Sys.Application.add_init(pageInit)
function pageInit() {
	
	
	
	
    var tmpCarrito = new dev54.OPCS.eCommerce.Carrito();
    tmpCarrito.set_id("dev54CarritoPedidos");
    tmpCarrito.set_ArticulosContainer($get("Carrito_Columna"));
    tmpCarrito.initialize();

    Sys.Application.addComponent(tmpCarrito);


    tmpCarrito.add_beginChange(CarritoBeginChange);
    tmpCarrito.add_endChange(CarritoEndChange);

//	my_kwicks();

    $(".ContentInputCantidad input").keypress(function(e) {

        if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {

            //$("#errmsg").html("Ingrese un numero para cantidad").show().fadeOut("slow"); 
            return false;
        }
    });

//
//
//function my_kwicks(){
//    $('.kwicks').kwicks({
//        duration: 300,
//        max: 395,
//        spacing:  0
//    });
//}  



    //Initialize Popups Code
    
    //LOADING POPUP
    //Click the button event!
    $("#cmdShowCarritoPedido").click(function() {
        //centering with css
        centerPopup();
        //load popup
        loadPopup();
    });


    //CLOSING POPUP
    //Click the x event!
    $("#popupContactClose").click(function() {
        disablePopup();
    });

    $("#cmdCerrarPopup").click(function() {
        disablePopup();
    });
    //Click out event!
    $("#backgroundPopup").click(function() {
        disablePopup();
    });
    //Press Escape event!
    $(document).keypress(function(e) {
        if (e.keyCode == 27 && popupStatus == 1) {
            disablePopup();
        }
    });
}

function CarritoPedidos() {
    return $find("dev54CarritoPedidos");
}

function CarritoBeginChange() {

}

function CarritoEndChange() {

}

function AddItemCarrito_Catalogo(txtCantID, IDArticulo) {
    var txtCant = $get(txtCantID);

    if (txtCant.value == "") {

        alert("Debes especificar la cantidad de productos");

    } else {
        var Cantidad = txtCant.value;

        CarritoPedidos().AddItem(IDArticulo, Cantidad);

        //Mostramos PopUp
        //centering with css
        centerPopup();
        //load popup
        loadPopup();
    }
}






