﻿$().ready(function() {
    LoadH3('default', 'Bienvenido al site para Partners de LicenciasOnline');
    $("td[VRPLink]").hover(function() {
        $(this).find("div[class='VRPLink']").slideDown("fast");
    }, function() {
        $(this).find("div[class='VRPLink']").slideUp("fast");
    });
});

function Show(iconName, title) {
    $("div[content]").hide();
    $.each($("div[content]"), function() {
        if ($(this).attr("content") == iconName) {
            $(this).show();
            var imgIcon = $("img[section='" + iconName + "']");
            imgIcon.attr("src", imgIcon.attr("src").replace("normal", "over"));
            LoadH3(iconName, title);
        }
    });
    $("div[content='" + iconName + "']").show();
}

function ClearContent() {
    $("div[content]").hide();
    $("div[content='default']").show();
    $.each($("img[section]"), function() {
        $(this).attr("src", $(this).attr("src").replace("over", "normal"));
    });
}

function LoadH3(name, title) {
    
    var h3 = $("h3[title='"+ name +"']");

    titleArray = title.split("");
    charsImg = "";

    for (i = 0; i <= titleArray.length - 1; i++) {
        charsImg += "<img src='Images/Default/Chars/" + titleArray[i].charCodeAt() + ".png'>";
    }

    h3.html(charsImg);
    //h3.show();
}

function ShowContent(contentId, anchor, hiddenText, visibleText) {
    if ($(anchor).attr("status") == "hidden") {
        $("#" + contentId + "").slideDown();
        $(anchor).text(hiddenText);
        $(anchor).attr("status","visible");
    }
    else {
        $("#" + contentId + "").slideUp();
        $(anchor).text(visibleText);
        $(anchor).attr("status","hidden");
    }
}

function slideVRPLink() { 
    
}