DATA_SRC_RES=1;DATA_SRC_FLD=2;DATA_SRC_BO=3;function login(){g_SysLoader.call(_login.bind(window),[sjcl.path.mapGlobalScript("Login.js")]);}function _login(){var dlg=new LoginDialog();dlg.show(true);}function loginByUserAccount(){g_SysLoader.call(_loginByUserAccount.bind(window),[sjcl.path.mapGlobalScript("SelectUser.js")]);}function _loginByUserAccount(){var win=new SelectUserDialog(null,false,null,1);win.dlg.destroyOnHide=true;win.onReturn=function(){new sjcl.net.WebRequest("/lib/ajax/LogByAccount.php?id="+win.selectedIds[0],function(){window.location="/";});showWaitDialog();};win.show(true);}function selectUser(owner,multiple,onReturn){g_SysLoader.call(_selectUser.bind(window,owner,multiple,onReturn),[sjcl.path.mapGlobalScript("SelectUser.js")]);}function _selectUser(owner,multiple,onReturn){var dlg=new SelectUserDialog(owner,multiple);if(onReturn)dlg.onReturn=function(){onReturn(dlg.selectedIds,dlg.selectedValues);};dlg.dlg.destroyOnHide=true;dlg.show(owner||true);}function selectGroup(owner,multiple,onReturn){g_SysLoader.call(_selectGroup.bind(window,owner,multiple,onReturn),[sjcl.path.mapGlobalScript("SelectGroup.js")]);}function _selectGroup(owner,multiple,onReturn){var dlg=new SelectGroupDialog(owner,multiple);if(onReturn)dlg.onReturn=function(){onReturn(dlg.selectedIds,dlg.selectedValues);};dlg.dlg.destroyOnHide=true;dlg.show(owner||true);}function selectGroupType(owner,multiple,onReturn){g_SysLoader.call(_selectGroupType.bind(window,owner,multiple,onReturn),[sjcl.path.mapGlobalScript("SelectGroupType.js")]);}function _selectGroupType(owner,multiple,onReturn){var dlg=new SelectGroupTypeDialog(owner,multiple);if(onReturn)dlg.onReturn=function(){onReturn(dlg.selectedIds,dlg.selectedValues);};dlg.dlg.destroyOnHide=true;dlg.show(owner||true);}function selectOUnit(owner,multiple,onReturn){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_selectOUnit.bind(window,owner,multiple,onReturn),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectOUnit.js")]);}function _selectOUnit(owner,multiple,onReturn){var dlg=new SelectOUnitDialog(owner,multiple);if(onReturn)dlg.onReturn=function(){onReturn(dlg.selectedIds,dlg.selectedValues);};dlg.dlg.destroyOnHide=true;dlg.show(owner||true);}function findAccount(){g_SysLoader.call(_findAccount.bind(window),[sjcl.path.mapGlobalScript("SelectUser.js")]);}function _findAccount(){var dlg=new SelectUserDialog();dlg.onReturn=function(){window.location="/control_panel/users/View.php?id="+dlg.selectedIds[0];};dlg.show();}function openCreateAccountWizard(admin){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Calendar.css"));g_SysLoader.call(_openCreateAccountWizard.bind(window,admin),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapSjclScript("Calendar.js"),sjcl.path.mapSjclScript("ImageList.js"),sjcl.path.mapGlobalScript("CreateAccount.js"),sjcl.path.mapGlobalScript("ProtectionKeys.js")]);}function _openCreateAccountWizard(admin){var dlg=new CreateAccountWizard(admin);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/CreateAccount.php",function(){var result=wr.getJson();wd.close();message=result.status?getString('CREATE_ACC_SUCC'):getString('CREATE_ACC_FAIL');alert(message);if(window["g_UsersGV"])g_UsersGV.dataTable.refresh();if(dlg.data.SetProfile)openPreferences(result.userId,0);},null,"POST",dlg.getPostData());};dlg.show(true);}function openPreferences(userId,tab){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_openPreferences.bind(window,userId,tab),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapSjclScript("OfficeBar.js"),sjcl.path.mapSjclScript("ImageList.js"),sjcl.path.mapGlobalScript("ProtectionKeys.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("ImageUpload.js"),sjcl.path.mapGlobalScript("UserProfile.js")]);}function _openPreferences(userId,tab){var dlg=new UserProfileDialog(userId,tab);dlg.onReturn=function(){var url="/lib/ajax/UpdateUP.php"+(dlg.userId?"?uid="+dlg.userId:"");var wd=showWaitDialog();var wr=new sjcl.net.WebRequest(url,function(){if(!dlg.userId){g_SpecialEffects=dlg.data.SpecialEffects;if((g_UserProfile.loginName=="")||(g_UserProfile.loginName==dlg.LoginName)){g_UserProfile.autoLogin=dlg.data.AutoLogin;g_UserProfile.loginName=dlg.LoginName;g_UserProfile.update();}if(dlg.data.Theme!=g_Theme)window.location.reload(true);}wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function openHtmlEditor(html,alternate,onReturn,help){if(sjcl.browser.screenWidth()<1024){alert(getString("MIN_RES_REQ"));return;}var version;if(arguments.length>0&&typeof arguments[0]=="object")version=arguments[0].version;if(version==2||(version==undefined&&sjcl.browser.isIE)){var info=arguments.length>0?arguments[0]:null;if(arguments.length>0&&typeof arguments[0]!="object")info={defaultHtml:html,alternateHtml:alternate,onReturn:onReturn};sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ColorPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("HTMLEditor1.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("HTMLEditor2.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ListView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("SymbolPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TabControl.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TableStyles.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_openHtmlEditor2.bind(window,info),[sjcl.path.mapSjclScript("ListView.js"),sjcl.path.mapGlobalScript("ContentEditor.js"),sjcl.path.mapGlobalScript("HtmlEditor.js"),sjcl.path.mapGlobalScript("HtmlEditor2.js")]);}else{sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ColorPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("SymbolPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Calendar.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("HTMLEditor1.css"));var modules=[sjcl.path.mapSjclScript("ColorPicker.js"),sjcl.path.mapSjclScript("SymbolPicker.js"),sjcl.path.mapSjclScript("Calendar.js"),sjcl.path.mapGlobalScript("HtmlEditor.js")];if(arguments.length>0&&typeof arguments[0]=="object")g_SysLoader.call(_openHtmlEditor.bind(window,arguments[0].defaultHtml,arguments[0].alternateHtml,arguments[0].onReturn),modules);else g_SysLoader.call(_openHtmlEditor.bind(window,html,alternate,onReturn,help),modules);}}function _openHtmlEditor(html,alternate,onReturn){if(!window.g_HtmlEditor)g_HtmlEditor=new HtmlEditor();g_HtmlEditor.defaultHtml=html||"";g_HtmlEditor.alternateHtml=alternate;g_HtmlEditor.onReturn=onReturn;g_HtmlEditor.show(true);}function _openHtmlEditor2(info){var dlg=new HtmlEditor2();if(info)Object.extend(dlg,info);dlg.show(true);}function openFileExplorer(onSelect,owner,defaultPath){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("GridView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ListView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_openFileExplorer.bind(window,onSelect,owner,defaultPath),[sjcl.path.mapSjclScript("GridView.js"),sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapSjclScript("ListView.js"),sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapGlobalScript("FileSelector.js"),sjcl.path.mapGlobalScript("FileUploadStatus.js"),sjcl.path.mapGlobalScript("FileExplorer.js")]);}function _openFileExplorer(onSelect,owner,defaultPath){if(!window.g_FileExplorer)g_FileExplorer=new FileExplorer();if(onSelect)g_FileExplorer.onSelect=onSelect;if(owner)g_FileExplorer.owner=owner;if(defaultPath)g_FileExplorer.defaultPath=defaultPath;g_FileExplorer.show(true);}function openOrganizationalUnits(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ListView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_openOrganizationalUnits.bind(window),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapSjclScript("ListView.js"),sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("OrganizationalUnits.js")]);}function _openOrganizationalUnits(){var dlg=new OrganizationalUnitsDialog();dlg.show();}function openPermissionsDialog(id){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_openPermissionsDialog.bind(window,id),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectGroup.js"),sjcl.path.mapGlobalScript("Permissions.js")]);}function _openPermissionsDialog(id){var dlg=new PermissionsDialog(id);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdatePermissions.php?id="+id,function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(false);}function openNotificationsDialog(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("HTMLEditor2.css"));g_SysLoader.call(_openNotificationsDialog.bind(window),[sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("NotificationsDialog.js"),sjcl.path.mapGlobalScript("ContentEditor.js"),sjcl.path.mapGlobalScript("HtmlEditor2.js")]);}function _openNotificationsDialog(){var dlg=new NotificationsDialog();dlg.show(true);}function openPrintPreview(html){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_openPrintPreview.bind(window,html),[sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapGlobalScript("PrintDialog.js")]);}function _openPrintPreview(html){var dlg=new PrintDialog(html);dlg.show();}function organizeFilters(admin){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_organizeFilters.bind(window,admin),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("OrganizeFiltersDialog.js")]);}function _organizeFilters(admin){var dlg=new OrganizeFiltersDialog(admin);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/OrganizeFilters.php",function(){wd.close();window.location.reload(true);},null,"POST",dlg.getPostData());};dlg.show(true);}function openSyncScheme(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_openSyncScheme.bind(window),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SyncSchemeDialog.js"),sjcl.path.mapGlobalScript("DbTablesDialog.js")]);}function _openSyncScheme(){var dlg=new SyncSchemeDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateSyncScheme.php",function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function openSyncWizard(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Calendar.css"));g_SysLoader.call(_openSyncWizard.bind(window),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapSjclScript("Calendar.js"),sjcl.path.mapGlobalScript("TableSync.js"),sjcl.path.mapGlobalScript("SyncWizard.js")]);}function _openSyncWizard(){var dlg=new SyncWizard();dlg.show(true);}function openBackupWizard(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_openBackupWizard.bind(window),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("BackupWizard.js")]);}function _openBackupWizard(){var dlg=new BackupWizard();dlg.show(true);}TSF_CAT_ADMIN=1;TSF_CAT_FAVORITE=2;TSF_CAT_SEARCH=3;function isSupportPage(){var regex=new RegExp("\/support\/\\w*","i");return regex.test(window.location.href);}function addTSFilter(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ColorPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_addTSFilter.bind(window,TSF_CAT_FAVORITE),[sjcl.path.mapSjclScript("ColorPicker.js"),sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("SelectGroup.js"),sjcl.path.mapGlobalScript("SelectGroupType.js"),sjcl.path.mapGlobalScript("SelectOUnit.js"),sjcl.path.mapGlobalScript("TSFilterDialog.js")]);}function tsSearch(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ColorPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_addTSFilter.bind(window,TSF_CAT_SEARCH),[sjcl.path.mapSjclScript("ColorPicker.js"),sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("SelectGroup.js"),sjcl.path.mapGlobalScript("SelectGroupType.js"),sjcl.path.mapGlobalScript("SelectOUnit.js"),sjcl.path.mapGlobalScript("TSFilterDialog.js")]);}function tsSearchInfo(callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ColorPicker.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_tsSearchInfo.bind(window,callback),[sjcl.path.mapSjclScript("ColorPicker.js"),sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("SelectGroup.js"),sjcl.path.mapGlobalScript("SelectGroupType.js"),sjcl.path.mapGlobalScript("SelectOUnit.js"),sjcl.path.mapGlobalScript("TSFilterDialog.js")]);}function _addTSFilter(category){var dlg=new TSFilterDialog(false,category);dlg.onReturn=function(){var url="/lib/ajax/UpdateTSFilter.php?cat="+category;var wd=showWaitDialog();var wr=new sjcl.net.WebRequest(url,function(){var result=wr.getJson();if(isSupportPage())g_TSFilters.push({id:result.id,fptr:eval(result.view),title:result.title,temp:result.temp});openTSFilter(result.id);wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function _tsSearchInfo(callback){var dlg=new TSFilterDialog(false,TSF_CAT_SEARCH);dlg.onReturn=function(){if(callback)callback(dlg.getPostData());};dlg.show(true);}function gotoTSItem(){g_SysLoader.call(_gotoTSItem.bind(window),[sjcl.path.mapGlobalScript("GotoDialog.js")]);}function _gotoTSItem(){var dlg=new GotoDialog();dlg.onReturn=function(){window.location="/support/"+(dlg.type==1?"ViewTicket":"ViewTask")+".php?id="+dlg.id;};dlg.show(true);}function openTSFilter(id,inactive){if(isSupportPage()){var filter=g_TSFilters.findByProp("id",id);if(filter)g_TSViews.add(new filter.fptr(id,filter.title,window["g_TSView_"+id],window["g_TSView_DFI_"+id],parseInt(filter.temp)),inactive);}else window.location="/support/?fid="+id;}function quickFind(){g_SysLoader.call(_quickFind.bind(window),[sjcl.path.mapGlobalScript("QuickFindDialog.js")]);}function _quickFind(){var dlg=new QuickFindDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/QuickFind.php",function(){var result=wr.getJson();if(isSupportPage())g_TSFilters.push({id:result.id,fptr:eval(result.view),title:result.title,temp:result.temp});openTSFilter(result.id);wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function openSettings(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_openSettings.bind(window),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("SettingsDialog.js")]);}function _openSettings(){var dlg=new SettingsDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateSettings.php",function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function openFeedbackCategories(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TreeView.css"));g_SysLoader.call(_openFeedbackCategories.bind(window),[sjcl.path.mapSjclScript("TreeView.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("FeedbackCategories.js")]);}function _openFeedbackCategories(){var dlg=new FeedbackCategoriesDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateFeedbackCategories.php",function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function addBlog(callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TabControl.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ListView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_addBlog.bind(window,callback),[sjcl.path.mapSjclScript("TabControl.js"),sjcl.path.mapSjclScript("ListView.js"),sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("SelectGroup.js"),sjcl.path.mapGlobalScript("BlogDialog.js")]);}function _addBlog(callback){var dlg=new BlogDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateBlog.php",function(){wd.close();if(callback)callback(wr.getJson());},null,"POST",dlg.getPostData());};dlg.show(true);}function editBlog(id,callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TabControl.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ListView.css"));sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Toolbars.css"));g_SysLoader.call(_editBlog.bind(window,id,callback),[sjcl.path.mapSjclScript("TabControl.js"),sjcl.path.mapSjclScript("ListView.js"),sjcl.path.mapSjclScript("ToolBar.js"),sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("SelectGroup.js"),sjcl.path.mapGlobalScript("BlogDialog.js")]);}function _editBlog(id,callback){var dlg=new BlogDialog(id);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateBlog.php?id="+id,function(){wd.close();if(callback)callback(wr.getJson());},null,"POST",dlg.getPostData());};dlg.show(true);}function addBlogArticle(blogId,callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TabControl.css"));g_SysLoader.call(_addBlogArticle.bind(window,blogId,callback),[sjcl.path.mapSjclScript("TabControl.js"),sjcl.path.mapGlobalScript("BlogArticleDialog.js")]);}function _addBlogArticle(blogId,callback){var dlg=new BlogArticleDialog(null,blogId);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateBlogArticle.php",function(){wd.close();if(callback)callback(wr.getJson());},null,"POST","BlogId="+blogId+"&"+dlg.getPostData());};dlg.show(true);}function editBlogArticle(id,callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TabControl.css"));g_SysLoader.call(_editBlogArticle.bind(window,id,callback),[sjcl.path.mapSjclScript("TabControl.js"),sjcl.path.mapGlobalScript("BlogArticleDialog.js")]);}function _editBlogArticle(id,callback){var dlg=new BlogArticleDialog(id);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateBlogArticle.php?id="+id,function(){wd.close();if(callback)callback(wr.getJson());},null,"POST",dlg.getPostData());};dlg.show(true);}function addToGoUrls(){g_SysLoader.call(_addToGoUrls.bind(window),[sjcl.path.mapGlobalScript("CreateGoUrl.js")]);}function _addToGoUrls(){var dlg=new CreateGoUrlDialog(null,window.location.pathname+window.location.search,document.title);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/UpdateGoUrl.php",function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function ratePage(){g_SysLoader.call(_ratePage.bind(window),[sjcl.path.mapGlobalScript("RatePageDialog.js")]);}function _ratePage(){var dlg=new RatePageDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/RatePage.php",function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function addComment(idCategory,caption,category,parentId,commentId,optional,quote,callback){g_SysLoader.call(_addComment.bind(window,idCategory,caption,category,parentId,commentId,optional,quote,callback),[sjcl.path.mapGlobalScript("SelectUser.js"),sjcl.path.mapGlobalScript("CommentDialog.js")]);}function _addComment(idCategory,caption,category,parentId,commentId,optional,quote,callback){var dlg=new CommentDialog(caption,category,parentId,commentId,optional,quote);dlg.onReturn=function(){var sb=new sjcl.StringBuilder("&");if(commentId&&!quote)sb.write("CommentId="+commentId);sb.write("ParentId="+parentId);sb.write("IdCategory="+idCategory);sb.write(dlg.getPostData());var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/AddComment.php",function(){wd.close();if(callback)callback();},null,"POST",sb.toString());};dlg.show();}function createTask(category,parentId,parentTask,callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Calendar.css"));g_SysLoader.call(_createTask.bind(window,category,parentId,parentTask,callback),[sjcl.path.mapSjclScript("Calendar.js"),sjcl.path.mapGlobalScript("CreateTask.js")]);}function _createTask(category,parentId,parentTask,callback){var dlg=new CreateTaskDialog(category,parentId,parentTask);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/CreateTask.php",function(){wd.close();if(callback)callback();},null,"POST",dlg.getPostData());};dlg.show(true);}function editTask(category,parentId,parentTask,taskId,callback){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("Calendar.css"));g_SysLoader.call(_editTask.bind(window,category,parentId,parentTask,taskId,callback),[sjcl.path.mapSjclScript("Calendar.js"),sjcl.path.mapGlobalScript("CreateTask.js")]);}function _editTask(category,parentId,parentTask,taskId,callback){var dlg=new CreateTaskDialog(category,parentId,parentTask,taskId);dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/CreateTask.php",function(){wd.close();if(callback)callback();},null,"POST",dlg.getPostData());};dlg.show(true);}function playTask(id,callback){g_SysLoader.call(_playTask.bind(window,id,callback),[sjcl.path.mapGlobalScript("WorkItemDialog.js")]);}function _playTask(id,callback){var dlg=new WorkItemDialog();dlg.onReturn=function(){var sb=new sjcl.StringBuilder("&");sb.write("Id="+id);sb.write("Type="+dlg.getValue("Type"));sb.write("Description="+sjcl.escape(dlg.getValue("Description")));var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/PlayTask.php",function(){wd.close();if(callback)callback();},null,"POST",sb.toString());};dlg.show(true);}function pauseTask(id,callback){if(confirm(getString("CONFIRM_STOP_TASK"))){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/PauseTask.php",function(){wd.close();if(callback)callback();},null,"POST","Id="+id);}}function completeTask(id,callback){if(confirm(getString("CONFIRM_COMP_TASK"))){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/CompleteTask.php",function(){wd.close();if(callback)callback();},null,"POST","Id="+id);}}function SendArticleFeedback(id){g_SysLoader.call(_SendArticleFeedback.bind(window,id),[sjcl.path.mapGlobalScript("ArticleFeedbackDialog.js")]);}function _SendArticleFeedback(id){var dlg=new ArticleFeedbackDialog();dlg.onReturn=function(){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/AddArticleFeedback.php?id="+id,function(){wd.close();},null,"POST",dlg.getPostData());};dlg.show(true);}function TransferHours(){g_SysLoader.call(_TransferHours.bind(window),[sjcl.path.mapGlobalScript("RSBalanceDialogs.js")]);}function _TransferHours(){var transferDialog=new TransferHoursDialog();transferDialog.dlg.show(true);}function CreateRequest(){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("TabControl.css"));g_SysLoader.call(_CreateRequest.bind(window),[sjcl.path.mapSjclScript("TabControl.js"),sjcl.path.mapGlobalScript("RSRequestDialogs.js")]);}function _CreateRequest(){var requestDialog=new CreateRequestDialog();requestDialog.dlg.show(true);}function CreateHoursRequest(){g_SysLoader.call(_CreateHoursRequest.bind(window),[sjcl.path.mapGlobalScript("RSHoursRequestDialogs.js")]);}function _CreateHoursRequest(){var hoursRequestDialog=new HoursRequestDialog();hoursRequestDialog.show(true);}function RecoverPassword(){var newPass=new sjcl.widget.InputDialog(getString('LOGIN_NAME')+':','',sjcl.widget.ContentType.String,'Required="1"',function(text){_recoverPassword(text);},getString('FORGOT_PASSWORD'),null);newPass.show();}function _recoverPassword(text){var wd=showWaitDialog();var wr=new sjcl.net.WebRequest("/lib/ajax/RecoverPassword.php?login="+text,function(){alert(wr.getText());wd.close();},null,"POST",'');}function ShowUserInformation(element,userId){g_SysLoader.call(_showUserInfo.bind(window,element,userId),[sjcl.path.mapSjclScript("ToolTip.js")]);}function _showUserInfo(element,userId){var toolTip=new sjcl.widget.ToolTip(element,"../../../lib/ajax/UserInformation.php?userId="+userId,true,true);toolTip.onLoad=_toolTipHandler.bind(toolTip);toolTip.show();}function _toolTipHandler(){var e=sjcl.dom.getElementsByClassName(document,"Frame");var closeBtn=e[e.length-1].firstChild;var _this=this;closeBtn.onclick=function(){_this.close();};}function showPageVisitors(page){sjcl.requireStyle(sjcl.path.mapThemeLocaleCSS("ListView.css"));g_SysLoader.call(_showPageVisitors.bind(window,page),[sjcl.path.mapGlobalScript("PageVisitDialog.js"),sjcl.path.mapSjclScript("ListView.js")]);}function _showPageVisitors(page){targetPage=(page!=undefined)?page:window.location;var pageDlg=new PageVisitorsDialog(targetPage);pageDlg.show(true);}function openEmailUsers(){g_SysLoader.call(_openEmailUsers.bind(window),[sjcl.path.mapGlobalScript("EmailUsersDlg.js")]);}function _openEmailUsers(){var dlg=new EmailUsersDlg();dlg.show();}