﻿  
function display(v_nombreImagen, v_urlImagen) 
{
    if (document.images && typeof v_urlImagen != 'undefined')
        document[v_nombreImagen].src = v_urlImagen;
}


function printpage() { window.print(); }

function isDefined(variable) {
    return (typeof (window[variable]) == "undefined") ? false : true;
}

function cargarMouseOver() {
    imgsrc = $(this).attr("src");
    matches = imgsrc.match(/_on/);
    if (!matches) {
        imgsrcON = imgsrc.replace(/_off.gif$/ig, "_on.gif");
        $(this).attr("src", imgsrcON);
    }
}

function cargarMouseOut() {
    if (isDefined("imgsrc"))
        $(this).attr("src", imgsrc);
}

var portadasMostradas = true;

function ocultarMostrarPortadas() {
    
    if (portadasMostradas) {

        portadasMostradas = false;

        $(".opcion").text("Mostrar imágenes");

        $(".celdaImagen").hide();

        $(".celdaInformacion").attr("colspan", "2");

        $(".celdaInformacion").css("width", "100%");

    } else {

        portadasMostradas = true;

        $(".opcion").text("Ocultar imágenes");

        $(".celdaImagen").show();

        $(".celdaInformacion").removeAttr("colspan");

        $(".celdaInformacion").css("width", "535px");
    }
}

function MantenSesion() {
    var CONTROLADOR = "Controladores/RefrescarSesion.ashx";

    var head = document.getElementsByTagName('head').item(0);

    var script = document.createElement('script');

    script.src = CONTROLADOR;
    script.setAttribute('type', 'text/javascript');
    script.defer = true;

    head.appendChild(script);
} 
