﻿function MostrarDiv(id) {
    try {
        document.getElementById(id).style.display = "block";
        }catch(err){}
}

function MostrarDivInBlock(id)
{
    try {
        document.getElementById(id).style.display = "";
    } catch (err) { }}

//function colocarCantidad(cbocantidad) {

//    $('input[name*="LblCantidadSeleccionada"]').val(cbocantidad.value);
//}

function colocarPost(ticket) {
    //$('input[name*="LblIdTickSeleccionado"]').val(tick);
//    if ($('input[name*="LblCantidadSeleccionada"]').val() == "")
//        $('input[name*="LblCantidadSeleccionada"]').val(cantidad);
//    $('input[name*="LblIdFechEveSeleccionado"]').val(idfecheve);
    $('input[name*="LblEntidadSeleccionada"]').val(ticket);
//    $('input[name*="LblTipoClick"]').val(tipoclick);
}

function OcultarDiv(divId, anchorId)
{
    var DivVisible = (document.getElementById(divId).style.display != "none");
    document.getElementById(divId).style.display = DivVisible ? "none" : "block";
    document.getElementById(anchorId).className = DivVisible ? "mostrar" : "ocultar";
}
function CerrarDiv(id)
{ 
    document.getElementById(id).style.display = "none";  
}
function mostrardiv(id) { MostrarDiv(id); }
function cerrar(id) { CerrarDiv(id); }



if (typeof (Sys) != "undefined" && typeof (Sys.Application) != "undefined") {
    Sys.Application.notifyScriptLoaded();
}



function ajaxHide(options) {
    // Becomes this.options
    var defaults = {
        bgColor: '#fff',
        duration: 0,
        opacity: 0.7,
        classOveride: false
    }
    this.options = jQuery.extend(defaults, options);
    this.container = $("#aspnetForm");
    this.init = function() {
        var container = this.container;
        // Delete any other loaders
        this.remove();
        // Create the overlay
        var overlay = $('<div></div>').css({
            'background-color': this.options.bgColor,
            'opacity': this.options.opacity,
            'width': container.width(),
            'height': container.height(),
            'position': 'absolute',
            'top': '0px',
            'left': '0px',
            'z-index': 99999
        }).addClass('ajax_overlay');
        // add an overiding class name to set new loader style
        if (this.options.classOveride) {
            overlay.addClass(this.options.classOveride);
        }
        // insert overlay and loader into DOM
        container.append(
			overlay.append(
				$('<div></div>').addClass('ajax_loader')
			).show()
		);
    };
    this.remove = function() {
        var overlay = this.container.children(".ajax_overlay");
        if (overlay.length) {
            overlay.hide(this.options.classOveride, function() {
                overlay.remove();
            });
        }
    }
    this.init();
}

function ajaxShow(options) {
    // Becomes this.options
    var defaults = {
        bgColor: '#fff',
        duration: 0,
        opacity: 0.7,
        classOveride: false
    }
    this.options = jQuery.extend(defaults, options);
    this.container = $("#aspnetForm");
    this.init = function() {
        var container = this.container;
        // Delete any other loaders
        this.remove();

    };
    this.remove = function() {
        var overlay = this.container.children(".ajax_overlay");
        if (overlay.length) {
            overlay.hide(this.options.classOveride, function() {
                overlay.remove();
            });
        }
    }
    this.init();
}

function ajaxLoader(options) {
    // Becomes this.options
    var defaults = {
        bgColor: '#fff',
        duration: 800,
        opacity: 0.7,
        classOveride: false
    }
    this.options = jQuery.extend(defaults, options);
    this.container = $("#aspnetForm");
    this.init = function() {
        var container = this.container;
        // Delete any other loaders
        this.remove();
        // Create the overlay
        var overlay = $('<div></div>').css({
            'background-color': this.options.bgColor,
            'opacity': this.options.opacity,
            'width': container.width(),
            'height': container.height(),
            'position': 'absolute',
            'top': '0px',
            'left': '0px',
            'z-index': 99999
        }).addClass('ajax_overlay');
        // add an overiding class name to set new loader style
        if (this.options.classOveride) {
            overlay.addClass(this.options.classOveride);
        }
        // insert overlay and loader into DOM
        container.append(
			overlay.append(
				$('<div></div>').addClass('ajax_loader')
			).fadeIn(this.options.duration)
		);
    };
    this.remove = function() {
        var overlay = this.container.children(".ajax_overlay");
        if (overlay.length) {
            overlay.fadeOut(this.options.classOveride, function() {
                overlay.remove();
            });
        }
    }
    this.init();
}

