function input_onfocus(el) {
    if ((document.getElementById(el)!=null)){
        if (document.getElementById(el).type != "password"){
            document.getElementById(el).type = "password";
            document.getElementById(el).value = "";
            document.getElementById(el).style.color = "black";
        }
    }
}

function input_onblur(el,val) {
    if ((document.getElementById(el)!=null)){
        if (document.getElementById(el).value == ""){
            document.getElementById(el).type = "text";
            document.getElementById(el).value = val;
            document.getElementById(el).style.color = "gray";
        }
    }
}

function kontrola(id1,id2){
    if (((document.getElementById(id1)!=null))&&((document.getElementById(id2)!=null))){
        if ((document.getElementById(id1).value)!=(document.getElementById(id2).value)){
            alert("Nové heslo je potrebné správne zopakovať!");
            return false;
        } else if (document.getElementById(id1).value.length<6){
            alert("Nové heslo musí obsahovať aspoň 6 znakov!");
            return false;
        }
    }
    return true;
}

var overlay = jQuery("<div onclick='closeMessageForm()' id='loaderOverlay'></div>");
function showLoginForm(id) {
    overlay.css("position", "absolute");
    overlay.css("top", 0);
    overlay.css("left", 0);
    var width = $(document).width();
    var height = $(document).height();
    if (navigator.appName == "Microsoft Internet Explorer") {
        width = document.body.clientWidth;
    }
    overlay.css("width", width);
    overlay.css("height", height);
    overlay.css("background", "black");
    overlay.css("opacity", 0.90);
    overlay.css("z-index", 5000);
    overlay.css("filter", "aplha(opacity=90)");
    $("body").append(overlay);
    overlay.hide();
    overlay.fadeIn("fast");

    $("#"+id).css("position", "fixed");
    $("#"+id).css("top", "0");
    $("#"+id).css("margin-top", "10px");
    $("#"+id).css("left", ($(document).width() - $("#"+id).width()) / 2);
    $("#"+id).css("z-index", 5001);
    $("#"+id).fadeIn("fast");
}


function closeMessageForm() {
    overlay.fadeOut("fast");
    $(".overlayForm").fadeOut("fast");
}

var overlay2 = jQuery("<div onclick='closeMessageForm2()' id='loaderOverlay'></div>");
function showCard(){
    overlay2.css("position", "absolute");
    overlay2.css("top", 0);
    overlay2.css("left", 0);
    var width = $(document).width();
    var height = $(document).height();
    if (navigator.appName == "Microsoft Internet Explorer") {
        width = document.body.clientWidth;
    }
    overlay2.css("width", width);
    overlay2.css("height", height);
    overlay2.css("background", "black");
    overlay2.css("opacity", 0.90);
    overlay2.css("z-index", 5000);
    overlay2.css("filter", "aplha(opacity=90)");
    $("body").append(overlay2);
    overlay2.hide();
    overlay2.fadeIn("fast");

    $("#platinumCard").css("position", "fixed");
    $("#platinumCard").css("top", "0");
    $("#platinumCard").css("margin-top", "10px");
    $("#platinumCard").css("left", ($(document).width() - $("#platinumCard").width()) / 2);
    $("#platinumCard").css("z-index", 5001);
    $("#platinumCard").fadeIn("fast");
}

function closeMessageForm2() {
    overlay2.fadeOut("fast");
    $("#platinumCard").fadeOut("fast");
}

