﻿
var imagenesPreload = new Array(
    "App_Themes/TemaVillor/design/fondo-condiciones-on.png",
    "App_Themes/TemaVillor/design/fondo-como-on.png",
    "App_Themes/TemaVillor/design/fondo-contacto-on.png",
    "App_Themes/TemaVillor/design/fondo-inicio-on.png",
    "App_Themes/TemaVillor/design/fondo-quienes-on.png",
    "App_Themes/TemaVillor/design/fondo-tienda-on.png",
    "App_Themes/TemaVillor/design/triangulo-azul.png"
);

$(document).ready(function () {

    for (var i in imagenesPreload) {
        imagenesPreload[i] = new Image();
        imagenesPreload[i].src = imagenesPreload[i];
    }

    $('.textBoxBuscador').focus(function () {
        var valor = $(this).val();
        $(this).css('color', '#757575');
        if (valor == "Escriba su búsqueda...") {
            $(this).val('');
        }
    });

    $('.textBoxBuscador').blur(function () {
        var valor = $(this).val();
        $(this).css('color', '#a8a8a8');
        if (valor.trim() == '') {
            $(this).val('Escriba su búsqueda...');
        }
    });

    $('.paginador').find('a').mousedown(function () {
        $(this).css('background-position', '1px 1px');
        $(this).css('padding-top', '6px');
        $(this).css('padding-left', '1px');
        $(this).css('margin-left', '2px');
        $(this).css('margin-bottom', '4px');
    });
    $('.paginador').find('a').mouseup(function () {
        $(this).css('background-position', '0px 0px');
        $(this).css('padding-top', '5px');
        $(this).css('padding-left', '0px');
        $(this).css('margin-left', '3px');
        $(this).css('margin-bottom', '5px');
    });


});

function abrirCargador() {
    var altura = $(window).height();
    $('#marco-blanco').css('height', altura + 'px');
    $('#marco-blanco').fadeTo(400, 0.7, function () {
        $('#procesando').show();
    });
    return true;
}

function borrarCategoria(nombre) {
    if (confirm("¡¡ATENCION!!\r\n\r\nVa a eliminar la categoría: " + nombre + "\r\nSe borrarán todos los productos asociados a esta categoría\r\n\r\n¿Está seguro de realizar esta operación?"))
        return true;
    return false;
}
