﻿jQuery(document).ready(function() {
    SetHtmlElementEvent();
    SetJQueryElement();
});
function SetHtmlElementEvent() {

}
function SetJQueryElement() {
    GeneratePopup();
}

function GeneratePopup() {
    if (PopupsArray) {
        for (index in PopupsArray) {
            SetPopup(PopupsArray[index].divId, PopupsArray[index].frmId, PopupsArray[index].targetUrl);
        }
    }
}
function ShowMe(divId, frmId, left, top, width, height) {
    if (divId) {
        $("#" + divId).show();
        if (left)
            $("#" + divId).css("left", left);
        if (top)
            $("#" + divId).css("top", top);
        if (width)
            $("#" + divId).css("width", width + 10);
        if (height)
            $("#" + divId).css("height", height + 25);

        if (frmId) {
            if (left)
                $("#" + frmId).css("left", left);
            if (top)
                $("#" + frmId).css("top", top);
            if (width)
                $("#" + frmId).css("width", width + 10);
            if (height)
                $("#" + frmId).css("height", height + 25);
        }
    }
    else {
        $("#draggable").show();
    }
}
function HideMe(divId) {
    if (divId)
        $("#" + divId).hide();
    else
        $("#draggable").hide();
}
function ShowPopup(id) {
    $("#" + id).show();
}
function HidePopup(id) {
    $("#" + id).hide();
}
function SetPopup(divId, frmId, targetUrl) {
    $("#" + divId).draggable();
    $("#" + frmId).attr('src', targetUrl);
}
        

