var menuList = new Array(); var buttonList = new Array(); var scriptList = new Array(); var needPopup = false; function scriptDoLoadPost(scriptUrl, scriptForm, scriptPos, scriptArgs, noLoading) { if(needPopup) { scriptDoLoadPostDialog(scriptUrl, scriptForm, scriptPos, scriptArgs, noLoading); return; } if(!scriptArgs){ var scriptArgs = ''; } scriptArgs = jQuery('#'+scriptForm).serialize() + scriptArgs; showLoadingIcon(scriptPos, noLoading); jQuery.ajax({ type: "POST", url:scriptUrl, data: scriptArgs, success: function(data){ document.getElementById(scriptPos).innerHTML = data; jQuery("#"+scriptPos).find("script").each(function(i) { eval($(this).text()); }); } }); } function scriptDoLoad(scriptUrl, scriptPos, scriptArgs, noLoading) { if(needPopup) { scriptDoLoadGetDialog(scriptUrl, scriptPos, scriptArgs, noLoading); return; } showLoadingIcon(scriptPos, noLoading); jQuery.ajax({ type: "get", url:scriptUrl, data: scriptArgs, success: function(data){ document.getElementById(scriptPos).innerHTML = data; jQuery("#"+scriptPos).find("script").each(function(i) { eval($(this).text()); }); } }); } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } function sitemapDoLoadPost(scriptUrl, scriptForm, scriptPos, scriptArgs, noLoading) { hideDiv('proceed'); showDiv('message'); if(!scriptArgs){ var scriptArgs = ''; } scriptArgs = jQuery('#'+scriptForm).serialize() + scriptArgs; showLoadingIcon(scriptPos, noLoading); jQuery.ajax({ type: "POST", url:scriptUrl, data: scriptArgs, success: function(data){ document.getElementById(scriptPos).innerHTML = data; jQuery("#"+scriptPos).find("script").each(function(i) { eval($(this).text()); }); } }); } function showLoadingIcon(scriptPos,noLoading){ loading = 0; contentDiv = ""; switch (scriptPos){ case "content": contentDiv = '
'; loading = 1; break; case "subcontent": contentDiv = ''; loading = 1; break; case "ContentFrame": contentDiv = ''; loading = 1; break; case "subcontmed": contentDiv = ''; loading = 1; break; case "newsalert": contentDiv = ''; loading = 1; break; default : contentDiv = ''; loading = 1; break; } if((loading == 1) && (noLoading != 1)){ if(needPopup) { return contentDiv; } else { document.getElementById(scriptPos).innerHTML = contentDiv; } } } function confirmLoad(scriptUrl, scriptPos, scriptArgs) { if (chkObject('wantproceed')) { wantproceed = "Do you really want to proceed?"; } var agree = confirm(wantproceed); if (agree) return scriptDoLoad(scriptUrl, scriptPos, scriptArgs); else return false; } function confirmSubmit(scriptUrl, scriptForm, scriptPos, scriptArgs) { if(!scriptArgs){ var scriptArgs = ''; } if (chkObject('wantproceed')) { wantproceed = "Do you really want to proceed?"; } var agree = confirm(wantproceed); if (agree) return scriptDoLoadPost(scriptUrl, scriptForm, scriptPos, scriptArgs); else return false; } function doAction(scriptUrl, scriptPos, scriptArgs, actionDiv) { actVal = document.getElementById(actionDiv).value; scriptArgs += "&sec=" + actVal; switch (actVal) { case "select": break; case "checkstatus": case "edit": case "reports": case "viewreports": case "pagedetails": case "website-access-manager": scriptDoLoad(scriptUrl, scriptPos, scriptArgs); break; default: if(spdemo){ if((actVal == 'delete') || (actVal == 'Activate') || (actVal == 'Inactivate') || (actVal == 'recheckreport') || (actVal == 'addToWebmasterTools') || (actVal == 'showrunproject') || (actVal == 'checkscore') || (actVal == 'deletepage') || (actVal == 'upgrade') || (actVal == 'reinstall') || (actVal == 'deleteSitemap')){ alertDemoMsg(); return false; } } confirmLoad(scriptUrl, scriptPos, scriptArgs); break; } } function doLoad(argVal, scriptUrl, scriptPos, scriptArgs) { if(needPopup) { actVal = $("#dialogContent #" + argVal).val(); } else { actVal = document.getElementById(argVal).value; } scriptArgs += "&"+ argVal +"=" + actVal; scriptDoLoad(scriptUrl, scriptPos, scriptArgs); } function doLoadUrl(argVal, scriptUrl) { actVal = document.getElementById(argVal).value; window.location = scriptUrl += "&"+ argVal +"=" + actVal; } function showMenu(button, scriptPos){ var downClass = 'fa-caret-down'; var upClass = 'fa-caret-up'; for (var i=0; i