function GetCenteredLeft(Width) { return (screen.width - Width) / 2; } function GetCenteredTop(Height) { return (screen.height - Height) / 2; } function OpenWindow(URL, Name, Width, Height) { // Ανοίγει ένα κεντραρισμένο στην οθόνη παράθυρο var l = GetCenteredLeft(Width); var t = GetCenteredTop(Height) - 50; var win = window.open(URL, Name, "resizable=yes,toolbar=no,scrollbars=yes,left=" + l + ",top=" + t + ",width=" + Width + ",height=" + Height + ",directories=no,status=yes,menubar=no,dependent=yes"); win.focus(); } function OpenDialog(URL, Name, Width, Height) { var ret; if (document.all) { root = 'http://www.nessi-europe.net/'; ret = window.showModalDialog(root + "Admin/Forms/OpenDialog.aspx?URL='" + URL + "'", Name, "center:yes;resizable:yes;help:no;dialogWidth:" + Width + "px;dialogHeight:" + Height + "px;status=yes;scroll:no"); } else ret = window.showModalDialog(URL, Name, "center:yes;resizable:yes;help:no;dialogWidth:" + Width + "px;dialogHeight:" + Height + "px;status=yes;scroll:yes"); if (Name == "PagesTreeView") { window.location = window.location.href; window.location.search = "page=" + ret; window.parent.window.location = window.parent.window.location.href; window.parent.window.location.search = "page=" + ret; } else { window.location = window.location.href; } return ret; } function OpenZoomedDialog(URL, Name) { return OpenDialog(URL, Name, screen.width - 20, screen.height - 20); } function OpenDialogNoFrame(URL, Name, Width, Height) { window.open(URL, Name, 'width=' + Width + ',height=' + Height + ',resizable=yes,location=yes,toolbar=yes'); } //UPDATE SORT ORDER ASYNCH function UpdateSortOrder(PagePortletID, SortOrderTextBox) { var text = document.getElementById(SortOrderTextBox).value; if (text != null && text != "") { //alert(PagePortletID + "," + text) $.ajax({ type: "POST", data: "{'PagePortletID':'" + PagePortletID + "','SortOrder':'" + text + "'}", url: "WebServices/wsUpdateSortOrder.asmx/wsUpdateSortOrderByPagePortletID", contentType: "application/json; charset=utf-8", dataType: "json", success: OnSuccessSorting, error: OnErrorSorting }); } } function OnSuccessSorting(data, status) { alert('Η θέση ενημερώθηκε με επιτυχία.'); } function OnErrorSorting(data, status) { alert('ΣΦΑΛΜΑ στην ενημέρωση της θέσης.'); } //UPDATE SORT ORDER ASYNCH END