﻿(function(a){a.fn.jnotifyInizialize=function(d){var c=this;var b={oneAtTime:false,appendType:"append"};d=a.extend(b,d||{});this.addClass("notify-wrapper");if(d.oneAtTime){this.addClass("notify-wrapper-oneattime")}if(d.appendType==="prepend"&&!d.oneAtTime){this.addClass("notify-wrapper-prepend")}return this};a.fn.jnotifyAddMessage=function(g){var f=this;if(f.hasClass("notify-wrapper")){var b={text:"",type:"message",showIcon:true,permanent:false,disappearTime:3000};g=a.extend(b,g||{});var i;var c;switch(g.type){case"message":i="ui-state-highlight";c="ui-icon-info";break;case"error":i="ui-state-error";c="ui-icon-alert";break;default:i="ui-state-highlight";c="ui-icon-info";break}if(f.hasClass("notify-wrapper-oneattime")){this.children().remove()}var e=a('<div class="jnotify-item-wrapper"></div>');var d=a('<div class="ui-corner-all jnotify-item"></div>').addClass(i);if(f.hasClass("notify-wrapper-prepend")){d.prependTo(f)}else{d.appendTo(f)}d.wrap(e);if(g.showIcon){a('<span class="ui-icon" style="float:left; margin-right: .3em;" />').addClass(c).appendTo(d)}a("<span></span>").html(g.text).appendTo(d);a('<div class="jnotify-item-close"><span class="ui-icon ui-icon-circle-close"/></div>').prependTo(d).click(function(){h(d)});if($.browser.msie&&$.browser.version<7){f.css({top:document.documentElement.scrollTop});f.removeClass("IEsucks")}if(!g.permanent){setTimeout(function(){h(d)},g.disappearTime)}}function h(j){j.stop().animate({opacity:"0"},600,function(){j.parent().stop().animate({height:"0px"},300,function(){j.parent().remove();if($.browser.msie&&$.browser.version<7){j.parent().parent().removeClass("IEsucks")}})})}}})(jQuery);
(function(a){a.fn.jnotifyClose=function(){return this.each(function(){var b=a(this).find("div:eq(0)").find("div:eq(0)");b.stop().animate({opacity:"0"},600,function(){b.parent().stop().animate({height:"0px"},300,function(){b.parent().remove();if(navigator.userAgent.match(/MSIE (\d+\.\d+);/)){b.parent().parent().removeClass("IEsucks")}})})})}})(jQuery);
/*
 * jQuery Address Plugin v1.4
 * http://www.asual.com/jquery/address/
 *
 * Copyright (c) 2009-2010 Rostislav Hristov
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Date: 2011-05-04 14:22:12 +0300 (Wed, 04 May 2011)
 */
(function(c){c.address=function(){var v=function(a){c(c.address).trigger(c.extend(c.Event(a),function(){for(var b={},e=c.address.parameterNames(),f=0,p=e.length;f<p;f++)b[e[f]]=c.address.parameter(e[f]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:e,parameters:b,queryString:c.address.queryString()}}.call(c.address)))},w=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},r=function(){return M.pushState&&
d.state!==k},s=function(){return("/"+g.pathname.replace(new RegExp(d.state),"")+g.search+(D()?"#"+D():"")).replace(U,"/")},D=function(){var a=g.href.indexOf("#");return a!=-1?B(g.href.substr(a+1),l):""},u=function(){return r()?s():D()},ha=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},B=function(a,b){if(d.crawlable&&b)return(a!==""?"!":"")+a;return a.replace(/^\!/,"")},x=function(a,b){return parseInt(a.css(b),10)},V=function(a){for(var b,
e,f=0,p=a.childNodes.length;f<p;f++){try{if("src"in a.childNodes[f]&&a.childNodes[f].src)b=String(a.childNodes[f].src)}catch(J){}if(e=V(a.childNodes[f]))b=e}return b},F=function(){if(!K){var a=u();if(h!=a)if(y&&q<7)g.reload();else{y&&q<8&&d.history&&t(O,50);h=a;E(l)}}},E=function(a){v(W);v(a?X:Y);t(Z,10)},Z=function(){if(d.tracker!=="null"&&d.tracker!==null){var a=c.isFunction(d.tracker)?d.tracker:j[d.tracker],b=(g.pathname+g.search+(c.address&&!r()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,
"");if(c.isFunction(a))a(b);else if(c.isFunction(j.urchinTracker))j.urchinTracker(b);else if(j.pageTracker!==k&&c.isFunction(j.pageTracker._trackPageview))j.pageTracker._trackPageview(b);else j._gaq!==k&&c.isFunction(j._gaq.push)&&j._gaq.push(["_trackPageview",decodeURI(b)])}},O=function(){var a=ha()+":"+l+";document.open();document.writeln('<html><head><title>"+n.title.replace("'","\\'")+"</title><script>var "+C+' = "'+encodeURIComponent(u())+(n.domain!=g.hostname?'";document.domain="'+n.domain:
"")+"\";<\/script></head></html>');document.close();";if(q<7)m.src=a;else m.contentWindow.location.replace(a)},aa=function(){if(G&&$!=-1){var a,b=G.substr($+1).split("&");for(i=0;i<b.length;i++){a=b[i].split("=");if(/^(autoUpdate|crawlable|history|strict|wrap)$/.test(a[0]))d[a[0]]=isNaN(a[1])?/^(true|yes)$/i.test(a[1]):parseInt(a[1],10)!==0;if(/^(state|tracker)$/.test(a[0]))d[a[0]]=a[1]}G=null}h=u()},ca=function(){if(!ba){ba=o;aa();var a=function(){ia.call(this);ja.call(this)},b=c("body").ajaxComplete(a);
a();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(x(b,"marginTop")+x(b,"paddingTop"))+"px "+(x(b,"marginRight")+x(b,"paddingRight"))+"px "+(x(b,"marginBottom")+x(b,"paddingBottom"))+"px "+(x(b,"marginLeft")+x(b,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+C+'" style="height:100%;overflow:auto;position:relative;'+(H&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});H&&c('<style type="text/css" />').appendTo("head").text("#"+
C+"::-webkit-resizer { background-color: #fff; }")}if(y&&q<8){a=n.getElementsByTagName("frameset")[0];m=n.createElement((a?"":"i")+"frame");if(a){a.insertAdjacentElement("beforeEnd",m);a[a.cols?"cols":"rows"]+=",0";m.noResize=o;m.frameBorder=m.frameSpacing=0}else{m.style.display="none";m.style.width=m.style.height=0;m.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",m)}t(function(){c(m).bind("load",function(){var e=m.contentWindow;h=e[C]!==k?e[C]:"";if(h!=u()){E(l);g.hash=B(h,o)}});m.contentWindow[C]===
k&&O()},50)}t(function(){v("init");E(l)},1);if(!r())if(y&&q>7||!y&&"on"+I in j)if(j.addEventListener)j.addEventListener(I,F,l);else j.attachEvent&&j.attachEvent("on"+I,F);else ka(F,50)}},ia=function(){var a,b=c("a"),e=b.size(),f=-1,p=function(){if(++f!=e){a=c(b.get(f));a.is('[rel*="address:"]')&&a.address();t(p,1)}};t(p,1)},la=function(){if(h!=u()){h=u();E(l)}},ma=function(){if(j.removeEventListener)j.removeEventListener(I,F,l);else j.detachEvent&&j.detachEvent("on"+I,F)},ja=function(){if(d.crawlable){var a=
g.pathname.replace(/\/$/,"");c("body").html().indexOf("_escaped_fragment_")!=-1&&c('a[href]:not([href^=http]), a[href*="'+document.domain+'"]').each(function(){var b=c(this).attr("href").replace(/^http:/,"").replace(new RegExp(a+"/?$"),"");if(b===""||b.indexOf("_escaped_fragment_")!=-1)c(this).attr("href","#"+b.replace(/\/(.*)\?_escaped_fragment_=(.*)$/,"!$2"))})}},k,C="jQueryAddress",I="hashchange",W="change",X="internalChange",Y="externalChange",o=true,l=false,d={autoUpdate:o,crawlable:l,history:o,
strict:o,wrap:l},z=c.browser,q=parseFloat(c.browser.version),da=z.mozilla,y=z.msie,ea=z.opera,H=z.webkit||z.safari,P=l,j=function(){try{return top.document!==k?top:window}catch(a){return window}}(),n=j.document,M=j.history,g=j.location,ka=setInterval,t=setTimeout,U=/\/{2,9}/g;z=navigator.userAgent;var m,G=V(document),$=G?G.indexOf("?"):-1,Q=n.title,K=l,ba=l,R=o,fa=o,L=l,h=u();if(y){q=parseFloat(z.substr(z.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=q)q=n.documentMode!=8?7:8;var ga=n.onpropertychange;
n.onpropertychange=function(){ga&&ga.call(n);if(n.title!=Q&&n.title.indexOf("#"+u())!=-1)n.title=Q}}if(P=da&&q>=1||y&&q>=6||ea&&q>=9.5||H&&q>=523){if(ea)history.navigationMode="compatible";if(document.readyState=="complete")var na=setInterval(function(){if(c.address){ca();clearInterval(na)}},50);else{aa();c(ca)}c(window).bind("popstate",la).bind("unload",ma)}else!P&&D()!==""?g.replace(g.href.substr(0,g.href.indexOf("#"))):Z();return{bind:function(a,b,e){return w(a,b,e)},init:function(a){return w("init",
a)},change:function(a){return w(W,a)},internalChange:function(a){return w(X,a)},externalChange:function(a){return w(Y,a)},baseURL:function(){var a=g.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==k){d.autoUpdate=a;return this}return d.autoUpdate},crawlable:function(a){if(a!==k){d.crawlable=a;return this}return d.crawlable},history:function(a){if(a!==k){d.history=a;return this}return d.history},state:function(a){if(a!==
k){d.state=a;var b=s();if(d.state!==k)if(M.pushState)b.substr(0,3)=="/#/"&&g.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=D()&&t(function(){g.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==k){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==k){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==k){d.wrap=a;return this}return d.wrap},update:function(){L=o;this.value(h);L=l;return this},
title:function(a){if(a!==k){t(function(){Q=n.title=a;if(fa&&m&&m.contentWindow&&m.contentWindow.document){m.contentWindow.document.title=a;fa=l}if(!R&&da)g.replace(g.href.indexOf("#")!=-1?g.href:g.href+"#");R=l},50);return this}return n.title},value:function(a){if(a!==k){a=N(a);if(a=="/")a="";if(h==a&&!L)return;R=o;h=a;if(d.autoUpdate||L){E(o);if(r())M[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(h===""?"/":h));else{K=o;if(H)if(d.history)g.hash="#"+B(h,o);else g.replace("#"+
B(h,o));else if(h!=u())if(d.history)g.hash="#"+B(h,o);else g.replace("#"+B(h,o));y&&q<8&&d.history&&t(O,50);if(H)t(function(){K=l},1);else K=l}}return this}if(!P)return null;return N(h)},path:function(a){if(a!==k){var b=this.queryString(),e=this.hash();this.value(a+(b?"?"+b:"")+(e?"#"+e:""));return this}return N(h).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(U,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-
1,1);return b},queryString:function(a){if(a!==k){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=h.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,e){var f,p;if(b!==k){var J=this.parameterNames();p=[];b=b?b.toString():"";for(f=0;f<J.length;f++){var S=J[f],A=this.parameter(S);if(typeof A=="string")A=[A];if(S==a)A=b===null||b===""?[]:e?A.concat([b]):[b];for(var T=0;T<A.length;T++)p.push(S+"="+A[T])}c.inArray(a,J)==-1&&b!==null&&
b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){e=[];p=b.split("&");for(f=0;f<p.length;f++){b=p[f].split("=");b[0]==a&&e.push(b.slice(1).join("="))}if(e.length!==0)return e.length!=1?e:e[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var e=0;e<a.length;e++){var f=a[e].split("=")[0];c.inArray(f,b)==-1&&b.push(f)}}return b},hash:function(a){if(a!==k){this.value(h.split("#")[0]+(a?"#"+a:""));return this}a=
h.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(v){if(!c(this).attr("address")){var w=function(r){if(r.shiftKey||r.ctrlKey||r.metaKey)return true;if(c(this).is("a")){var s=v?v.call(this):/address:/.test(c(this).attr("rel"))?c(this).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&c.address.state()!="/"?c(this).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(this).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(s);
r.preventDefault()}};c(this).click(w).live("click",w).live("submit",function(r){if(c(this).is("form")){var s=c(this).attr("action");s=v?v.call(this):(s.indexOf("?")!=-1?s.replace(/&$/,""):s+"?")+c(this).serialize();c.address.value(s);r.preventDefault()}}).attr("address",true)}return this}})(jQuery);

$(document).bind("cbox_open",function(){$("html, body").animate({scrollTop:0},"fast");$("body").css("overflow","hidden")});$(document).bind("cbox_closed",function(){$("body").css("overflow","auto")});$(document).bind("cbox_complete",function(){});
//from:http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript
(function ($) {
	var cache = [];
	// Arguments are image paths relative to the current page.
	$.preLoadImages = function () {
		var args_len = arguments.length;
		for (var i = args_len; i--; ) {
			var cacheImage = document.createElement('img');
			cacheImage.src = arguments[i];
			cache.push(cacheImage);
		}
	};
})(jQuery);
/* jQuery CooQuery Plugin v2 (minified) - http://cooquery.lenonmarcel.com.br/
Copyright 2009, 2010 Lenon Marcel
Dual licensed under the MIT and GPL licenses.
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html */
(function($){$.setCookie=function(name,value,options){if(typeof name==='undefined'||typeof value==='undefined')
return false;var str=name+'='+encodeURIComponent(value);if(options.domain)str+='; domain='+options.domain;if(options.path)str+='; path='+options.path;if(options.duration){var date=new Date();date.setTime(date.getTime()+options.duration*24*60*60*1000);str+='; expires='+date.toGMTString();}
if(options.secure)str+='; secure';return document.cookie=str;};$.delCookie=function(name){return $.setCookie(name,'',{duration:-1});};$.readCookie=function(name){var value=document.cookie.match('(?:^|;)\\s*'+name.replace(/([-.*+?^${}()|[\]\/\\])/g,'\\$1')+'=([^;]*)');return(value)?decodeURIComponent(value[1]):null;};$.CooQueryVersion='v 2.0';})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
var Payoff;if(!Payoff){Payoff={}}(function(a){a.fn.IsInTab=function(c){var b=a(this).parents("div.ui-tabs-panel:eq(0)");if(b===null||b.length===0){return null}return b.attr("id")};a.fn.CommonPrintArea=function(b){var c={mode:"iframe",popClose:true,popWd:600,footherHtml:"Payoff Expoblox"};if(/chrome/.test(navigator.userAgent.toLowerCase())){c.mode="popup";c.popClose=true}return this.each(function(){var d=a.extend(c,b||{});a(this).printArea(d)})};a.fn.CommonTag=function(b){return this.each(function(){var c=a.extend({minChars:2,matchCase:false,queryParam:"searchBy",selectedItemProp:"Name",searchObjProps:"Name",selectedValuesProp:"Name",onChangeInputValue:OnChangeSomeInForm},b||{});a(this).autoSuggest("/Expoblox/Tag/SuggestTags/",c)})};a.fn.OpenMyTab=function(){return this.each(function(){var c=a(this).parents("div.ui-tabs:eq(0)");var b=c.tabs("option","selected");if(b!=a(this)){c.tabs("select",a(this).attr("id"))}})};a.fn.OpenTab=function(c){var b=a(this).attr("id");var e=a("#"+b+"-"+c);if(e.elementExists()){var d=a(this).tabs("option","selected");if(d!=e){a(this).tabs("select",c)}}};a.fn.DivClickable=function(){a(".clickableDeep",a(this)).click(function(c){c.preventDefault();var b=a(this).children("a");var d=b.attr("href");if(a(this).hasClass("addJsonIdToUrl")){if(IsNotNullObject(window.GLB_mainJsonContainer)){d+=GLB_mainJsonContainer.GetId()}else{if(IsNotEmptyString(window.GLB_Id)){d+=GLB_Id}}}document.location.href=d})};a.fn.InputNumber=function(b){var c=a.extend({TypeField:"integer"},b||{});return this.each(function(){return})};a.fn.SumValues=function(){var b=0;var c=null;this.each(function(){if(a(this).is(":input")){c=a(this).val()}else{c=a(this).text()}if(!IsNotEmptyString(c)){return}if(c==="0"){return}b+=Globalization.parseFloat(c)});return b};a.fn.valNum=function(){var b=0;this.each(function(){var c=Globalization.parseFloat(CommonUt.EnsureDigit(a(this).val()));if(!isNaN(c)&&isFinite(c)){b=b+c}});return b};a.fn.textNum=function(){var b=0;this.each(function(){var c=Globalization.parseFloat(a(this).text());if(!isNaN(c)&&isFinite(c)){b+=c}});return b}})(jQuery);
function OnChangeSomeInForm(){$("#NotificationFormChangedBar").jnotifyAddMessage({text:commonText.DataWasChanged+" <input type='button' value='"+commonText.SaveQuestion+"' onclick='SimplySaveRoutine();return false;' />",permanent:true});GLB_IsFormDirty=true}function NotifiesToHtmlPoints(c,a){if(!IsAnArray(c)){throw new Error("You should pass an array to NotifiesToHtmlPoints")}if(c.length===0){return""}var b=[];if(IsFunction(a)){ILoopF(c,function(d){if(a(d)){b.push(d.PropertyName+": "+d.MessageText)}})}else{ILoopF(c,function(d){b.push(d.PropertyName+": "+d.MessageText)})}return b.join("<br/>")}function CheckDirtyFormAndGoToUrl(b){if(GLB_IsFormDirty){var a={};a[commonText.ConfirmLeavePageButton]=function(){document.location.href=b};a[commonText.Cancel]=function(){$(this).dialog("close")};$("#DialogConfirmLeavePageDirty").dialog({resizable:false,height:250,width:500,modal:true,buttons:a})}else{document.location.href=b}}function NotificateErrors(a){if(a===undefined||a===null){return}var b="";if(typeof a==="string"){b=a}if(typeof a==="object"){b=a.MessageText;if(a.PropertyName!==""){if($("#"+a.PropertyName+"_validationMessage").length>0){$("#"+a.PropertyName+"_validationMessage").text(b).show()}}if((b===null||b==="")&&a.PropertyName!==""){b=commonText.AnErrorForProperty}if(IsNotEmptyString(a.PropertyName)){b+=" ( in '"+a.PropertyName+"') "}}if(b===null||b===""){return}$("#NotificationBox").jnotifyAddMessage({text:b,permanent:true,type:"error"});$("#NotificationBox").effect("pulsate",{times:4},500)}function NotificateInfo(a){if(a===undefined||a===null){return}if(a.length===0){return}var b="";if(typeof a==="string"){b=a}if(typeof a==="object"){b=a.MessageText}$("#NotificationBox").jnotifyAddMessage({text:b,permanent:true})}function ClearNotificationErrors(){if($("#NotificationBox").length===0){return}$("#NotificationBox div").jnotifyClose()}function CloseNotificationBarInfo(){$("#NotificationBar").jnotifyClose();$("#NotificationFormChangedBar").jnotifyClose()}function NiceMessageBox(f,d,g,a){if($("#DialogGeneric").length===0){var c='<div id="DialogGeneric" style=\'display:none;\' title="">';c+='<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><span class=\'DialogContent\'></span></p></div>';$("body").prepend(c)}var b={};var e=null;g=$.extend({width:500,height:250},g||{});if(a!==null&&a!==undefined){b=a}else{if(g===undefined||g===null){b.ok=function(){$(this).dialog("close")}}else{if(g.Type==="alert"){b.ok=function(){$(this).dialog("close")}}if(g.Type==="confirm"){b.ok=function(){if(IsFunction(g.onOk)){g.onOk();e=true}$(this).dialog("close")};b.cancel=function(){if(IsFunction(g.onCancel)){g.onCancel();e=false}$(this).dialog("close")}}if(g.Type==="error"){alert("NOT IMPLEMENTED EXCEPTION")}if(g.Type==="warning"){alert("NOT IMPLEMENTED EXCEPTION")}}}$("#DialogGeneric").attr("title",f);$("#DialogGeneric span.DialogContent").html(d);$("#DialogGeneric").dialog({resizable:false,height:g.height,width:g.width,modal:true,buttons:b})}function showResponseError(g,d,b){if(g!==null){if(g.code===401){return}try{if(g.responseText!==null){if(g.responseText.length<100){MyLogDebug("Error during ajax call: "+g.responseText)}else{var c="Err"+$.Guid.New();MyLogDebug("Error during ajax call: <a href='#' onclick=\"$('#"+c+"').toggle();return false;\">open</a>");var f="<div id='"+c+"' style='display:none;'>"+g.responseText+"</div>";$("#ErrorrsIsland").append(f)}}}catch(a){MyLogDebug("showResponseError cannot catch the error due to responseText not accessible")}}NotificateErrors(commonText.ErrorDuringWork)}$(document).ready(function(){if($("#NotificationBar").length===0){$("body").prepend("<div id='NotificationBar'></div>")}if($("#NotificationBox").length===0){$("body").prepend("<div id='NotificationBox'></div>")}if($("#NotificationFormChangedBar").length===0){$("body").prepend("<div id='NotificationFormChangedBar'></div>")}$("#NotificationFormChangedBar").jnotifyInizialize({oneAtTime:true});$("#NotificationBar").jnotifyInizialize({oneAtTime:true});$("#NotificationBox").jnotifyInizialize({oneAtTime:false,appendType:"append",showIcon:true})});function ProcessNotifies(d){if(!IsAnArray(d)){throw new Error("You must pass an array of notifies if u want to process it.")}var a=0;ILoopF(d,function(e){if(!IsNotifyMessage(e)){a++}});if(a>1){var c=NotifiesToHtmlPoints(d,function(e){return(!IsNotifyMessage(e))});var b=250;if(a>5){b=b+((a-5)*20);if(b>500){b=500}}MyLogDebug("Notify errors: "+JSON.stringify(c));ClearNotificationErrors();NiceMessageBox(commonText.Attention,c,{Type:"alert",height:b});$.each(d,function(e,f){if(IsNotifyMessage(f)){NotificateInfo(f)}});return}$.each(d,function(e,f){if(IsNotifyMessage(f)){NotificateInfo(f)}if(!IsNotifyMessage(f)){NotificateErrors(f)}})}function StartToListenForErrors(a){var b=$.extend({SilentMode:false,SuppressError:false,FilterSilent:function(d,c){return b.SilentMode},FilterSuppressError:function(d,c){return b.SuppressError}},a||{});window.onerror=function(l,h,k){try{if($("#DialogOnJsError").length===0){var i='<div id="DialogOnJsError" style=\'display:none;\' title="'+commonText.TitleDialogJsError+'"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>'+commonText.BodyDialogJsError+"</p></div>";$("body").prepend(i)}}catch(d){}var n=null;if($.browser.msie){try{n=printStackTrace({})}catch(d){}}var m=b.FilterSilent(l,h);try{if(n!==null&&typeof n==="object"){l+=". Stack trace: "+n.join("\n\n")}var j=h.lastIndexOf("/");var g=j==-1?h:h.substr(j+1);l+=". Silent mode for this error (not showed to user): "+m;var f={Msg:l,FileName:h,LineNo:k};jsonCall({url:"/Helper/LogJsError/",data:JSON.stringify(f),error:function(){},async:true})}catch(d){}if(!m){try{var c={};c.ok=function(){$(this).dialog("close")};$("#DialogOnJsError").dialog({resizable:false,height:250,width:500,modal:true,buttons:c})}catch(d){}}return b.FilterSuppressError(l,h)}}function OpenProxyFrame(b){var c=$.extend({href:null,modal:true,width:920,height:570,fancybox:null,onClosed:null,onOpen:null,fixedPage:true},b||{});if(typeof $.fancybox==="function"){var a=$.extend({href:c.href,hideOnContentClick:true,enableEscapeButton:true,modal:false,padding:15,margin:20,width:c.width,height:c.height,autoDimensions:true,centerOnScroll:false,onClosed:function(){if(c.fixedPage){$("body").css("overflow","auto")}if(typeof c.onClosed==="function"){c.onClosed()}},onStart:function(){if(c.fixedPage){$("html, body").animate({scrollTop:0},"fast");$("body").css("overflow","hidden")}},onComplete:function(){$("#fancybox-wrap").css({top:"20px",bottom:"auto"});if(typeof c.onOpen==="function"){c.onOpen()}}},c.fancybox||{});if(c.modal===true){$.extend(a,{modal:true,hideOnContentClick:false,enableEscapeButton:false,autoDimensions:false})}$.fancybox(a)}};

