function AjaxAction(){this.request=null;this.before=function(){};this.after=function(){}}
function ElementDisable(a,b){this.loading=this.currentEvents=this.element=null;this.before=function(){this.element=$(a);if(null!=b&&""!=b){this.currentEvents=[];var c=this.element.attr("on"+b);if(null!=c&&""!=c)this.currentEvents.push(c),this.element.removeAttr("on"+b);else{var d=this.element.data("events"),e=c=null;for(e in d)if(e==b){c=d[b];break}if(null!=c&&0<c.length)for(d=0;d<c.length;d++)this.currentEvents.push(c[d].handler);this.element.unbind()}}this.loading=$(".loadingCursor");if(0==this.loading.length){this.loading=
$('<table class="loadingCursor" style="display:none;"><td class="loadingCursorImg"></td><td class="loadingCursorText" style="display:none;">'+NextWay.Localization.pleaseWaitText+"</td></table>");$("body").append(this.loading);var g=this.loading,f=!1;$(document).bind("mousemove.ajaxActions",function(a){setNextToCursor($(".loadingCursor"),a.pageX,a.pageY);f||(f=!0,g.fadeIn())})}null!=b&&this.element.bind(b+".waitmessage",function(a){$(".loadingCursorText").fadeIn();setTimeout("$('.loadingCursorText').fadeOut()",
2E3)})};this.after=function(){null!=this.loading&&0<this.loading.length&&cleanUpLoadingCursor(this.loading);this.element.unbind(b);if(null!=this.currentEvents&&0<this.currentEvents.length)for(var a=0;a<this.currentEvents.length;a++)this.element.bind(b,this.currentEvents[a])}}ElementDisable.prototype=AjaxAction;
function BlockUI(a){this.beforeInternal=function(){4!=this.request.state&&$.blockUI({message:'<h1><img src="busy.gif" /> Just a moment...</h1><span class="PleaseWait" style="display:none;color:Red;">Your request its still being processed.</span>',onBlock:function(){$(document).bind("click.block",function(){$(".PleaseWait").fadeIn();setTimeout("$('.PleaseWait').fadeOut()",5E3)})}})};this.after=function(){$.unblockUI()}}BlockUI.prototype=AjaxAction;
function setNextToCursor(a,b,c){a.css({top:c+15+"px",left:b+15+"px"})}function cleanUpLoadingCursor(a){$(document).unbind("mousemove.ajaxActions");a.fadeOut(function(){a.remove()})}
function VortalBlockUI(){function a(){$(".loadingCursorText").fadeIn()}function b(){var a=0;isNaN(window.innerWidth)?document.documentElement&&document.documentElement.clientWidth?a=document.documentElement.clientWidth:document.body&&document.body.clientWidth&&(a=document.body.clientWidth):a=window.innerWidth;return a}function c(){isNaN(window.innerHeight)?document.documentElement&&document.documentElement.clientHeight?width=document.documentElement.clientHeight:document.body&&document.body.clientHeight&&
(width=document.body.clientHeight):width=window.innerHeight;return width}function d(){var a=$(".loadingCursor");if(0==a.length){a=$('<table class="loadingCursor" style="display:none;z-index:9999;"><tr><td class="loadingCursorImg"></td><td class="loadingCursorText" style="display:none;">'+NextWay.Localization.pleaseWaitText+"</td></tr></table>");$("body").append(a);var d=Math.floor(b()/2),e=Math.floor(c()/2);setNextToCursor(a,d,e);a.fadeIn();$(document).bind("mousemove.ajaxActions",function(a){setNextToCursor($(".loadingCursor"),
a.pageX,a.pageY)})}}var e=0,g,f;this.setTimeouts=function(){f=setTimeout(d,300);g=setTimeout(a,1E3)};this.clearTimeouts=function(){clearTimeout(f);clearTimeout(g)};this.removeWheel=function(){var a=$(".loadingCursor");null!=a&&0<a.length&&cleanUpLoadingCursor(a)};VortalBlockUI.prototype.blockUI=function(){0==e&&($.blockUI({message:null,css:{backgroundColor:"#fff",opacity:0,cursor:"auto"},overlayCSS:{backgroundColor:"#fff",opacity:0,cursor:"auto"}}),this.setTimeouts());e++};VortalBlockUI.prototype.unblockUI=
function(){e--;0==e&&($.unblockUI(),this.clearTimeouts(),this.removeWheel())}}(function(a){a.vortalBlockUI=a.vortalBlockUI||new VortalBlockUI})(jQuery);function NextWayAjaxActionConfig(){function a(b){if(void 0!=b)if("function"==typeof b)b();else if($.isArray(b)&&0<b.length)for(var c=0,d=b.length;c<d;c++)a(b[c])}this.Sucess=this.Error=null;NextWayAjaxActionConfig.prototype.OnError=function(){a(this.Error)};NextWayAjaxActionConfig.prototype.OnSucess=function(){a(this.Sucess)}}
function postForm(a,b,c,d,e,g){var f=null;if(window.tinyMCE)for(tinyMCE.triggerSave(),i=0;i<tinyMCE.editors.length;i++)f=document.getElementById(tinyMCE.editors[i].editorId),null!=f&&(v=f.value,null!=v&&""!=v&&(v=v.replace(/&amp;amp;/gi,"&amp;"),f.value=v));a=$("#"+a).parents("form:first");var h="";a.children("input[name=Post_Back_Action_Name_Hidden]:first").val(b);a.children("input[name=Post_Back_Arguments_Hidden]:first").val(c);a.find("select[arl=true]").each(function(){$("#"+this.id).selectOptions(/./);
null==$("#"+this.id).val()&&(h+="&"+this.name+"=")});b=a.nextWaySerializer();e&&(e=jQuery.param(e),void 0!==e&&""!==e&&(b+="&"+e));b+=h;g?$.ajax({url:d,data:b,type:"POST",cache:!1,timeout:0,beforeSend:function(){$.vortalBlockUI.blockUI()},error:function(a,b,c){$.vortalBlockUI.unblockUI();-1!=d.indexOf("SendChunk")&&(null!=c?document.certificateApplet.DebugInfo(["Ajax error textStatus: ",b," -- errorThrown.Name: ",c.name," -- errorThrown.Number: ",c.number," -- errorThrown.Description: ",c.description,
" -- errorThrown.Message: ",c.message,"\n"].join("")):document.certificateApplet.DebugInfo(["Ajax error textStatus: ",b,"\n"].join("")))},success:function(a){-1!=d.indexOf("SendChunk")&&document.certificateApplet.DebugInfo(["Ajax received data=",a,"\n"].join(""));-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?($.vortalBlockUI.unblockUI(),parseAjaxElementReturn(a)):($.vortalBlockUI.unblockUI(),openTimeoutBlockUI())},complete:function(){var a=arguments[0];!0!==
this.async&&"undefined"!=typeof this.async||"undefined"==typeof a||("unknown"!=typeof a.onreadystatechange&&(a.onreadystatechange=null),"unknown"!=typeof a.abort&&(a.abort=null));"function"==typeof complete&&complete.apply(this,arguments)},dataType:"html"}):$.ajax({url:d,data:b,type:"POST",cache:!1,timeout:0,error:function(a,b,c){-1!=d.indexOf("SendChunk")&&(null!=c?document.certificateApplet.DebugInfo(["Ajax error textStatus: ",b," -- errorThrown.Name: ",c.name," -- errorThrown.Number: ",c.number,
" -- errorThrown.Description: ",c.description," -- errorThrown.Message: ",c.message,"\n"].join("")):document.certificateApplet.DebugInfo(["Ajax error textStatus: ",b,"\n"].join("")))},success:function(a){-1!=d.indexOf("SendChunk")&&document.certificateApplet.DebugInfo(["Ajax received data=",a,"\n"].join(""));-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?parseAjaxElementReturn(a):openTimeoutBlockUI()},complete:function(){var a=arguments[0];!0!==this.async&&"undefined"!=
typeof this.async||"undefined"==typeof a||("unknown"!=typeof a.onreadystatechange&&(a.onreadystatechange=null),"unknown"!=typeof a.abort&&(a.abort=null));"function"==typeof complete&&complete.apply(this,arguments)},dataType:"html"});a.find("select[arl=true]").each(function(){$("#"+this.id).selectOptions(/zzzzz/,!0)})}
function postAction(a,b,c){c?$.ajax({url:a,data:b,type:"POST",cache:!1,beforeSend:function(){$.vortalBlockUI.blockUI()},error:function(){$.vortalBlockUI.unblockUI()},success:function(a){-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?($.vortalBlockUI.unblockUI(),parseAjaxElementReturn(a)):($.vortalBlockUI.unblockUI(),openTimeoutBlockUI())},dataType:"html"}):$.ajax({url:a,data:b,type:"POST",cache:!1,success:function(a){-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?
parseAjaxElementReturn(a):openTimeoutBlockUI()},dataType:"html"})}function getActionAutoRefresh(a,b){$.ajax({url:a,type:"GET",cache:!1,success:function(a){-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?(a=parseAjaxElementReturnAutoRefresh(a),void 0!=b&&"function"==typeof b&&null!==a&&void 0!==a&&""!=a&&b(a)):openTimeoutBlockUI()},dataType:"html"})}
function getAction(a,b,c,d){if(800<=a.length){a=a.split("&");for(var e=a[0],g=1;g<a.length;g++){var f=a[g].split("=");1<f.length&&""===f[1]||(e+="&"+a[g])}a=e}b?$.ajax({url:a,type:"GET",cache:!1,beforeSend:function(){$.vortalBlockUI.blockUI()},error:function(){$.vortalBlockUI.unblockUI();d&&d.OnError()},success:function(a){-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?($.vortalBlockUI.unblockUI(),parseAjaxElementReturn(a),void 0!=c&&"function"==typeof c&&c(),
d&&d.OnSucess()):($.vortalBlockUI.unblockUI(),openTimeoutBlockUI())},dataType:"html"}):$.ajax({url:a,type:"GET",cache:!1,success:function(a){-1==a.indexOf("AtLoginPage")&&-1==a.indexOf("RequestSecurityTokenResponseCollection")?(parseAjaxElementReturn(a),void 0!=c&&"function"==typeof c&&c()):openTimeoutBlockUI()},dataType:"html"})}function showGetVideoTutorial(a,b){var c=$("#"+a);void 0==c||null==c.html()?getAction(b,!1,function(){$("#"+a).bPopup("open")}):$("#"+a).bPopup("open")}
function hideVideoTutorial(a){var b=$("#"+a);b.bPopup("close");setInterval(function(){b.remove()},1E3)};
