/* * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(d,a0){function an(){if(!m.isReady){try{aL.documentElement.doScroll("left")}catch(c){setTimeout(an,1);return}m.ready()}}function aF(c,s){s.src?m.ajax({url:s.src,async:false,dataType:"script"}):m.globalEval(s.text||s.textContent||s.innerHTML||"");s.parentNode&&s.parentNode.removeChild(s)}function a5(c,s,w,F,A,J){var G=c.length;if(typeof s==="object"){for(var K in s){a5(c,K,s[K],F,A,w)}return c}if(w!==a0){F=!J&&F&&m.isFunction(w);for(K=0;K)[^>]*$|^#([\w-]+)$/,aU=/^.[^:#\[\.,]*$/,aY=/\S/,a3=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,a7=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,az=navigator.userAgent,a6=false,aD=[],aj,a=Object.prototype.toString,e=Object.prototype.hasOwnProperty,i=Array.prototype.push,aH=Array.prototype.slice,ba=Array.prototype.indexOf;m.fn=m.prototype={init:function(c,s){var w,A;if(!c){return this}if(c.nodeType){this.context=this[0]=c;this.length=1;return this}if(c==="body"&&!s){this.context=aL;this[0]=aL.body;this.selector="body";this.length=1;return this}if(typeof c==="string"){if((w=aR.exec(c))&&(w[1]||!s)){if(w[1]){A=s?s.ownerDocument||s:aL;if(c=a7.exec(c)){if(m.isPlainObject(s)){c=[aL.createElement(c[1])];m.fn.attr.call(c,s,true)}else{c=[A.createElement(c[1])]}}else{c=aM([w[1]],[A]);c=(c.cacheable?c.fragment.cloneNode(true):c.fragment).childNodes}return m.merge(this,c)}else{if(s=aL.getElementById(w[2])){if(s.id!==w[2]){return aP.find(c)}this.length=1;this[0]=s}this.context=aL;this.selector=c;return this}}else{if(!s&&/^\w+$/.test(c)){this.selector=c;this.context=aL;c=aL.getElementsByTagName(c);return m.merge(this,c)}else{return !s||s.jquery?(s||aP).find(c):m(s).find(c)}}}else{if(m.isFunction(c)){return aP.ready(c)}}if(c.selector!==a0){this.selector=c.selector;this.context=c.context}return m.makeArray(c,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return aH.call(this,0)},get:function(c){return c==null?this.toArray():c<0?this.slice(c)[0]:this[c]},pushStack:function(c,s,w){var A=m();m.isArray(c)?i.apply(A,c):m.merge(A,c);A.prevObject=this;A.context=this.context;if(s==="find"){A.selector=this.selector+(this.selector?" ":"")+w}else{if(s){A.selector=this.selector+"."+s+"("+w+")"}}return A},each:function(c,s){return m.each(this,c,s)},ready:function(c){m.bindReady();if(m.isReady){c.call(aL,m)}else{aD&&aD.push(c)}return this},eq:function(c){return c===-1?this.slice(c):this.slice(c,+c+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(aH.apply(this,arguments),"slice",aH.call(arguments).join(","))},map:function(c){return this.pushStack(m.map(this,function(s,w){return c.call(s,w,s)}))},end:function(){return this.prevObject||m(null)},push:i,sort:[].sort,splice:[].splice};m.fn.init.prototype=m.fn;m.extend=m.fn.extend=function(){var c=arguments[0]||{},s=1,w=arguments.length,F=false,A,J,G,K;if(typeof c==="boolean"){F=c;c=arguments[1]||{};s=2}if(typeof c!=="object"&&!m.isFunction(c)){c={}}if(w===s){c=this;--s}for(;s
a";var A=w.getElementsByTagName("*"),J=w.getElementsByTagName("a")[0];if(!(!A||!A.length||!J)){m.support={leadingWhitespace:w.firstChild.nodeType===3,tbody:!w.getElementsByTagName("tbody").length,htmlSerialize:!!w.getElementsByTagName("link").length,style:/red/.test(J.getAttribute("style")),hrefNormalized:J.getAttribute("href")==="/a",opacity:/^0.55$/.test(J.style.opacity),cssFloat:!!J.style.cssFloat,checkOn:w.getElementsByTagName("input")[0].value==="on",optSelected:aL.createElement("select").appendChild(aL.createElement("option")).selected,parentNode:w.removeChild(w.appendChild(aL.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};s.type="text/javascript";try{s.appendChild(aL.createTextNode("window."+F+"=1;"))}catch(G){}c.insertBefore(s,c.firstChild);if(d[F]){m.support.scriptEval=true;delete d[F]}try{delete s.test}catch(L){m.support.deleteExpando=false}c.removeChild(s);if(w.attachEvent&&w.fireEvent){w.attachEvent("onclick",function K(){m.support.noCloneEvent=false;w.detachEvent("onclick",K)});w.cloneNode(true).fireEvent("onclick")}w=aL.createElement("div");w.innerHTML="";c=aL.createDocumentFragment();c.appendChild(w.firstChild);m.support.checkClone=c.cloneNode(true).cloneNode(true).lastChild.checked;m(function(){var N=aL.createElement("div");N.style.width=N.style.paddingLeft="1px";aL.body.appendChild(N);m.boxModel=m.support.boxModel=N.offsetWidth===2;aL.body.removeChild(N).style.display="none"});c=function(N){var O=aL.createElement("div");N="on"+N;var P=N in O;if(!P){O.setAttribute(N,"return;");P=typeof O[N]==="function"}return P};m.support.submitBubbles=c("submit");m.support.changeBubbles=c("change");c=s=w=A=J=null}})();m.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var D="jQuery"+ab(),bb=0,be={};m.extend({cache:{},expando:D,noData:{embed:true,object:true,applet:true},data:function(c,s,w){if(!(c.nodeName&&m.noData[c.nodeName.toLowerCase()])){c=c==d?be:c;var F=c[D],A=m.cache;if(!F&&typeof s==="string"&&w===a0){return null}F||(F=++bb);if(typeof s==="object"){c[D]=F;A[F]=m.extend(true,{},s)}else{if(!A[F]){c[D]=F;A[F]={}}}c=A[F];if(w!==a0){c[s]=w}return typeof s==="string"?c[s]:c}},removeData:function(c,s){if(!(c.nodeName&&m.noData[c.nodeName.toLowerCase()])){c=c==d?be:c;var w=c[D],F=m.cache,A=F[w];if(s){if(A){delete A[s];m.isEmptyObject(A)&&m.removeData(c)}}else{if(m.support.deleteExpando){delete c[m.expando]}else{c.removeAttribute&&c.removeAttribute(m.expando)}delete F[w]}}}});m.fn.extend({data:function(c,s){if(typeof c==="undefined"&&this.length){return m.data(this[0])}else{if(typeof c==="object"){return this.each(function(){m.data(this,c)})}}var w=c.split(".");w[1]=w[1]?"."+w[1]:"";if(s===a0){var A=this.triggerHandler("getData"+w[1]+"!",[w[0]]);if(A===a0&&this.length){A=m.data(this[0],c)}return A===a0&&w[1]?this.data(w[0]):A}else{return this.trigger("setData"+w[1]+"!",[w[0],s]).each(function(){m.data(this,c,s)})}},removeData:function(c){return this.each(function(){m.removeData(this,c)})}});m.extend({queue:function(c,s,w){if(c){s=(s||"fx")+"queue";var A=m.data(c,s);if(!w){return A||[]}if(!A||m.isArray(w)){A=m.data(c,s,m.makeArray(w))}else{A.push(w)}return A}},dequeue:function(c,s){s=s||"fx";var w=m.queue(c,s),A=w.shift();if(A==="inprogress"){A=w.shift()}if(A){s==="fx"&&w.unshift("inprogress");A.call(c,function(){m.dequeue(c,s)})}}});m.fn.extend({queue:function(c,s){if(typeof c!=="string"){s=c;c="fx"}if(s===a0){return m.queue(this[0],c)}return this.each(function(){var w=m.queue(this,c,s);c==="fx"&&w[0]!=="inprogress"&&m.dequeue(this,c)})},dequeue:function(c){return this.each(function(){m.dequeue(this,c)})},delay:function(c,s){c=m.fx?m.fx.speeds[c]||c:c;s=s||"fx";return this.queue(s,function(){var w=this;setTimeout(function(){m.dequeue(w,s)},c)})},clearQueue:function(c){return this.queue(c||"fx",[])}});var f=/[\n\t]/g,n=/\s+/,bf=/\r/g,b=/href|src|style/,g=/(button|input)/i,k=/(button|input|object|select|textarea)/i,p=/^(a|area)$/i,j=/radio|checkbox/;m.fn.extend({attr:function(c,s){return a5(this,c,s,true,m.attr)},removeAttr:function(c){return this.each(function(){m.attr(this,c,"");this.nodeType===1&&this.removeAttribute(c)})},addClass:function(c){if(m.isFunction(c)){return this.each(function(N){var O=m(this);O.addClass(c.call(this,N,O.attr("class")))})}if(c&&typeof c==="string"){for(var s=(c||"").split(n),w=0,F=this.length;w-1){return true}}return false},val:function(c){if(c===a0){var s=this[0];if(s){if(m.nodeName(s,"option")){return(s.attributes.value||{}).specified?s.value:s.text}if(m.nodeName(s,"select")){var w=s.selectedIndex,F=[],A=s.options;s=s.type==="select-one";if(w<0){return null}var J=s?w:0;for(w=s?w+1:A.length;J=0}else{if(m.nodeName(this,"select")){var P=m.makeArray(O);m("option",this).each(function(){this.selected=m.inArray(m(this).val(),P)>=0});if(!P.length){this.selectedIndex=-1}}else{this.value=O}}}})}});m.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(c,s,w,F){if(!c||c.nodeType===3||c.nodeType===8){return a0}if(F&&s in m.attrFn){return m(c)[s](w)}F=c.nodeType!==1||!m.isXMLDoc(c);var A=w!==a0;s=F&&m.props[s]||s;if(c.nodeType===1){var G=b.test(s);if(s in c&&F&&!G){if(A){s==="type"&&g.test(c.nodeName)&&c.parentNode&&m.error("type property can't be changed");c[s]=w}if(m.nodeName(c,"form")&&c.getAttributeNode(s)){return c.getAttributeNode(s).nodeValue}if(s==="tabIndex"){return(s=c.getAttributeNode("tabIndex"))&&s.specified?s.value:k.test(c.nodeName)||p.test(c.nodeName)&&c.href?0:a0}return c[s]}if(!m.support.style&&F&&s==="style"){if(A){c.style.cssText=""+w}return c.style.cssText}A&&c.setAttribute(s,""+w);c=!m.support.hrefNormalized&&F&&G?c.getAttribute(s,2):c.getAttribute(s);return c===null?a0:c}return m.style(c,s,w)}});var av=/\.(.*)$/,t=function(c){return c.replace(/[^\w\s\.\|`]/g,function(s){return"\\"+s})};m.event={add:function(c,s,w,F){if(!(c.nodeType===3||c.nodeType===8)){if(c.setInterval&&c!==d&&!c.frameElement){c=d}var A,J;if(w.handler){A=w;w=A.handler}if(!w.guid){w.guid=m.guid++}if(J=m.data(c)){var G=J.events=J.events||{},N=J.handle;if(!N){J.handle=N=function(){return typeof m!=="undefined"&&!m.event.triggered?m.event.handle.apply(N.elem,arguments):a0}}N.elem=c;s=s.split(" ");for(var K,L=0,O;K=s[L++];){J=A?m.extend({},A):{handler:w,data:F};if(K.indexOf(".")>-1){O=K.split(".");K=O.shift();J.namespace=O.slice(0).sort().join(".")}else{O=[];J.namespace=""}J.type=K;J.guid=w.guid;var P=G[K],Q=m.event.special[K]||{};if(!P){P=G[K]=[];if(!Q.setup||Q.setup.call(c,F,O,N)===false){if(c.addEventListener){c.addEventListener(K,N,false)}else{c.attachEvent&&c.attachEvent("on"+K,N)}}}if(Q.add){Q.add.call(c,J);if(!J.handler.guid){J.handler.guid=w.guid}}P.push(J);m.event.global[K]=true}c=null}}},global:{},remove:function(c,s,F,J){if(!(c.nodeType===3||c.nodeType===8)){var G,L=0,K,P,N,O,Q,R,T=m.data(c),A=T&&T.events;if(T&&A){if(s&&s.type){F=s.handler;s=s.type}if(!s||typeof s==="string"&&s.charAt(0)==="."){s=s||"";for(G in A){m.event.remove(c,G+s)}}else{for(s=s.split(" ");G=s[L++];){O=G;K=G.indexOf(".")<0;P=[];if(!K){P=G.split(".");G=P.shift();N=new RegExp("(^|\\.)"+m.map(P.slice(0).sort(),t).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(Q=A[G]){if(F){O=m.event.special[G]||{};for(w=J||0;w=0){c.type=A=A.slice(0,-1);c.exclusive=true}if(!w){c.stopPropagation();m.event.global[A]&&m.each(m.cache,function(){this.events&&this.events[A]&&m.event.trigger(c,s,this.handle.elem)})}if(!w||w.nodeType===3||w.nodeType===8){return a0}c.result=a0;c.target=w;s=m.makeArray(s);s.unshift(c)}c.currentTarget=w;(F=m.data(w,"handle"))&&F.apply(w,s);F=w.parentNode||w.ownerDocument;try{if(!(w&&w.nodeName&&m.noData[w.nodeName.toLowerCase()])){if(w["on"+A]&&w["on"+A].apply(w,s)===false){c.result=false}}}catch(J){}if(!c.isPropagationStopped()&&F){m.event.trigger(c,s,F,true)}else{if(!c.isDefaultPrevented()){F=c.target;var G,N=m.nodeName(F,"a")&&A==="click",K=m.event.special[A]||{};if((!K._default||K._default.call(w,c)===false)&&!N&&!(F&&F.nodeName&&m.noData[F.nodeName.toLowerCase()])){try{if(F[A]){if(G=F["on"+A]){F["on"+A]=null}m.event.triggered=true;F[A]()}}catch(L){}if(G){F["on"+A]=G}m.event.triggered=false}}}},handle:function(c){var s,w,F,A;c=arguments[0]=m.event.fix(c||d.event);c.currentTarget=this;s=c.type.indexOf(".")<0&&!c.exclusive;if(!s){w=c.type.split(".");c.type=w.shift();F=new RegExp("(^|\\.)"+w.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}A=m.data(this,"events");w=A[c.type];if(A&&w){w=w.slice(0);A=0;for(var J=w.length;A-1?m.map(c.options,function(A){return A.selected}).join("-"):""}else{if(c.nodeName.toLowerCase()==="select"){w=c.selectedIndex}}}return w},z=function(c,s){var w=c.target,F,A;if(!(!q.test(w.nodeName)||w.readOnly)){F=m.data(w,"_change_data");A=B(w);if(c.type!=="focusout"||w.type!=="radio"){m.data(w,"_change_data",A)}if(!(F===a0||A===F)){if(F!=null||A){c.type="change";return m.event.trigger(c,s,w)}}}};m.event.special.change={filters:{focusout:z,click:function(c){var s=c.target,w=s.type;if(w==="radio"||w==="checkbox"||s.nodeName.toLowerCase()==="select"){return z.call(this,c)}},keydown:function(c){var s=c.target,w=s.type;if(c.keyCode===13&&s.nodeName.toLowerCase()!=="textarea"||c.keyCode===32&&(w==="checkbox"||w==="radio")||w==="select-multiple"){return z.call(this,c)}},beforeactivate:function(c){c=c.target;m.data(c,"_change_data",B(c))}},setup:function(){if(this.type==="file"){return false}for(var c in u){m.event.add(this,c+".specialChange",u[c])}return q.test(this.nodeName)},teardown:function(){m.event.remove(this,".specialChange");return q.test(this.nodeName)}};u=m.event.special.change.filters}aL.addEventListener&&m.each({focus:"focusin",blur:"focusout"},function(c,s){function w(A){A=m.event.fix(A);A.type=s;return m.event.handle.call(this,A)}m.event.special[s]={setup:function(){this.addEventListener(c,w,true)},teardown:function(){this.removeEventListener(c,w,true)}}});m.each(["bind","one"],function(c,s){m.fn[s]=function(w,F,A){if(typeof w==="object"){for(var J in w){this[s](J,F,w[J],A)}return this}if(m.isFunction(F)){A=F;F=a0}var G=s==="one"?m.proxy(A,function(L){m(this).unbind(L,G);return A.apply(this,arguments)}):A;if(w==="unload"&&s!=="one"){this.one(w,F,A)}else{J=0;for(var K=this.length;J0){bn=bl;break}}}bl=bl[Y]}bi[bk]=bn}}}var K=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,G=0,O=Object.prototype.toString,N=false,R=true;[0,0].sort(function(){R=false;return 0});var P=function(Z,bh,bk,bl){bk=bk||[];var bo=bh=bh||aL;if(bh.nodeType!==1&&bh.nodeType!==9){return[]}if(!Z||typeof Z!=="string"){return bk}for(var bn=[],br,bq,bs,bp,bi=true,bm=W(bh),bj=Z;(K.exec(""),br=K.exec(bj))!==null;){bj=br[3];bn.push(br[1]);if(br[2]){bp=br[3];break}}if(bn.length>1&&T.exec(Z)){if(bn.length===2&&Q.relative[bn[0]]){bq=L(bn[0]+bn[1],bh)}else{for(bq=Q.relative[bn[0]]?[bh]:P(bn.shift(),bh);bn.length;){Z=bn.shift();if(Q.relative[Z]){Z+=bn.shift()}bq=L(Z,bq)}}}else{if(!bl&&bn.length>1&&bh.nodeType===9&&!bm&&Q.match.ID.test(bn[0])&&!Q.match.ID.test(bn[bn.length-1])){br=P.find(bn.shift(),bh,bm);bh=br.expr?P.filter(br.expr,br.set)[0]:br.set[0]}if(bh){br=bl?{expr:bn.pop(),set:X(bl)}:P.find(bn.pop(),bn.length===1&&(bn[0]==="~"||bn[0]==="+")&&bh.parentNode?bh.parentNode:bh,bm);bq=br.expr?P.filter(br.expr,br.set):br.set;if(bn.length>0){bs=X(bq)}else{bi=false}for(;bn.length;){var Y=bn.pop();br=Y;if(Q.relative[Y]){br=bn.pop()}else{Y=""}if(br==null){br=bh}Q.relative[Y](bs,br,bm)}}else{bs=[]}}bs||(bs=bq);bs||P.error(Y||Z);if(O.call(bs)==="[object Array]"){if(bi){if(bh&&bh.nodeType===1){for(Z=0;bs[Z]!=null;Z++){if(bs[Z]&&(bs[Z]===true||bs[Z].nodeType===1&&J(bh,bs[Z]))){bk.push(bq[Z])}}}else{for(Z=0;bs[Z]!=null;Z++){bs[Z]&&bs[Z].nodeType===1&&bk.push(bq[Z])}}}else{bk.push.apply(bk,bs)}}else{X(bs,bk)}if(bp){P(bp,bo,bk,bl);P.uniqueSort(bk)}return bk};P.uniqueSort=function(Y){if(w){N=R;Y.sort(w);if(N){for(var Z=1;Z":function(Y,Z){var bh=typeof Z==="string";if(bh&&!/\W/.test(Z)){Z=Z.toLowerCase();for(var bi=0,bk=Y.length;bi=0)){bh||bi.push(bl)}else{if(bh){Z[bj]=false}}}}return false},ID:function(Y){return Y[1].replace(/\\/g,"")},TAG:function(Y){return Y[1].toLowerCase()},CHILD:function(Y){if(Y[1]==="nth"){var Z=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(Y[2]==="even"&&"2n"||Y[2]==="odd"&&"2n+1"||!/\D/.test(Y[2])&&"0n+"+Y[2]||Y[2]);Y[2]=Z[1]+(Z[2]||1)-0;Y[3]=Z[3]-0}Y[0]=G++;return Y},ATTR:function(Y,Z,bh,bi,bk,bj){Z=Y[1].replace(/\\/g,"");if(!bj&&Q.attrMap[Z]){Y[1]=Q.attrMap[Z]}if(Y[2]==="~="){Y[4]=" "+Y[4]+" "}return Y},PSEUDO:function(Y,Z,bh,bi,bj){if(Y[1]==="not"){if((K.exec(Y[3])||"").length>1||/^\w/.test(Y[3])){Y[3]=P(Y[3],null,null,Z)}else{Y=P.filter(Y[3],Z,bh,true^bj);bh||bi.push.apply(bi,Y);return false}}else{if(Q.match.POS.test(Y[0])||Q.match.CHILD.test(Y[0])){return true}}return Y},POS:function(Y){Y.unshift(true);return Y}},filters:{enabled:function(Y){return Y.disabled===false&&Y.type!=="hidden"},disabled:function(Y){return Y.disabled===true},checked:function(Y){return Y.checked===true},selected:function(Y){return Y.selected===true},parent:function(Y){return !!Y.firstChild},empty:function(Y){return !Y.firstChild},has:function(Y,Z,bh){return !!P(bh[3],Y).length},header:function(Y){return/h\d/i.test(Y.nodeName)},text:function(Y){return"text"===Y.type},radio:function(Y){return"radio"===Y.type},checkbox:function(Y){return"checkbox"===Y.type},file:function(Y){return"file"===Y.type},password:function(Y){return"password"===Y.type},submit:function(Y){return"submit"===Y.type},image:function(Y){return"image"===Y.type},reset:function(Y){return"reset"===Y.type},button:function(Y){return"button"===Y.type||Y.nodeName.toLowerCase()==="button"},input:function(Y){return/input|select|textarea|button/i.test(Y.nodeName)}},setFilters:{first:function(Y,Z){return Z===0},last:function(Y,Z,bh,bi){return Z===bi.length-1},even:function(Y,Z){return Z%2===0},odd:function(Y,Z){return Z%2===1},lt:function(Y,Z,bh){return Zbh[3]-0},nth:function(Y,Z,bh){return bh[3]-0===Z},eq:function(Y,Z,bh){return bh[3]-0===Z}},filter:{PSEUDO:function(Y,Z,bh,bi){var bk=Z[1],bj=Q.filters[bk];if(bj){return bj(Y,bh,Z,bi)}else{if(bk==="contains"){return(Y.textContent||Y.innerText||c([Y])||"").indexOf(Z[3])>=0}else{if(bk==="not"){Z=Z[3];bh=0;for(bi=Z.length;bh=0}},ID:function(Y,Z){return Y.nodeType===1&&Y.getAttribute("id")===Z},TAG:function(Y,Z){return Z==="*"&&Y.nodeType===1||Y.nodeName.toLowerCase()===Z},CLASS:function(Y,Z){return(" "+(Y.className||Y.getAttribute("class"))+" ").indexOf(Z)>-1},ATTR:function(Y,Z){var bh=Z[1];Y=Q.attrHandle[bh]?Q.attrHandle[bh](Y):Y[bh]!=null?Y[bh]:Y.getAttribute(bh);bh=Y+"";var bi=Z[2];Z=Z[4];return Y==null?bi==="!=":bi==="="?bh===Z:bi==="*="?bh.indexOf(Z)>=0:bi==="~="?(" "+bh+" ").indexOf(Z)>=0:!Z?bh&&Y!==false:bi==="!="?bh!==Z:bi==="^="?bh.indexOf(Z)===0:bi==="$="?bh.substr(bh.length-Z.length)===Z:bi==="|="?bh===Z||bh.substr(0,Z.length+1)===Z+"-":false},POS:function(Y,Z,bh,bi){var bj=Q.setFilters[Z[2]];if(bj){return bj(Y,bh,Z,bi)}}}},T=Q.match.POS;for(var V in Q.match){Q.match[V]=new RegExp(Q.match[V].source+/(?![^\[]*\])(?![^\(]*\))/.source);Q.leftMatch[V]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Q.match[V].source.replace(/\\(\d+)/g,function(Y,Z){return"\\"+(Z-0+1)}))}var X=function(Y,Z){Y=Array.prototype.slice.call(Y,0);if(Z){Z.push.apply(Z,Y);return Z}return Y};try{Array.prototype.slice.call(aL.documentElement.childNodes,0)}catch(A){X=function(Y,Z){Z=Z||[];if(O.call(Y)==="[object Array]"){Array.prototype.push.apply(Z,Y)}else{if(typeof Y.length==="number"){for(var bh=0,bi=Y.length;bh";var bh=aL.documentElement;bh.insertBefore(Y,bh.firstChild);if(aL.getElementById(Z)){Q.find.ID=function(bi,bk,bj){if(typeof bk.getElementById!=="undefined"&&!bj){return(bk=bk.getElementById(bi[1]))?bk.id===bi[1]||typeof bk.getAttributeNode!=="undefined"&&bk.getAttributeNode("id").nodeValue===bi[1]?[bk]:a0:[]}};Q.filter.ID=function(bi,bk){var bj=typeof bi.getAttributeNode!=="undefined"&&bi.getAttributeNode("id");return bi.nodeType===1&&bj&&bj.nodeValue===bk}}bh.removeChild(Y);bh=Y=null})();(function(){var Y=aL.createElement("div");Y.appendChild(aL.createComment(""));if(Y.getElementsByTagName("*").length>0){Q.find.TAG=function(Z,bh){bh=bh.getElementsByTagName(Z[1]);if(Z[1]==="*"){Z=[];for(var bi=0;bh[bi];bi++){bh[bi].nodeType===1&&Z.push(bh[bi])}bh=Z}return bh}}Y.innerHTML="";if(Y.firstChild&&typeof Y.firstChild.getAttribute!=="undefined"&&Y.firstChild.getAttribute("href")!=="#"){Q.attrHandle.href=function(Z){return Z.getAttribute("href",2)}}Y=null})();aL.querySelectorAll&&function(){var Y=P,Z=aL.createElement("div");Z.innerHTML="

";if(!(Z.querySelectorAll&&Z.querySelectorAll(".TEST").length===0)){P=function(bi,bk,bj,bm){bk=bk||aL;if(!bm&&bk.nodeType===9&&!W(bk)){try{return X(bk.querySelectorAll(bi),bj)}catch(bl){}}return Y(bi,bk,bj,bm)};for(var bh in Y){P[bh]=Y[bh]}Z=null}}();(function(){var Y=aL.createElement("div");Y.innerHTML="
";if(!(!Y.getElementsByClassName||Y.getElementsByClassName("e").length===0)){Y.lastChild.className="e";if(Y.getElementsByClassName("e").length!==1){Q.order.splice(1,0,"CLASS");Q.find.CLASS=function(Z,bh,bi){if(typeof bh.getElementsByClassName!=="undefined"&&!bi){return bh.getElementsByClassName(Z[1])}};Y=null}}})();var J=aL.compareDocumentPosition?function(Y,Z){return !!(Y.compareDocumentPosition(Z)&16)}:function(Y,Z){return Y!==Z&&(Y.contains?Y.contains(Z):true)},W=function(Y){return(Y=(Y?Y.ownerDocument||Y:0).documentElement)?Y.nodeName!=="HTML":false},L=function(Y,Z){var bh=[],bi="",bk;for(Z=Z.nodeType?[Z]:Z;bk=Q.match.PSEUDO.exec(Y);){bi+=bk[0];Y=Y.replace(Q.match.PSEUDO,"")}Y=Q.relative[Y]?Y+"*":Y;bk=0;for(var bj=Z.length;bk=0===w})};m.fn.extend({find:function(c){for(var s=this.pushStack("","find",c),w=0,F=0,A=this.length;F0){for(var J=w;J0},closest:function(c,s){if(m.isArray(c)){var w=[],F=this[0],A,J={},G;if(F&&c.length){A=0;for(var L=c.length;A-1:m(F).is(A)){w.push({selector:G,elem:F});delete J[G]}}F=F.parentNode}}return w}var K=m.expr.match.POS.test(c)?m(c,s||this.context):null;return this.map(function(N,O){for(;O&&O.ownerDocument&&O!==s;){if(K?K.index(O)>-1:m(O).is(c)){return O}O=O.parentNode}return null})},index:function(c){if(!c||typeof c==="string"){return m.inArray(this[0],c?m(c):this.parent().children())}return m.inArray(c.jquery?c[0]:c,this)},add:function(c,s){c=typeof c==="string"?m(c,s||this.context):m.makeArray(c);s=m.merge(this.get(),c);return this.pushStack(aE(c[0])||aE(s[0])?s:m.unique(s))},andSelf:function(){return this.add(this.prevObject)}});m.each({parent:function(c){return(c=c.parentNode)&&c.nodeType!==11?c:null},parents:function(c){return m.dir(c,"parentNode")},parentsUntil:function(c,s,w){return m.dir(c,"parentNode",w)},next:function(c){return m.nth(c,2,"nextSibling")},prev:function(c){return m.nth(c,2,"previousSibling")},nextAll:function(c){return m.dir(c,"nextSibling")},prevAll:function(c){return m.dir(c,"previousSibling")},nextUntil:function(c,s,w){return m.dir(c,"nextSibling",w)},prevUntil:function(c,s,w){return m.dir(c,"previousSibling",w)},siblings:function(c){return m.sibling(c.parentNode.firstChild,c)},children:function(c){return m.sibling(c.firstChild)},contents:function(c){return m.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:m.makeArray(c.childNodes)}},function(c,s){m.fn[c]=function(w,F){var A=m.map(this,s,w);x.test(c)||(F=w);if(F&&typeof F==="string"){A=m.filter(F,A)}A=this.length>1?m.unique(A):A;if((this.length>1||H.test(F))&&C.test(c)){A=A.reverse()}return this.pushStack(A,c,aH.call(arguments).join(","))}});m.extend({filter:function(c,s,w){if(w){c=":not("+c+")"}return m.find.matches(c,s)},dir:function(c,s,w){var A=[];for(c=c[s];c&&c.nodeType!==9&&(w===a0||c.nodeType!==1||!m(c).is(w));){c.nodeType===1&&A.push(c);c=c[s]}return A},nth:function(c,s,w){s=s||1;for(var A=0;c;c=c[w]){if(c.nodeType===1&&++A===s){break}}return c},sibling:function(c,s){for(var w=[];c;c=c.nextSibling){c.nodeType===1&&c!==s&&w.push(c)}return w}});var ad=/ jQuery\d+="(?:\d+|null)"/g,aW=/^\s+/,ah=/(<([\w:]+)[^>]*?)\/>/g,M=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,al=/<([\w:]+)/,aa=/"},y={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};y.optgroup=y.option;y.tbody=y.tfoot=y.colgroup=y.caption=y.thead;y.th=y.td;if(!m.support.htmlSerialize){y._default=[1,"div
","
"]}m.fn.extend({text:function(c){if(m.isFunction(c)){return this.each(function(s){var w=m(this);w.text(c.call(this,s,w.text()))})}if(typeof c!=="object"&&c!==a0){return this.empty().append((this[0]&&this[0].ownerDocument||aL).createTextNode(c))}return m.text(this)},wrapAll:function(c){if(m.isFunction(c)){return this.each(function(w){m(this).wrapAll(c.call(this,w))})}if(this[0]){var s=m(c,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&s.insertBefore(this[0]);s.map(function(){for(var w=this;w.firstChild&&w.firstChild.nodeType===1;){w=w.firstChild}return w}).append(this)}return this},wrapInner:function(c){if(m.isFunction(c)){return this.each(function(s){m(this).wrapInner(c.call(this,s))})}return this.each(function(){var s=m(this),w=s.contents();w.length?w.wrapAll(c):s.append(c)})},wrap:function(c){return this.each(function(){m(this).wrapAll(c)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.appendChild(c)})},prepend:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.insertBefore(c,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(s){this.parentNode.insertBefore(s,this)})}else{if(arguments.length){var c=m(arguments[0]);c.push.apply(c,this.toArray());return this.pushStack(c,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(s){this.parentNode.insertBefore(s,this.nextSibling)})}else{if(arguments.length){var c=this.pushStack(this,"after",arguments);c.push.apply(c,m(arguments[0]).toArray());return c}}},remove:function(c,s){for(var w=0,A;(A=this[w])!=null;w++){if(!c||m.filter(c,[A]).length){if(!s&&A.nodeType===1){m.cleanData(A.getElementsByTagName("*"));m.cleanData([A])}A.parentNode&&A.parentNode.removeChild(A)}}return this},empty:function(){for(var c=0,s;(s=this[c])!=null;c++){for(s.nodeType===1&&m.cleanData(s.getElementsByTagName("*"));s.firstChild;){s.removeChild(s.firstChild)}}return this},clone:function(c){var s=this.map(function(){if(!m.support.noCloneEvent&&!m.isXMLDoc(this)){var w=this.outerHTML,A=this.ownerDocument;if(!w){w=A.createElement("div");w.appendChild(this.cloneNode(true));w=w.innerHTML}return m.clean([w.replace(ad,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(aW,"")],A)[0]}else{return this.cloneNode(true)}});if(c===true){aI(this,s);aI(this.find("*"),s.find("*"))}return s},html:function(c){if(c===a0){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ad,""):null}else{if(typeof c==="string"&&!aQ.test(c)&&(m.support.leadingWhitespace||!aW.test(c))&&!y[(al.exec(c)||["",""])[1].toLowerCase()]){c=c.replace(ah,ao);try{for(var s=0,w=this.length;s0||A.cacheable||this.length>1?K.cloneNode(true):K)}}N.length&&m.each(N,aF)}return this}});m.fragments={};m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(c,s){m.fn[c]=function(w){var F=[];w=m(w);var A=this.length===1&&this[0].parentNode;if(A&&A.nodeType===11&&A.childNodes.length===1&&w.length===1){w[s](this[0]);return this}else{A=0;for(var J=w.length;A0?this.clone(true):this).get();m.fn[s].apply(m(w[A]),G);F=F.concat(G)}return this.pushStack(F,c,w.selector)}}});m.extend({clean:function(c,s,w,F){s=s||aL;if(typeof s.createElement==="undefined"){s=s.ownerDocument||s[0]&&s[0].ownerDocument||aL}for(var A=[],J=0,G;(G=c[J])!=null;J++){if(typeof G==="number"){G+=""}if(G){if(typeof G==="string"&&!ae.test(G)){G=s.createTextNode(G)}else{if(typeof G==="string"){G=G.replace(ah,ao);var N=(al.exec(G)||["",""])[1].toLowerCase(),K=y[N]||y._default,L=K[0],O=s.createElement("div");for(O.innerHTML=K[1]+G+K[2];L--;){O=O.lastChild}if(!m.support.tbody){L=aa.test(G);N=N==="table"&&!L?O.firstChild&&O.firstChild.childNodes:K[1]===""&&!L?O.childNodes:[];for(K=N.length-1;K>=0;--K){m.nodeName(N[K],"tbody")&&!N[K].childNodes.length&&N[K].parentNode.removeChild(N[K])}}!m.support.leadingWhitespace&&aW.test(G)&&O.insertBefore(s.createTextNode(aW.exec(G)[0]),O.firstChild);G=O.childNodes}}if(G.nodeType){A.push(G)}else{A=m.merge(A,G)}}}if(w){for(J=0;A[J];J++){if(F&&m.nodeName(A[J],"script")&&(!A[J].type||A[J].type.toLowerCase()==="text/javascript")){F.push(A[J].parentNode?A[J].parentNode.removeChild(A[J]):A[J])}else{A[J].nodeType===1&&A.splice.apply(A,[J+1,0].concat(m.makeArray(A[J].getElementsByTagName("script"))));w.appendChild(A[J])}}}return A},cleanData:function(c){for(var s,w,F=m.cache,A=m.event.special,J=m.support.deleteExpando,G=0,L;(L=c[G])!=null;G++){if(w=L[m.expando]){s=F[w];if(s.events){for(var K in s.events){A[K]?m.event.remove(L,K):o(L,K,s.handle)}}if(J){delete L[m.expando]}else{L.removeAttribute&&L.removeAttribute(m.expando)}delete F[w]}}}});var ai=/z-?index|font-?weight|opacity|zoom|line-?height/i,at=/alpha\([^)]*\)/,ax=/opacity=([^)]*)/,I=/float/i,S=/-([a-z])/ig,am=/([A-Z])/g,ap=/^-?\d+(?:px)?$/i,au=/^-?\d/,ay={position:"absolute",visibility:"hidden",display:"block"},aC=["Left","Right"],aG=["Top","Bottom"],aK=aL.defaultView&&aL.defaultView.getComputedStyle,aB=m.support.cssFloat?"cssFloat":"styleFloat",ac=function(c,s){return s.toUpperCase()};m.fn.css=function(c,s){return a5(this,c,s,true,function(w,F,A){if(A===a0){return m.curCSS(w,F)}if(typeof A==="number"&&!ai.test(F)){A+="px"}m.style(w,F,A)})};m.extend({style:function(c,s,w){if(!c||c.nodeType===3||c.nodeType===8){return a0}if((s==="width"||s==="height")&&parseFloat(w)<0){w=a0}var F=c.style||c,A=w!==a0;if(!m.support.opacity&&s==="opacity"){if(A){F.zoom=1;s=parseInt(w,10)+""==="NaN"?"":"alpha(opacity="+w*100+")";c=F.filter||m.curCSS(c,"filter")||"";F.filter=at.test(c)?c.replace(at,s):s}return F.filter&&F.filter.indexOf("opacity=")>=0?parseFloat(ax.exec(F.filter)[1])/100+"":""}if(I.test(s)){s=aB}s=s.replace(S,ac);if(A){F[s]=w}return F[s]},css:function(c,s,w,F){if(s==="width"||s==="height"){var A,J=s==="width"?aC:aG;function G(){A=s==="width"?c.offsetWidth:c.offsetHeight;F!=="border"&&m.each(J,function(){F||(A-=parseFloat(m.curCSS(c,"padding"+this,true))||0);if(F==="margin"){A+=parseFloat(m.curCSS(c,"margin"+this,true))||0}else{A-=parseFloat(m.curCSS(c,"border"+this+"Width",true))||0}})}c.offsetWidth!==0?G():m.swap(c,ay,G);return Math.max(0,Math.round(A))}return m.curCSS(c,s,w)},curCSS:function(c,s,w){var F,A=c.style;if(!m.support.opacity&&s==="opacity"&&c.currentStyle){F=ax.test(c.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return F===""?"1":F}if(I.test(s)){s=aB}if(!w&&A&&A[s]){F=A[s]}else{if(aK){if(I.test(s)){s="float"}s=s.replace(am,"-$1").toLowerCase();A=c.ownerDocument.defaultView;if(!A){return null}if(c=A.getComputedStyle(c,null)){F=c.getPropertyValue(s)}if(s==="opacity"&&F===""){F="1"}}else{if(c.currentStyle){w=s.replace(S,ac);F=c.currentStyle[s]||c.currentStyle[w];if(!ap.test(F)&&au.test(F)){s=A.left;var G=c.runtimeStyle.left;c.runtimeStyle.left=c.currentStyle.left;A.left=w==="fontSize"?"1em":F||0;F=A.pixelLeft+"px";A.left=s;c.runtimeStyle.left=G}}}}return F},swap:function(c,s,w){var F={};for(var A in s){F[A]=c.style[A];c.style[A]=s[A]}w.call(c);for(A in s){c.style[A]=F[A]}}});if(m.expr&&m.expr.filters){m.expr.filters.hidden=function(c){var s=c.offsetWidth,w=c.offsetHeight,A=c.nodeName.toLowerCase()==="tr";return s===0&&w===0&&!A?true:s>0&&w>0&&!A?false:m.curCSS(c,"display")==="none"};m.expr.filters.visible=function(c){return !m.expr.filters.hidden(c)}}var aO=ab(),aS=//gi,aV=/select|textarea/i,aZ=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,aq=/=\?(&|$)/,ag=/\?/,a4=/(\?|&)_=.*?(&|$)/,a8=/^(\w+:)?\/\/([^\/?#]+)/,bc=/%20/g,bg=m.fn.load;m.fn.extend({load:function(c,s,w){if(typeof c!=="string"){return bg.call(this,c)}else{if(!this.length){return this}}var F=c.indexOf(" ");if(F>=0){var A=c.slice(F,c.length);c=c.slice(0,F)}F="GET";if(s){if(m.isFunction(s)){w=s;s=null}else{if(typeof s==="object"){s=m.param(s,m.ajaxSettings.traditional);F="POST"}}}var G=this;m.ajax({url:c,type:F,dataType:"html",data:s,complete:function(J,K){if(K==="success"||K==="notmodified"){G.html(A?m("
").append(J.responseText.replace(aS,"")).find(A):J.responseText)}w&&G.each(w,[J.responseText,K,J])}});return this},serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?m.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||aV.test(this.nodeName)||aZ.test(this.type))}).map(function(c,s){c=m(this).val();return c==null?null:m.isArray(c)?m.map(c,function(w){return{name:s.name,value:w}}):{name:s.name,value:c}}).get()}});m.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(c,s){m.fn[s]=function(w){return this.bind(s,w)}});m.extend({get:function(c,s,w,A){if(m.isFunction(s)){A=A||w;w=s;s=null}return m.ajax({type:"GET",url:c,data:s,success:w,dataType:A})},getScript:function(c,s){return m.get(c,null,s,"script")},getJSON:function(c,s,w){return m.get(c,s,w,"json")},post:function(c,s,w,A){if(m.isFunction(s)){A=A||w;w=s;s={}}return m.ajax({type:"POST",url:c,data:s,success:w,dataType:A})},ajaxSetup:function(c){m.extend(m.ajaxSettings,c)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:d.XMLHttpRequest&&(d.location.protocol!=="file:"||!d.ActiveXObject)?function(){return new d.XMLHttpRequest}:function(){try{return new d.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(c){function s(){G.success&&G.success.call(R,X,P,bh);G.global&&K("ajaxSuccess",[bh,G])}function F(){G.complete&&G.complete.call(R,bh,P);G.global&&K("ajaxComplete",[bh,G]);G.global&&!--m.active&&m.event.trigger("ajaxStop")}function K(bk,bj){(G.context?m(G.context):m.event).trigger(bk,bj)}var G=m.extend(true,{},m.ajaxSettings,c),Q,P,X,R=c&&c.context||G,W=G.type.toUpperCase();if(G.data&&G.processData&&typeof G.data!=="string"){G.data=m.param(G.data,G.traditional)}if(G.dataType==="jsonp"){if(W==="GET"){aq.test(G.url)||(G.url+=(ag.test(G.url)?"&":"?")+(G.jsonp||"callback")+"=?")}else{if(!G.data||!aq.test(G.data)){G.data=(G.data?G.data+"&":"")+(G.jsonp||"callback")+"=?"}}G.dataType="json"}if(G.dataType==="json"&&(G.data&&aq.test(G.data)||aq.test(G.url))){Q=G.jsonpCallback||"jsonp"+aO++;if(G.data){G.data=(G.data+"").replace(aq,"="+Q+"$1")}G.url=G.url.replace(aq,"="+Q+"$1");G.dataType="script";d[Q]=d[Q]||function(bk){X=bk;s();F();d[Q]=a0;try{delete d[Q]}catch(bj){}bi&&bi.removeChild(A)}}if(G.dataType==="script"&&G.cache===null){G.cache=false}if(G.cache===false&&W==="GET"){var Y=ab(),Z=G.url.replace(a4,"$1_="+Y+"$2");G.url=Z+(Z===G.url?(ag.test(G.url)?"&":"?")+"_="+Y:"")}if(G.data&&W==="GET"){G.url+=(ag.test(G.url)?"&":"?")+G.data}G.global&&!m.active++&&m.event.trigger("ajaxStart");Y=(Y=a8.exec(G.url))&&(Y[1]&&Y[1]!==location.protocol||Y[2]!==location.host);if(G.dataType==="script"&&W==="GET"&&Y){var bi=aL.getElementsByTagName("head")[0]||aL.documentElement,A=aL.createElement("script");A.src=G.url;if(G.scriptCharset){A.charset=G.scriptCharset}if(!Q){var w=false;A.onload=A.onreadystatechange=function(){if(!w&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){w=true;s();F();A.onload=A.onreadystatechange=null;bi&&A.parentNode&&bi.removeChild(A)}}}bi.insertBefore(A,bi.firstChild);return a0}var J=false,bh=G.xhr();if(bh){G.username?bh.open(W,G.url,G.async,G.username,G.password):bh.open(W,G.url,G.async);try{if(G.data||c&&c.contentType){bh.setRequestHeader("Content-Type",G.contentType)}if(G.ifModified){m.lastModified[G.url]&&bh.setRequestHeader("If-Modified-Since",m.lastModified[G.url]);m.etag[G.url]&&bh.setRequestHeader("If-None-Match",m.etag[G.url])}Y||bh.setRequestHeader("X-Requested-With","XMLHttpRequest");bh.setRequestHeader("Accept",G.dataType&&G.accepts[G.dataType]?G.accepts[G.dataType]+", */*":G.accepts._default)}catch(N){}if(G.beforeSend&&G.beforeSend.call(R,bh,G)===false){G.global&&!--m.active&&m.event.trigger("ajaxStop");bh.abort();return false}G.global&&K("ajaxSend",[bh,G]);var L=bh.onreadystatechange=function(bk){if(!bh||bh.readyState===0||bk==="abort"){J||F();J=true;if(bh){bh.onreadystatechange=m.noop}}else{if(!J&&bh&&(bh.readyState===4||bk==="timeout")){J=true;bh.onreadystatechange=m.noop;P=bk==="timeout"?"timeout":!m.httpSuccess(bh)?"error":G.ifModified&&m.httpNotModified(bh,G.url)?"notmodified":"success";var bj;if(P==="success"){try{X=m.httpData(bh,G.dataType,G)}catch(bl){P="parsererror";bj=bl}}if(P==="success"||P==="notmodified"){Q||s()}else{m.handleError(G,bh,P,bj)}F();bk==="timeout"&&bh.abort();if(G.async){bh=null}}}};try{var O=bh.abort;bh.abort=function(){bh&&O.call(bh);L("abort")}}catch(T){}G.async&&G.timeout>0&&setTimeout(function(){bh&&!J&&L("timeout")},G.timeout);try{bh.send(W==="POST"||W==="PUT"||W==="DELETE"?G.data:null)}catch(V){m.handleError(G,bh,null,V);F()}G.async||L();return bh}},handleError:function(c,s,w,A){if(c.error){c.error.call(c.context||c,s,w,A)}if(c.global){(c.context?m(c.context):m.event).trigger("ajaxError",[s,c,A])}},active:0,httpSuccess:function(c){try{return !c.status&&location.protocol==="file:"||c.status>=200&&c.status<300||c.status===304||c.status===1223||c.status===0}catch(s){}return false},httpNotModified:function(c,s){var w=c.getResponseHeader("Last-Modified"),A=c.getResponseHeader("Etag");if(w){m.lastModified[s]=w}if(A){m.etag[s]=A}return c.status===304||c.status===0},httpData:function(c,s,w){var F=c.getResponseHeader("content-type")||"",A=s==="xml"||!s&&F.indexOf("xml")>=0;c=A?c.responseXML:c.responseText;A&&c.documentElement.nodeName==="parsererror"&&m.error("parsererror");if(w&&w.dataFilter){c=w.dataFilter(c,s)}if(typeof c==="string"){if(s==="json"||!s&&F.indexOf("json")>=0){c=m.parseJSON(c)}else{if(s==="script"||!s&&F.indexOf("javascript")>=0){m.globalEval(c)}}}return c},param:function(c,s){function w(J,K){if(m.isArray(K)){m.each(K,function(L,N){s||/\[\]$/.test(J)?F(J,N):w(J+"["+(typeof N==="object"||m.isArray(N)?L:"")+"]",N)})}else{!s&&K!=null&&typeof K==="object"?m.each(K,function(L,N){w(J+"["+L+"]",N)}):F(J,K)}}function F(J,K){K=m.isFunction(K)?K():K;A[A.length]=encodeURIComponent(J)+"="+encodeURIComponent(K)}var A=[];if(s===a0){s=m.ajaxSettings.traditional}if(m.isArray(c)||c.jquery){m.each(c,function(){F(this.name,this.value)})}else{for(var G in c){w(G,c[G])}}return A.join("&").replace(bc,"+")}});var ak={},h=/toggle|show|hide/,l=/^([+-]=)?([\d+-.]+)(.*)$/,a1,aX=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];m.fn.extend({show:function(c,s){if(c||c===0){return this.animate(af("show",3),c,s)}else{c=0;for(s=this.length;c").appendTo("body");F=A.css("display");if(F==="none"){F="block"}A.remove();ak[w]=F}m.data(this[c],"olddisplay",F)}}c=0;for(s=this.length;c=0;A--){if(w[A].elem===this){s&&w[A](true);w.splice(A,1)}}});s||this.dequeue();return this}});m.each({slideDown:af("show",1),slideUp:af("hide",1),slideToggle:af("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(c,s){m.fn[c]=function(w,A){return this.animate(s,w,A)}});m.extend({speed:function(c,s,w){var A=c&&typeof c==="object"?c:{complete:w||!w&&s||m.isFunction(c)&&c,duration:c,easing:w&&s||s&&!m.isFunction(s)&&s};A.duration=m.fx.off?0:typeof A.duration==="number"?A.duration:m.fx.speeds[A.duration]||m.fx.speeds._default;A.old=A.complete;A.complete=function(){A.queue!==false&&m(this).dequeue();m.isFunction(A.old)&&A.old.call(this)};return A},easing:{linear:function(c,s,w,A){return w+A*c},swing:function(c,s,w,A){return(-Math.cos(c*Math.PI)/2+0.5)*A+w}},timers:[],fx:function(c,s,w){this.options=s;this.elem=c;this.prop=w;if(!s.orig){s.orig={}}}});m.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(m.fx.step[this.prop]||m.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(c){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}return(c=parseFloat(m.css(this.elem,this.prop,c)))&&c>-10000?c:parseFloat(m.curCSS(this.elem,this.prop))||0},custom:function(c,s,w){function F(G){return A.step(G)}this.startTime=ab();this.start=c;this.end=s;this.unit=w||this.unit||"px";this.now=this.start;this.pos=this.state=0;var A=this;F.elem=this.elem;if(F()&&m.timers.push(F)&&!a1){a1=setInterval(m.fx.tick,13)}},show:function(){this.options.orig[this.prop]=m.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());m(this.elem).show()},hide:function(){this.options.orig[this.prop]=m.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var s=ab(),w=true;if(c||s>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){w=false}}if(w){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;c=m.data(this.elem,"olddisplay");this.elem.style.display=c?c:this.options.display;if(m.css(this.elem,"display")==="none"){this.elem.style.display="block"}}this.options.hide&&m(this.elem).hide();if(this.options.hide||this.options.show){for(var A in this.options.curAnim){m.style(this.elem,A,this.options.orig[A])}}this.options.complete.call(this.elem)}return false}else{A=s-this.startTime;this.state=A/this.options.duration;c=this.options.easing||(m.easing.swing?"swing":"linear");this.pos=m.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||c](this.state,A,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};m.extend(m.fx,{tick:function(){for(var c=m.timers,s=0;s
";c.insertBefore(s,c.firstChild);w=s.firstChild;F=w.firstChild;A=w.nextSibling.firstChild.firstChild;this.doesNotAddBorder=F.offsetTop!==5;this.doesAddBorderForTableAndCells=A.offsetTop===5;F.style.position="fixed";F.style.top="20px";this.supportsFixedPosition=F.offsetTop===20||F.offsetTop===15;F.style.position=F.style.top="";w.style.overflow="hidden";w.style.position="relative";this.subtractsBorderForOverflowNotVisible=F.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=c.offsetTop!==G;c.removeChild(s);m.offset.initialize=m.noop},bodyOffset:function(c){var s=c.offsetTop,w=c.offsetLeft;m.offset.initialize();if(m.offset.doesNotIncludeMarginInBodyOffset){s+=parseFloat(m.curCSS(c,"marginTop",true))||0;w+=parseFloat(m.curCSS(c,"marginLeft",true))||0}return{top:s,left:w}},setOffset:function(c,s,w){if(/static/.test(m.curCSS(c,"position"))){c.style.position="relative"}var F=m(c),A=F.offset(),J=parseInt(m.curCSS(c,"top",true),10)||0,G=parseInt(m.curCSS(c,"left",true),10)||0;if(m.isFunction(s)){s=s.call(c,w,A)}w={top:s.top-A.top+J,left:s.left-A.left+G};"using" in s?s.using.call(c,w):F.css(w)}};m.fn.extend({position:function(){if(!this[0]){return null}var c=this[0],s=this.offsetParent(),w=this.offset(),A=/^body|html$/i.test(s[0].nodeName)?{top:0,left:0}:s.offset();w.top-=parseFloat(m.curCSS(c,"marginTop",true))||0;w.left-=parseFloat(m.curCSS(c,"marginLeft",true))||0;A.top+=parseFloat(m.curCSS(s[0],"borderTopWidth",true))||0;A.left+=parseFloat(m.curCSS(s[0],"borderLeftWidth",true))||0;return{top:w.top-A.top,left:w.left-A.left}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||aL.body;c&&!/^body|html$/i.test(c.nodeName)&&m.css(c,"position")==="static";){c=c.offsetParent}return c})}});m.each(["Left","Top"],function(c,s){var w="scroll"+s;m.fn[w]=function(F){var A=this[0],G;if(!A){return null}if(F!==a0){return this.each(function(){if(G=a2(this)){G.scrollTo(!c?F:m(G).scrollLeft(),c?F:m(G).scrollTop())}else{this[w]=F}})}else{return(G=a2(A))?"pageXOffset" in G?G[c?"pageYOffset":"pageXOffset"]:m.support.boxModel&&G.document.documentElement[w]||G.document.body[w]:A[w]}}});m.each(["Height","Width"],function(c,s){var w=s.toLowerCase();m.fn["inner"+s]=function(){return this[0]?m.css(this[0],w,false,"padding"):null};m.fn["outer"+s]=function(A){return this[0]?m.css(this[0],w,false,A?"margin":"border"):null};m.fn[w]=function(F){var A=this[0];if(!A){return F==null?null:this}if(m.isFunction(F)){return this.each(function(J){var G=m(this);G[w](F.call(this,J,G[w]()))})}return"scrollTo" in A&&A.document?A.document.compatMode==="CSS1Compat"&&A.document.documentElement["client"+s]||A.document.body["client"+s]:A.nodeType===9?Math.max(A.documentElement["client"+s],A.body["scroll"+s],A.documentElement["scroll"+s],A.body["offset"+s],A.documentElement["offset"+s]):F===a0?m.css(A,w):this.css(w,typeof F==="string"?F:F+"px")}});d.jQuery=d.$=m})(window);/* * jQuery UI 1.8 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ jQuery.ui||(function(b){b.ui={version:"1.8",plugin:{add:function(g,h,j){var i=b.ui[g].prototype;for(var a in j){i.plugins[a]=i.plugins[a]||[];i.plugins[a].push([h,j[a]])}},call:function(a,h,g){var j=a.plugins[h];if(!j||!a.element[0].parentNode){return}for(var i=0;i0){return true}h[a]=1;g=(h[a]>0);h[a]=0;return g},isOverAxis:function(e,a,f){return(e>a)&&(e<(a+f))},isOver:function(l,h,k,j,a,i){return b.ui.isOverAxis(l,k,a)&&b.ui.isOverAxis(h,j,i)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};b.fn.extend({_focus:b.fn.focus,focus:function(a,d){return typeof a==="number"?this.each(function(){var c=this;setTimeout(function(){b(c).focus();(d&&d.call(c))},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var a;if((b.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){a=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(b.curCSS(this,"position",1))&&(/(auto|scroll)/).test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0)}else{a=this.parents().filter(function(){return(/(auto|scroll)/).test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!a.length?b(document):a},zIndex:function(h){if(h!==undefined){return this.css("zIndex",h)}if(this.length){var f=b(this[0]),a,g;while(f.length&&f[0]!==document){a=f.css("position");if(a=="absolute"||a=="relative"||a=="fixed"){g=parseInt(f.css("zIndex"));if(!isNaN(g)&&g!=0){return g}}f=f.parent()}}return 0}});b.extend(b.expr[":"],{data:function(f,e,a){return !!b.data(f,a[3])},focusable:function(e){var f=e.nodeName.toLowerCase(),a=b.attr(e,"tabindex");return(/input|select|textarea|button|object/.test(f)?!e.disabled:"a"==f||"area"==f?e.href||!isNaN(a):!isNaN(a))&&!b(e)["area"==f?"parents":"closest"](":hidden").length},tabbable:function(d){var a=b.attr(d,"tabindex");return(isNaN(a)||a>=0)&&b(d).is(":focusable")}})})(jQuery); /* * jQuery UI Widget 1.8 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Widget */ (function(d){var c=d.fn.remove;d.fn.remove=function(a,b){return this.each(function(){if(!b){if(!a||d.filter(a,[this]).length){d("*",this).add(this).each(function(){d(this).triggerHandler("remove")})}}return c.call(d(this),a,b)})};d.widget=function(b,j,a){var i=b.split(".")[0],l;b=b.split(".")[1];l=i+"-"+b;if(!a){a=j;j=d.Widget}d.expr[":"][l]=function(e){return !!d.data(e,b)};d[i]=d[i]||{};d[i][b]=function(e,f){if(arguments.length){this._createWidget(e,f)}};var k=new j();k.options=d.extend({},k.options);d[i][b].prototype=d.extend(true,k,{namespace:i,widgetName:b,widgetEventPrefix:d[i][b].prototype.widgetEventPrefix||b,widgetBaseClass:l},a);d.widget.bridge(b,d[i][b])};d.widget.bridge=function(b,a){d.fn[b]=function(k){var i=typeof k==="string",j=Array.prototype.slice.call(arguments,1),l=this;k=!i&&j.length?d.extend.apply(null,[true,k].concat(j)):k;if(i&&k.substring(0,1)==="_"){return l}if(i){this.each(function(){var e=d.data(this,b),f=e&&d.isFunction(e[k])?e[k].apply(e,j):e;if(f!==e&&f!==undefined){l=f;return false}})}else{this.each(function(){var e=d.data(this,b);if(e){if(k){e.option(k)}e._init()}else{d.data(this,b,new a(k,this))}})}return l}};d.Widget=function(a,b){if(arguments.length){this._createWidget(a,b)}};d.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,f){this.element=d(f).data(this.widgetName,this);this.options=d.extend(true,{},this.options,d.metadata&&d.metadata.get(f)[this.widgetName],b);var a=this;this.element.bind("remove."+this.widgetName,function(){a.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(g,h){var b=g,a=this;if(arguments.length===0){return d.extend({},a.options)}if(typeof g==="string"){if(h===undefined){return this.options[g]}b={};b[g]=h}d.each(b,function(e,f){a._setOption(e,f)});return a},_setOption:function(a,b){this.options[a]=b;if(a==="disabled"){this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",b)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,i,j){var l=this.options[b];i=d.Event(i);i.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();j=j||{};if(i.originalEvent){for(var a=d.event.props.length,k;a;){k=d.event.props[--a];i[k]=i.originalEvent[k]}}this.element.trigger(i,j);return !(d.isFunction(l)&&l.call(this.element[0],i,j)===false||i.isDefaultPrevented())}}})(jQuery); /* * jQuery UI Mouse 1.8 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Mouse * * Depends: * jquery.ui.widget.js */ (function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(d){return a._mouseDown(d)}).bind("click."+this.widgetName,function(d){if(a._preventClickEvent){a._preventClickEvent=false;d.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(g){g.originalEvent=g.originalEvent||{};if(g.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(g));this._mouseDownEvent=g;var f=this,h=(g.which==1),a=(typeof this.options.cancel=="string"?b(g.target).parents().add(g.target).filter(this.options.cancel).length:false);if(!h||a||!this._mouseCapture(g)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){f.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(g)&&this._mouseDelayMet(g)){this._mouseStarted=(this._mouseStart(g)!==false);if(!this._mouseStarted){g.preventDefault();return true}}this._mouseMoveDelegate=function(c){return f._mouseMove(c)};this._mouseUpDelegate=function(c){return f._mouseUp(c)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(b.browser.safari||g.preventDefault());g.originalEvent.mouseHandled=true;return true},_mouseMove:function(a){if(b.browser.msie&&!a.button){return this._mouseUp(a)}if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,a)!==false);(this._mouseStarted?this._mouseDrag(a):this._mouseUp(a))}return !this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(a.target==this._mouseDownEvent.target);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return(Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance)},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return true}})})(jQuery);(function(m){m.ui=m.ui||{};var j=/left|center|right/,l="center",k=/top|center|bottom/,n="center",h=m.fn.position,i=m.fn.offset;m.fn.position=function(b){if(!b||!b.of){return h.apply(this,arguments)}b=m.extend({},b);var e=m(b.of),g=(b.collision||"flip").split(" "),f=b.offset?b.offset.split(" "):[0,0],d,a,c;if(b.of.nodeType===9){d=e.width();a=e.height();c={top:0,left:0}}else{if(b.of.scrollTo&&b.of.document){d=e.width();a=e.height();c={top:e.scrollTop(),left:e.scrollLeft()}}else{if(b.of.preventDefault){b.at="left top";d=a=0;c={top:b.of.pageY,left:b.of.pageX}}else{d=e.outerWidth();a=e.outerHeight();c=e.offset()}}}m.each(["my","at"],function(){var p=(b[this]||"").split(" ");if(p.length===1){p=j.test(p[0])?p.concat([n]):k.test(p[0])?[l].concat(p):[l,n]}p[0]=j.test(p[0])?p[0]:l;p[1]=k.test(p[1])?p[1]:n;b[this]=p});if(g.length===1){g[1]=g[0]}f[0]=parseInt(f[0],10)||0;if(f.length===1){f[1]=f[0]}f[1]=parseInt(f[1],10)||0;if(b.at[0]==="right"){c.left+=d}else{if(b.at[0]===l){c.left+=d/2}}if(b.at[1]==="bottom"){c.top+=a}else{if(b.at[1]===n){c.top+=a/2}}c.left+=f[0];c.top+=f[1];return this.each(function(){var v=m(this),u=v.outerWidth(),t=v.outerHeight(),s=m.extend({},c);if(b.my[0]==="right"){s.left-=u}else{if(b.my[0]===l){s.left-=u/2}}if(b.my[1]==="bottom"){s.top-=t}else{if(b.my[1]===n){s.top-=t/2}}m.each(["left","top"],function(p,o){if(m.ui.position[g[p]]){m.ui.position[g[p]][o](s,{targetWidth:d,targetHeight:a,elemWidth:u,elemHeight:t,offset:f,my:b.my,at:b.at})}});if(m.fn.bgiframe){v.bgiframe()}v.offset(m.extend(s,{using:b.using}))})};m.ui.position={fit:{left:function(a,b){var d=m(window),c=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=c>0?a.left-c:Math.max(0,a.left)},top:function(a,b){var d=m(window),c=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=c>0?a.top-c:Math.max(0,a.top)}},flip:{left:function(b,c){if(c.at[0]==="center"){return}var e=m(window),d=b.left+c.elemWidth-e.width()-e.scrollLeft(),a=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,f=-2*c.offset[0];b.left+=b.left<0?a+c.targetWidth+f:d>0?a-c.targetWidth+f:0},top:function(b,d){if(d.at[1]==="center"){return}var f=m(window),e=b.top+d.elemHeight-f.height()-f.scrollTop(),a=d.my[1]==="top"?-d.elemHeight:d.my[1]==="bottom"?d.elemHeight:0,c=d.at[1]==="top"?d.targetHeight:-d.targetHeight,g=-2*d.offset[1];b.top+=b.top<0?a+d.targetHeight+g:e>0?a+c+g:0}}};if(!m.offset.setOffset){m.offset.setOffset=function(e,b){if(/static/.test(m.curCSS(e,"position"))){e.style.position="relative"}var d=m(e),g=d.offset(),a=parseInt(m.curCSS(e,"top",true),10)||0,f=parseInt(m.curCSS(e,"left",true),10)||0,c={top:(b.top-g.top)+a,left:(b.left-g.left)+f};if("using" in b){b.using.call(e,c)}else{d.css(c)}};m.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument){return null}if(a){return this.each(function(){m.offset.setOffset(this,a)})}return i.call(this)}}}(jQuery));(function(b){b.widget("ui.draggable",b.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(a){var d=this.options;if(this.helper||d.disabled||b(a.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(a);if(!this.handle){return false}return true},_mouseStart:function(a){var d=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(b.ui.ddmanager){b.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;(d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt));if(d.containment){this._setContainment()}if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();if(b.ui.ddmanager&&!d.dropBehaviour){b.ui.ddmanager.prepareOffsets(this,a)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,f){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!f){var e=this._uiHash();if(this._trigger("drag",a,e)===false){this._mouseUp({});return false}this.position=e.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(b.ui.ddmanager){b.ui.ddmanager.drag(this,a)}return false},_mouseStop:function(e){var f=false;if(b.ui.ddmanager&&!this.options.dropBehaviour){f=b.ui.ddmanager.drop(this,e)}if(this.dropped){f=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode){return false}if((this.options.revert=="invalid"&&!f)||(this.options.revert=="valid"&&f)||this.options.revert===true||(b.isFunction(this.options.revert)&&this.options.revert.call(this.element,f))){var a=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(a._trigger("stop",e)!==false){a._clear()}})}else{if(this._trigger("stop",e)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(a){var d=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target){d=true}});return d},_createHelper:function(e){var f=this.options;var a=b.isFunction(f.helper)?b(f.helper.apply(this.element[0],[e])):(f.helper=="clone"?this.element.clone():this.element);if(!a.parents("body").length){a.appendTo((f.appendTo=="parent"?this.element[0].parentNode:f.appendTo))}if(a[0]!=this.element[0]&&!(/(fixed|absolute)/).test(a.css("position"))){a.css("position","absolute")}return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string"){a=a.split(" ")}if(b.isArray(a)){a={left:+a[0],top:+a[1]||0}}if("left" in a){this.offset.click.left=a.left+this.margins.left}if("right" in a){this.offset.click.left=this.helperProportions.width-a.right+this.margins.left}if("top" in a){this.offset.click.top=a.top+this.margins.top}if("bottom" in a){this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)){a={top:0,left:0}}return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var h=this.options;if(h.containment=="parent"){h.containment=this.helper[0].parentNode}if(h.containment=="document"||h.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(h.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(h.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(h.containment)&&h.containment.constructor!=Array){var f=b(h.containment)[0];if(!f){return}var g=b(h.containment).offset();var a=(b(f).css("overflow")!="hidden");this.containment=[g.left+(parseInt(b(f).css("borderLeftWidth"),10)||0)+(parseInt(b(f).css("paddingLeft"),10)||0)-this.margins.left,g.top+(parseInt(b(f).css("borderTopWidth"),10)||0)+(parseInt(b(f).css("paddingTop"),10)||0)-this.margins.top,g.left+(a?Math.max(f.scrollWidth,f.offsetWidth):f.offsetWidth)-(parseInt(b(f).css("borderLeftWidth"),10)||0)-(parseInt(b(f).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,g.top+(a?Math.max(f.scrollHeight,f.offsetHeight):f.offsetHeight)-(parseInt(b(f).css("borderTopWidth"),10)||0)-(parseInt(b(f).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(h.containment.constructor==Array){this.containment=h.containment}}},_convertPositionTo:function(j,l){if(!l){l=this.position}var d=j=="absolute"?1:-1;var i=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,k=(/(html|body)/i).test(a[0].tagName);return{top:(l.top+this.offset.relative.top*d+this.offset.parent.top*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(k?0:a.scrollTop()))*d)),left:(l.left+this.offset.relative.left*d+this.offset.parent.left*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():k?0:a.scrollLeft())*d))}},_generatePosition:function(l){var o=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,p=(/(html|body)/i).test(a[0].tagName);var k=l.pageX;var j=l.pageY;if(this.originalPosition){if(this.containment){if(l.pageX-this.offset.click.leftthis.containment[2]){k=this.containment[2]+this.offset.click.left}if(l.pageY-this.offset.click.top>this.containment[3]){j=this.containment[3]+this.offset.click.top}}if(o.grid){var n=this.originalPageY+Math.round((j-this.originalPageY)/o.grid[1])*o.grid[1];j=this.containment?(!(n-this.offset.click.topthis.containment[3])?n:(!(n-this.offset.click.topthis.containment[2])?m:(!(m-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(b(this).offset()).appendTo("body")})},stop:function(a,d){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(f,g){var a=b(g.helper),h=b(this).data("draggable").options;if(a.css("opacity")){h._opacity=a.css("opacity")}a.css("opacity",h.opacity)},stop:function(a,e){var f=b(this).data("draggable").options;if(f._opacity){b(e.helper).css("opacity",f._opacity)}}});b.ui.plugin.add("draggable","scroll",{start:function(e,f){var a=b(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML"){a.overflowOffset=a.scrollParent.offset()}},drag:function(h,i){var g=b(this).data("draggable"),j=g.options,a=false;if(g.scrollParent[0]!=document&&g.scrollParent[0].tagName!="HTML"){if(!j.axis||j.axis!="x"){if((g.overflowOffset.top+g.scrollParent[0].offsetHeight)-h.pageY=0;I--){var G=o.snapElements[I].left,D=G+o.snapElements[I].width,C=o.snapElements[I].top,a=C+o.snapElements[I].height;if(!((G-L').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=m.handles||(!f(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var n=this.handles.split(",");this.handles={};for(var c=0;c');if(/sw|se|ne|nw/.test(l)){i.css({zIndex:++m.zIndex})}if("se"==l){i.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[l]=".ui-resizable-"+l;this.element.append(i)}}this._renderAxis=function(q){q=q||this.element;for(var h in this.handles){if(this.handles[h].constructor==String){this.handles[h]=f(this.handles[h],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=f(this.handles[h],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(h)?j.outerHeight():j.outerWidth();var g=["padding",/ne|nw|n/.test(h)?"Top":/se|sw|s/.test(h)?"Bottom":/^e$/.test(h)?"Right":"Left"].join("");q.css(g,k);this._proportionallyResize()}if(!f(this.handles[h]).length){continue}}};this._renderAxis(this.element);this._handles=f(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!b.resizing){if(this.className){var g=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}b.axis=g&&g[1]?g[1]:"se"}});if(m.autoHide){this._handles.hide();f(this.element).addClass("ui-resizable-autohide").hover(function(){f(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){f(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var a=function(c){f(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){a(this.element);var b=this.element;b.after(this.originalElement.css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);a(this.originalElement);return this},_mouseCapture:function(b){var c=false;for(var a in this.handles){if(f(this.handles[a])[0]==b.target){c=true}}return !this.options.disabled&&c},_mouseStart:function(c){var m=this.options,b=this.element.position(),a=this.element;this.resizing=true;this.documentScroll={top:f(document).scrollTop(),left:f(document).scrollLeft()};if(a.is(".ui-draggable")||(/absolute/).test(a.css("position"))){a.css({position:"absolute",top:b.top,left:b.left})}if(f.browser.opera&&(/relative/).test(a.css("position"))){a.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var n=e(this.helper.css("left")),k=e(this.helper.css("top"));if(m.containment){n+=f(m.containment).scrollLeft()||0;k+=f(m.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:n,top:k};this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()};this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()};this.originalPosition={left:n,top:k};this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()};this.originalMousePosition={left:c.pageX,top:c.pageY};this.aspectRatio=(typeof m.aspectRatio=="number")?m.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var l=f(".ui-resizable-"+this.axis).css("cursor");f("body").css("cursor",l=="auto"?this.axis+"-resize":l);a.addClass("ui-resizable-resizing");this._propagate("start",c);return true},_mouseDrag:function(a){var o=this.helper,c=this.options,v={},y=this,s=this.originalMousePosition,w=this.axis;var z=(a.pageX-s.left)||0,x=(a.pageY-s.top)||0;var r=this._change[w];if(!r){return false}var u=r.apply(this,[a,z,x]),t=f.browser.msie&&f.browser.version<7,b=this.sizeDiff;if(this._aspectRatio||a.shiftKey){u=this._updateRatio(u,a)}u=this._respectSize(u,a);this._propagate("resize",a);o.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(u);this._trigger("resize",a,this.ui());return false},_mouseStop:function(n){this.resizing=false;var o=this.options,s=this;if(this._helper){var c=this._proportionallyResizeElements,a=c.length&&(/textarea/i).test(c[0].nodeName),b=a&&f.ui.hasScroll(c[0],"left")?0:s.sizeDiff.height,q=a?0:s.sizeDiff.width;var t={width:(s.size.width-q),height:(s.size.height-b)},p=(parseInt(s.element.css("left"),10)+(s.position.left-s.originalPosition.left))||null,r=(parseInt(s.element.css("top"),10)+(s.position.top-s.originalPosition.top))||null;if(!o.animate){this.element.css(f.extend(t,{top:r,left:p}))}s.helper.height(s.size.height);s.helper.width(s.size.width);if(this._helper&&!o.animate){this._proportionallyResize()}}f("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",n);if(this._helper){this.helper.remove()}return false},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset();if(d(a.left)){this.position.left=a.left}if(d(a.top)){this.position.top=a.top}if(d(a.height)){this.size.height=a.height}if(d(a.width)){this.size.width=a.width}},_updateRatio:function(j,c){var k=this.options,l=this.position,b=this.size,a=this.axis;if(j.height){j.width=(b.height*this.aspectRatio)}else{if(j.width){j.height=(b.width/this.aspectRatio)}}if(a=="sw"){j.left=l.left+(b.width-j.width);j.top=null}if(a=="nw"){j.top=l.top+(b.height-j.height);j.left=l.left+(b.width-j.width)}return j},_respectSize:function(w,c){var u=this.helper,t=this.options,B=this._aspectRatio||c.shiftKey,A=this.axis,D=d(w.width)&&t.maxWidth&&(t.maxWidthw.width),C=d(w.height)&&t.minHeight&&(t.minHeight>w.height);if(o){w.width=t.minWidth}if(C){w.height=t.minHeight}if(D){w.width=t.maxWidth}if(x){w.height=t.maxHeight}var b=this.originalPosition.left+this.originalSize.width,z=this.position.top+this.size.height;var v=/sw|nw|w/.test(A),a=/nw|ne|n/.test(A);if(o&&v){w.left=b-t.minWidth}if(D&&v){w.left=b-t.maxWidth}if(C&&a){w.top=z-t.minHeight}if(x&&a){w.top=z-t.maxHeight}var y=!w.width&&!w.height;if(y&&!w.left&&w.top){w.top=null}else{if(y&&!w.top&&w.left){w.left=null}}return w},_proportionallyResize:function(){var l=this.options;if(!this._proportionallyResizeElements.length){return}var c=this.helper||this.element;for(var b=0;b');var a=f.browser.msie&&f.browser.version<7,c=(a?1:0),i=(a?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++j.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(c,b,a){return{width:this.originalSize.width+b}},w:function(j,b,a){var l=this.options,c=this.originalSize,k=this.originalPosition;return{left:k.left+b,width:c.width-b}},n:function(j,b,a){var l=this.options,c=this.originalSize,k=this.originalPosition;return{top:k.top+a,height:c.height-a}},s:function(c,b,a){return{height:this.originalSize.height+a}},se:function(c,b,a){return f.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[c,b,a]))},sw:function(c,b,a){return f.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[c,b,a]))},ne:function(c,b,a){return f.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[c,b,a]))},nw:function(c,b,a){return f.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[c,b,a]))}},_propagate:function(b,a){f.ui.plugin.call(this,b,[a,this.ui()]);(b!="resize"&&this._trigger(b,a,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});f.extend(f.ui.resizable,{version:"1.8"});f.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var a=f(this).data("resizable"),j=a.options;var i=function(g){f(g).each(function(){f(this).data("resizable-alsoresize",{width:parseInt(f(this).width(),10),height:parseInt(f(this).height(),10),left:parseInt(f(this).css("left"),10),top:parseInt(f(this).css("top"),10)})})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.parentNode){if(j.alsoResize.length){j.alsoResize=j.alsoResize[0];i(j.alsoResize)}else{f.each(j.alsoResize,function(g,h){i(g)})}}else{i(j.alsoResize)}},resize:function(c,m){var b=f(this).data("resizable"),n=b.options,l=b.originalSize,p=b.originalPosition;var o={height:(b.size.height-l.height)||0,width:(b.size.width-l.width)||0,top:(b.position.top-p.top)||0,left:(b.position.left-p.left)||0},a=function(g,h){f(g).each(function(){var k=f(this),r=f(this).data("resizable-alsoresize"),j={},i=h&&h.length?h:["width","height","top","left"];f.each(i||["width","height","top","left"],function(q,v){var u=(r[v]||0)+(o[v]||0);if(u&&u>=0){j[v]=u||null}});if(/relative/.test(k.css("position"))&&f.browser.opera){b._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(j)})};if(typeof(n.alsoResize)=="object"&&!n.alsoResize.nodeType){f.each(n.alsoResize,function(g,h){a(g,h)})}else{a(n.alsoResize)}},stop:function(b,c){var a=f(this).data("resizable");if(a._revertToRelativePosition&&f.browser.opera){a._revertToRelativePosition=false;el.css({position:"relative"})}f(this).removeData("resizable-alsoresize-start")}});f.ui.plugin.add("resizable","animate",{stop:function(p,u){var v=f(this).data("resizable"),q=v.options;var o=v._proportionallyResizeElements,a=o.length&&(/textarea/i).test(o[0].nodeName),b=a&&f.ui.hasScroll(o[0],"left")?0:v.sizeDiff.height,s=a?0:v.sizeDiff.width;var c={width:(v.size.width-s),height:(v.size.height-b)},r=(parseInt(v.element.css("left"),10)+(v.position.left-v.originalPosition.left))||null,t=(parseInt(v.element.css("top"),10)+(v.position.top-v.originalPosition.top))||null;v.element.animate(f.extend(c,t&&r?{top:t,left:r}:{}),{duration:q.animateDuration,easing:q.animateEasing,step:function(){var g={width:parseInt(v.element.css("width"),10),height:parseInt(v.element.css("height"),10),top:parseInt(v.element.css("top"),10),left:parseInt(v.element.css("left"),10)};if(o&&o.length){f(o[0]).css({width:g.width,height:g.height})}v._updateCache(g);v._propagate("resize",p)}})}});f.ui.plugin.add("resizable","containment",{start:function(b,z){var B=f(this).data("resizable"),t=B.options,v=B.element;var c=t.containment,u=(c instanceof f)?c.get(0):(/parent/.test(c))?v.parent().get(0):c;if(!u){return}B.containerElement=f(u);if(/document/.test(c)||c==document){B.containerOffset={left:0,top:0};B.containerPosition={left:0,top:0};B.parentData={element:f(document),left:0,top:0,width:f(document).width(),height:f(document).height()||document.body.parentNode.scrollHeight}}else{var x=f(u),p=[];f(["Top","Right","Left","Bottom"]).each(function(h,g){p[h]=e(x.css("padding"+g))});B.containerOffset=x.offset();B.containerPosition=x.position();B.containerSize={height:(x.innerHeight()-p[3]),width:(x.innerWidth()-p[1])};var y=B.containerOffset,a=B.containerSize.height,w=B.containerSize.width,o=(f.ui.hasScroll(u,"left")?u.scrollWidth:w),A=(f.ui.hasScroll(u)?u.scrollHeight:a);B.parentData={element:u,left:y.left,top:y.top,width:o,height:A}}},resize:function(c,A){var D=f(this).data("resizable"),t=D.options,b=D.containerSize,z=D.containerOffset,x=D.size,y=D.position,B=D._aspectRatio||c.shiftKey,a={top:0,left:0},o=D.containerElement;if(o[0]!=document&&(/static/).test(o.css("position"))){a=z}if(y.left<(D._helper?z.left:0)){D.size.width=D.size.width+(D._helper?(D.position.left-z.left):(D.position.left-a.left));if(B){D.size.height=D.size.width/t.aspectRatio}D.position.left=t.helper?z.left:0}if(y.top<(D._helper?z.top:0)){D.size.height=D.size.height+(D._helper?(D.position.top-z.top):D.position.top);if(B){D.size.width=D.size.height*t.aspectRatio}D.position.top=D._helper?z.top:0}D.offset.left=D.parentData.left+D.position.left;D.offset.top=D.parentData.top+D.position.top;var w=Math.abs((D._helper?D.offset.left-a.left:(D.offset.left-a.left))+D.sizeDiff.width),C=Math.abs((D._helper?D.offset.top-a.top:(D.offset.top-z.top))+D.sizeDiff.height);var v=D.containerElement.get(0)==D.element.parent().get(0),u=/relative|absolute/.test(D.containerElement.css("position"));if(v&&u){w-=D.parentData.left}if(w+D.size.width>=D.parentData.width){D.size.width=D.parentData.width-w;if(B){D.size.height=D.size.width/D.aspectRatio}}if(C+D.size.height>=D.parentData.height){D.size.height=D.parentData.height-C;if(B){D.size.width=D.size.height*D.aspectRatio}}},stop:function(b,u){var w=f(this).data("resizable"),c=w.options,s=w.position,t=w.containerOffset,a=w.containerPosition,h=w.containerElement;var o=f(w.helper),x=o.offset(),v=o.outerWidth()-w.sizeDiff.width,r=o.outerHeight()-w.sizeDiff.height;if(w._helper&&!c.animate&&(/relative/).test(h.css("position"))){f(this).css({left:x.left-a.left-t.left,width:v,height:r})}if(w._helper&&!c.animate&&(/static/).test(h.css("position"))){f(this).css({left:x.left-a.left-t.left,width:v,height:r})}}});f.ui.plugin.add("resizable","ghost",{start:function(c,i){var a=f(this).data("resizable"),j=a.options,b=a.size;a.ghost=a.originalElement.clone();a.ghost.css({opacity:0.25,display:"block",position:"relative",height:b.height,width:b.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof j.ghost=="string"?j.ghost:"");a.ghost.appendTo(a.helper)},resize:function(b,c){var a=f(this).data("resizable"),h=a.options;if(a.ghost){a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})}},stop:function(b,c){var a=f(this).data("resizable"),h=a.options;if(a.ghost&&a.helper){a.helper.get(0).removeChild(a.ghost.get(0))}}});f.ui.plugin.add("resizable","grid",{resize:function(a,t){var v=f(this).data("resizable"),o=v.options,r=v.size,p=v.originalSize,q=v.originalPosition,u=v.axis,s=o._aspectRatio||a.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var c=Math.round((r.width-p.width)/(o.grid[0]||1))*(o.grid[0]||1),b=Math.round((r.height-p.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(u)){v.size.width=p.width+c;v.size.height=p.height+b}else{if(/^(ne)$/.test(u)){v.size.width=p.width+c;v.size.height=p.height+b;v.position.top=q.top-b}else{if(/^(sw)$/.test(u)){v.size.width=p.width+c;v.size.height=p.height+b;v.position.left=q.left-c}else{v.size.width=p.width+c;v.size.height=p.height+b;v.position.top=q.top-b;v.position.left=q.left-c}}}}});var e=function(a){return parseInt(a,10)||0};var d=function(a){return !isNaN(parseInt(a,10))}})(jQuery);(function(d){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ";d.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");var s=this,t=s.options,q=t.title||s.originalTitle||" ",b=d.ui.dialog.getTitleId(s.element),r=(s.uiDialog=d("
")).appendTo(document.body).hide().addClass(c+t.dialogClass).css({zIndex:t.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(e){if(t.closeOnEscape&&e.keyCode&&e.keyCode===d.ui.keyCode.ESCAPE){s.close(e);e.preventDefault()}}).attr({role:"dialog","aria-labelledby":b}).mousedown(function(e){s.moveToTop(false,e)}),n=s.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(r),m=(s.uiDialogTitlebar=d("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(r),p=d('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){p.addClass("ui-state-hover")},function(){p.removeClass("ui-state-hover")}).focus(function(){p.addClass("ui-state-focus")}).blur(function(){p.removeClass("ui-state-focus")}).click(function(e){s.close(e);return false}).appendTo(m),o=(s.uiDialogTitlebarCloseText=d("")).addClass("ui-icon ui-icon-closethick").text(t.closeText).appendTo(p),a=d("").addClass("ui-dialog-title").attr("id",b).html(q).prependTo(m);if(d.isFunction(t.beforeclose)&&!d.isFunction(t.beforeClose)){t.beforeClose=t.beforeclose}m.find("*").add(m).disableSelection();if(t.draggable&&d.fn.draggable){s._makeDraggable()}if(t.resizable&&d.fn.resizable){s._makeResizable()}s._createButtons(t.buttons);s._isOpen=false;if(d.fn.bgiframe){r.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var a=this;if(a.overlay){a.overlay.destroy()}a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();if(a.originalTitle){a.element.attr("title",a.originalTitle)}return a},widget:function(){return this.uiDialog},close:function(f){var a=this,b;if(false===a._trigger("beforeClose",f)){return}if(a.overlay){a.overlay.destroy()}a.uiDialog.unbind("keypress.ui-dialog");a._isOpen=false;if(a.options.hide){a.uiDialog.hide(a.options.hide,function(){a._trigger("close",f)})}else{a.uiDialog.hide();a._trigger("close",f)}d.ui.dialog.overlay.resize();if(a.options.modal){b=0;d(".ui-dialog").each(function(){if(this!==a.uiDialog[0]){b=Math.max(b,d(this).css("z-index"))}});d.ui.dialog.maxZ=b}return a},isOpen:function(){return this._isOpen},moveToTop:function(j,i){var a=this,h=a.options,b;if((h.modal&&!j)||(!h.stack&&!h.modal)){return a._trigger("focus",i)}if(h.zIndex>d.ui.dialog.maxZ){d.ui.dialog.maxZ=h.zIndex}if(a.overlay){d.ui.dialog.maxZ+=1;a.overlay.$el.css("z-index",d.ui.dialog.overlay.maxZ=d.ui.dialog.maxZ)}b={scrollTop:a.element.attr("scrollTop"),scrollLeft:a.element.attr("scrollLeft")};d.ui.dialog.maxZ+=1;a.uiDialog.css("z-index",d.ui.dialog.maxZ);a.element.attr(b);a._trigger("focus",i);return a},open:function(){if(this._isOpen){return}var b=this,f=b.options,a=b.uiDialog;b.overlay=f.modal?new d.ui.dialog.overlay(b):null;if(a.next().length){a.appendTo("body")}b._size();b._position(f.position);a.show(f.show);b.moveToTop(true);if(f.modal){a.bind("keypress.ui-dialog",function(k){if(k.keyCode!==d.ui.keyCode.TAB){return}var j=d(":tabbable",this),l=j.filter(":first"),e=j.filter(":last");if(k.target===e[0]&&!k.shiftKey){l.focus(1);return false}else{if(k.target===l[0]&&k.shiftKey){e.focus(1);return false}}})}d([]).add(a.find(".ui-dialog-content :tabbable:first")).add(a.find(".ui-dialog-buttonpane :tabbable:first")).add(a).filter(":first").focus();b._trigger("open");b._isOpen=true;return b},_createButtons:function(h){var g=this,a=false,b=d("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");g.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof h==="object"&&h!==null){d.each(h,function(){return !(a=true)})}if(a){d.each(h,function(e,j){var f=d('').text(e).click(function(){j.apply(g.element[0],arguments)}).appendTo(b);if(d.fn.button){f.button()}});b.appendTo(g.uiDialog)}},_makeDraggable:function(){var a=this,i=a.options,j=d(document),h;function b(e){return{position:e.position,offset:e.offset}}a.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,f){h=i.height==="auto"?"auto":d(this).height();d(this).height(d(this).height()).addClass("ui-dialog-dragging");a._trigger("dragStart",e,b(f))},drag:function(e,f){a._trigger("drag",e,b(f))},stop:function(e,f){i.position=[f.position.left-j.scrollLeft(),f.position.top-j.scrollTop()];d(this).removeClass("ui-dialog-dragging").height(h);a._trigger("dragStop",e,b(f));d.ui.dialog.overlay.resize()}})},_makeResizable:function(l){l=(l===undefined?this.options.resizable:l);var b=this,k=b.options,a=b.uiDialog.css("position"),j=(typeof l==="string"?l:"n,e,s,w,se,sw,ne,nw");function i(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}b.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:b.element,maxWidth:k.maxWidth,maxHeight:k.maxHeight,minWidth:k.minWidth,minHeight:b._minHeight(),handles:j,start:function(e,f){d(this).addClass("ui-dialog-resizing");b._trigger("resizeStart",e,i(f))},resize:function(e,f){b._trigger("resize",e,i(f))},stop:function(e,f){d(this).removeClass("ui-dialog-resizing");k.height=d(this).height();k.width=d(this).width();b._trigger("resizeStop",e,i(f));d.ui.dialog.overlay.resize()}}).css("position",a).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;if(a.height==="auto"){return a.minHeight}else{return Math.min(a.minHeight,a.height)}},_position:function(b){var g=[],h=[0,0],a;b=b||d.ui.dialog.prototype.options.position;if(typeof b==="string"||(typeof b==="object"&&"0" in b)){g=b.split?b.split(" "):[b[0],b[1]];if(g.length===1){g[1]=g[0]}d.each(["left","top"],function(f,e){if(+g[f]===g[f]){h[f]=g[f];g[f]=e}})}else{if(typeof b==="object"){if("left" in b){g[0]="left";h[0]=b.left}else{if("right" in b){g[0]="right";h[0]=-b.right}}if("top" in b){g[1]="top";h[1]=b.top}else{if("bottom" in b){g[1]="bottom";h[1]=-b.bottom}}}}a=this.uiDialog.is(":visible");if(!a){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position({my:g.join(" "),at:g.join(" "),offset:h.join(" "),of:window,collision:"fit",using:function(f){var e=d(this).css(f).offset().top;if(e<0){d(this).css("top",f.top-e)}}});if(!a){this.uiDialog.hide()}},_setOption:function(j,k){var b=this,a=b.uiDialog,l=a.is(":data(resizable)"),i=false;switch(j){case"beforeclose":j="beforeClose";break;case"buttons":b._createButtons(k);break;case"closeText":b.uiDialogTitlebarCloseText.text(""+k);break;case"dialogClass":a.removeClass(b.options.dialogClass).addClass(c+k);break;case"disabled":if(k){a.addClass("ui-dialog-disabled")}else{a.removeClass("ui-dialog-disabled")}break;case"draggable":if(k){b._makeDraggable()}else{a.draggable("destroy")}break;case"height":i=true;break;case"maxHeight":if(l){a.resizable("option","maxHeight",k)}i=true;break;case"maxWidth":if(l){a.resizable("option","maxWidth",k)}i=true;break;case"minHeight":if(l){a.resizable("option","minHeight",k)}i=true;break;case"minWidth":if(l){a.resizable("option","minWidth",k)}i=true;break;case"position":b._position(k);break;case"resizable":if(l&&!k){a.resizable("destroy")}if(l&&typeof k==="string"){a.resizable("option","handles",k)}if(!l&&k!==false){b._makeResizable(k)}break;case"title":d(".ui-dialog-title",b.uiDialogTitlebar).html(""+(k||" "));break;case"width":i=true;break}d.Widget.prototype._setOption.apply(b,arguments);if(i){b._size()}},_size:function(){var b=this.options,a;this.element.css("width","auto").hide();a=this.uiDialog.css({height:"auto",width:b.width}).height();this.element.css(b.height==="auto"?{minHeight:Math.max(b.minHeight-a,0),height:"auto"}:{minHeight:0,height:Math.max(b.height-a,0)}).show();if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});d.extend(d.ui.dialog,{version:"1.8",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");if(!b){this.uuid+=1;b=this.uuid}return"ui-dialog-title-"+b},overlay:function(a){this.$el=d.ui.dialog.overlay.create(a)}});d.extend(d.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:d.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){if(this.instances.length===0){setTimeout(function(){if(d.ui.dialog.overlay.instances.length){d(document).bind(d.ui.dialog.overlay.events,function(f){return(d(f.target).zIndex()>=d.ui.dialog.overlay.maxZ)})}},1);d(document).bind("keydown.dialog-overlay",function(f){if(b.options.closeOnEscape&&f.keyCode&&f.keyCode===d.ui.keyCode.ESCAPE){b.close(f);f.preventDefault()}});d(window).bind("resize.dialog-overlay",d.ui.dialog.overlay.resize)}var a=(this.oldInstances.pop()||d("
").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if(d.fn.bgiframe){a.bgiframe()}this.instances.push(a);return a},destroy:function(a){this.oldInstances.push(this.instances.splice(d.inArray(a,this.instances),1)[0]);if(this.instances.length===0){d([document,window]).unbind(".dialog-overlay")}a.remove();var b=0;d.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var b,a;if(d.browser.msie&&d.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);a=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(b").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)}c.settings.submitHandler.call(c,c.currentForm);if(c.submitButton){f.remove()}return false}return true}if(c.cancelSubmit){c.cancelSubmit=false;return e()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return e()}else{c.focusInvalid();return false}})}return c},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var b=true;var c=a(this[0].form).validate();this.each(function(){b&=c.element(this)});return b}},removeAttrs:function(c){var d={},b=this;a.each(c.split(/\s/),function(e,f){d[f]=b.attr(f);b.removeAttr(f)});return d},rules:function(c,b){var e=this[0];if(c){var i=a.data(e.form,"validator").settings;var j=i.rules;var f=a.validator.staticRules(e);switch(c){case"add":a.extend(f,a.validator.normalizeRule(b));j[e.name]=f;if(b.messages){i.messages[e.name]=a.extend(i.messages[e.name],b.messages)}break;case"remove":if(!b){delete j[e.name];return f}var g={};a.each(b.split(/\s/),function(k,l){g[l]=f[l];delete f[l]});return g}}var d=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(e),a.validator.classRules(e),a.validator.attributeRules(e),a.validator.staticRules(e)),e);if(d.required){var h=d.required;delete d.required;d=a.extend({required:h},d)}return d}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(""+b.value)},filled:function(b){return !!a.trim(""+b.value)},unchecked:function(b){return !b.checked}});a.validator=function(c,b){this.settings=a.extend(true,{},a.validator.defaults,c);this.currentForm=b;this.init()};a.validator.format=function(c,b){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(c);return a.validator.format.apply(this,d)}}if(arguments.length>2&&b.constructor!=Array){b=a.makeArray(arguments).slice(1)}if(b.constructor!=Array){b=[b]}a.each(b,function(d,e){c=c.replace(new RegExp("\\{"+d+"\\}","g"),e)});return c};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(b){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass,this.settings.validClass);this.errorsFor(b).hide()}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b){if(b.name in this.submitted){this.element(b)}else{if(b.parentNode.name in this.submitted){this.element(b.parentNode)}}},highlight:function(b,c,d){a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var c=(this.groups={});a.each(this.settings.groups,function(e,f){a.each(f.split(/\s/),function(g,h){c[h]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function b(e){var g=a.data(this[0].form,"validator"),f="on"+e.type.replace(/^validate/,"");g.settings[f]&&g.settings[f].call(g,this[0])}a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",b).validateDelegate(":radio, :checkbox, select, option","click",b);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var c=0,b=(this.currentElements=this.elements());b[c];c++){this.check(b[c])}return this.valid()},element:function(b){b=this.clean(b);this.lastElement=b;this.prepareElement(b);this.currentElements=a(b);var c=this.check(b);if(c){delete this.invalid[b.name]}else{this.invalid[b.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return c},showErrors:function(b){if(b){a.extend(this.errorMap,b);this.errorList=[];for(var c in b){this.errorList.push({message:b[c],element:this.findByName(c)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(d){var b=0;for(var c in d){b++}return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},check:function(d){d=this.clean(d);if(this.checkable(d)){d=this.findByName(d.name)[0]}var h=a(d).rules();var b=false;for(method in h){var g={method:method,parameters:h[method]};try{var f=a.validator.methods[method].call(this,d.value.replace(/\r/g,""),d,g.parameters);if(f=="dependency-mismatch"){b=true;continue}b=false;if(f=="pending"){this.toHide=this.toHide.not(this.errorsFor(d));return}if(!f){this.formatAndAdd(d,g);return false}}catch(c){this.settings.debug&&window.console&&console.log("exception occured when checking element "+d.id+", check the '"+g.method+"' method",c);throw c}}if(b){return}if(this.objectLength(h)){this.successList.push(d)}return true},customMetaMessage:function(b,d){if(!a.metadata){return}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d]},customMessage:function(d,c){var b=this.settings.messages[d];return b&&(b.constructor==String?b:b[c])},findDefined:function(){for(var b=0;bWarning: No message defined for "+b.name+"")},formatAndAdd:function(b,d){var c=this.defaultMessage(b,d.method),e=/\$?\{(\d+)\}/g;if(typeof c=="function"){c=c.call(this,d.parameters,b)}else{if(e.test(c)){c=jQuery.format(c.replace(e,"{$1}"),d.parameters)}}this.errorList.push({message:c,element:b});this.errorMap[b.name]=c;this.submitted[b.name]=c},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parent(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var d=0;this.errorList[d];d++){var c=this.errorList[d];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass);this.showLabel(c.element,c.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var d=0;this.successList[d];d++){this.showLabel(this.successList[d])}}if(this.settings.unhighlight){for(var d=0,b=this.validElements();b[d];d++){this.settings.unhighlight.call(this,b[d],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,d){var c=this.errorsFor(b);if(c.length){c.removeClass().addClass(this.settings.errorClass);c.attr("generated")&&c.html(d)}else{c=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){c=c.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(c).length){this.settings.errorPlacement?this.settings.errorPlacement(c,a(b)):c.insertAfter(b)}}if(!d&&this.settings.success){c.text("");typeof this.settings.success=="string"?c.addClass(this.settings.success):this.settings.success(c)}this.toShow=this.toShow.add(c)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")==c})},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(c){var b=this.currentForm;return a(document.getElementsByName(c)).map(function(e,d){return d.form==b&&d.name==c&&d||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,b.form).length},"function":function(c,b){return c(b)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();this.formSubmitted=false}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}});return d},attributeRules:function(c){var d={};var b=a(c);for(method in a.validator.methods){var e=b.attr(method);if(e){d[method]=e}}if(d.maxlength&&/-1|2147483647|524288/.test(d.maxlength)){delete d.maxlength}return d},metadataRules:function(b){if(!a.metadata){return{}}var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={};var d=a.data(b.form,"validator");if(d.settings.rules){c=a.validator.normalizeRule(d.settings.rules[b.name])||{}}return c},normalizeRules:function(c,b){a.each(c,function(e,f){if(f===false){delete c[e];return}if(f.param||f.depends){var d=true;switch(typeof f.depends){case"string":d=!!a(f.depends,b.form).length;break;case"function":d=f.depends.call(b,b);break}if(d){c[e]=f.param!==undefined?f.param:true}else{delete c[e]}}});a.each(c,function(e,d){c[e]=a.isFunction(d)?d(b):d});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])]}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}if(c.messages){delete c.messages}return c},normalizeRule:function(b){if(typeof b=="string"){var c={};a.each(b.split(/\s/),function(){c[this]=true});b=c}return b},addMethod:function(d,c,b){a.validator.methods[d]=c;a.validator.messages[d]=b!=undefined?b:a.validator.messages[d];if(c.length<3){a.validator.addClassRules(d,a.validator.normalizeRule(d))}},methods:{required:function(e,b,c){if(!this.depend(c,b)){return"dependency-mismatch"}switch(b.nodeName.toLowerCase()){case"select":var d=a(b).val();return d&&d.length>0;case"input":if(this.checkable(b)){return this.getLength(e,b)>0}default:return a.trim(e).length>0}},remote:function(g,c,d){if(this.optional(c)){return"dependency-mismatch"}var e=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}e.originalMessage=this.settings.messages[c.name].remote;this.settings.messages[c.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(e.old!==g){e.old=g;var f=this;this.startRequest(c);var b={};b[c.name]=g;a.ajax(a.extend(true,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:b,success:function(j){f.settings.messages[c.name].remote=e.originalMessage;var l=j===true;if(l){var k=f.formSubmitted;f.prepareElement(c);f.formSubmitted=k;f.successList.push(c);f.showErrors()}else{var h={};var i=(e.message=j||f.defaultMessage(c,"remote"));h[c.name]=a.isFunction(i)?i(g):i;f.showErrors(h)}e.valid=l;f.stopRequest(c,l)}},d));return"pending"}else{if(this.pending[c.name]){return"pending"}}return e.valid},minlength:function(d,b,c){return this.optional(b)||this.getLength(a.trim(d),b)>=c},maxlength:function(d,b,c){return this.optional(b)||this.getLength(a.trim(d),b)<=c},rangelength:function(e,b,d){var c=this.getLength(a.trim(e),b);return this.optional(b)||(c>=d[0]&&c<=d[1])},min:function(d,b,c){return this.optional(b)||d>=c},max:function(d,b,c){return this.optional(b)||d<=c},range:function(d,b,c){return this.optional(b)||(d>=c[0]&&d<=c[1])},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(c)},url:function(c,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c))},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},creditcard:function(h,d){if(this.optional(d)){return"dependency-mismatch"}if(/[^0-9-]+/.test(h)){return false}var f=0,g=0,b=false;h=h.replace(/\D/g,"");for(var e=h.length-1;e>=0;e--){var c=h.charAt(e);var g=parseInt(c,10);if(b){if((g*=2)>9){g-=9}}f+=g;b=!b}return(f%10)==0},accept:function(d,b,c){c=typeof c=="string"?c.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||d.match(new RegExp(".("+c+")$","i"))},equalTo:function(e,b,c){var d=a(c).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(b).valid()});return e==d.val()}}});a.format=a.validator.format})(jQuery);(function(a){var b=a.ajax;var c={};a.ajax=function(e){e=a.extend(e,a.extend({},a.ajaxSettings,e));var d=e.port;if(e.mode=="abort"){if(c[d]){c[d].abort()}return(c[d]=b.apply(this,arguments))}return b.apply(this,arguments)}})(jQuery);(function(a){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(d,b){a.event.special[b]={setup:function(){this.addEventListener(d,c,true)},teardown:function(){this.removeEventListener(d,c,true)},handler:function(f){arguments[0]=a.event.fix(f);arguments[0].type=b;return a.event.handle.apply(this,arguments)}};function c(f){f=a.event.fix(f);f.type=b;return a.event.handle.call(this,f)}})}a.extend(a.fn,{validateDelegate:function(b,d,c){return this.bind(d,function(e){var f=a(e.target);if(f.is(b)){return c.apply(f,arguments)}})}})})(jQuery);function str_repeat(a,b){for(var c=[];b>0;c[--b]=a){}return(c.join(""))}function sprintf(){var g=0,b,e=arguments[g++],j=[],h,k,d,l;while(e){if(h=/^[^\x25]+/.exec(e)){j.push(h[0])}else{if(h=/^\x25{2}/.exec(e)){j.push("%")}else{if(h=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(e)){if(((b=arguments[h[1]||g++])==null)||(b==undefined)){throw ("Too few arguments.")}if(/[^s]/.test(h[7])&&(typeof(b)!="number")){throw ("Expecting number but found "+typeof(b))}switch(h[7]){case"b":b=b.toString(2);break;case"c":b=String.fromCharCode(b);break;case"d":b=parseInt(b);break;case"e":b=h[6]?b.toExponential(h[6]):b.toExponential();break;case"f":b=h[6]?parseFloat(b).toFixed(h[6]):parseFloat(b);break;case"o":b=b.toString(8);break;case"s":b=((b=String(b))&&h[6]?b.substring(0,h[6]):b);break;case"u":b=Math.abs(b);break;case"x":b=b.toString(16);break;case"X":b=b.toString(16).toUpperCase();break}b=(/[def]/.test(h[7])&&h[2]&&b>0?"+"+b:b);d=h[3]?h[3]=="0"?"0":h[3].charAt(1):" ";l=h[5]-String(b).length;k=h[5]?str_repeat(d,l):"";j.push(h[4]?b+k:k+b)}else{throw ("Huh ?!")}}}e=e.substring(h[0].length)}return j.join("")};(function($){$.toJSON=function(o){if(typeof(JSON)=="object"&&JSON.stringify){return JSON.stringify(o)}var type=typeof(o);if(o===null){return"null"}if(type=="undefined"){return undefined}if(type=="number"||type=="boolean"){return o+""}if(type=="string"){return $.quoteString(o)}if(type=="object"){if(typeof o.toJSON=="function"){return $.toJSON(o.toJSON())}if(o.constructor===Date){var month=o.getUTCMonth()+1;if(month<10){month="0"+month}var day=o.getUTCDate();if(day<10){day="0"+day}var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10){hours="0"+hours}var minutes=o.getUTCMinutes();if(minutes<10){minutes="0"+minutes}var seconds=o.getUTCSeconds();if(seconds<10){seconds="0"+seconds}var milli=o.getUTCMilliseconds();if(milli<100){milli="0"+milli}if(milli<10){milli="0"+milli}return'"'+year+"-"+month+"-"+day+"T"+hours+":"+minutes+":"+seconds+"."+milli+'Z"'}if(o.constructor===Array){var ret=[];for(var i=0;i').css({position:"absolute",left:c.left+"px",top:c.top+"px",width:c.width+"px",height:c.height+"px"}).appendTo(document.body).hide();this.ajaxLoader.fadeIn(0)})};jQuery.fn.ajaxLoaderRemove=function(){return this.each(function(){if(this.ajaxLoader){this.ajaxLoader.fadeOut(0)}})};(function(a,e){a.jCacher=new function(){var h=this;var f=a(this);h.version="1.1.0";h.count=0;var i;var k;var j;var q=new d(false);var g=function(s,t){return new Date(s.getTime()+t)};var n=function(t,v){var s=q.getCacheItem(t);if(t!==null&&t!==e&&s!==null){h.count--;var u=q.getDependencyMappings(t);q.removeCacheItem(t);l(s,v);m(u)}return s!==e};var m=function(t){for(var s=0;s0){i=setTimeout(r,t)}else{r()}}};var l=function(s,t){f.trigger("itemremoved",[s,t])};h.itemremoved=function(s){f.bind("itemremoved",s)};h.add=function(w,B,A,s,t,y){if(B!==e){if(q.getCacheKeys().indexOf(w)==-1){h.count++}else{var x=q.getDependencyMappings(w);m(x)}var u;if(A||s){if(A){u=g(new Date(),(A*1000))}else{if(s){u=s}}}var z=false;if(t){if(!q.registerDependencies(w,t)){z=true}}var v=new b(w,B,u,A);q.addCacheItem(v);if(!z){if(u&&(j===e||u0){return n(s,"removed");if(k==s){o()}}};h.clear=function(){if(h.count>0){h.count=0;q.clear();if(i!==null){clearTimeout(i);i=null}}};if(q.getCacheItems().length>0){o()}};function b(g,i,f,h){this.key=g;this.value=i;this.expires=f;this.slidingExpiration=h}function c(f,g){this.key=f;this.mappings=g}function d(i){var g=[];var h=[];var f=[];(function(){if(i&&window.localStorage){if(!window.localStorage.jCacher){window.localStorage.jCacher=jQuery.toJSON({items:[],dependencyMappings:[]})}else{var j=jQuery.parseJSON(window.localStorage.jCacher);for(var k=0;k-1?g[j]:null};this.getCacheItems=function(){return g};this.removeCacheItem=function(l){var k=h.indexOf(l);if(i&&window.localStorage){var j=jQuery.parseJSON(window.localStorage.jCacher);j.dependencyMappings.splice(k,1);j.items.splice(k,1);window.localStorage.jCacher=jQuery.toJSON(j)}g.splice(k,1);h.splice(k,1);f.splice(k,1)};this.addCacheItem=function(n){var k=h.indexOf(n.key);if(k==-1){var m=new c(n.key,[]);g.push(n);h.push(n.key);f.push(m);if(i&&window.localStorage){var j=jQuery.parseJSON(window.localStorage.jCacher);var l=(function(){var o=new Object();o.expires=n.expires.getTime();o.key=n.key;o.value=n.value;o.slidingExpiration=n.slidingExpiration;return o})();j.items.push(l);j.dependencyMappings.push(m);window.localStorage.jCacher=jQuery.toJSON(j)}}else{g[k]=n;if(i&&window.localStorage){var j=jQuery.parseJSON(window.localStorage.jCacher);j.items[k]=n;window.localStorage.jCacher=jQuery.toJSON(j)}}};this.getCacheKeys=function(){return h};this.registerDependencies=function(m,k){for(var l=0;l-1?f[j].mappings:null};this.clear=function(){if(window.localStorage){window.localStorage.removeItem("jCacher")}g=[];f=[];h=[]}}if(!Array.indexOf){Array.prototype.indexOf=function(g){for(var f=0;f0){for(var aN=0;aN");sizingImageJQuery.attr("src",aJ);n.append(sizingImageJQuery);aI.width=sizingImageJQuery.width();aI.height=sizingImageJQuery.height();sizingImageJQuery.remove();return aI}function af(aK){var aJ=null;var aI=aK.css("background-image");aI=aI.replace("url(","","gi");aI=aI.replace('"',"","gi");aI=aI.replace('"',"","gi");aI=aI.replace(")","","gi");if(aI!="none"){aJ=ao(aI)}return aJ}function ae(){u=af(v);O=af(P)}function aB(aL){if(j.comboboxValueContentContainerClass){if(O!=null){var aJ=P.height();var aK=(aL*aJ);if(O.height>aK){var aI=String.format("0px -{0}px",aK);P.css("background-position",aI)}}}}function ax(aK){if(j.comboboxDropDownButtonClass){if(u!=null){var aM=v.width();var aJ=(aK*aM);if(u.width>aJ){var aI=String.format("-{0}px 0px",aJ);v.css("background-position",aI)}}}else{var aL=s;if(aK==1){aL=q}V(v,aL)}}function aw(aI){aB(aI);ax(aI)}function ad(){var aJ="";if(j.comboboxValueContentContainerClass){aJ=String.format("
",j.comboboxValueContentContainerClass,N)}else{aJ=String.format("
",N)}var aK="";if(j.comboboxValueContentClass){aK=String.format("
",j.comboboxValueContentClass,R)}else{aK=String.format("
",R+Q)}var aI="";if(j.comboboxDropDownButtonClass){aI=String.format("
",t,j.comboboxDropDownButtonClass)}else{aI=String.format("
{1}
",(t+r),p)}S=jQuery(aK);v=jQuery(aI);P=jQuery(aJ);P.appendTo(n);S.appendTo(P);v.appendTo(P);ae();T=ap(S.css("max-height"));aw(0)}function ab(aJ){var aL="";var aK=null;var aO="";var aP="";var aR=null;var aN="";var aQ="option";var aI=aJ[0];if(aI.title){if(aI.title!=""){aP=aI.title}}if(aJ.is("option")){if(aI.dataText){aO=aI.dataText}else{aO=aJ.text()}aR=aJ.val();if(j.comboboxDropDownItemClass){aK=j.comboboxDropDownItemClass;aN=E}else{aN=(E+D)}if(aK){aL=String.format("
  • {2}
  • ",aN,aK,aO)}else{aL=String.format("
  • {1}
  • ",aN,aO)}}else{if(aJ[0].dataText){aO=aJ[0].dataText}else{aO=aJ.attr("label")}aR=aJ.attr("class");aQ="optgroup";if(j.comboboxDropDownGroupItemHeaderClass){aK=j.comboboxDropDownGroupItemHeaderClass;aN=B}else{aN=(B+A)}if(aK){aL=String.format("
  • {2}
  • ",aN,aK,aO)}else{aL=String.format("
  • {1}
  • ",aN,aO)}}var aM=jQuery(aL);aM.css("display","inline");aM[0].dataText=aO;aM[0].dataValue=aR;aM[0].dataType=aQ;if(aP==""){aP=aO}aM[0].title=aP;return aM}function at(aJ,aI){aI.each(function(){var aL=jQuery(this);var aK=ab(aL);aJ.append(aK);var aO=aK.offset().left;aO-=H.left;if(aO<0){aO=0}var aP=(aO+aK.outerWidth());if(aP>L){L=aP}V(aK,E);if(aL.is("optgroup")){var aM="";if(j.comboboxDropDownGroupItemContainerClass){aM=String.format("
      ",z,j.comboboxDropDownGroupItemContainerClass)}else{aM=String.format("
        ",(z+y))}var aN=jQuery(aM);aK.append(aN);at(aN,aL.children())}})}function ac(){var aL=M.children();J=null;K=null;if(F){F.empty()}else{var aI="";if(j.comboboxDropDownClass){aI=String.format("
          ",j.comboboxDropDownClass,x)}else{aI=String.format("
            ",(x+w))}F=jQuery(aI);F.appendTo(n);F.attr("tabIndex",0)}if(aL.length>0){L=0;H=F.offset();at(F,aL)}var aK=ap(F.css("max-height"));if(aK){G=aK}var aJ=F.height();if(aJ>G){F.height(G)}C=F.height()}function aH(){var aI=n.outerWidth();if(aI0){var aK=jQuery("li[dataValue='"+M.val()+"']",F);S.html(aK[0].dataText);S.attr("title",aK[0].title);ar();if(K!=null){if(K!=M.val()){aL=true}}K=M.val();if(aL){if(a.combobox.onChange){a.combobox.onChange()}}if(J){aG(J,false)}J=aK;aG(J,true)}}function aG(aI,aJ){if(aI){if(j.comboboxDropDownItemHoverClass){if(aJ){aI.addClass(j.comboboxDropDownItemHoverClass)}else{aI.removeClass(j.comboboxDropDownItemHoverClass)}}else{if(aJ){aI.css("background","#000");aI.css("color","#fff")}else{aI.css("background","");aI.css("color","")}}}}function aa(){var aI="";if(j.comboboxContainerClass){aI=String.format("
            ",j.comboboxContainerClass,m)}else{aI=String.format("
            ",l,m)}n=jQuery(aI);M.before(n);n.append(M);M.hide();n.attr("tabIndex",0)}this.initialise=function(){aa();ad();ac();U();Y();av()};function aE(aI){F.animate({height:"toggle",top:aI},h.animationSpeed)}function aC(aI){F.animate({height:"toggle",opacity:"toggle",top:aI},h.animationSpeed)}function aD(aI){F.animate({height:"toggle",opacity:"toggle"},h.animationSpeed,aI)}function an(){var aK=n.position().top;var aL=F.outerHeight();var aJ=(aK+n.outerHeight());var aO=jQuery(window).scrollTop();var aN=jQuery(window).height();var aI=(aN-(aJ-aO));var aM;aM=aJ;o=false;if(aIaL){aM=(aK-aL);o=true}}return aM}function aF(aL){if(aL){if(F.is(":hidden")){aG(I,false);aG(J,true);aw(1);var aK=an();F.css("top",aK);F.css("left",n.offset().left);switch(h.animationType){case"slide":if(o){var aI=n.position().top;var aJ=n.outerHeight();F.css("top",(aI-aJ));aE(aK)}else{aD()}break;case"fade":F.fadeIn(h.animationSpeed);break;default:F.show(1)}}}else{if(F.is(":visible")){aw(0);switch(h.animationType){case"slide":if(o){aI=n.position().top;dropdownListHeight=F.height();aC(aI-n.outerHeight())}else{aD()}break;case"fade":F.fadeOut(h.animationSpeed);break;default:F.hide()}}}}function aA(aJ,aK){var aI=M[0];if(aK==null){aI.selectedIndex=aJ}else{aI.value=aK;if(aI.selectedIndex<0){aI.selectedIndex=0}}av()}function au(aM){var aL=M[0];var aI=aL.selectedIndex;var aJ=-1;var aK=aL.length-1;switch(aM){case":next":aJ=aI+1;if(aJ>aK){aJ=aK}break;case":previous":aJ=aI-1;if(aJ<0){aJ=0}break;case":first":aJ=0;break;case":last":aJ=aK;break}aA(aJ,null)}function aq(){return F.is(":visible")}function Z(){jQuery("li",F).not("ul").not("span").not("[dataType='optgroup']").each(function(){var aI=jQuery(this);aI.click(function(aJ){aJ.stopPropagation();ai(aI)});aI.mouseover(function(){ak(aI)});aI.mouseout(function(){aj(aI)})})}function X(){$(document).click(function(aK){var aJ=$(aK.target);var aI=aJ.parents().filter(function(){return this===n[0]});if(aI.length){aK.stopPropagation()}else{al()}})}function W(){n.click(function(){ag()})}function Y(){n.keydown(function(aI){aI.preventDefault();ah(aI)});W();X();Z()}function ag(){if(F.is(":hidden")){aF(true)}else{aF(false)}}function al(){if(F.is(":visible")){aF(false)}}function ai(aI){aA(null,aI[0].dataValue);aF(false)}function ak(aI){aG(J,false);aG(I,false);aG(aI,true)}function aj(aI){I=aI}function ah(aI){switch(aI.which){case 33:case 36:au(":first");break;case 34:case 35:au(":last");break;case 37:au(":previous");break;case 38:if(aI.altKey){aF(!(aq()))}else{au(":previous")}break;case 39:au(":next");break;case 40:if(aI.altKey){aF(!(aq()))}else{au(":next")}break;case 27:case 13:aF(false);break;case 9:F.blur();jQuery(window)[0].focus();break}}this.updateSelection=function(){av()};this.update=function(){ac();aH();Z();av()};this.remove=function(){n.before(M);n.remove();M[0].internalCombobox=null;M.show()};this.addRange=function(aI){if(aI){var aM=M[0].options;var aL=aM.length;for(optionIndex in aI){var aJ=aI[optionIndex];var aK=document.createElement("option");aK.value=aJ.value;aK.text=aJ.text;aK.dataText=aJ.text;if(aJ.title){aK.title=aJ.title}aM[aL+optionIndex]=aK}M.combobox.update()}}}})};var bedrock={};bedrock._construct=function(){};bedrock._construct();bedrock.collections={};bedrock.collections._construct=function(){function a(){this.items=new Array()}a.prototype={add:function(b){this.items[this.items.length]=b},addRange:function(d){if(d){var b=d.items?d.items:d;for(var c=0;c-1&&b<=this.items.length){this.items.splice(b,0,c)}},remove:function(e){if(e){var c=new Array();var d=this.items;for(var b=0;b-1&&b1){this.each(function(){a(this).toDate(e)});return this}var b=a(this);var f=a.extend({},a.fn.toDate.defaults,e);b.intialize=function(){g();return this};function g(){var h=c(b.html());if(h){var i=d(h);b.html(i)}}function c(j){var i=/-?\d+/;var h=i.exec(j);return h===null?null:new Date(parseInt(h[0]))}function d(h){return(h.getMonth()+"/"+h.getDate()+"/"+h.getFullYear()+" "+h.getUTCHours()+":"+h.getUTCMinutes()).toString()}return b.intialize()};a.fn.toDate.defaults={};a.fn.tabs=function(f){if(this.length>1){this.each(function(){a(this).tabs(f)});return this}var b=a(this);var g=a.extend({},a.fn.tabs.defaults,f);var i=a(g.views).children("div");var h=null;var c;b.intialize=function(j){h=b.children("li");if(h&&h.length>0){h.each(function(k){var l=a(this);if(!l.hasClass("notab")){l.click(function(){e(l,k)})}});b.activateTab(g.startTab,j,true)}return this};b.activateTab=function(l,j,k){if(l!=c||j){c=l;h.removeClass(g.activeClass);if(i){i.hide();a(i[l]).show()}a(h[l]).addClass(g.activeClass);d(h[l],l,k)}};b.rebind=function(){b.intialize(true)};b.get_tabIndex=function(){return c};function d(l,j,k){if(g.activeTabChanged!==null){g.activeTabChanged(l,j,k)}}function e(k,j){if(g.tabClicked!==null){g.tabClicked(k,j)}b.activateTab(j)}return b.intialize()};a.fn.tabs.defaults={activeTabChanged:null,tabClicked:null,views:null,startTab:0,activeClass:"active"};a.fn.makeAbsolute=function(b){return this.each(function(){var c=a(this);var d=c.position();c.css({position:"absolute",marginLeft:0,marginTop:0,top:d.top,left:d.left});if(b){c.remove().appendTo("body")}})}})(jQuery);String.prototype.endsWith=function(a){return this.indexOf(a,this.length-a.length)!==-1};var mds={};mds._construct=function(){var e=this;var a=jQuery(this);var b=jQuery("
            ");var c=null;var d=null;e.defaultRowCount=100;e.bind=function(g,f,h){a.bind(g,f,h);return e};e.raiseEvent=function(h,g,f){a.trigger(h,[g,f])};e.bindNumericalBox=function(f){f.keyup(function(){if(isNaN(f.val().replace(",",".").replace(" ",""))){f.val("")}else{}})};e.translate=function(f){var g="";switch(f.toLowerCase()){case"pole":return"Aluminum";case"aluminum":return"Aluminum";case"cast iron":return"Cast Iron";case"dust ignition proof motors":return"Dust Ignition Proof Motors";case"+002 restamping voltage, frequency and output, continuous duty. Variant code not needed if MEPS vc is used":g="Translate(002_Restamping_voltage_frequency_and_output_continuous_duty)";break;case"+209 non-standard voltage or frequency, (special winding). Variant code not needed if MEPS vc is used":g="Translate(209_Non-standard_voltage_or_frequency_special_winding)";break;case"+519 Motor fulfilling European directive and regulations":g="+519 Motor fulfilling European directive and regulations";break;case"flameproof motors":return"Flameproof Motors";case"general performance motors":return"General Performance Motors";case"increased safety motors":return"Increased Safety Motors";case"increased safety ex ec zone 2 motors":return"Increased Safety Ex ec Zone 2 Motors";case"process performance motors":return"Process Performance Motors";case"comparison summary":g="Comparison summary";break;default:break}if(g.length>0){if(g.indexOf("Translate(")>-1){return f}else{return g}}if(f.endsWith("pole")){f=f.replace("pole","pole")}return f};e.formatNumber=function(f){f+="";x=f.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var g=/(\d+)(\d{3})/;while(g.test(x1)){x1=x1.replace(g,"$1 $2")}return x1+x2};e.getPropertyIfExists=function(g,f){if(f&&f[g]){return f[g]}return""};e.roundNumber=function(g,f){return Math.round(g*Math.pow(10,f))/Math.pow(10,f)};e.getDialogContainer=function(){return b.clone()};e.ajaxPostForm=function(h,g,f){$.ajax({type:"post",url:h,data:"data="+g,success:f,error:f})};e.postForm=function(f,g,i){var h=$("
            ").attr("method","post").attr("action",f).attr("target","PostWindow").appendTo("body").submit(function(){if(i){window.open("","PostWindow","status=0,toolbar=0")}else{var j=$("").attr("name","PostWindow").css({width:"0px",height:"0px",border:"0px"}).appendTo("body")}});$("").attr("type","hidden").attr("name","data").val(g).appendTo(h);h.trigger("submit")};e.error=function(g){var h=function(){d=setTimeout(function(){d=null;c.fadeOut(5000)},5000)};if(c===null){c=$("
            ").addClass("error-dialog").appendTo("body").hide().mouseover(function(){var i=$(this);i.stop().animate({opacity:1},1)}).mouseout(function(){h()})}if(d!==null){clearTimeout(d)}else{c.html("").fadeIn(1000)}var f=$("
            ").append(g).hide().appendTo(c).fadeIn(500);h()};e.dataFactory=new function(){var h=this;var f=jQuery(this);var g=function(i){i=i?i:[]};h.bind=function(j,i,k){f.bind(j,i,k);return h};h.getGroupName=function(i){return i};h.getDocumentTypeName=function(i){var j="";if(i==0){j="Unknown"}else{if(i==1){j="Brochure"}else{if(i==2){j="Catalogue"}else{if(i==3){j="Certificate"}else{if(i==4){j="Declaration of conformity"}else{if(i==5){j="Leaflet"}else{if(i==6){j="Manual"}else{if(i==7){j="Software"}else{if(i==8){j="Spare parts list"}else{if(i==9){j="Standard"}else{if(i==10){j="Cad outline drawing"}else{if(i==11){j="Drawing"}else{if(i==12){j="Test Report"}else{if(i==13){j="Connection Diagram"}}}}}}}}}}}}}}return j};h.metadata={getSearchViewState:function(i,j){g(j);if(window.localStorage!==undefined){var k=$.parseJSON(localStorage.SelectionData);var l=new mds.SelectionData();l.Meps=mds.getPropertyIfExists("Meps",k);l.IEClass=mds.getPropertyIfExists("IEClass",k);l.FrameMaterial=mds.getPropertyIfExists("FrameMaterial",k);l.MotorRange=mds.getPropertyIfExists("MotorRange",k);l.HideOutsideMeps=mds.getPropertyIfExists("HideOutsideMeps",k);l.ProductClass=mds.getPropertyIfExists("ProductClass",k);l.Voltage=mds.getPropertyIfExists("Voltage",k);l.Frequency=mds.getPropertyIfExists("Frequency",k);l.Poles=mds.getPropertyIfExists("Poles",k);l.Output=mds.getPropertyIfExists("Output",k);l.FreeTextSearch=mds.getPropertyIfExists("FreeTextSearch",k);i({SelectionData:l})}else{e.request("/Services/MetadataService.asmx/GetSearchViewState",null,function(m){if(i){i(m)}},function(m){e.error("Error fetching search view-state.");if(i){i(null,m)}})}},saveSearchViewState:function(k,i,j){g(j);if(window.localStorage!==undefined){if(k===null){localStorage.removeItem("SelectionData")}else{localStorage.SelectionData=$.toJSON(k)}if(i){i()}}else{e.request("/Services/MetadataService.asmx/SaveSearchViewState",{jsonedSelectionData:$.toJSON(k)},function(l){if(i){i()}},function(l){e.error("Error saving search view-state.");if(i){i(l)}})}},changeUICulture:function(k,i,j){g(j);e.request("/Services/MetadataService.asmx/ChangeUICulture",{culture:k},function(l){if(i){i()}},function(l){e.error("Error changing UI culture.");if(i){i(l)}})},getUICulture:function(i,j){g(j);e.request("/Services/MetadataService.asmx/GetUICulture",null,function(l){var k=l;if(i){i(k)}},function(k){e.error("Error getting UI culture.");if(i){i(k)}})},getAvailableCurrencies:function(j,k){g(k);var i="currencies";var l=$.jCacher.get(i);if(l){if(j){j(l.value)}}else{e.request("/Services/MetadataService.asmx/GetAvailableCurrencies",null,function(m){l=m;$.jCacher.add(i,l,60,null,null,null);if(j){j(l)}},function(m){e.error("Error fetching available currencies.");if(j){j(null,m)}})}},getStandardSelections:function(m,j,k){g(k);var i="getStandardSelections:"+$.toJSON(m);var l=$.jCacher.get(i);if(l){if(j){j(l.value)}}else{e.request("/Services/MetadataService.asmx/GetStandardSelections",{jsonedSelectionData:$.toJSON(m)},function(n){l=n;$.jCacher.add(i,l,60,null,null,null);if(j){j(l)}},function(n){e.error("Error fetching selections.");if(j){j(null,n)}})}}};h.motor={getMotors:function(o,k,l,m,i,j){g(j);var n;e.request("/Services/MotorService.asmx/GetMotors",{jsonedSelectionData:$.toJSON(o),rowCount:mds.defaultRowCount,sortColumn:k,sortOrder:l,page:m},function(p){n=p;if(i){i(n)}},function(p){e.error("Error fetching standard motors.");if(i){i(null,p)}})},getCorrespondingMotor:function(m,j,k){g(k);var i="correspondingMotor:"+m.id;var l=$.jCacher.get(i);if(l&&l.value){if(j){j(l.value)}}else{e.request("/Services/MotorService.asmx/GetCorrespondingMotor",{motorId:m.id,output:m.output},function(n){l=n;$.jCacher.add(i,l,60,null,null,null);if(j){j(l)}},function(n){e.error("Error getting motor '"+m.id+"'.");if(j){j(null,n)}})}},getMotor:function(m,n,j,k){g(k);var i="motor:"+m;var l=$.jCacher.get(i);if(l){if(j){j(l.value)}}else{e.request("/Services/MotorService.asmx/GetMotor",{motorId:m,output:n},function(o){l=o;$.jCacher.add(i,l,60,null,null,null);if(j){j(l)}},function(o){e.error("Error getting motor '"+m+"'.");if(j){j(null,o)}})}},getMotorData:function(m,n,l,p,j,k,q){g(k);var i="motorData:"+m+";meps:"+n+";InMepsAccToRules:"+l+";SelectedMeps:"+p;var o=$.jCacher.get(i);if(o){if(j){j(o.value)}}else{e.request("/Services/MotorService.asmx/GetMotorData",{internalID:m,meps:n,InMepsAccToRules:l,jsonedSelectionData:$.toJSON(q)},function(r){o=r;$.jCacher.add(i,o,60,null,null,null);if(j){j(o)}},function(r){e.error("Error getting motor data '"+m+"'.");if(j){j(null,r)}})}},getDocumentsByGroup:function(l,j,k){g(k);l=l==null?"":l;var i="documentsForMotors:"+l;var n=$.jCacher.get(i);if(n){if(j){j(n.value)}}else{var m=h.getGroupName(l);e.request("/Services/MotorService.asmx/GetDocumentsByGroup",{group:m},function(o){n=o;$.jCacher.add(i,n,60,null,null,null);if(j){j(n)}},function(o){e.error("Error fetching documents for standard motors.");if(j){j(null,o)}})}},getDocumentsByMotor:function(m,n,l,p,q,j,k){g(k);m=m==null?"":m;l=l==null?false:l;p=p==null?"":p;var i="documentsForMotors:"+m+";meps:"+n+";InMepsAccToRules:"+l+";SelectedMeps:"+p+";TypeProtection"+q;var o=$.jCacher.get(i);if(o){if(j){j(o.value)}}else{e.request("/Services/MotorService.asmx/GetDocumentsByMotor",{internalID:m,meps:n,InMepsAccToRules:l,SelectedMeps:p,TypeProtection:q},function(r){o=r;$.jCacher.add(i,o,60,null,null,null);if(j){j(o)}},function(r){e.error("Error fetching documents for standard motors.");if(j){j(null,r)}})}},getComparisonSheetByParams:function(r,q,p,s,o,w,v,u,y,t,B,A,l,D,n,C,m,j,z,i,k){g(k);e.request("/Services/MotorService.asmx/GetComparisonSheetByParams",{motor1Name:r,motor1Efficiency:q,motor1Effect:p,motor1Price:s,motor1ComplyWithStandard:o,motor2Name:w,motor2Efficiency:v,motor2Effect:u,motor2Price:y,motor2ComplyWithStandard:t,operatingHours:B,operatingDays:A,energyPrice:l,serviceLifeOfMotor:D,maintenanceCost:n,operatingProfile:C,greenhouseGases:m,co2PerKWh:j,numberOfMotors:z},function(E){if(i){i(E)}},function(E){e.error("Error fetching comparison sheet.");if(i){i(null,E)}})},getCharts:function(l,j,k){g(k);var i="charts:"+l;var m=$.jCacher.get(i);if(m){if(j){j(m.value)}}else{e.request("/Services/MotorService.asmx/GetCharts",{internalID:l},function(n){$.jCacher.add(i,n,60);if(j){j(n)}},function(n){e.error("Error getting charts.");if(j){j(null,n)}})}}};h.user={clearComparisonData:function(i,j){g(j);e.request("/Services/UserService.asmx/ClearComparisonData",null,function(){if(i){i()}},function(k){e.error("Error clearing comparison data.");if(i){i(null,k)}})},saveSelectionList:function(k,i,j){g(j);e.request("/Services/UserService.asmx/SaveSelectionList",{jsonedEntityList:$.toJSON(k.items)},function(l){if(i){i(l)}})},getSelectionList:function(i,j){g(j);e.request("/Services/UserService.asmx/GetSelectionList",null,function(k){if(i){i(k)}},function(k){e.error("Error fetching comparison data.");if(i){i(null,k)}})},saveDocumentSelectionList:function(k,i,j){g(j);e.request("/Services/UserService.asmx/SaveDocumentSelectionList",{jsonedEntityList:$.toJSON(k.items)},function(l){if(i){i(l)}})},getDocumentSelectionList:function(i,j){g(j);e.request("/Services/UserService.asmx/GetDocumentSelectionList",null,function(k){if(i){i(k)}},function(k){e.error("Error fetching comparison data.");if(i){i(null,k)}})},saveComparisonSelectionList:function(j,i,k){g(k);e.request("/Services/UserService.asmx/SaveComparisonSelectionList",{jsonedEntityList:$.toJSON(j.items)},function(l){if(i){i(l)}})},getComparisonSelectionList:function(i,j){g(j);e.request("/Services/UserService.asmx/GetComparisonSelectionList",null,function(k){if(i){i(k)}},function(k){e.error("Error fetching comparison data.");if(i){i(null,k)}})},saveComparisonData:function(n,o,m,l,p,k,t,u,s,r,v,q,w,i,j){g(j);n=n===null?"":n;o=o===null?"":o;m=m==""?0:m;l=l==""?0:l;p=p==""?0:p;t=t===null?"":t;u=u===null?"":u;s=s==""||s===null?0:s;r=r==""||r===null?0:r;v=v==""||v===null?0:v;w=w==""||w===null?0:w;e.request("/Services/UserService.asmx/SaveComparisonData",{motor1ID:n,motor1Name:o,motor1Efficiency:m,motor1Effect:l,motor1Price:p,motor1ComplyWithStandard:k,motor2ID:t,motor2Name:u,motor2Efficiency:s,motor2Effect:r,motor2Price:v,motor2ComplyWithStandard:q,numberOfMotors:w},function(y){if(i){i(y)}},function(y){e.error("Error saving comparison data.");if(i){i(null,y)}})},getComparisonData:function(i,j){g(j);e.request("/Services/UserService.asmx/GetComparisonData",null,function(k){if(i){i(k)}},function(k){e.error("Error fetching comparison data.");if(i){i(null,k)}})},saveComparisonSettings:function(m,n,s,r,q,t,p,o,k,j,l){g(l);var i="comparisonSettings";e.request("/Services/UserService.asmx/SaveComparisonSettings",{currency:m,energyPrice:n,operatingProfile:s,operatingHours:r,operatingDays:q,serviceLife:t,maintenanceCost:p,greenhouseGases:o,co2PerKWh:k},function(u){var v=u;$.jCacher.add(i,v,60);if(j){j()}},function(u){e.error("Error saving comparison settings.");if(j){j(u)}})},getComparisonSettings:function(j,k){g(k);var i="comparisonSettings";var l=$.jCacher.get("");if(l){if(j){j(l.value)}}else{e.request("/Services/UserService.asmx/GetComparisonSettings",null,function(m){l=m;$.jCacher.add(i,l,60);if(j){j(l)}},function(m){e.error("Error fetching comparison settings.");if(j){j(null,m)}})}}}};e.request=function(i,f,h,g){jQuery.ajax({type:"POST",url:i,contentType:"application/json; charset=utf-8",data:f?$.toJSON(f):"{}",dataType:"json",success:function(j){if(h){h(j!==null?j.d:null)}},error:function(j){if(g){g(j)}}})};e.selectedMotors=new bedrock.collections.list();e.Motor=function(h,o,g,l,k,i,f,j,n,m){this.id=h;this.name="";this.voltage=o;this.frequency=g;this.output=l;this.motorType=k;this.hideOutsideMeps="";this.ie=i;this.efficiency=f;this.motorRange=j;this.price=0;this.complyWithStandard=true;this.isCustom=false;this.frameMaterial="";this.meps="";this.TypeProtection=n;this.productCode=m;this.fillFromEntity=function(p){this.id=p.Id;this.name=p.Name;this.voltage=p.Voltage;this.frequency=p.Frequency;this.output=p.Output;this.motorType=p.MotorType;this.ie=p.IE;this.efficiency=p.Efficiency;this.motorRange=p.MotorRange;this.hideOutsideMeps=p.HideOutsideMeps;this.price=p.Price;this.complyWithStandard=true;this.isCustom=false;this.frameMaterial=p.FrameMaterial;this.meps=p.Meps;this.TypeProtection=p.TypeProtection;this.DolOrVsd=p.DolOrVsd;this.S100_T100=p.S100_T100;this.RtdSpeed=p.RtdSpeed}};e.SelectionData=function(){this.Meps=null;this.IEClass=null;this.FrameMaterial=null;this.MotorRange=null;this.HideOutsideMeps=null;this.ProductClass=null;this.Voltage=null;this.Frequency=null;this.Poles=null;this.Output=null;this.FreeTextSearch=null};e.ComparisonSettings=function(){this.operatingHours=null;this.operatingDays=null;this.operatingProfile=null;this.energyPrice=null;this.currency=null;this.serviceLife=null;this.maintenanceCost=null;this.operatingProfile=null;this.greenhouseGases=null;this.co2PerKWh=null;this.clone=function(){var f=new e.ComparisonSettings();f.operatingHours=this.operatingHours;f.operatingDays=this.operatingDays;f.operatingProfile=this.operatingProfile;f.energyPrice=this.energyPrice;f.currency=this.currency;f.serviceLife=this.serviceLife;f.maintenanceCost=this.maintenanceCost;f.operatingProfile=this.operatingProfile;f.greenhouseGases=this.greenhouseGases;f.co2PerKWh=this.co2PerKWh;return f};this.fillFromEntity=function(f){this.operatingHours=f.OperatingHours;this.operatingDays=f.OperatingDays;this.operatingProfile=f.OperatingProfile;this.energyPrice=f.EnergyPrice;this.currency=f.Currency;this.serviceLife=f.ServiceLife;this.maintenanceCost=f.MaintenanceCost;this.operatingProfile=f.OperatingProfile;this.greenhouseGases=f.GreenhouseGases;this.co2PerKWh=f.Co2PerKWh}};e.ComparisonData=function(){this.motor1=new e.Motor();this.motor2=new e.Motor();this.settings=new e.ComparisonSettings();this.numberOfMotors=1};e.documentListGroup=function(f){this.typeId=f;this.typeName=mds.dataFactory.getDocumentTypeName(f);this.documents=[]};e.selectedComparisons=new bedrock.collections.list();e.selectedDocuments=new bedrock.collections.list();e.Document=function(g,l,k,m,i,f,h,j){this.id=g;this.type=l;this.title=k;this.url=m;this.mountingArrangements=i;this.accessories=f;this.mainterminalboxsize=h;this.terminalBoxLocations=j};e.isLowMsieBrowser=function(){var f=navigator.userAgent.match(/iPad/i)!=null;var g=navigator.userAgent.match(/iPhone/i)!=null;return(f||g||$.browser.msie&&($.browser.version=="7.0"||$.browser.version=="6.0"))};e.isAppleDevice=function(){var f=navigator.userAgent.match(/iPad/i)!=null;var g=navigator.userAgent.match(/iPhone/i)!=null;return f||g};e.documentView=null;e.exportView=null};mds._construct();$(function(){$(".infoContents").tooltip();$(".questionContents").tooltip();$(".clearDataContents").tooltip();$(".clearDataContents .bbOK").click(function(d){d.preventDefault();$(".trashContent .bbOK").each(function(){$(this).trigger("click")})});$(".selectLanguageContents").tooltip();var a=250;if(mds.isAppleDevice()){$("#export > .footer #completeExport").hide();a=0}$(".acc-functionality").lvaccordion({activatorSelector:".acc-selector",contentSelector:".acc-content",duration:a});var b=!mds.isLowMsieBrowser();if(b&&!mds.isAppleDevice()){$(".meps select").selectbox({zIndex:1000});$(".types select").selectbox({zIndex:1000});$(".frame select").selectbox({zIndex:1000});$(".motorRange select").selectbox({zIndex:1000});$(".hideOutsideMeps select").selectbox({zIndex:1000});$(".productClass select").selectbox({zIndex:1000});$(".frameMaterial select").selectbox({zIndex:1000});$(".voltage select").selectbox({zIndex:999});$(".frequency select").selectbox({zIndex:999});$(".poles select").selectbox({zIndex:999});$(".output select").selectbox({zIndex:999});$(".currency select").selectbox({zIndex:1000})}var c=view2=view4=null;$(".select-language a").click(function(f){f.preventDefault();var d=$(this).attr("href").replace("#","");if(d.length>0){mds.dataFactory.metadata.changeUICulture(d,function(e){if(!e){location.reload(true)}})}return false});if(CURRENTVIEW=="Overview"){}else{mds.selectionView=$("#mSelection").selectionView();mds.comparisonView=$("#mCostOfOwnership").comparisonView();mds.documentView=$("#mDocuments").documentView();mds.exportView=$("#mExport").exportView()}window.scrollTo(0,1)});var addExtraMotorParameters;(function(a){a.fn.selectionView=function(z){if(this.length>1){this.each(function(){a(this).selectionView(z)});return this}var b=a(this);var A=a.extend({},a.fn.selectionView.defaults,z);var Q=new mds.SelectionData();var g;var O=false;var u=false;var d=a(".selection .compare").hide();var l=a(".selection .efficiency-savings");var L=a("#mSelection .reset");var w=a("#motorBank").slidecontainer();var e=new bedrock.collections.list();var P=a("#mSelection .selection > div.search-result div.motors .body table");var q=a("#mSelection .selection > div.search-result div.motors .header table");var h="output";var i="ASC";a(".eisaInformation").tooltip();a(".csaInformation").tooltip();a(".trmInformation").tooltip();a(".auInformation").tooltip();a(".euInformation").tooltip();var k=function(Z,Y){mds.raiseEvent("dialogopen");var X=mds.getDialogContainer().prependTo("body").addClass("data-dialog-container").addClass("dialog-container");X.load("/units/data-dialog.html",Z,function(){X.datadialog({onClose:function(){X.remove();mds.raiseEvent("dialogclose")}}).loadMotor(Z,Y);var aa=X.find(".data-dialog");var ab=a("html").scrollTop();if(ab){aa.css({top:parseFloat(ab)+10})}})};var j=function(){if(e.items.length==2){mds.raiseEvent("dialogopen");var X=mds.getDialogContainer().prependTo("body").addClass("compare-dialog-container").addClass("dialog-container");X.load("/units/compare-dialog.html",null,function(){X.comparedialog({onClose:function(){X.fadeOut(500,function(){X.remove();mds.raiseEvent("dialogclose")})}}).loadMotors(e.items[0].id,e.items[1].id)})}};var N=function(X){mds.dataFactory.metadata.saveSearchViewState(Q,function(){if(X){X()}})};var T=a("#mSelection .trashContent").tooltip();a(".bbOK",T).click(function(X){X.preventDefault();mds.selectedMotors=new bedrock.collections.list();w.clearList();V(function(){mds.dataFactory.user.saveSelectionList(mds.selectedMotors)});a("#mSelection .addButton.inactive").removeClass("inactive")});var R=a("#body input[name=textSearch]").keyup(function(){Q.FreeTextSearch=R.val();H(1,function(){if(Q.FreeTextSearch.length>0){P.show()}})});var v=a("#body div.meps select").change(function(){c(true);Q.Meps=v.val();if(Q.Meps!==""){W.trigger("enable").removeAttr("disabled");n.trigger("enable").removeAttr("disabled");B.trigger("enable").removeAttr("disabled");D.trigger("enable").removeAttr("disabled");U.trigger("enable").removeAttr("disabled");m.trigger("enable").removeAttr("disabled");y.trigger("enable").removeAttr("disabled");r.trigger("enable").removeAttr("disabled");J.trigger("enable").removeAttr("disabled");R.trigger("enable").removeAttr("disabled")}if(Q.Meps.toLowerCase().indexOf("eisa")>=0){a("a.eisaClick").trigger("click")}if(Q.Meps.toLowerCase().indexOf("csa eev")>=0){a("a.csaClick").trigger("click")}if(Q.Meps.toLowerCase().indexOf("tr - meps")>=0){a("a.trmClick").trigger("click")}if(Q.Meps.toLowerCase().indexOf("australia")>=0){a("a.auClick").trigger("click")}if(Q.Meps.toLowerCase().indexOf("eu - meps")>=0){a("a.euClick").trigger("click")}C(function(){if(Q.Meps!==""){P.show()}})});var W=a("#body div.voltage select").change(function(){Q.Voltage=W.val();C()});var n=a("#body div.frequency select").change(function(){Q.Frequency=n.val();C()});var B=a("#body div.output select").change(function(){Q.Output=B.val();C()});var D=a("#body div.poles select").change(function(){Q.Poles=D.val();C()});var U=a("#body div.types select").change(function(){Q.IEClass=U.val();C()});var m=a("#body div.frameMaterial select").change(function(){Q.FrameMaterial=m.val();C()});var y=a("#body div.motorRange select").change(function(){Q.MotorRange=y.val();C()});var r=a("#body div.hideOutsideMeps select").change(function(){Q.HideOutsideMeps=r.val();C()});var J=a("#body div.productClass select").change(function(){Q.ProductClass=J.val();C()});L.click(function(){c(false)});var c=function(X){Q.Voltage="";M(W);Q.FrameMaterial="";M(m);Q.Frequency="";M(n);Q.IEClass="";M(U);if(!X){Q.Meps="";M(v)}Q.MotorRange="";M(y);Q.HideOutsideMeps="";M(r);Q.Output="";M(B);Q.Poles="";M(D);Q.ProductClass="";M(J);if(X){return}N(function(){C()})};var M=function(X){X.val("");setTimeout(function(){X.trigger("refresh")},10)};var p=function(X){var Y=function(){if(X){X()}};mds.dataFactory.metadata.getStandardSelections(Q,function(Z,aa){I(Q,Z);Y()})};var I=function(Y,X){Q=Y;a.fn.selectionView.selectionData=Q;X.MEPS.sort(function(Z,aa){if(Z=="No requirements"){return 1}if(aa=="No requirements"){return -1}return Z.localeCompare(aa)});E(v,Q.Meps,"Select MEPS",X.MEPS);E(U,Q.IEClass,"All types",X.EfficiencyClasses);E(B,Q.Output,"All outputs (kW)",X.Outputs);E(m,Q.FrameMaterial,"All frames",X.FrameMaterials);E(y,Q.MotorRange,"All motor ranges",X.MotorRanges);E(r,Q.HideOutsideMeps,"No",X.HideOutsideMeps);E(J,Q.ProductClass,"All product classes",X.ProductClasses);E(W,Q.Voltage,"All voltages",X.Voltages,"V");E(n,Q.Frequency,"All frequencies",X.Frequencies,"Hz");G(X.Poles)};var E=function(ab,X,af,Z,ag,Y){var aa=function(){if(Y){Y()}};ab.html("").addClass("loading");a("").append(af).attr("value","").appendTo(ab);for(var ac=0;ac").attr("value",Z[ac]).append(ae+(ag?ag:"")).appendTo(ab);if(Z[ac]==X){ad.attr("selected",true)}}setTimeout(function(){ab.trigger("refresh")},10);ab.removeClass("loading").removeClass("error");aa()};var G=function(Y,X){var Z=function(){if(X){X()}};D.html("").addClass("loading");a("").append("All poles").attr("value","").appendTo(D);for(var aa=0;aa").append(mds.translate(ac.DisplayName)).attr("value",ac.Value).appendTo(D);if(ac.Value+""===Q.Poles){ab.attr("selected",true)}}setTimeout(function(){D.trigger("refresh")},10);D.removeClass("loading").removeClass("error");Z()};var F=function(X){var Y=function(){if(X){X()}};mds.dataFactory.user.getSelectionList(function(Z){for(var aa=0;aa").addClass("remove");var aa=w.addElement(Z.id,""+Z.motorType+", "+Z.ie+"
            "+Z.output+"kW / "+Z.voltage+"V / "+Z.frequency+"Hz").prepend(ab);if(e.items.length>=2){aa.addClass("disabled")}ab.bind("click",function(ac){ac.stopPropagation();var ad=a(this).closest(".item").attr("elementid");var ae=mds.selectedMotors.findById(ad);S(ae,true)})}if(X){X()}};var C=function(X){R.val("");Q.FreeTextSearch="";if(Q.Meps===""){W.trigger("disable").attr("disabled","disabled");n.trigger("disable").attr("disabled","disabled");B.trigger("disable").attr("disabled","disabled");D.trigger("disable").attr("disabled","disabled");U.trigger("disable").attr("disabled","disabled");m.trigger("disable").attr("disabled","disabled");y.trigger("disable").attr("disabled","disabled");r.trigger("disable").attr("disabled","disabled");J.trigger("disable").attr("disabled","disabled");R.trigger("disable").attr("disabled","disabled");P.hide()}H(1,function(){N();if(X){X()}})};var s=function(){q.find("tr:first td").each(function(){if(a(this).attr("sort")){a(this).bind("click",function(){var X=a(this).attr("sort");if(h===X){if(i==="ASC"){i="DESC"}else{i="ASC"}}else{h=X;i="ASC"}if(Q.FreeTextSearch===""){C()}else{H(1)}})}})};var f=false;var S=function(X,Z){if(mds.selectedMotors.containsId(X)||Z){mds.selectedMotors.removeId(X);w.removeElement(X.id,function(){});a("a.addButton[motorid='"+X.id+"']").removeClass("inactive");V(function(){mds.dataFactory.user.saveSelectionList(mds.selectedMotors)})}else{var Y=addExtraMotorParameters([X]);Promise.all(Y).then(function(aa){mds.selectedMotors.add(X);V(function(){mds.dataFactory.user.saveSelectionList(mds.selectedMotors)})})}};var K=function(X,ac){var Y=function(ad,ae){ad.bind("click",function(){var af=a(this).attr("page");H(af,function(){})})};var Z=function(){var ad=a(".page .selection > div.search-result div.motors .footer");if(a("#pager",ad).size()>0){return a("#pager",ad)}else{var ae=a("
            ");ad.append(ae);return ae}};var aa=function(ah,aj){var ak=a("
              ");if(aj<=1){return ak}var ad=aj>7?7:aj;var af=parseInt(ah,10);aj=parseInt(aj,10);var ai=af-Math.floor(ad/2);if((ai+ad)>aj){ai=(aj+1)-ad}if(ai<1){ai=1}if(ai>aj){ai=aj-ad}if(af>1){ak.append(a("
            • <
            • "))}for(var ae=ai;ae<(ad+ai);ae++){var ag=a("
            • "+ae+"
            • ");ak.append(ag);if(af===ae){ag.addClass("active")}}if(ah>"))}a("li",ak).each(function(){Y(a(this).find("a"))});return ak};var ab=Z();ab.html("");if(Q.Meps!==""){ab.append(aa(X,Math.ceil(ac/mds.defaultRowCount)))}};var o=function(Z,X,aa){var ab="";var Y=Z.toLowerCase();if(Y.indexOf("australia - meps")>-1){ab="Variant Code 543 Australia MEPS"}else{if(Y.indexOf("australia - he meps")>-1){ab="Variant Code 544 Australian HE MEPS"}else{if(Y==="brazil - nbr"){ab="Variant Code VC 542 NBR design"}else{if(Y==="brazil - nbr ir3"){ab="Translate(Meps_Info_BrazilIe3)"}else{if(Y.indexOf("canada - csa eev energy efficient")>-1){ab="Variant Code VC242 Fulfilling CSA Energy Efficiency Verification IE2 (code 010 included)"}else{if(Y.indexOf("canada - nrcan")>-1){ab="Variant code 687 Fulfilling energy efficiency requirements for Canada"}else{if(Y==="china - meps"){ab="Variant Code 540 China Energy Label"}else{if(Y==="singapore - meps"){ab="Variantcode 564 Singapore MEPS"}else{if(Y==="india - meps"){ab="Variant Code 552 BIS licence for India"}else{if(aa&&aa.substring(aa.length-2,2).toLowerCase()==="in"){ab="This product can only be offered and ordered from the factory in India"}else{if(Y==="eu - meps"||Y==="tr - meps"){ab=""}else{if(Y.indexOf("us - eisa energy efficient")>-1){ab="Variant Code 408 Fulfilling EPACT requirements CC031A"}else{if(Y.indexOf("us - ihp")>-1){ab="Variant Code 509 Fulfilling US Integral Horsepower Motor ​Rule (IHP)"}else{if(Y==="korea - meps"){ab="Variant Code 500 Fulfilling Korean MEPS efficiency regulations"}}}}}}}}}}}}}}if(ab.length>0){ab="For ordering purposes within selected meps, please add "+ab+"";return a("")}return""};function H(ac,Y){P.addClass("loading");var aa=function(){if(Y){Y()}};var Z=function(aq,ao,aA,ap,az,aC,ag,aM,al,aB,ah,ay,aj,aw,aI,aJ,av,aH,aL,aD,ak,an,af,aK,aF){var aE=a("");var ax=new mds.Motor(ao,aM,al,aA,az,ap,ah,ay,aL);ax.frameMaterial=aj;ax.meps=aw;ax.TypeProtection=aL;ax.selectedMeps=aH;ax.inMepsAccToRules=av;ax.hideOutsideMeps=an;ax.productCode=aC;ax.rtdSpeed=aF;var am=function(){var aN="?cn=&pn="+(_UNBRANDED?"&unbranded":"");var aO="/documentation/singledocument.pdf"+aN+"&data="+encodeURIComponent(a.toJSON({MotorItems:[{InternalId:ao,Meps:aw,InMepsAccToRules:av,SelectedMeps:aH,SelectedMepsFromUI:Q.Meps,TypeProtection:aL}]}));return aO};var ar="info";var au=mds.translate(ay);if(aC.length>0&&aC.substring(aC.length-2)==="IN"&&aH.length>0&&aH==="EU - MEPS"){ar+=" ";au+="

              "+mds.translate("+519 Motor fulfilling European directive and regulations")}else{if(aK){switch(aK.trim().toLowerCase()){case"002":ar+=" alert-1";au+="

              "+mds.translate("+002 Restamping voltage, frequency and output, continuous duty. Variant code not needed if MEPS vc is used");break;case"209":ar+=" alert-2";au+="

              "+mds.translate("+209 Non-standard voltage or frequency, (special winding). Variant code not needed if MEPS vc is used");break}}}var at=a("").addClass("col0").html("
              "+au+"
              ").appendTo(aE);at.find(".ttContent").tooltip();a("").addClass("col1").html("
              "+aA+"kW
              ").appendTo(aE);a("").addClass("col2").append("
              "+aM+"V "+af+" "+al+"Hz
              ").appendTo(aE);var ai="";if(aI){ai=a("
              This motor is not subject to MEPS due to output power or pole number.
              ");a("").addClass("col25").append(ai).appendTo(aE);ai.find(".ttContent").tooltip()}else{if(aJ){ai=a("
              This motor is not subject to MEPS due to motor type.
              ");a("").addClass("col25").append(ai).appendTo(aE);ai.find(".ttContent").tooltip()}else{a("").addClass("col25").append(ai).appendTo(aE)}}a("").addClass("col3").append("
              "+ap+"
              ").appendTo(aE);a("").addClass("col4").append("
              "+az+"
              ").appendTo(aE);a("").addClass("col45").append("
              "+aC+"
              ").appendTo(aE);a("").addClass("col5").append("
              "+aB+"
              ").appendTo(aE);a("").addClass("col7").append('
              ').appendTo(aE);a("").addClass("col8").append("
              "+aL+"
              ").appendTo(aE);var aG=a("
              ").addClass("col9").appendTo(aE);var ae="";if(mds.selectedMotors.containsId(ax)){ae="inactive"}var ad=a("Add").attr("motorid",ax.id).addClass(ae).click(function(aO){aO.preventDefault();var aN=a(this);if(aN.hasClass("inactive")){aN.removeClass("inactive")}else{aN.addClass("inactive")}S(ax,false)}).appendTo(aG.find("div"));if(aq%2==1){aE.addClass("alt")}return aE};var X=function(af,aq,ag){var ai=a(".page .selection > div.search-result div.motors .footer").addClass("loading");var al=a(".page .selection > div.search-result div.motors.list").ajaxLoader();P.find("tr").not("tr.headerRow").remove();ai.html("");if(!ag){var an=af.Motors;var ae=af.MotorCount;for(var aj=0;aj0&&Q.Meps!="Not applicable"){ap=o(Q.Meps,Q.IEClass,Q.productCode)}var ao=a("#orderingInformation");ao.html("").append(ap);if(ao.find(".ttOrder").size()>0){ao.find(".ttOrder").tooltip()}if(ae==0){ai.append("No motors found.")}else{if(Q.Meps===""){ai.html("Start your selections by selecting a meps.")}else{if(ae>mds.defaultRowCount){var ak=parseInt(aq,10);var ad=((ak-1)*100+1);var at=((ak)*100);if(at>ae){at=ae}ai.append(sprintf("Displaying %1$s out of %2$s motors.",ad+"-"+at,ae))}else{ai.append(sprintf("A total of %1$s motors found.",ae))}}}var ah="/documentation/excelmotorlist?sortColumn="+h+"&sortOrder="+i+"&data="+encodeURIComponent(a.toJSON(Q));ai.append(''+sprintf("Create excel file of the current list of %1$s motors.",ae)+"");a("#excelMotorListInfo").tooltip();P.removeClass("error").removeClass("loading");ai.removeClass("error").removeClass("loading");al.ajaxLoaderRemove();if(u){al.find(".body").css("background-color","#f4fbff").animate({backgroundColor:"white"},500)}aa()}else{P.addClass("error").removeClass("error");ai.addClass("error").removeClass("error");al.ajaxLoaderRemove();aa()}};var ab=function(){var ad;if(Q.FreeTextSearch){if(Q.FreeTextSearch.length>3){t();ad=mds.dataFactory.motor.getMotors;ad&&ad(Q,h,i,ac,function(ae,af){I(ae.SelectionData,ae.SelectionsContainer);X(ae.MotorSearchResult,ac,af);K(ac,ae.MotorSearchResult.MotorCount);aa()})}}else{t();ad=mds.dataFactory.motor.getMotors;ad&&ad(Q,h,i,ac,function(ae,af){I(ae.SelectionData,ae.SelectionsContainer);X(ae.MotorSearchResult,ac,af);K(ac,ae.MotorSearchResult.MotorCount);aa()})}};ab()}var t=function(){a("#mSelection .motors .footer").html(" ")};b.intialize=function(){var aa=false;var X=false;var Y=false;var Z=false;mds.dataFactory.metadata.getSearchViewState(function(ac,ab){if(ac&&ac.SelectionData!=="undefined"&&!ab){Q=ac.SelectionData}F(function(){C()})});a("#mSelection").data("openEvent")(function(){V()});s();return this};return b.intialize()};a.fn.selectionView.defaults={};a.fn.selectionView.selectionData={}})(jQuery);(function(a){a.fn.comparisonView=function(V){if(this.length>1){this.each(function(){a(this).comparisonView(V)});return this}var b=a(this);var W=a.extend({},a.fn.comparisonView.defaults,V);var p=a("#corrMotorTooltipContents");p.tooltip();var T=a(".settings .operating-hours input");var S=a(".settings .operating-days input");var t=a(".settings .energy-price input");var q=a(".settings .currency select");var ai=a(".settings .service-life-of-motor input");var P=a(".settings .maintenance-cost input");var U=a(".settings .operating-profile input");var D=a(".settings .greenhouse-gases input");var h=D;var ag=a(".motor1 select.motorSelect",Q);var ah=a(".motor2 select.motorSelect",Q);var i=a("#comparisonBank").slidecontainer({visibleItems:2,itemBoxHeight:59});var m=a("#coodialog");var al=a("#settings-form").validate({errorPlacement:function(ar,aq){a(aq).focus().select();return false}});var ae=a("#saveComparison");var N=a(".comparison .motor-compare-box-result .life-cycle-savings strong.lifetime");var X=a(".comparison .motor-compare-box-result .payback-period strong");var E=a(".comparison .motor-compare-box-result .environment strong.annual").not(".estimate");var C=a(".comparison .motor-compare-box-result .environment strong.annual.estimate");var u=a(".comparison .motor-compare-box-result .energy strong.annual").not(".estimate");var s=a(".comparison .motor-compare-box-result .energy strong.annual.estimate");var c=a(".comparison .motor-compare-box-result .life-cycle-savings strong.annual");var M=a(".comparison .motor-compare-box-result .environment strong.lifetime").not(".estimate");var L=a(".comparison .motor-compare-box-result .environment strong.lifetime.estimate");var K=a(".comparison .motor-compare-box-result .energy strong.lifetime").not(".estimate");var J=a(".comparison .motor-compare-box-result .energy strong.lifetime.estimate");var o=a("#correspondingMotor");var Q=a(".comparison .motor-compare-box-list");var R=a("#motor-compare-area select.motorSelect");var af=a("#sCoInfo");var O=a("#comparison .comparison-tabs");var I=false;var j=new mds.ComparisonData();var k=new mds.ComparisonSettings();var n=new mds.Motor();k.clone();a("#comparison input[type=text]").each(function(){mds.bindNumericalBox(a(this))});var H=a("#comparison input.numberOfMotors");H.keyup(function(){F()});H.change(function(){F()});var F=function(){var aq=H.attr("maxlength");if(H.val().length>aq){H.val(H.val().substring(0,aq))}if(H.val().length>0&&H.val()<1){H.val("")}var ar=H.val();j.numberOfMotors=ar.length<1||isNaN(ar)||ar<1?1:parseInt(ar);ap()};mds.Motor.prototype.isValid=function(){return(this.efficiency!==null&&this.efficiency!==undefined&&this.output!==null&&this.output!==undefined&&this.price!==null&&this.price!==undefined)};var f=function(aq){if(aq!==null&&aq!==undefined&&typeof aq=="string"){return aq.replace(",",".")}return aq};var v=function(aq){var ar=false;var at=aq.find("input:text").each(function(){var au=a(this);if(au.val().length==0){au.focus().select();ar=true;return false}});if(!focus&&at.length>0){a(at[0]).focus().select()}};var Y=function(aq){q.html("");var ar=function(at){for(var au=0;au0&&ay.is(":checked");ax=new mds.Motor(av,0,0,at,"","",au,"");ax.complyWithStandard=ar;ax.isCustom=true}else{ax=mds.selectedMotors.findById(av)}var aC=aq.find(".motor-price input");var aF=aC.val().length==0?0:aC.val();ax.price=aF;return ax};var ab=function(aq,ay){var aD=aq.find(".motor-id input");var aH=aq.find(".motor-type input");var aB=aq.find(".motor-effect input");var aC=aq.find(".motor-efficenty input");var aG=aq.find("select.motorSelect");var aE=aq.find(".motor-price input");var ax=aq.find(".comply-with-standard input");var aF=aq.find(".motor-remove-button a");aD.val(ay.id===null?"":ay.id);aH.val(ay.name===null?"":ay.name);aB.val(ay.output=="0"||ay.output===null?"":ay.output);aC.val(ay.efficiency=="0"||ay.efficiency===null?"":ay.efficiency);aE.val(ay.price=="0"||ay.price===null?"":ay.price);ax.attr("checked",ay.complyWithStandard);var aI=aq.find(".motor-vsd-efficiency input");var aA=aq.find(".motorItem span.dol-or-vsd");var az=aq.find(".motor-type span.dol-or-vsd");aA.html(ay.DolOrVsd?" ("+ay.DolOrVsd+")":"");az.html(ay.DolOrVsd?ay.DolOrVsd:"");if(ay.DolOrVsd&&ay.DolOrVsd==="DOL"){aI.val(ay.S100_T100?(ay.S100_T100>0?ay.S100_T100.toFixed(1):ay.S100_T100):"")}else{aI.val(ay.efficiency=="0"||ay.efficiency===null?"":ay.efficiency)}var ar=aq.closest("#motor-compare-area");var aJ=false;var av=ar.find(".motor1 .motor-type span.dol-or-vsd").html();var aw=ar.find(".motor2 .motor-type span.dol-or-vsd").html();var at=av;var au=aw;if((av==="DOL"&&aw==="VSD")||(av==="VSD"&&aw==="DOL")){aJ=true;if(av==="DOL"){at="VSD¹"}else{if(aw==="DOL"){au="VSD¹"}}}if(aJ){ar.find(".motor-efficenty").hide();ar.find(".motor-vsd-efficiency").show();ar.find(".motor1 .motor-vsd-efficiency span.dol-or-vsd").html(" ("+at+")");ar.find(".motor2 .motor-vsd-efficiency span.dol-or-vsd").html(" ("+au+")")}else{ar.find(".motor-efficenty").show();ar.find(".motor-vsd-efficiency").hide()}if(ay.isCustom){aD.val("");if(ay.noSelection){aq.addClass("disabled").find("input[type=text]").val("").not(".alwaysEnabled").attr("disabled",true);ax.parents(".motor-compare-box-footer").hide()}else{aq.removeClass("disabled").find("input[type=text]").removeAttr("disabled");ax.parents(".motor-compare-box-footer").show()}}else{aq.addClass("disabled").find("input[type=text]").not(".alwaysEnabled").attr("disabled",true);ax.parents(".motor-compare-box-footer").hide()}aF.unbind("click").bind("click",function(){aH.val("");aB.val("");aC.val("");aE.val("");aG.val("");aG.trigger("refresh");aA.html("");aI.val("");ax.attr("checked",false);n=null;ao(false);if(aq.hasClass("primary")){j.motor1=new mds.Motor();j.motor1.isCustom=true;j.motor1.noSelection=true;ab(aq,j.motor1)}else{j.motor2=new mds.Motor();j.motor2.isCustom=true;ab(aq,j.motor2)}w(function(aK){if(aK!==null){ac(aK.Total.LifeCycleSavingsRounded,aK.Total.AnnualSavingsRounded,aK.PaybackPeriodRounded,aK.Total.GreenhouseGasReductionRounded,aK.Total.GreenhouseGasCarComparisonRounded,aK.Total.LifeCycleGreenhouseGasReductionRounded,aK.Total.LifeCycleGreenhouseGasCarComparisonRounded,aK.Total.EnergySavingsRounded,aK.Total.EnergyCarComparisonRounded,aK.Total.LifeCycleEnergySavingsRounded,aK.Total.LifeCycleEnergyCarComparisonRounded,aK.Co2PerKWh);v(aq)}},false)})};var g=function(){a("#documentModalCover").hide();a("#documentModal").hide()};var e=function(){a("#comparison .settingsLink").click(function(aq){aq.preventDefault();ad();am()});a("#documentModal a.smallModalClose").click(function(aq){aq.preventDefault();ad();g()});a("#documentModal .settingsSave").click(function(aq){aq.preventDefault();k.co2PerKWh=f(h.val());k.currency=q.val();k.energyPrice=f(t.val());k.greenhouseGases=f(D.val());k.maintenanceCost=f(P.val());k.operatingDays=f(S.val());k.operatingProfile=f(U.val());k.operatingHours=f(T.val());k.serviceLife=f(ai.val());w(function(ar){ac(ar.Total.LifeCycleSavingsRounded,ar.Total.AnnualSavingsRounded,ar.PaybackPeriodRounded,ar.Total.GreenhouseGasReductionRounded,ar.Total.GreenhouseGasCarComparisonRounded,ar.Total.LifeCycleGreenhouseGasReductionRounded,ar.Total.LifeCycleGreenhouseGasCarComparisonRounded,ar.Total.EnergySavingsRounded,ar.Total.EnergyCarComparisonRounded,ar.Total.LifeCycleEnergySavingsRounded,ar.Total.LifeCycleEnergyCarComparisonRounded,ar.Co2PerKWh)},true);g()})};var am=function(){a("#documentModal").show();a("#documentModalCover").show()};var w=function(aq,aC){var au=false;var ar=function(){if(au||!aC){if(!j.motor1.isValid()||!j.motor2.isValid()){return true}var aK;var aL;if(j.motor1.efficiency>=j.motor2.efficiency){aK=j.motor1;aL=j.motor2}else{if(j.motor1.efficiency").addClass("remove");var aq=a("
              ").addClass("cnt").html(""+(ar.numberOfMotors?ar.numberOfMotors:1)+" x");ar.id=ar.motor1.id+" - "+ar.motor2.id;if(ar.motor1.isCustom){ar.motor1.motorType="Custom motor"}if(ar.motor2.isCustom){ar.motor2.motorType="Custom motor"}var aB=(ar.motor1.ie&&ar.motor1.ie.length>0)?", "+ar.motor1.ie:"";var aC=(ar.motor2.ie&&ar.motor2.ie.length>0)?", "+ar.motor2.ie:"";var av=ar.motor1.DolOrVsd&&(ar.motor1.DolOrVsd==="DOL"||ar.motor1.DolOrVsd==="VSD")?ar.motor1.DolOrVsd:"";var aw=ar.motor2.DolOrVsd&&(ar.motor2.DolOrVsd==="DOL"||ar.motor2.DolOrVsd==="VSD")?ar.motor2.DolOrVsd:"";var ax=ar.motor1.efficiency;var ay=ar.motor2.efficiency;var at=av;var au=aw;if((av==="DOL"&&aw==="VSD")||(av==="VSD"&&aw==="DOL")){try{if(av==="DOL"){if(ar.motor1.S100_T100){var aI=ar.motor1.S100_T100;ax=aI>0?aI.toFixed(1):aI;at="VSD¹"}}else{if(aw==="DOL"){if(ar.motor2.S100_T100){var aI=ar.motor2.S100_T100;ay=aI>0?aI.toFixed(1):aI;au="VSD¹"}}}}catch(az){console.log("Could not convert efficiency for DOL to S100_T100",az)}}var aD=(at.length>0?at+" ":"")+'('+av+") ";var aE=(au.length>0?au+" ":"")+'('+aw+") ";var aF="
              "+ar.motor1.motorType+aB+"
              "+ar.motor1.output+"kW / "+aD+ax+"%
              "+ar.motor2.motorType+aC+"
              "+ar.motor2.output+"kW / "+aE+ay+"%
              ";var aG=i.addElement(ar.id,aF).prepend(aH).prepend(aq);aH.bind("click",function(aK){aK.stopPropagation();var aJ=a(this).closest(".item").attr("elementid");var aL=mds.selectedComparisons.findById(aJ);an(aL)})}};var an=function(aq){if(mds.selectedComparisons.containsId(aq)){mds.selectedComparisons.removeId(aq);i.removeElement(aq.id)}else{mds.selectedComparisons.add(aq)}aa(function(){mds.dataFactory.user.saveComparisonList(mds.selectedComparisons)})};var A=function(aq){var ar=function(){if(aq){aq()}};mds.dataFactory.user.getComparisonSelectionList(function(au){for(var av=0;av0)?", "+ar.ie:"";var at=ar.motorType+", "+ar.voltage+"V/"+ar.frequency+"Hz"+aq;ag.append("");ah.append("")};var y=function(){var aq;var ar=true;if(j.motor1.isCustom&&j.motor2.isCustom){ao(false);return}if(!j.motor1.isCustom&&(j.motor2.efficiency==undefined||j.motor1.efficiency>j.motor2.efficiency)){aq=j.motor1;ar=true}else{if(!j.motor2.isCustom){aq=j.motor2;ar=false}else{ao(false);return}}mds.dataFactory.motor.getCorrespondingMotor(aq,function(at){if(!at){return}if(at.InternalID===aq.id){ao(false);n=new mds.Motor()}else{ao(true);n=new mds.Motor(at.InternalID,at.Voltage,at.Frequency,at.Output,at.Name,at.IE,at.Efficiency);n.motorRange=at.MotorRange;n.meps=at.Meps;p.html("Using this motor with higher efficiency is likely to reduce your cost of ownership: "+n.motorType+" "+n.ie+"

              Would you like to add this motor to your list?
              OkCancel");p.find(".bbOK").bind("click",function(av){av.preventDefault();var au=!mds.selectedMotors.containsId(n);var aw=[];if(au){aw=addExtraMotorParameters([n])}Promise.all(aw).then(function(ax){if(au){mds.selectedMotors.add(n);mds.dataFactory.user.saveSelectionList(mds.selectedMotors);d(n)}if(ar){ag.val(n.id).trigger("change")}else{ah.val(n.id).trigger("change")}ag.trigger("refresh");ah.trigger("refresh")})})}})};var ao=function(ar){var aq=a(".ef-savings-area");if(ar){aq.removeClass("nosibling");a(".corresponding-box").show()}else{aq.addClass("nosibling");a(".corresponding-box").hide()}};var r=function(){mds.raiseEvent("dialogopen");var aq=mds.getDialogContainer().prependTo("body").addClass("coo-dialog-container").addClass("dialog-container");aq.load("/units/costofownership-dialog.html",null,function(){aq.commondialog({onClose:function(){aq.remove();mds.raiseEvent("dialogclose")}})})};var G=function(){var aq=function(){var av=a("#costOfNotRunningContainer");var at=a(".inner-content:nth-child(1)",av);var au=a(".inner-content:nth-child(2)",av);if(mds.isAppleDevice()){a("#learnMoreCOVideo").show();a("#learnMoreCOVBroschure").hide()}else{a("#learnMoreCOVBroschure").show();a("#learnMoreCOVideo").hide()}av.find(".down").click(function(){at.hide();au.show()});av.find(".up").click(function(){au.hide();at.show()});var ar=function(){var aw=a("#smallBoxContainer");a("[tabType=tabActivator]",aw).click(function(){var ay=a(this).attr("tabName");a("[tabType=tab]",aw).hide();a("[tabType=tab][tabName='"+ay+"']",aw).show();var ax=a(".arrow",aw).removeClass("step1").removeClass("step2").removeClass("step3");if(ay=="tab1"){ax.addClass("step1")}if(ay=="tab2"){ax.addClass("step2")}if(ay=="tab3"){ax.addClass("step3")}})};ar()};O.find("li").each(function(){a(this).click(function(){a(this).siblings().removeClass("active");a(this).addClass("active");var ar=a(this).attr("tabName");var at=a("#comparison").find("[tabType='main']");at.hide();a("[tabName='"+ar+"']",at.parent()).show();a("#comparison").closest(".acc-content").data("height",a("#comparison").closest(".acc-content").height())})});aq()};var l=function(){var aq=function(ar,at){at=null;ar.find(".motor-remove-button").find("a").trigger("click")};if(isNaN(parseInt(j.motor1.id))&&!mds.selectedMotors.containsId(j.motor1)){aq(a(".motor1",Q),j.motor1)}if(isNaN(parseInt(j.motor2.id))&&!mds.selectedMotors.containsId(j.motor2)){aq(a(".motor2",Q),j.motor2)}};b.intialize=function(){var aq=false;if(!aq){G();e();A(function(){aa()});var at=a("#mCostOfOwnership .trashContent").tooltip();a(".bbOK",at).click(function(au){au.preventDefault();mds.selectedComparisons=new bedrock.collections.list();i.clearList();mds.dataFactory.user.saveComparisonSelectionList(mds.selectedComparisons)});if(!aq){var ar=!mds.isLowMsieBrowser();if(ar){ag.selectbox({zIndex:999});ah.selectbox({zIndex:999})}Y(function(){Z(function(){a(".currency-name").html(k.currency);I=true;ad();var au=Q.children(".motor-compare-box");ab(a(au[0]),j.motor1);ab(a(au[1]),j.motor2);v(a(au[0]));l()})});aq=true}}a("#mCostOfOwnership").data("openEvent")(function(){var aw=ag.val()===null?"no-selection":ag.val();var ax=ah.val()===null?"":ah.val();ag.children().remove();ah.children().remove();ag.append("");ah.append("");for(var au=0;au-1||a(this).val().indexOf(" ")>-1){a(this).val(a(this).val().replace(",",".").replace(" ",""))}var aq=z(ar);if(ar.hasClass("motor2")){j.motor2=aq}else{j.motor1=aq}ap()});var ap=function(){if(j.motor1.isValid()&&j.motor2.isValid()){w(function(aq){ac(aq.Total.LifeCycleSavingsRounded,aq.Total.AnnualSavingsRounded,aq.PaybackPeriodRounded,aq.Total.GreenhouseGasReductionRounded,aq.Total.GreenhouseGasCarComparisonRounded,aq.Total.LifeCycleGreenhouseGasReductionRounded,aq.Total.LifeCycleGreenhouseGasCarComparisonRounded,aq.Total.EnergySavingsRounded,aq.Total.EnergyCarComparisonRounded,aq.Total.LifeCycleEnergySavingsRounded,aq.Total.LifeCycleEnergyCarComparisonRounded,aq.Co2PerKWh)},false)}};q.change(function(){var aq=q.val();k.currency=aq;a(".currency-name").html(aq)});var ak=function(aq){if(aq.isCustom){aq.id="Custom motor "+aq.output+"kW "+aq.efficiency+"%"}};ae.click(function(ar){ar.preventDefault();if(!j.motor1.isValid()||!j.motor2.isValid()){return}ak(j.motor1);ak(j.motor2);var au=j.motor1.id+"-"+j.motor2.id;var aw=j.motor2.id+"-"+j.motor1.id;for(var at=mds.selectedComparisons.items.length-1;at>-1;at--){var aq=mds.selectedComparisons.items[at].id.replace(" - ","-");if(aq==au||aq==aw){mds.selectedComparisons.items.splice(at,1)}}var av=H.val();if(av.length<1||isNaN(av)||av<1){return}mds.selectedComparisons.add({id:au,motor1:j.motor1,motor2:j.motor2,settings:k.clone(),numberOfMotors:av});aa();mds.dataFactory.user.saveComparisonSelectionList(mds.selectedComparisons)});return b.intialize()};a.fn.comparisonView.defaults={}})(jQuery);(function(a){a.fn.datadialog=function(s){if(this.length>1){this.each(function(){a(this).datadialog(s)});return this}var b=a(this);var t=a.extend({},a.fn.datadialog.defaults,s);var f="";var e="";var l=a(".data-dialog .workarea .graph img");var o=a(".data-dialog .workarea .legends");var r=a(".data-dialog .motor-name");var c=a(".data-dialog-container .buttons .close");var h=a(".data-dialog-container .buttons .export");var w=a(".data-dialog .view-selection select");var m=a(".data-dialog .graph-selection select").hide();var g=a(".data-dialog .views .data-sheet").hide();var n=a(".data-dialog .views .curves").hide();var k=function(y){return"Motor"};w.change(function(){g.hide();n.hide();var y=w.val();if(y=="data"){g.show();q();m.hide()}else{n.show();p();m.show()}});m.change(function(){var y=m.data(m.val());if(y){u(y)}else{l.attr("src","")}});c.click(function(y){y.preventDefault();t.onClose()});var v=function(y,z){r.html("");a("
              ").addClass("group").append(k(y)+":").appendTo(r);a("").append(z).appendTo(r)};var u=function(y){l.attr("src",y.Url);o.html("");for(var z=0;z
              ");var y=a("
              ").addClass("color").css({backgroundColor:z}).appendTo(A);a("
              ").addClass("name").append(B).appendTo(A);return A};var p=function(){var y=function(){m.html("");mds.dataFactory.motor.getCharts(f,function(z,A){if(!A&&z){var B=null;for(var C=0;C").append(z[C].Title).attr("value",z[C].Title).appendTo(m);m.data(z[C].Title,z[C]);if(C==0){B=z[C]}}u(B)}else{l.attr("src","")}})};y()};var i=function(y){mds.dataFactory.motor.getMotor(f,function(z,A){if(!A){y(z)}else{y(null)}})};var j=function(y){if(y.toLowerCase().indexOf("china")>=0){return"GB/T 1032 / IEC 60034-2-1"}else{if(y.toLowerCase().indexOf("eisa")>=0||y.toLowerCase().indexOf("canada")>=0){return"Acc. to IEEE-112B or CSA 390-10"}else{if(y.toLowerCase().indexOf("brazil")>=0){return"NBR 17094-1"}else{return"Acc. to IEC 60034-2-1"}}}return""};var q=function(){var z=a(".data-dialog .data-sheet div.tableBody table").html("");var A=a(".data-dialog .data-sheet div.tableHeader table").html("");var y=function(C){var B=function(D,H,G,E){H=H===-1?"":H;var F=a("");a("").addClass("name").append(D).appendTo(F);a("").addClass("value").append(H).appendTo(F);a("").addClass("units").append(G).appendTo(F);a("").addClass("remarks").append(E).appendTo(F);a("td",F).each(function(){if(a(this).html()==""){a(this).html(" ")}});return F};B("Def","Data","Unit","Remarks").appendTo(A);B("Product","TEFC, 3-phase, squir","","").appendTo(z);B("Product code",C.ProductCode,"","").appendTo(z);if(C.CurrentMotor){B("Voltage code",C.VoltageCode,"","").appendTo(z)}B("Type/Frame",C.TypeDesignation,"","").appendTo(z);B("Design",C.Design,"","").appendTo(z);B("Rated output PN",mds.roundNumber(C.RtdPower,2),"kW","").appendTo(z);B("Rated voltage UN",mds.roundNumber(C.RtdVolt,2),"V D","± 5 % (IEC 60034-1)").appendTo(z);B("Rated frequency fN",mds.roundNumber(C.Frequency,2),"Hz","± 2 % (IEC 60034-1)").appendTo(z);B("Rated speed nN",mds.roundNumber(C.RtdSpeed,2),"r/min","").appendTo(z);B("Rated current IN",mds.roundNumber(C.RtdIn,2),"A","").appendTo(z);B("Starting current IS/IN",mds.roundNumber(C.RtdIst,2),"","").appendTo(z);B("Nominal torque TN",mds.roundNumber(C.RtdTn,2),"Nm","").appendTo(z);B("Locked rotor torque TS/TN",mds.roundNumber(C.RtdTst,2),"","").appendTo(z);B("Maximum torque Tmax/TN",mds.roundNumber(C.RtdTmax,2),"","").appendTo(z);B("IE class",C.IE,"","").appendTo(z);if(C.NominalValue.length>0){B("NEMA Nominal Value",C.NominalValue,"%","").appendTo(z)}B("Efficiency - full load 100%",mds.roundNumber(C.RtdEff,1),"%",j(C.Meps)).appendTo(z);B("Efficiency - 75%",mds.roundNumber(C.RtdEff75,1),"%","").appendTo(z);B("Efficiency - 50%",mds.roundNumber(C.RtdEff50,1),"%","").appendTo(z);B("Power factor - full load 100%",mds.roundNumber(C.RtdCos,2),"","").appendTo(z);B("Bearing DE/NDE",C.Bearing,"","").appendTo(z);B("Sound pressure level (LP dB(A) 1m)",mds.roundNumber(C.LpdB,2),"dB(A)","+3dB(A)").appendTo(z);B("Moment of inertia J = ¼ GD2",mds.roundNumber(C.Jrot,2),"kg-m²","").appendTo(z);B("Weight",C.WgtMotor,"kg","").appendTo(z);B("Ambient",C.Ambient,"°C","").appendTo(z);if(C.IsExMotor){B("Type of protection",C.TypeProtection,"","").appendTo(z);B("Certification No.",C.Certificate,"","").appendTo(z);B("tE time",C.tE_time,"s","").appendTo(z)}};mds.dataFactory.motor.getMotorData(f,e,function(C,B){if(!B&&C){y(C);i(function(D){if(D){v(D.MotorGroup,D.Name)}})}})};b.intialize=function(){return this};b.loadMotor=function(z,y){f=z;e=y;g.show();q()};return b.intialize()};a.fn.datadialog.defaults={onClose:function(){}}})(jQuery);(function(a){a.fn.comparedialog=function(f){if(this.length>1){this.each(function(){a(this).comparedialog(f)});return this}var b=a(this);var g=a.extend({},a.fn.comparedialog.defaults,f);var i=b.find(".tableBody table");var j=b.find(".tableHeader table");var c=b.find(".closebutton");var d=null;var e=null;var h=function(){if(d!==null&&e!==null){i.html("");var k=function(m,l,o,p){var n=a("").appendTo(m);a("").append(l).addClass("name").appendTo(n);a("").append(o).appendTo(n);a("").append(p).appendTo(n);a("td",n).each(function(){if(a(this).html()==""){a(this).html(" ")}});return n};k(i,"Type",d.TypeDesignation,e.TypeDesignation).appendTo(j);k(i,"Output",mds.roundNumber(d.RtdPower,2),mds.roundNumber(e.RtdPower,2));k(i,"Poles",d.Poles,e.Poles).addClass("alt");k(i,"Efficiency full load 100%",mds.roundNumber(d.RtdEff,1),mds.roundNumber(e.RtdEff,1));k(i,"Nominal current",mds.roundNumber(d.RtdTn,2),mds.roundNumber(e.RtdTn,2)).addClass("alt");k(i,"Power factor",mds.roundNumber(d.RtdCos,2),mds.roundNumber(e.RtdCos,2));k(i,"Noise level",d.LpdB,e.LpdB).addClass("alt");k(i,"Weight",d.WgtMotor,e.WgtMotor)}};b.intialize=function(){return this};b.loadMotors=function(l,m){d=null;e=null;var k=function(){if(d!==null&&e!==null){h()}};mds.dataFactory.motor.getMotorData(l,function(n,o){if(!o){d=n;k()}});mds.dataFactory.motor.getMotorData(m,function(n,o){if(!o){e=n;k()}})};c.click(function(k){k.preventDefault();g.onClose()});return b.intialize()};a.fn.comparedialog.defaults={onClose:function(){}}})(jQuery);(function(a){a.fn.commondialog=function(d){if(this.length>1){this.each(function(){a(this).commondialog(d)});return this}var b=a(this);var e=a.extend({},a.fn.commondialog.defaults,d);var c=a(".buttons .close");c.click(function(f){f.preventDefault();e.onClose()});b.intialize=function(){return this};return b.intialize()};a.fn.commondialog.defaults={onClose:function(){}}})(jQuery);(function(a){a.fn.documentView=function(y){if(this.length>1){this.each(function(){a(this).documentView(y)});return this}var b=a(this);var z=a.extend({},a.fn.documentView.defaults,y);var o=false;var h=null;var i=null;var u;var f;var c;var q;var j=0;var m=b.find("table.documents");var n=b.find("select.catSelect");var w=b.find("select.mountingSelect");var F=b.find("select.tblSelect");var e=b.find("select.accessoriesSelect");var s=b.find("select.mainterminalboxsizeSelect");var v=w.parent().hide();var d=e.parent().hide();var r=s.parent().hide();var g=F.parent().hide();var p=m;var k=a("#documentBank").slidecontainer({visibleItems:8});var t=a(".motorSelect",b);var l=a(".header",b);var G=function(){var Q=m.find("tbody");var M=n.val();if(M===""||M==="10"||M==="11"){v.show();d.show();r.show();g.show()}else{w.val("");setTimeout(function(){w.trigger("refresh")},10);v.hide();e.val("");setTimeout(function(){e.trigger("refresh")},10);s.val("");setTimeout(function(){s.trigger("refresh")},10);d.hide();F.val("");setTimeout(function(){F.trigger("refresh")},10);r.hide();F.val("");setTimeout(function(){F.trigger("refresh")},10);g.hide()}var O=w.val();var K=e.val();var N=s.val();var L=F.val();var P=Q.find("tr");var J=function(T,U){var R=false;if(U=="Standard"){if(!T||T.length===0){R=true}}else{if(T&&U){for(var S=0;S").addClass("remove");var M=k.addElement(mds.selectedDocuments.items[L].id,K.title.length>48?K.title.replace(/\//g,"/ ").substr(0,48)+"...":K.title).prepend(N);N.bind("click",function(P){P.stopPropagation();var O=a(this).closest(".item").attr("elementid");var Q=mds.selectedDocuments.findById(O);mds.selectedDocuments.removeId(Q);k.removeElement(O);mds.dataFactory.user.saveDocumentSelectionList(mds.selectedDocuments);a("a.addButton[docid='"+Q.id+"']").removeClass("inactive")})}if(J){J()}};var A=function(Q,R,J){var W=m;var X=m.find("tbody");var P=b.find("#documents .body .footer");var O=new bedrock.collections.list();u=new bedrock.collections.list();c=new bedrock.collections.list();q=new bedrock.collections.list();f=new bedrock.collections.list();var L=function(aa){var ac=a("").data("documentType",aa.type||"").data("mountingArrangements",aa.mountingArrangements||"").data("terminalBoxLocations",aa.terminalBoxLocations||"").data("accessories",aa.accessories||"").data("mainterminalboxsize",aa.mainterminalboxsize||"");var ab=a("").append(aa.title).attr("href",aa.url).attr("target","_blank");var Z="";if(mds.selectedDocuments.containsId(aa)){Z="inactive"}var Y=a("Add").attr("docid",aa.id).addClass(Z).click(function(af){af.preventDefault();var ae=a(this);if(ae.hasClass("inactive")){ae.removeClass("inactive")}else{ae.addClass("inactive")}if(mds.selectedDocuments.containsId(aa)){mds.selectedDocuments.removeId(aa);k.removeElement(aa.id)}else{mds.selectedDocuments.add(aa)}I(function(){mds.dataFactory.user.saveDocumentSelectionList(mds.selectedDocuments)})});a("").addClass("col1").append(mds.dataFactory.getDocumentTypeName(aa.type)).appendTo(ac);a("").addClass("col2").append(ab).appendTo(ac);a("").addClass("col3").append(Y).appendTo(ac);if(!O.contains(aa.type)){O.add(aa.type)}if(aa.mountingArrangements&&aa.mountingArrangements.length>0){for(var ad=0;ad0){for(var ad=0;ad0){for(var ad=0;ad0){for(var ad=0;ad").attr("value",ad).append(ac)};Y("All categories","").appendTo(aa);for(var ab=0;ab").attr("value","").append("All arrangements").appendTo(w);if(u.items.length>0){for(var Y=0;Y").append(u.items[Y]).attr("value",u.items[Y]).appendTo(w)}v.show()}else{v.hide()}setTimeout(function(){w.trigger("refresh")},10)};var S=function(){e.html("");if(c.items.length==0){a("").attr("value","").append("Not available").appendTo(e)}else{a("").attr("value","").append("Select accessories").appendTo(e);a("").append("Standard").attr("value","Standard").appendTo(e);if(c.items.length>0){for(var Y=0;Y").append(c.items[Y]).attr("value",c.items[Y]).appendTo(e)}d.show()}else{d.hide()}}setTimeout(function(){e.trigger("refresh")},10)};var U=function(){s.html("");if(q.items.length==0){a("").attr("value","").append("Not available").appendTo(s)}else{a("").attr("value","").append("Select MainTerminalbox Size").appendTo(s);if(q.items.length>0){for(var Y=0;Y").append(q.items[Y]).attr("value",q.items[Y]).appendTo(s)}r.show()}else{r.hide()}}setTimeout(function(){s.trigger("refresh")},10)};var T=function(Z){F.html("");if(f.items.length==0){a("").attr("value","").append("Not available").appendTo(F)}else{a("").attr("value","").append("Select locations").appendTo(F);if(f.items.length>0){for(var Y=0;Y").append(f.items[Y]).attr("value",f.items[Y]).appendTo(F)}g.show()}else{g.hide()}}setTimeout(function(){F.trigger("refresh")},10)};o=true;X.html("");a("Loading documents...").appendTo(X);var N=function(Y,aa){if(!aa&&Y){X.html("");P.html("");if(Y.length>0){for(var ab=0;abNo documents found").appendTo(X)}V();S(Y);U(Y);T(Y);K();G();P.append(sprintf("A total of %1$s documents found.",Y.length));o=false;W.removeClass("error")}else{W.addClass("error").find("tablebody").html("")}};if(Q){mds.dataFactory.motor.getDocumentsByGroup(Q,function(Y,Z){N(Y,Z)})}else{if(R){mds.dataFactory.motor.getDocumentsByMotor(i.id,i.meps,i.InMepsAccToRules,i.SelectedMeps,"",function(Y,Z){N(Y,Z)})}else{if(J){var M=[{DocumentType:1,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/3b8461e277c6af32c1257b1a002efcab/$file/9AKK105651%20Cost_Of_Ownership_brochure_EN%2002_2013.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"Optimized cost of ownership - See all the hidden costs without paying any"},{DocumentType:1,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/96786057818e047bc12579e900695aaf/$file/Condition%20monitoring_LR.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"Condition monitoring solutions for motors and generators"},{DocumentType:1,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/c8a336ea92dfeb57c125784f003800c3/$file/ABB_brochure_LEAP_low%20res1.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"ABB Life Expectancy Analysis Program (ABB LEAP) for stator windings of high voltage motors and generators"},{DocumentType:1,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/ce344108c9bb9e0bc125784f0038016d/$file/ABB_FactFile%20LEAP_02_low%20res.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"Service note - ABB Life Expectancy Analysis Program (ABB LEAP), Standard level for stator winding on high voltage motors and generators"},{DocumentType:5,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/7e59261f44e9d1dbc125788b004bc0f8/$file/ABB_FactFile%20MACHsense-P2_HR.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"Service note - ABB MACHsense-P for monitoring the condition of motors"},{DocumentType:1,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/76a126a5c8e73e86c125791700438083/$file/ABB%20MACHsense-P_FAQs_upd.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"ABB MACHsense P - Frequently asked questions"},{DocumentType:5,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/a366924f79a144ffc12579c70062c281/$file/MACH_LR.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"Service note - ABB MACHsense-R, Remote condition monitoring service for motors and generators"},{DocumentType:1,FilePath:"http://www05.abb.com/global/scot/scot234.nsf/veritydisplay/6fd516a8d07fc440c12579cf00499a38/$file/FAQs.pdf",MountingArrangements:[],SizeAndPolesDefinitions:[],Title:"ABB MACHsense R - Frequently asked questions"}];N(M)}else{o=false;X.html("");P.html("Select a motor to find documents");W.removeClass("error")}}}};var E=function(J){var K=function(){if(J){J()}};mds.dataFactory.user.getDocumentSelectionList(function(L){if(L){for(var N=0;NSelect motor");for(var K=0;K0)?", "+mds.selectedMotors.items[K].ie:"";var P=mds.selectedMotors.items[K].motorType+", "+M+mds.selectedMotors.items[K].voltage+"V/"+mds.selectedMotors.items[K].frequency+"Hz"+L;N.append("")}if(!J){var O=!mds.isLowMsieBrowser();if(O){N.selectbox({zIndex:1000});n.selectbox({zIndex:999});w.selectbox({zIndex:999});e.selectbox({zIndex:899});s.selectbox({zIndex:899});F.selectbox({zIndex:899})}J=true}else{setTimeout(function(){N.trigger("refresh")},10)}});return this};var C=function(){b.slideDown(500);a("#documents .body .contents").height(319);a(".options",b).show();if(i){A(i.motorRange)}else{A()}};var D=function(){b.slideDown(500);a("#documents .body .contents").height(319);a(".options",b).show();if(i){A(null,i.id)}else{A()}};var B=function(){b.slideDown(500);var J=a(".options",b).height();var K=a("#documents .body .contents").height();a(".options",b).hide();a("#documents .body .contents").height(J+K+2);A(null,null,true)};a("li#generalDocuments a").click(function(J){J.preventDefault();C();a("li#motorDocuments").removeClass("selected");a("li#costOfOwnershipDocuments").removeClass("selected");a(this).parent().addClass("selected")});a("li#motorDocuments a").click(function(J){J.preventDefault();D();a("li#generalDocuments").removeClass("selected");a("li#costOfOwnershipDocuments").removeClass("selected");a(this).parent().addClass("selected")});a("li#costOfOwnershipDocuments a").click(function(J){J.preventDefault();B();a("li#motorDocuments").removeClass("selected");a("li#generalDocuments").removeClass("selected");a(this).parent().addClass("selected")});w.change(function(){G()});e.change(function(){G()});s.change(function(){G()});F.change(function(){G()});t.change(function(){var J=a(this).val();i=mds.selectedMotors.findById(J);if(i.id){a("li#motorDocuments a").trigger("click")}});return b.intialize()};a.fn.documentView.defaults={}})(jQuery);(function(a){a.fn.exportView=function(y){if(this.length>1){this.each(function(){a(this).exportView(y)});return this}var b=a(this);var z=a.extend({},a.fn.exportView.defaults,y);var i=a("#customerName",b);var D=a("#projectName",b);var k=a("#export .col3",b);var g=a("#export .col2",b);var u=a("#export .col1",b);var p=a("#completeExport",b);var q=a("#sendExportToEmail",b);var n=a(".emailStatus",b);var v=u.slidecontainer({visibleItems:7});var l=k.slidecontainer({visibleItems:7});var h=g.slidecontainer({visibleItems:6});var m=[];var w=function(J){J.preventDefault();a(this).toggleClass("deselected");if(a(this).closest(".exportCol").hasClass("col2")){var I=a(".item[elementid='motorSummary']",g).find("a.comparisonSummary");var H=r();if(H.length>1){I.removeClass("disabled")}else{I.addClass("disabled")}}};var A=function(){if(mds.selectedComparisons.items.length>1){var Z='
              '+mds.translate("Comparison summary")+"
              ";var X=h.addElement("motorSummary",Z);X.find(".itemSelection").click(w);f(X)}for(var Q=0;Q0)?", "+I.motor1.ie:"";var S=(I.motor2.ie&&I.motor2.ie.length>0)?", "+I.motor2.ie:"";var L=I.motor1.DolOrVsd&&(I.motor1.DolOrVsd==="DOL"||I.motor1.DolOrVsd==="VSD")?I.motor1.DolOrVsd:"";var M=I.motor2.DolOrVsd&&(I.motor2.DolOrVsd==="DOL"||I.motor2.DolOrVsd==="VSD")?I.motor2.DolOrVsd:"";var N=I.motor1.efficiency;var O=I.motor2.efficiency;var J=L;var K=M;if((L==="DOL"&&M==="VSD")||(L==="VSD"&&M==="DOL")){try{if(L==="DOL"){if(I.motor1.S100_T100){var Y=I.motor1.S100_T100;N=Y>0?Y.toFixed(1):Y;J="VSD¹";a("#MyComparisonDolToVsdInfo").show()}}else{if(M==="DOL"){if(I.motor2.S100_T100){var Y=I.motor2.S100_T100;O=Y>0?Y.toFixed(1):Y;K="VSD¹";a("#MyComparisonDolToVsdInfo").show()}}}}catch(P){console.log("Could not convert efficiency for DOL to S100_T100",P)}}var T=(J.length>0?J+" ":"")+' ('+L+") ";var U=(K.length>0?K+" ":"")+' ('+M+") ";var H='
              x '+(I.numberOfMotors?I.numberOfMotors:1)+"
              ";var V="
              "+I.motor1.motorType+R+" "+I.motor1.output+"kW / "+T+N+"%
              "+I.motor2.motorType+S+" "+I.motor2.output+"kW / "+U+O+"%
              ";V+=H;var W=h.addElement("motor"+Q,V);W.find(".itemSelection").click(w);c(W,I)}};function c(I,H){I.find("a").not(".itemSelection").bind("click",function(J){J.preventDefault();var K="?cn="+i.val()+"&pn="+D.val()+(_UNBRANDED?"&unbranded":"");mds.postForm("/documentation/singledocument.pdf"+K,a.toJSON({Comparison:[H]}),mds.isAppleDevice())})}function f(H){H.find("a").not(".itemSelection").bind("click",function(J){J.preventDefault();var K="?cn="+i.val()+"&pn="+D.val()+(_UNBRANDED?"&unbranded":"");var I=r();mds.postForm("/documentation/singledocument.pdf"+K,a.toJSON({Comparison:I,ComparisonSummary:1}),mds.isAppleDevice())})}function r(){var H=[];for(var I=0;I"+N.title+"");O.find(".itemSelection").click(w)}var H=mds.dataFactory.metadata.getUICulture();l.addElement(I.items[L].typeName,""+I.items[L].typeName+"s ("+I.items[L].documents.length+")","item-header")}};var C=function(){for(var H=0;H"+I.motorType+", "+I.ie+"
              "+I.output+"kW / "+I.voltage+"V / "+I.frequency+"Hz
              ");J.find(".itemSelection").click(w);d(J,I)}};function d(I,H){I.find("a").not(".itemSelection").bind("click",function(J){J.preventDefault();var K="?cn="+i.val()+"&pn="+D.val()+(_UNBRANDED?"&unbranded":"");mds.postForm("/documentation/singledocument.pdf"+K,a.toJSON({MotorItems:[{InternalId:H.id,Meps:H.meps,InMepsAccToRules:H.inMepsAccToRules,SelectedMeps:H.selectedMeps,SelectedMepsFromUI:a.fn.selectionView.selectionData.Meps,TypeProtection:H.TypeProtection}]}),mds.isAppleDevice())})}q.click(function(){E();a("#exportLoaderCover").show();a("#exportToEmail").show()});var F=function(M){var J=[];var K=[];var H=r();for(var L=0;L=5){a("#exportToEmail .emailInput").attr("disabled","disabled")}else{a("#exportToEmail .emailInput").removeAttr("disabled")}if(m.length>0){a("#exportToEmail .sendMailButton").show()}else{a("#exportToEmail .sendMailButton").hide()}var J=a("#recipientList");J.html("");var H='
              {0}
              ';for(var I=0;I0){var J=m.pop();if(J!==I){K.push(J)}}m=K;E()})};a("#exportToEmail .emailInput").keyup(function(H){if(H.keyCode===13){a("#exportToEmail a.addMailButton").trigger("click");return}if(G(a(this).val())){o()}else{j()}}).change(function(H){if(G(a(this).val())){o()}else{j()}});function G(H){var I=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return I.test(H)}a("#exportLoader a, #exportToEmail a.smallModalClose").click(function(H){H.preventDefault();a("#exportLoaderCover").hide();a("#exportLoader").hide();a("#exportToEmail").hide()});var t=function(I,H){return !a(".item[elementid='"+I+"']",H).find("a.itemSelection").hasClass("deselected")};b.intialize=function(){var H=false;a("#mExport").data("openEvent")(function(){if(!H){H=true}k.find(".slide").html("");u.find(".slide").html("");g.find(".slide").html("");a("#export").find(".more").children().hide();B();C();A()});return this};return b.intialize()};a.fn.exportView.defaults={}})(jQuery);(function(a){a.fn.selectbox=function(o){if(this.length>1){this.each(function(){a(this).selectbox(o)});return this}var b=a(this);var p=a.extend({},a.fn.selectbox.defaults,o);var c;var r=p.zIndex;var n=320;var l=false;var h="";var i=false;var k=function(){g();d();j();return this};var j=function(){b.hide();l=false};var g=function(){h=a("option:selected",b).text();if(h===""){a("option:first",b).text()}c=a("
              "+h+"
              ").css({"z-index":r});b.after(c);var t=a(".headElement",c);var s=a(".bodyElement",c);var u=parseFloat(b.width());if(u===null||isNaN(u)){return}if(u===0){u=parseFloat(b.css("width"))}t.css({width:u+"px",height:"26px"});s.css({position:"absolute",top:"26px","min-width":u+"px"});if(b.attr("body-width")){s.css({width:b.attr("body-width")+"px"})}t.children("div").css({overflow:"hidden",width:(u-21)+"px"});t.find("span").css({width:(u+200)+"px"});q()};var d=function(){a(".headElement",c).bind("click",function(){if(l){a(".bodyElement",c).hide()}else{a(".bodyElement").hide();if(!i){a(".bodyElement",c).show()}}l=!l});b.bind("refresh",function(){q()});b.bind("disable",function(){i=true;c.find(".headElement").addClass("disabled")});b.bind("enable",function(){i=false;c.find(".headElement").removeClass("disabled")})};var q=function(){var s=a(".bodyElement",c);var t=a("ul",c);t.html("");b.children("option").each(function(u){var v=a("
            • "+a(this).text()+"
            • ").data("sVal",a(this).val());if(a(this).attr("selected")){a(".headElement span",c).text(a(this).text());h=a(this).text();v.addClass("active")}t.append(v);v.bind("click",m)});if(s.height()+1>n||s.height()===0){t.css({"max-height":n,"overflow-y":"scroll"})}else{t.css({height:"auto"})}};var m=function(){var s=a(this);if(h!==s.data("sVal")){a("li.active",c).removeClass("active");h=s.data("sVal");a(".headElement span",c).text(s.text());b.val(s.data("sVal")).change();s.addClass("active");setTimeout(function(){s.addClass("active")},200)}f()};var f=function(){a(".bodyElement",c).hide();l=false};var e=(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i))?"touchstart":"click";a("html").bind(e,function(s){if(l){var t=a(s.target);if(t.parents(".selectBox").size()==0&&!t.is(".selectBox")){f()}}});return k();a.fn.selectbox.defaults={zIndex:1000}}})(jQuery);ParallelAnimations=function(a,b){this.init(a,b)};$.extend(ParallelAnimations.prototype,{options:{duration:250},rules:{},init:function(a,d){$.extend(this.options,d);this.rules={};for(var c in a){this.rules[c]={element:a[c].element,changes:new Array(),callback:a[c].callback};for(var e in a[c].styles){var b=this.parse_style_value(a[c].element,e,"");var f=this.parse_style_value(a[c].element,e,a[c].styles[e]);this.rules[c].changes.push({from:b,to:f,style:e})}}this.start()},parse_style_value:function(a,e,c){var d=a.css(e);if(c.indexOf("px")!=-1){return{amount:c.substring(0,(c.length-2)),unit:"px"}}if(d=="auto"){return{amount:0,unit:"px"}}if(c.indexOf("%")!=-1){var b=c.substring(0,c.length-1)/100;return{amount:(d.substring(0,d.length-2)*b),unit:"px"}}if(!c){return{amount:d.substring(0,d.length-2),unit:"px"}}},start:function(){var c=this;var d=new Date().getTime();var a=(1/this.options.duration);var b=setInterval(function(){var e=new Date().getTime()-d;if(e0){i.css("height",i.height()+"px");g.push({element:i,styles:{height:"0px"},callback:function(){i.siblings().removeClass("selected")}})}});if(h.height()==0){g.push({element:h,styles:{height:h.data("height")+"px"},callback:function(){h.css("height","auto")}});h.siblings().addClass("selected")}if(g.length>0){new ParallelAnimations(g,{duration:f.duration})}};return this.each(function(i){var g=a(this);var j;var h=a(f.contentSelector,g);h.data("height",h.height());if(i!==f.startOpenIndex){h.css({height:"0px"});h.show()}g.data("openEvent",function(k){j=k});a(f.activatorSelector,g).bind("click",function(){if(j){j()}d(a(f.contentSelector,g))})})}};a.fn.lvaccordion=function(c){if(b[c]){return b[c].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof c==="object"||!c){return b.init.apply(this,arguments)}else{a.error("Method "+c+" does not exist on jQuery.lvaccordion")}}}})(jQuery);(function(a){a.fn.slidecontainer=function(g){a.fn.slidecontainer.defaults={body:".body",nextButton:".more .next",prevButton:".more .prev",slideElement:".slide",itemBoxHeight:47,visibleItems:4,itemClass:"item"};if(this.length>1){this.each(function(){a(this).slidecontainer(g)});return this}var b=a(this);var h=a.extend({},a.fn.slidecontainer.defaults,g);var c=a(h.body,b);var f=a(h.nextButton,b);var i=a(h.prevButton,b);var k=a(h.slideElement,b);var e=h.itemBoxHeight;var l=h.visibleItems;var d=0;b.initialize=function(){this.clearList=function(){b.find(".item").remove();k.trigger("refresh");i.hide();f.hide()};return this};b.bind("mousewheel",function(o,m){o.preventDefault();var n=m>0?"up":"down";if(n==="up"){i.trigger("click")}else{f.trigger("click")}});f.bind("click",function(m){m.preventDefault();var n=a("."+h.itemClass,c).size();if(d0){i.css({display:"block"})}});i.bind("click",function(m){m.preventDefault();var n=a("."+h.itemClass,c).size();if(d>0){j("up",1);d--}if(d===0){a(this).hide()}if(d");if(a("."+h.itemClass+"[elementId='"+n+"']",c).size()===0){p.addClass(h.itemClass);if(o){p.addClass(o)}p.css({display:"none"}).attr("elementId",n).html(m).prependTo(k).slideDown()}if(a("."+h.itemClass,c).size()>l){f.css({display:"block"})}else{f.hide();i.hide()}return p};return b.initialize()}})(jQuery);(function(a){a.fn.tooltip=function(f){if(this.length>1){this.each(function(){a(this).tooltip(f)});return this}var h=this;var b=a(this);var g=a.extend({},a.fn.commondialog.defaults,f);var e=false;b.intialize=function(){b.hide();b.parent().css({position:"relative",cursor:"pointer"});return this};var d=function(){b.hide();e=false};if(b.is(".show-on-hover")){b.prev().bind("mouseover",function(i){a("html").trigger("click");i.preventDefault();i.stopPropagation();b.show();h.isOpen=true});b.prev().bind("mouseleave",function(i){d()});b.bind("mouseleave",function(i){d()})}else{b.prev().bind("click",function(i){a("html").trigger("click");i.preventDefault();i.stopPropagation();if(h.isOpen){b.hide();h.isOpen=false}else{b.show();h.isOpen=true}})}var c=(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i))?"touchstart":"click";a("html").bind("click",function(i){d()});return b.intialize()};a.fn.tooltip.defaults={onClose:function(){}}})(jQuery);