﻿//Funciones JavaScript.

function makeDoubleDelegate(function1, function2) {
    return function () {
        if (function1)
            function1();
        if (function2)
            function2();
    }
}

function Maximizar() {
    window.moveTo(0, 0);
    if (document.all) {
        top.window.resizeTo(screen.availWidth, screen.availHeight);
    }
    else if (document.layers || document.getElementById) {
        if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
            top.window.outerHeight = screen.availHeight;
            top.window.outerWidth = screen.availWidth;
        }
    }
}

function no_Focus() {
    anclas = document.getElementsByTagName("a").length;
    for (i = 0; i < anclas; i++)
        document.getElementsByTagName("a").item(i).onfocus = new Function("if(this.blur)this.blur()")
}

function showDiv(id) {
    document.getElementById(id).style.visibility = "visible";
}

function hideDiv(id) {
    document.getElementById(id).style.visibility = "hidden"; document.getElementById(id).style.display = "none";
}

function imagen_fondo(pagina, img) {
    var objeto = document.getElementById(pagina);
    objeto.style.background = "url(" + img + ") fixed center top no-repeat #090909";
}

function disableControl(id) {
    document.getElementById(id).disabled = true;
}

function SetUniqueRadioButton(nameregex, current) {
    re = new RegExp(nameregex);

    for (i = 0; i < document.forms[0].elements.length; i++) {

        elm = document.forms[0].elements[i]
        if (elm.type == 'radio') {
            elm.checked = false;
        }

    }
    current.checked = true;
}



