
/** STATIC TEXT POPUP */
function showStaticTextPopup(title,header,content,isAlert) {
    $(function() {
        $("#jqueryStatic").dialog({
                modal: true,
                title: title,
                width: 500,
                resizable: true,
                height: 'auto',
                stack: true,
                closeOnEscape:true,
                buttons: {
                        Ok: function() {
                            $(this).dialog('close');
                        }
                }
        });
    });
    //TODO
    document.getElementById("jqueryStatic_content").style.overflow = "auto";
    document.getElementById("jqueryStatic_content").innerHTML = content;   
    document.getElementById("jqueryStatic_header").innerHTML = header;
    
    //If alert set another width
    if(isAlert) {
        document.getElementById("jqueryStatic").style.zIndex = "999";
        //document.getElementById("popupDivStatic").focus();
    } else {
        document.getElementById("jqueryStatic_content").style.height = "200px";
    }
   
}

function hideStaticTextPopup() {
    $("#popupDivStatic").dialog('close');
   
}

/* Confirm- denne confirm skal deprecates...!! Og benyt istedet confirmPopup hvor ok function skal gives med som parameter  */
//function showConfirmPopup(title,header,content) {
//
//    $(function() {
//        $("#jqueryStatic").dialog({
//                modal: true,
//                title: title,
//                width: 500,
//                resizable: false,
//                stack: true,
//                closeOnEscape:true,
//                buttons: {
//                        Ok : function() {
//                                ok_();
//                        },
//                        Annullér : function() {
//                                $(this).dialog('close');
//                        }
//                }
//        });
//    });
//    //TODO
//    document.getElementById("jqueryStatic_content").style.overflow = "auto";
//    document.getElementById("jqueryStatic_content").innerHTML = content;
//    document.getElementById("jqueryStatic_header").innerHTML = header;
//}

/* Confirm  */
function confirmPopup(title,header,content,confirmFunction) {
    $(function() {
        $("#jqueryStatic").dialog({
                modal: true,
                title: title,
                width: 500,
                height: 'auto',
                resizable: false,
                stack: true,
                closeOnEscape:true,
                buttons: {
                    Ok : function() {
                        confirmFunction();
                    },
                    Annullér: function() {
                        $(this).dialog('close');
                    }
                }
        });
    });
    //TODO
    document.getElementById("jqueryStatic_content").style.overflow = "auto";
    document.getElementById("jqueryStatic_content").innerHTML = content;   
    document.getElementById("jqueryStatic_header").innerHTML = header;
}


/* Ja eller Nej Confirm Popup  */
function yesNoConfirmPopup(title,header,content,confirmFunction) {
    
    $(function() {
        $("#jqueryStatic").dialog({
                modal: true,
                title: title,
                width: 500,
                height: 'auto',
                resizable: false,
                stack: true,
                closeOnEscape:true,
                buttons: {
                        Ja : function() {
                                confirmFunction();
                        },
                        Nej : function() {
                                $(this).dialog('close');
                        }
                }
        });
    });
    //TODO
    document.getElementById("jqueryStatic_content").style.overflow = "auto";
    document.getElementById("jqueryStatic_content").innerHTML = content;   
    document.getElementById("jqueryStatic_header").innerHTML = header;
}



