/*
 * jQuery JavaScript Library v1.8.0
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2012 jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: Thu Aug 09 2012 16:24:48 GMT-0400 (Eastern Daylight Time)
 */
(function(a3,aC){var y,ag,q=a3.document,aJ=a3.location,f=a3.navigator,bh=a3.jQuery,J=a3.$,an=Array.prototype.push,a5=Array.prototype.slice,aL=Array.prototype.indexOf,B=Object.prototype.toString,W=Object.prototype.hasOwnProperty,aO=String.prototype.trim,bH=function(e,b0){return new bH.fn.init(e,b0,y)},by=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,ab=/\S/,aW=/\s+/,E=ab.test("\xA0")?(/^[\s\xA0]+|[\s\xA0]+$/g):/^\s+|\s+$/g,bp=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,a=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,bg=/^[\],:{}\s]*$/,bj=/(?:^|:|,)(?:\s*\[)+/g,bE=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,a1=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,bQ=/^-ms-/,aV=/-([\da-z])/gi,O=function(e,b0){return(b0+"").toUpperCase()},aG=function(){if(q.addEventListener){q.removeEventListener("DOMContentLoaded",aG,false);bH.ready()}else{if(q.readyState==="complete"){q.detachEvent("onreadystatechange",aG);bH.ready()}}},aa={};bH.fn=bH.prototype={constructor:bH,init:function(e,b3,b2){var b1,b4,b0,b5;if(!e){return this}if(e.nodeType){this.context=this[0]=e;this.length=1;return this}if(typeof e==="string"){if(e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3){b1=[null,e,null]}else{b1=bp.exec(e)}if(b1&&(b1[1]||!b3)){if(b1[1]){b3=b3 instanceof bH?b3[0]:b3;b5=(b3&&b3.nodeType?b3.ownerDocument||b3:q);e=bH.parseHTML(b1[1],b5,true);if(a.test(b1[1])&&bH.isPlainObject(b3)){this.attr.call(e,b3,true)}return bH.merge(this,e)}else{b4=q.getElementById(b1[2]);if(b4&&b4.parentNode){if(b4.id!==b1[2]){return b2.find(e)}this.length=1;this[0]=b4}this.context=q;this.selector=e;return this}}else{if(!b3||b3.jquery){return(b3||b2).find(e)}else{return this.constructor(b3).find(e)}}}else{if(bH.isFunction(e)){return b2.ready(e)}}if(e.selector!==aC){this.selector=e.selector;this.context=e.context}return bH.makeArray(e,this)},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return a5.call(this)},get:function(e){return e==null?this.toArray():(e<0?this[this.length+e]:this[e])},pushStack:function(b0,b2,e){var b1=bH.merge(this.constructor(),b0);b1.prevObject=this;b1.context=this.context;if(b2==="find"){b1.selector=this.selector+(this.selector?" ":"")+e}else{if(b2){b1.selector=this.selector+"."+b2+"("+e+")"}}return b1},each:function(b0,e){return bH.each(this,b0,e)},ready:function(e){bH.ready.promise().done(e);return this},eq:function(e){e=+e;return e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(a5.apply(this,arguments),"slice",a5.call(arguments).join(","))},map:function(e){return this.pushStack(bH.map(this,function(b1,b0){return e.call(b1,b0,b1)}))},end:function(){return this.prevObject||this.constructor(null)},push:an,sort:[].sort,splice:[].splice};bH.fn.init.prototype=bH.fn;bH.extend=bH.fn.extend=function(){var b8,b1,e,b0,b5,b6,b4=arguments[0]||{},b3=1,b2=arguments.length,b7=false;if(typeof b4==="boolean"){b7=b4;b4=arguments[1]||{};b3=2}if(typeof b4!=="object"&&!bH.isFunction(b4)){b4={}}if(b2===b3){b4=this;--b3}for(;b3<b2;b3++){if((b8=arguments[b3])!=null){for(b1 in b8){e=b4[b1];b0=b8[b1];if(b4===b0){continue}if(b7&&b0&&(bH.isPlainObject(b0)||(b5=bH.isArray(b0)))){if(b5){b5=false;b6=e&&bH.isArray(e)?e:[]}else{b6=e&&bH.isPlainObject(e)?e:{}}b4[b1]=bH.extend(b7,b6,b0)}else{if(b0!==aC){b4[b1]=b0}}}}}return b4};bH.extend({noConflict:function(e){if(a3.$===bH){a3.$=J}if(e&&a3.jQuery===bH){a3.jQuery=bh}return bH},isReady:false,readyWait:1,holdReady:function(e){if(e){bH.readyWait++}else{bH.ready(true)}},ready:function(e){if(e===true?--bH.readyWait:bH.isReady){return}if(!q.body){return setTimeout(bH.ready,1)}bH.isReady=true;if(e!==true&&--bH.readyWait>0){return}ag.resolveWith(q,[bH]);if(bH.fn.trigger){bH(q).trigger("ready").off("ready")}},isFunction:function(e){return bH.type(e)==="function"},isArray:Array.isArray||function(e){return bH.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return !isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):aa[B.call(e)]||"object"},isPlainObject:function(b2){if(!b2||bH.type(b2)!=="object"||b2.nodeType||bH.isWindow(b2)){return false}try{if(b2.constructor&&!W.call(b2,"constructor")&&!W.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===aC||W.call(b2,b0)},isEmptyObject:function(b0){var e;for(e in b0){return false}return true},error:function(e){throw new Error(e)},parseHTML:function(b2,b1,e){var b0;if(!b2||typeof b2!=="string"){return null}if(typeof b1==="boolean"){e=b1;b1=0}b1=b1||q;if((b0=a.exec(b2))){return[b1.createElement(b0[1])]}b0=bH.buildFragment([b2],b1,e?null:[]);return bH.merge([],(b0.cacheable?bH.clone(b0.fragment):b0.fragment).childNodes)},parseJSON:function(e){if(!e||typeof e!=="string"){return null}e=bH.trim(e);if(a3.JSON&&a3.JSON.parse){return a3.JSON.parse(e)}if(bg.test(e.replace(bE,"@").replace(a1,"]").replace(bj,""))){return(new Function("return "+e))()}bH.error("Invalid JSON: "+e)},parseXML:function(b2){var b0,b1;if(!b2||typeof b2!=="string"){return null}try{if(a3.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=aC}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bH.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(e){if(e&&ab.test(e)){(a3.execScript||function(b0){a3["eval"].call(a3,b0)})(e)}},camelCase:function(e){return e.replace(bQ,"ms-").replace(aV,O)},nodeName:function(b0,e){return b0.nodeName&&b0.nodeName.toUpperCase()===e.toUpperCase()},each:function(b4,b5,b1){var b0,b2=0,b3=b4.length,e=b3===aC||bH.isFunction(b4);if(b1){if(e){for(b0 in b4){if(b5.apply(b4[b0],b1)===false){break}}}else{for(;b2<b3;){if(b5.apply(b4[b2++],b1)===false){break}}}}else{if(e){for(b0 in b4){if(b5.call(b4[b0],b0,b4[b0])===false){break}}}else{for(;b2<b3;){if(b5.call(b4[b2],b2,b4[b2++])===false){break}}}}return b4},trim:aO?function(e){return e==null?"":aO.call(e)}:function(e){return e==null?"":e.toString().replace(E,"")},makeArray:function(e,b1){var b2,b0=b1||[];if(e!=null){b2=bH.type(e);if(e.length==null||b2==="string"||b2==="function"||b2==="regexp"||bH.isWindow(e)){an.call(b0,e)}else{bH.merge(b0,e)}}return b0},inArray:function(b2,b0,b1){var e;if(b0){if(aL){return aL.call(b0,b2,b1)}e=b0.length;b1=b1?b1<0?Math.max(0,e+b1):b1:0;for(;b1<e;b1++){if(b1 in b0&&b0[b1]===b2){return b1}}}return -1},merge:function(b3,b1){var e=b1.length,b2=b3.length,b0=0;if(typeof e==="number"){for(;b0<e;b0++){b3[b2++]=b1[b0]}}else{while(b1[b0]!==aC){b3[b2++]=b1[b0++]}}b3.length=b2;return b3},grep:function(b0,b5,e){var b4,b1=[],b2=0,b3=b0.length;e=!!e;for(;b2<b3;b2++){b4=!!b5(b0[b2],b2);if(e!==b4){b1.push(b0[b2])}}return b1},map:function(e,b6,b7){var b4,b5,b3=[],b1=0,b0=e.length,b2=e instanceof bH||b0!==aC&&typeof b0==="number"&&((b0>0&&e[0]&&e[b0-1])||b0===0||bH.isArray(e));if(b2){for(;b1<b0;b1++){b4=b6(e[b1],b1,b7);if(b4!=null){b3[b3.length]=b4}}}else{for(b5 in e){b4=b6(e[b5],b5,b7);if(b4!=null){b3[b3.length]=b4}}}return b3.concat.apply([],b3)},guid:1,proxy:function(b3,b2){var b1,e,b0;if(typeof b2==="string"){b1=b3[b2];b2=b3;b3=b1}if(!bH.isFunction(b3)){return aC}e=a5.call(arguments,2);b0=function(){return b3.apply(b2,e.concat(a5.call(arguments)))};b0.guid=b3.guid=b3.guid||b0.guid||bH.guid++;return b0},access:function(e,b5,b8,b6,b3,b9,b7){var b1,b4=b8==null,b2=0,b0=e.length;if(b8&&typeof b8==="object"){for(b2 in b8){bH.access(e,b5,b2,b8[b2],1,b9,b6)}b3=1}else{if(b6!==aC){b1=b7===aC&&bH.isFunction(b6);if(b4){if(b1){b1=b5;b5=function(cb,ca,cc){return b1.call(bH(cb),cc)}}else{b5.call(e,b6);b5=null}}if(b5){for(;b2<b0;b2++){b5(e[b2],b8,b1?b6.call(e[b2],b2,b5(e[b2],b8)):b6,b7)}}b3=1}}return b3?e:b4?b5.call(e):b0?b5(e[0],b8):b9},now:function(){return(new Date()).getTime()}});bH.ready.promise=function(b3){if(!ag){ag=bH.Deferred();if(q.readyState==="complete"||(q.readyState!=="loading"&&q.addEventListener)){setTimeout(bH.ready,1)}else{if(q.addEventListener){q.addEventListener("DOMContentLoaded",aG,false);a3.addEventListener("load",bH.ready,false)}else{q.attachEvent("onreadystatechange",aG);a3.attachEvent("onload",bH.ready);var b2=false;try{b2=a3.frameElement==null&&q.documentElement}catch(b1){}if(b2&&b2.doScroll){(function b0(){if(!bH.isReady){try{b2.doScroll("left")}catch(b4){return setTimeout(b0,50)}bH.ready()}})()}}}}return ag.promise(b3)};bH.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(b0,e){aa["[object "+e+"]"]=e.toLowerCase()});y=bH(q);var bV={};function ad(b0){var e=bV[b0]={};bH.each(b0.split(aW),function(b2,b1){e[b1]=true});return e}bH.Callbacks=function(b9){b9=typeof b9==="string"?(bV[b9]||ad(b9)):bH.extend({},b9);var b2,e,b3,b1,b4,b5,b6=[],b7=!b9.once&&[],b0=function(ca){b2=b9.memory&&ca;e=true;b5=b1||0;b1=0;b4=b6.length;b3=true;for(;b6&&b5<b4;b5++){if(b6[b5].apply(ca[0],ca[1])===false&&b9.stopOnFalse){b2=false;break}}b3=false;if(b6){if(b7){if(b7.length){b0(b7.shift())}}else{if(b2){b6=[]}else{b8.disable()}}}},b8={add:function(){if(b6){var cb=b6.length;(function ca(cc){bH.each(cc,function(ce,cd){if(bH.isFunction(cd)&&(!b9.unique||!b8.has(cd))){b6.push(cd)}else{if(cd&&cd.length){ca(cd)}}})})(arguments);if(b3){b4=b6.length}else{if(b2){b1=cb;b0(b2)}}}return this},remove:function(){if(b6){bH.each(arguments,function(cc,ca){var cb;while((cb=bH.inArray(ca,b6,cb))>-1){b6.splice(cb,1);if(b3){if(cb<=b4){b4--}if(cb<=b5){b5--}}}})}return this},has:function(ca){return bH.inArray(ca,b6)>-1},empty:function(){b6=[];return this},disable:function(){b6=b7=b2=aC;return this},disabled:function(){return !b6},lock:function(){b7=aC;if(!b2){b8.disable()}return this},locked:function(){return !b7},fireWith:function(cb,ca){ca=ca||[];ca=[cb,ca.slice?ca.slice():ca];if(b6&&(!e||b7)){if(b3){b7.push(ca)}else{b0(ca)}}return this},fire:function(){b8.fireWith(this,arguments);return this},fired:function(){return !!e}};return b8};bH.extend({Deferred:function(b1){var b0=[["resolve","done",bH.Callbacks("once memory"),"resolved"],["reject","fail",bH.Callbacks("once memory"),"rejected"],["notify","progress",bH.Callbacks("memory")]],b2="pending",b3={state:function(){return b2},always:function(){e.done(arguments).fail(arguments);return this},then:function(){var b4=arguments;return bH.Deferred(function(b5){bH.each(b0,function(b7,b6){var b9=b6[0],b8=b4[b7];e[b6[1]](bH.isFunction(b8)?function(){var ca=b8.apply(this,arguments);if(ca&&bH.isFunction(ca.promise)){ca.promise().done(b5.resolve).fail(b5.reject).progress(b5.notify)}else{b5[b9+"With"](this===e?b5:this,[ca])}}:b5[b9])});b4=null}).promise()},promise:function(b4){return typeof b4==="object"?bH.extend(b4,b3):b3}},e={};b3.pipe=b3.then;bH.each(b0,function(b5,b4){var b7=b4[2],b6=b4[3];b3[b4[1]]=b7.add;if(b6){b7.add(function(){b2=b6},b0[b5^1][2].disable,b0[2][2].lock)}e[b4[0]]=b7.fire;e[b4[0]+"With"]=b7.fireWith});b3.promise(e);if(b1){b1.call(e,e)}return e},when:function(b3){var b1=0,b5=a5.call(arguments),e=b5.length,b0=e!==1||(b3&&bH.isFunction(b3.promise))?e:0,b8=b0===1?b3:bH.Deferred(),b2=function(ca,cb,b9){return function(cc){cb[ca]=this;b9[ca]=arguments.length>1?a5.call(arguments):cc;if(b9===b7){b8.notifyWith(cb,b9)}else{if(!(--b0)){b8.resolveWith(cb,b9)}}}},b7,b4,b6;if(e>1){b7=new Array(e);b4=new Array(e);b6=new Array(e);for(;b1<e;b1++){if(b5[b1]&&bH.isFunction(b5[b1].promise)){b5[b1].promise().done(b2(b1,b6,b5)).fail(b8.reject).progress(b2(b1,b4,b7))}else{--b0}}}if(!b0){b8.resolveWith(b6,b5)}return b8.promise()}});bH.support=(function(){var cc,cb,b9,ca,b3,b8,b7,b5,b4,b2,b0,b1=q.createElement("div");b1.setAttribute("className","t");b1.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";cb=b1.getElementsByTagName("*");b9=b1.getElementsByTagName("a")[0];b9.style.cssText="top:1px;float:left;opacity:.5";if(!cb||!cb.length||!b9){return{}}ca=q.createElement("select");b3=ca.appendChild(q.createElement("option"));b8=b1.getElementsByTagName("input")[0];cc={leadingWhitespace:(b1.firstChild.nodeType===3),tbody:!b1.getElementsByTagName("tbody").length,htmlSerialize:!!b1.getElementsByTagName("link").length,style:/top/.test(b9.getAttribute("style")),hrefNormalized:(b9.getAttribute("href")==="/a"),opacity:/^0.5/.test(b9.style.opacity),cssFloat:!!b9.style.cssFloat,checkOn:(b8.value==="on"),optSelected:b3.selected,getSetAttribute:b1.className!=="t",enctype:!!q.createElement("form").enctype,html5Clone:q.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",boxModel:(q.compatMode==="CSS1Compat"),submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true,boxSizingReliable:true,pixelPosition:false};b8.checked=true;cc.noCloneChecked=b8.cloneNode(true).checked;ca.disabled=true;cc.optDisabled=!b3.disabled;try{delete b1.test}catch(b6){cc.deleteExpando=false}if(!b1.addEventListener&&b1.attachEvent&&b1.fireEvent){b1.attachEvent("onclick",b0=function(){cc.noCloneEvent=false});b1.cloneNode(true).fireEvent("onclick");b1.detachEvent("onclick",b0)}b8=q.createElement("input");b8.value="t";b8.setAttribute("type","radio");cc.radioValue=b8.value==="t";b8.setAttribute("checked","checked");b8.setAttribute("name","t");b1.appendChild(b8);b7=q.createDocumentFragment();b7.appendChild(b1.lastChild);cc.checkClone=b7.cloneNode(true).cloneNode(true).lastChild.checked;cc.appendChecked=b8.checked;b7.removeChild(b8);b7.appendChild(b1);if(b1.attachEvent){for(b4 in {submit:true,change:true,focusin:true}){b5="on"+b4;b2=(b5 in b1);if(!b2){b1.setAttribute(b5,"return;");b2=(typeof b1[b5]==="function")}cc[b4+"Bubbles"]=b2}}bH(function(){var cd,ch,cf,cg,ce="padding:0;margin:0;border:0;display:block;overflow:hidden;",e=q.getElementsByTagName("body")[0];if(!e){return}cd=q.createElement("div");cd.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";e.insertBefore(cd,e.firstChild);ch=q.createElement("div");cd.appendChild(ch);ch.innerHTML="<table><tr><td></td><td>t</td></tr></table>";cf=ch.getElementsByTagName("td");cf[0].style.cssText="padding:0;margin:0;border:0;display:none";b2=(cf[0].offsetHeight===0);cf[0].style.display="";cf[1].style.display="none";cc.reliableHiddenOffsets=b2&&(cf[0].offsetHeight===0);ch.innerHTML="";ch.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";cc.boxSizing=(ch.offsetWidth===4);cc.doesNotIncludeMarginInBodyOffset=(e.offsetTop!==1);if(a3.getComputedStyle){cc.pixelPosition=(a3.getComputedStyle(ch,null)||{}).top!=="1%";cc.boxSizingReliable=(a3.getComputedStyle(ch,null)||{width:"4px"}).width==="4px";cg=q.createElement("div");cg.style.cssText=ch.style.cssText=ce;cg.style.marginRight=cg.style.width="0";ch.style.width="1px";ch.appendChild(cg);cc.reliableMarginRight=!parseFloat((a3.getComputedStyle(cg,null)||{}).marginRight)}if(typeof ch.style.zoom!=="undefined"){ch.innerHTML="";ch.style.cssText=ce+"width:1px;padding:1px;display:inline;zoom:1";cc.inlineBlockNeedsLayout=(ch.offsetWidth===3);ch.style.display="block";ch.style.overflow="visible";ch.innerHTML="<div></div>";ch.firstChild.style.width="5px";cc.shrinkWrapBlocks=(ch.offsetWidth!==3);cd.style.zoom=1}e.removeChild(cd);cd=ch=cf=cg=null});b7.removeChild(b1);cb=b9=ca=b3=b8=b7=b1=null;return cc})();var bu=/^(?:\{.*\}|\[.*\])$/,aM=/([A-Z])/g;bH.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(bH.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?bH.cache[e[bH.expando]]:e[bH.expando];return !!e&&!P(e)},data:function(b2,b0,b4,b3){if(!bH.acceptData(b2)){return}var b5,b7,b8=bH.expando,b6=typeof b0==="string",b9=b2.nodeType,e=b9?bH.cache:b2,b1=b9?b2[b8]:b2[b8]&&b8;if((!b1||!e[b1]||(!b3&&!e[b1].data))&&b6&&b4===aC){return}if(!b1){if(b9){b2[b8]=b1=bH.deletedIds.pop()||++bH.uuid}else{b1=b8}}if(!e[b1]){e[b1]={};if(!b9){e[b1].toJSON=bH.noop}}if(typeof b0==="object"||typeof b0==="function"){if(b3){e[b1]=bH.extend(e[b1],b0)}else{e[b1].data=bH.extend(e[b1].data,b0)}}b5=e[b1];if(!b3){if(!b5.data){b5.data={}}b5=b5.data}if(b4!==aC){b5[bH.camelCase(b0)]=b4}if(b6){b7=b5[b0];if(b7==null){b7=b5[bH.camelCase(b0)]}}else{b7=b5}return b7},removeData:function(b2,b0,b3){if(!bH.acceptData(b2)){return}var b6,b5,b4,b7=b2.nodeType,e=b7?bH.cache:b2,b1=b7?b2[bH.expando]:bH.expando;if(!e[b1]){return}if(b0){b6=b3?e[b1]:e[b1].data;if(b6){if(!bH.isArray(b0)){if(b0 in b6){b0=[b0]}else{b0=bH.camelCase(b0);if(b0 in b6){b0=[b0]}else{b0=b0.split(" ")}}}for(b5=0,b4=b0.length;b5<b4;b5++){delete b6[b0[b5]]}if(!(b3?P:bH.isEmptyObject)(b6)){return}}}if(!b3){delete e[b1].data;if(!P(e[b1])){return}}if(b7){bH.cleanData([b2],true)}else{if(bH.support.deleteExpando||e!=e.window){delete e[b1]}else{e[b1]=null}}},_data:function(b0,e,b1){return bH.data(b0,e,b1,true)},acceptData:function(b0){var e=b0.nodeName&&bH.noData[b0.nodeName.toLowerCase()];return !e||e!==true&&b0.getAttribute("classid")===e}});bH.fn.extend({data:function(b8,b7){var b3,b0,b6,e,b2,b1=this[0],b5=0,b4=null;if(b8===aC){if(this.length){b4=bH.data(b1);if(b1.nodeType===1&&!bH._data(b1,"parsedAttrs")){b6=b1.attributes;for(b2=b6.length;b5<b2;b5++){e=b6[b5].name;if(e.indexOf("data-")===0){e=bH.camelCase(e.substring(5));bw(b1,e,b4[e])}}bH._data(b1,"parsedAttrs",true)}}return b4}if(typeof b8==="object"){return this.each(function(){bH.data(this,b8)})}b3=b8.split(".",2);b3[1]=b3[1]?"."+b3[1]:"";b0=b3[1]+"!";return bH.access(this,function(b9){if(b9===aC){b4=this.triggerHandler("getData"+b0,[b3[0]]);if(b4===aC&&b1){b4=bH.data(b1,b8);b4=bw(b1,b8,b4)}return b4===aC&&b3[1]?this.data(b3[0]):b4}b3[1]=b9;this.each(function(){var ca=bH(this);ca.triggerHandler("setData"+b0,b3);bH.data(this,b8,b9);ca.triggerHandler("changeData"+b0,b3)})},null,b7,arguments.length>1,null,false)},removeData:function(e){return this.each(function(){bH.removeData(this,e)})}});function bw(b2,b1,b3){if(b3===aC&&b2.nodeType===1){var b0="data-"+b1.replace(aM,"-$1").toLowerCase();b3=b2.getAttribute(b0);if(typeof b3==="string"){try{b3=b3==="true"?true:b3==="false"?false:b3==="null"?null:+b3+""===b3?+b3:bu.test(b3)?bH.parseJSON(b3):b3}catch(b4){}bH.data(b2,b1,b3)}else{b3=aC}}return b3}function P(b0){var e;for(e in b0){if(e==="data"&&bH.isEmptyObject(b0[e])){continue}if(e!=="toJSON"){return false}}return true}bH.extend({queue:function(b1,b0,b2){var e;if(b1){b0=(b0||"fx")+"queue";e=bH._data(b1,b0);if(b2){if(!e||bH.isArray(b2)){e=bH._data(b1,b0,bH.makeArray(b2))}else{e.push(b2)}}return e||[]}},dequeue:function(b4,b3){b3=b3||"fx";var b0=bH.queue(b4,b3),b2=b0.shift(),e=bH._queueHooks(b4,b3),b1=function(){bH.dequeue(b4,b3)};if(b2==="inprogress"){b2=b0.shift()}if(b2){if(b3==="fx"){b0.unshift("inprogress")}delete e.stop;b2.call(b4,b1,e)}if(!b0.length&&e){e.empty.fire()}},_queueHooks:function(b1,b0){var e=b0+"queueHooks";return bH._data(b1,e)||bH._data(b1,e,{empty:bH.Callbacks("once memory").add(function(){bH.removeData(b1,b0+"queue",true);bH.removeData(b1,e,true)})})}});bH.fn.extend({queue:function(e,b0){var b1=2;if(typeof e!=="string"){b0=e;e="fx";b1--}if(arguments.length<b1){return bH.queue(this[0],e)}return b0===aC?this:this.each(function(){var b2=bH.queue(this,e,b0);bH._queueHooks(this,e);if(e==="fx"&&b2[0]!=="inprogress"){bH.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){bH.dequeue(this,e)})},delay:function(b0,e){b0=bH.fx?bH.fx.speeds[b0]||b0:b0;e=e||"fx";return this.queue(e,function(b2,b1){var b3=setTimeout(b2,b0);b1.stop=function(){clearTimeout(b3)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(b1,b5){var b0,b2=1,b6=bH.Deferred(),b4=this,e=this.length,b3=function(){if(!(--b2)){b6.resolveWith(b4,[b4])}};if(typeof b1!=="string"){b5=b1;b1=aC}b1=b1||"fx";while(e--){if((b0=bH._data(b4[e],b1+"queueHooks"))&&b0.empty){b2++;b0.empty.add(b3)}}b3();return b6.promise(b5)}});var a8,bW,p,bK=/[\t\r\n]/g,aj=/\r/g,l=/^(?:button|input)$/i,aB=/^(?:button|input|object|select|textarea)$/i,F=/^a(?:rea|)$/i,N=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,bM=bH.support.getSetAttribute;bH.fn.extend({attr:function(e,b0){return bH.access(this,bH.attr,e,b0,arguments.length>1)},removeAttr:function(e){return this.each(function(){bH.removeAttr(this,e)})},prop:function(e,b0){return bH.access(this,bH.prop,e,b0,arguments.length>1)},removeProp:function(e){e=bH.propFix[e]||e;return this.each(function(){try{this[e]=aC;delete this[e]}catch(b0){}})},addClass:function(b3){var b5,b1,b0,b2,b4,b6,e;if(bH.isFunction(b3)){return this.each(function(b7){bH(this).addClass(b3.call(this,b7,this.className))})}if(b3&&typeof b3==="string"){b5=b3.split(aW);for(b1=0,b0=this.length;b1<b0;b1++){b2=this[b1];if(b2.nodeType===1){if(!b2.className&&b5.length===1){b2.className=b3}else{b4=" "+b2.className+" ";for(b6=0,e=b5.length;b6<e;b6++){if(!~b4.indexOf(" "+b5[b6]+" ")){b4+=b5[b6]+" "}}b2.className=bH.trim(b4)}}}}return this},removeClass:function(b5){var b2,b3,b4,b6,b0,b1,e;if(bH.isFunction(b5)){return this.each(function(b7){bH(this).removeClass(b5.call(this,b7,this.className))})}if((b5&&typeof b5==="string")||b5===aC){b2=(b5||"").split(aW);for(b1=0,e=this.length;b1<e;b1++){b4=this[b1];if(b4.nodeType===1&&b4.className){b3=(" "+b4.className+" ").replace(bK," ");for(b6=0,b0=b2.length;b6<b0;b6++){while(b3.indexOf(" "+b2[b6]+" ")>-1){b3=b3.replace(" "+b2[b6]+" "," ")}}b4.className=b5?bH.trim(b3):""}}}return this},toggleClass:function(b2,b0){var b1=typeof b2,e=typeof b0==="boolean";if(bH.isFunction(b2)){return this.each(function(b3){bH(this).toggleClass(b2.call(this,b3,this.className,b0),b0)})}return this.each(function(){if(b1==="string"){var b5,b4=0,b3=bH(this),b6=b0,b7=b2.split(aW);while((b5=b7[b4++])){b6=e?b6:!b3.hasClass(b5);b3[b6?"addClass":"removeClass"](b5)}}else{if(b1==="undefined"||b1==="boolean"){if(this.className){bH._data(this,"__className__",this.className)}this.className=this.className||b2===false?"":bH._data(this,"__className__")||""}}})},hasClass:function(e){var b2=" "+e+" ",b1=0,b0=this.length;for(;b1<b0;b1++){if(this[b1].nodeType===1&&(" "+this[b1].className+" ").replace(bK," ").indexOf(b2)>-1){return true}}return false},val:function(b2){var e,b0,b3,b1=this[0];if(!arguments.length){if(b1){e=bH.valHooks[b1.type]||bH.valHooks[b1.nodeName.toLowerCase()];if(e&&"get" in e&&(b0=e.get(b1,"value"))!==aC){return b0}b0=b1.value;return typeof b0==="string"?b0.replace(aj,""):b0==null?"":b0}return}b3=bH.isFunction(b2);return this.each(function(b5){var b6,b4=bH(this);if(this.nodeType!==1){return}if(b3){b6=b2.call(this,b5,b4.val())}else{b6=b2}if(b6==null){b6=""}else{if(typeof b6==="number"){b6+=""}else{if(bH.isArray(b6)){b6=bH.map(b6,function(b7){return b7==null?"":b7+""})}}}e=bH.valHooks[this.type]||bH.valHooks[this.nodeName.toLowerCase()];if(!e||!("set" in e)||e.set(this,b6,"value")===aC){this.value=b6}})}});bH.extend({valHooks:{option:{get:function(e){var b0=e.attributes.value;return !b0||b0.specified?e.value:e.text}},select:{get:function(e){var b5,b0,b4,b2,b3=e.selectedIndex,b6=[],b7=e.options,b1=e.type==="select-one";if(b3<0){return null}b0=b1?b3:0;b4=b1?b3+1:b7.length;for(;b0<b4;b0++){b2=b7[b0];if(b2.selected&&(bH.support.optDisabled?!b2.disabled:b2.getAttribute("disabled")===null)&&(!b2.parentNode.disabled||!bH.nodeName(b2.parentNode,"optgroup"))){b5=bH(b2).val();if(b1){return b5}b6.push(b5)}}if(b1&&!b6.length&&b7.length){return bH(b7[b3]).val()}return b6},set:function(b0,b1){var e=bH.makeArray(b1);bH(b0).find("option").each(function(){this.selected=bH.inArray(bH(this).val(),e)>=0});if(!e.length){b0.selectedIndex=-1}return e}}},attrFn:{},attr:function(b5,b2,b6,b4){var b1,e,b3,b0=b5.nodeType;if(!b5||b0===3||b0===8||b0===2){return}if(b4&&bH.isFunction(bH.fn[b2])){return bH(b5)[b2](b6)}if(typeof b5.getAttribute==="undefined"){return bH.prop(b5,b2,b6)}b3=b0!==1||!bH.isXMLDoc(b5);if(b3){b2=b2.toLowerCase();e=bH.attrHooks[b2]||(N.test(b2)?bW:a8)}if(b6!==aC){if(b6===null){bH.removeAttr(b5,b2);return}else{if(e&&"set" in e&&b3&&(b1=e.set(b5,b6,b2))!==aC){return b1}else{b5.setAttribute(b2,""+b6);return b6}}}else{if(e&&"get" in e&&b3&&(b1=e.get(b5,b2))!==null){return b1}else{b1=b5.getAttribute(b2);return b1===null?aC:b1}}},removeAttr:function(b2,b4){var b3,b5,b0,e,b1=0;if(b4&&b2.nodeType===1){b5=b4.split(aW);for(;b1<b5.length;b1++){b0=b5[b1];if(b0){b3=bH.propFix[b0]||b0;e=N.test(b0);if(!e){bH.attr(b2,b0,"")}b2.removeAttribute(bM?b0:b3);if(e&&b3 in b2){b2[b3]=false}}}}},attrHooks:{type:{set:function(e,b0){if(l.test(e.nodeName)&&e.parentNode){bH.error("type property can't be changed")}else{if(!bH.support.radioValue&&b0==="radio"&&bH.nodeName(e,"input")){var b1=e.value;e.setAttribute("type",b0);if(b1){e.value=b1}return b0}}}},value:{get:function(b0,e){if(a8&&bH.nodeName(b0,"button")){return a8.get(b0,e)}return e in b0?b0.value:null},set:function(b0,b1,e){if(a8&&bH.nodeName(b0,"button")){return a8.set(b0,b1,e)}b0.value=b1}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(b4,b2,b5){var b1,e,b3,b0=b4.nodeType;if(!b4||b0===3||b0===8||b0===2){return}b3=b0!==1||!bH.isXMLDoc(b4);if(b3){b2=bH.propFix[b2]||b2;e=bH.propHooks[b2]}if(b5!==aC){if(e&&"set" in e&&(b1=e.set(b4,b5,b2))!==aC){return b1}else{return(b4[b2]=b5)}}else{if(e&&"get" in e&&(b1=e.get(b4,b2))!==null){return b1}else{return b4[b2]}}},propHooks:{tabIndex:{get:function(b0){var e=b0.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):aB.test(b0.nodeName)||F.test(b0.nodeName)&&b0.href?0:aC}}}});bW={get:function(b0,e){var b2,b1=bH.prop(b0,e);return b1===true||typeof b1!=="boolean"&&(b2=b0.getAttributeNode(e))&&b2.nodeValue!==false?e.toLowerCase():aC},set:function(b0,b2,e){var b1;if(b2===false){bH.removeAttr(b0,e)}else{b1=bH.propFix[e]||e;if(b1 in b0){b0[b1]=true}b0.setAttribute(e,e.toLowerCase())}return e}};if(!bM){p={name:true,id:true,coords:true};a8=bH.valHooks.button={get:function(b1,b0){var e;e=b1.getAttributeNode(b0);return e&&(p[b0]?e.value!=="":e.specified)?e.value:aC},set:function(b1,b2,b0){var e=b1.getAttributeNode(b0);if(!e){e=q.createAttribute(b0);b1.setAttributeNode(e)}return(e.value=b2+"")}};bH.each(["width","height"],function(b0,e){bH.attrHooks[e]=bH.extend(bH.attrHooks[e],{set:function(b1,b2){if(b2===""){b1.setAttribute(e,"auto");return b2}}})});bH.attrHooks.contenteditable={get:a8.get,set:function(b0,b1,e){if(b1===""){b1="false"}a8.set(b0,b1,e)}}}if(!bH.support.hrefNormalized){bH.each(["href","src","width","height"],function(b0,e){bH.attrHooks[e]=bH.extend(bH.attrHooks[e],{get:function(b2){var b1=b2.getAttribute(e,2);return b1===null?aC:b1}})})}if(!bH.support.style){bH.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||aC},set:function(e,b0){return(e.style.cssText=""+b0)}}}if(!bH.support.optSelected){bH.propHooks.selected=bH.extend(bH.propHooks.selected,{get:function(b0){var e=b0.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null}})}if(!bH.support.enctype){bH.propFix.enctype="encoding"}if(!bH.support.checkOn){bH.each(["radio","checkbox"],function(){bH.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}})}bH.each(["radio","checkbox"],function(){bH.valHooks[this]=bH.extend(bH.valHooks[this],{set:function(e,b0){if(bH.isArray(b0)){return(e.checked=bH.inArray(bH(e).val(),b0)>=0)}}})});var bF=/^(?:textarea|input|select)$/i,bs=/^([^\.]*|)(?:\.(.+)|)$/,bb=/(?:^|\s)hover(\.\S+|)\b/,a4=/^key/,bL=/^(?:mouse|contextmenu)|click/,bz=/^(?:focusinfocus|focusoutblur)$/,ar=function(e){return bH.event.special.hover?e:e.replace(bb,"mouseenter$1 mouseleave$1")};bH.event={add:function(b2,b6,cd,b4,b3){var b7,b5,ce,cc,cb,b9,e,ca,b0,b1,b8;if(b2.nodeType===3||b2.nodeType===8||!b6||!cd||!(b7=bH._data(b2))){return}if(cd.handler){b0=cd;cd=b0.handler;b3=b0.selector}if(!cd.guid){cd.guid=bH.guid++}ce=b7.events;if(!ce){b7.events=ce={}}b5=b7.handle;if(!b5){b7.handle=b5=function(cf){return typeof bH!=="undefined"&&(!cf||bH.event.triggered!==cf.type)?bH.event.dispatch.apply(b5.elem,arguments):aC};b5.elem=b2}b6=bH.trim(ar(b6)).split(" ");for(cc=0;cc<b6.length;cc++){cb=bs.exec(b6[cc])||[];b9=cb[1];e=(cb[2]||"").split(".").sort();b8=bH.event.special[b9]||{};b9=(b3?b8.delegateType:b8.bindType)||b9;b8=bH.event.special[b9]||{};ca=bH.extend({type:b9,origType:cb[1],data:b4,handler:cd,guid:cd.guid,selector:b3,namespace:e.join(".")},b0);b1=ce[b9];if(!b1){b1=ce[b9]=[];b1.delegateCount=0;if(!b8.setup||b8.setup.call(b2,b4,e,b5)===false){if(b2.addEventListener){b2.addEventListener(b9,b5,false)}else{if(b2.attachEvent){b2.attachEvent("on"+b9,b5)}}}}if(b8.add){b8.add.call(b2,ca);if(!ca.handler.guid){ca.handler.guid=cd.guid}}if(b3){b1.splice(b1.delegateCount++,0,ca)}else{b1.push(ca)}bH.event.global[b9]=true}b2=null},global:{},remove:function(b2,b7,cd,b3,b6){var ce,cf,ca,b1,b0,b4,b5,cc,b9,e,cb,b8=bH.hasData(b2)&&bH._data(b2);if(!b8||!(cc=b8.events)){return}b7=bH.trim(ar(b7||"")).split(" ");for(ce=0;ce<b7.length;ce++){cf=bs.exec(b7[ce])||[];ca=b1=cf[1];b0=cf[2];if(!ca){for(ca in cc){bH.event.remove(b2,ca+b7[ce],cd,b3,true)}continue}b9=bH.event.special[ca]||{};ca=(b3?b9.delegateType:b9.bindType)||ca;e=cc[ca]||[];b4=e.length;b0=b0?new RegExp("(^|\\.)"+b0.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(b5=0;b5<e.length;b5++){cb=e[b5];if((b6||b1===cb.origType)&&(!cd||cd.guid===cb.guid)&&(!b0||b0.test(cb.namespace))&&(!b3||b3===cb.selector||b3==="**"&&cb.selector)){e.splice(b5--,1);if(cb.selector){e.delegateCount--}if(b9.remove){b9.remove.call(b2,cb)}}}if(e.length===0&&b4!==e.length){if(!b9.teardown||b9.teardown.call(b2,b0,b8.handle)===false){bH.removeEvent(b2,ca,b8.handle)}delete cc[ca]}}if(bH.isEmptyObject(cc)){delete b8.handle;bH.removeData(b2,"events",true)}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(b0,b7,b5,ce){if(b5&&(b5.nodeType===3||b5.nodeType===8)){return}var e,b2,b8,cc,b4,b3,ca,b9,b6,cd,cb=b0.type||b0,b1=[];if(bz.test(cb+bH.event.triggered)){return}if(cb.indexOf("!")>=0){cb=cb.slice(0,-1);b2=true}if(cb.indexOf(".")>=0){b1=cb.split(".");cb=b1.shift();b1.sort()}if((!b5||bH.event.customEvent[cb])&&!bH.event.global[cb]){return}b0=typeof b0==="object"?b0[bH.expando]?b0:new bH.Event(cb,b0):new bH.Event(cb);b0.type=cb;b0.isTrigger=true;b0.exclusive=b2;b0.namespace=b1.join(".");b0.namespace_re=b0.namespace?new RegExp("(^|\\.)"+b1.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;b3=cb.indexOf(":")<0?"on"+cb:"";if(!b5){e=bH.cache;for(b8 in e){if(e[b8].events&&e[b8].events[cb]){bH.event.trigger(b0,b7,e[b8].handle.elem,true)}}return}b0.result=aC;if(!b0.target){b0.target=b5}b7=b7!=null?bH.makeArray(b7):[];b7.unshift(b0);ca=bH.event.special[cb]||{};if(ca.trigger&&ca.trigger.apply(b5,b7)===false){return}b6=[[b5,ca.bindType||cb]];if(!ce&&!ca.noBubble&&!bH.isWindow(b5)){cd=ca.delegateType||cb;cc=bz.test(cd+cb)?b5:b5.parentNode;for(b4=b5;cc;cc=cc.parentNode){b6.push([cc,cd]);b4=cc}if(b4===(b5.ownerDocument||q)){b6.push([b4.defaultView||b4.parentWindow||a3,cd])}}for(b8=0;b8<b6.length&&!b0.isPropagationStopped();b8++){cc=b6[b8][0];b0.type=b6[b8][1];b9=(bH._data(cc,"events")||{})[b0.type]&&bH._data(cc,"handle");if(b9){b9.apply(cc,b7)}b9=b3&&cc[b3];if(b9&&bH.acceptData(cc)&&b9.apply(cc,b7)===false){b0.preventDefault()}}b0.type=cb;if(!ce&&!b0.isDefaultPrevented()){if((!ca._default||ca._default.apply(b5.ownerDocument,b7)===false)&&!(cb==="click"&&bH.nodeName(b5,"a"))&&bH.acceptData(b5)){if(b3&&b5[cb]&&((cb!=="focus"&&cb!=="blur")||b0.target.offsetWidth!==0)&&!bH.isWindow(b5)){b4=b5[b3];if(b4){b5[b3]=null}bH.event.triggered=cb;b5[cb]();bH.event.triggered=aC;if(b4){b5[b3]=b4}}}}return b0.result},dispatch:function(cc){cc=bH.event.fix(cc||a3.event);var ce,cb,b3,b5,cf,cd,b6,b1,e,ca,cg,b8=((bH._data(this,"events")||{})[cc.type]||[]),b7=b8.delegateCount,b2=[].slice.call(arguments),b9=!cc.exclusive&&!cc.namespace,b4=bH.event.special[cc.type]||{},b0=[];b2[0]=cc;cc.delegateTarget=this;if(b4.preDispatch&&b4.preDispatch.call(this,cc)===false){return}if(b7&&!(cc.button&&cc.type==="click")){b5=bH(this);b5.context=this;for(b3=cc.target;b3!=this;b3=b3.parentNode||this){if(b3.disabled!==true||cc.type!=="click"){cd={};b1=[];b5[0]=b3;for(ce=0;ce<b7;ce++){e=b8[ce];ca=e.selector;if(cd[ca]===aC){cd[ca]=b5.is(ca)}if(cd[ca]){b1.push(e)}}if(b1.length){b0.push({elem:b3,matches:b1})}}}}if(b8.length>b7){b0.push({elem:this,matches:b8.slice(b7)})}for(ce=0;ce<b0.length&&!cc.isPropagationStopped();ce++){b6=b0[ce];cc.currentTarget=b6.elem;for(cb=0;cb<b6.matches.length&&!cc.isImmediatePropagationStopped();cb++){e=b6.matches[cb];if(b9||(!cc.namespace&&!e.namespace)||cc.namespace_re&&cc.namespace_re.test(e.namespace)){cc.data=e.data;cc.handleObj=e;cf=((bH.event.special[e.origType]||{}).handle||e.handler).apply(b6.elem,b2);if(cf!==aC){cc.result=cf;if(cf===false){cc.preventDefault();cc.stopPropagation()}}}}}if(b4.postDispatch){b4.postDispatch.call(this,cc)}return cc.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(b0,e){if(b0.which==null){b0.which=e.charCode!=null?e.charCode:e.keyCode}return b0}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(b2,b1){var b3,b4,e,b0=b1.button,b5=b1.fromElement;if(b2.pageX==null&&b1.clientX!=null){b3=b2.target.ownerDocument||q;b4=b3.documentElement;e=b3.body;b2.pageX=b1.clientX+(b4&&b4.scrollLeft||e&&e.scrollLeft||0)-(b4&&b4.clientLeft||e&&e.clientLeft||0);b2.pageY=b1.clientY+(b4&&b4.scrollTop||e&&e.scrollTop||0)-(b4&&b4.clientTop||e&&e.clientTop||0)}if(!b2.relatedTarget&&b5){b2.relatedTarget=b5===b2.target?b1.toElement:b5}if(!b2.which&&b0!==aC){b2.which=(b0&1?1:(b0&2?3:(b0&4?2:0)))}return b2}},fix:function(b1){if(b1[bH.expando]){return b1}var b0,b4,e=b1,b2=bH.event.fixHooks[b1.type]||{},b3=b2.props?this.props.concat(b2.props):this.props;b1=bH.Event(e);for(b0=b3.length;b0;){b4=b3[--b0];b1[b4]=e[b4]}if(!b1.target){b1.target=e.srcElement||q}if(b1.target.nodeType===3){b1.target=b1.target.parentNode}b1.metaKey=!!b1.metaKey;return b2.filter?b2.filter(b1,e):b1},special:{ready:{setup:bH.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(b1,b0,e){if(bH.isWindow(this)){this.onbeforeunload=e}},teardown:function(b0,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}},simulate:function(b1,b3,b2,b0){var b4=bH.extend(new bH.Event(),b2,{type:b1,isSimulated:true,originalEvent:{}});if(b0){bH.event.trigger(b4,null,b3)}else{bH.event.dispatch.call(b3,b4)}if(b4.isDefaultPrevented()){b2.preventDefault()}}};bH.event.handle=bH.event.dispatch;bH.removeEvent=q.removeEventListener?function(b0,e,b1){if(b0.removeEventListener){b0.removeEventListener(e,b1,false)}}:function(b1,b0,b2){var e="on"+b0;if(b1.detachEvent){if(typeof b1[e]==="undefined"){b1[e]=null}b1.detachEvent(e,b2)}};bH.Event=function(b0,e){if(!(this instanceof bH.Event)){return new bH.Event(b0,e)}if(b0&&b0.type){this.originalEvent=b0;this.type=b0.type;this.isDefaultPrevented=(b0.defaultPrevented||b0.returnValue===false||b0.getPreventDefault&&b0.getPreventDefault())?S:Y}else{this.type=b0}if(e){bH.extend(this,e)}this.timeStamp=b0&&b0.timeStamp||bH.now();this[bH.expando]=true};function Y(){return false}function S(){return true}bH.Event.prototype={preventDefault:function(){this.isDefaultPrevented=S;var b0=this.originalEvent;if(!b0){return}if(b0.preventDefault){b0.preventDefault()}else{b0.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=S;var b0=this.originalEvent;if(!b0){return}if(b0.stopPropagation){b0.stopPropagation()}b0.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=S;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};bH.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(b0,e){bH.event.special[b0]={delegateType:e,bindType:e,handle:function(b4){var b2,b6=this,b5=b4.relatedTarget,b3=b4.handleObj,b1=b3.selector;if(!b5||(b5!==b6&&!bH.contains(b6,b5))){b4.type=b3.origType;b2=b3.handler.apply(this,arguments);b4.type=e}return b2}}});if(!bH.support.submitBubbles){bH.event.special.submit={setup:function(){if(bH.nodeName(this,"form")){return false}bH.event.add(this,"click._submit keypress._submit",function(b2){var b1=b2.target,b0=bH.nodeName(b1,"input")||bH.nodeName(b1,"button")?b1.form:aC;if(b0&&!bH._data(b0,"_submit_attached")){bH.event.add(b0,"submit._submit",function(e){e._submit_bubble=true});bH._data(b0,"_submit_attached",true)}})},postDispatch:function(e){if(e._submit_bubble){delete e._submit_bubble;if(this.parentNode&&!e.isTrigger){bH.event.simulate("submit",this.parentNode,e,true)}}},teardown:function(){if(bH.nodeName(this,"form")){return false}bH.event.remove(this,"._submit")}}}if(!bH.support.changeBubbles){bH.event.special.change={setup:function(){if(bF.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){bH.event.add(this,"propertychange._change",function(e){if(e.originalEvent.propertyName==="checked"){this._just_changed=true}});bH.event.add(this,"click._change",function(e){if(this._just_changed&&!e.isTrigger){this._just_changed=false}bH.event.simulate("change",this,e,true)})}return false}bH.event.add(this,"beforeactivate._change",function(b1){var b0=b1.target;if(bF.test(b0.nodeName)&&!bH._data(b0,"_change_attached")){bH.event.add(b0,"change._change",function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){bH.event.simulate("change",this.parentNode,e,true)}});bH._data(b0,"_change_attached",true)}})},handle:function(b0){var e=b0.target;if(this!==e||b0.isSimulated||b0.isTrigger||(e.type!=="radio"&&e.type!=="checkbox")){return b0.handleObj.handler.apply(this,arguments)}},teardown:function(){bH.event.remove(this,"._change");return bF.test(this.nodeName)}}}if(!bH.support.focusinBubbles){bH.each({focus:"focusin",blur:"focusout"},function(b2,e){var b0=0,b1=function(b3){bH.event.simulate(e,b3.target,bH.event.fix(b3),true)};bH.event.special[e]={setup:function(){if(b0++===0){q.addEventListener(b2,b1,true)}},teardown:function(){if(--b0===0){q.removeEventListener(b2,b1,true)}}}})}bH.fn.extend({on:function(b1,e,b4,b3,b0){var b5,b2;if(typeof b1==="object"){if(typeof e!=="string"){b4=b4||e;e=aC}for(b2 in b1){this.on(b2,e,b4,b1[b2],b0)}return this}if(b4==null&&b3==null){b3=e;b4=e=aC}else{if(b3==null){if(typeof e==="string"){b3=b4;b4=aC}else{b3=b4;b4=e;e=aC}}}if(b3===false){b3=Y}else{if(!b3){return this}}if(b0===1){b5=b3;b3=function(b6){bH().off(b6);return b5.apply(this,arguments)};b3.guid=b5.guid||(b5.guid=bH.guid++)}return this.each(function(){bH.event.add(this,b1,b3,b4,e)})},one:function(b0,e,b2,b1){return this.on(b0,e,b2,b1,1)},off:function(b1,e,b3){var b0,b2;if(b1&&b1.preventDefault&&b1.handleObj){b0=b1.handleObj;bH(b1.delegateTarget).off(b0.namespace?b0.origType+"."+b0.namespace:b0.origType,b0.selector,b0.handler);return this}if(typeof b1==="object"){for(b2 in b1){this.off(b2,e,b1[b2])}return this}if(e===false||typeof e==="function"){b3=e;e=aC}if(b3===false){b3=Y}return this.each(function(){bH.event.remove(this,b1,b3,e)})},bind:function(e,b1,b0){return this.on(e,null,b1,b0)},unbind:function(e,b0){return this.off(e,null,b0)},live:function(e,b1,b0){bH(this.context).on(e,this.selector,b1,b0);return this},die:function(e,b0){bH(this.context).off(e,this.selector||"**",b0);return this},delegate:function(e,b0,b2,b1){return this.on(b0,e,b2,b1)},undelegate:function(e,b0,b1){return arguments.length==1?this.off(e,"**"):this.off(b0,e||"**",b1)},trigger:function(e,b0){return this.each(function(){bH.event.trigger(e,b0,this)})},triggerHandler:function(e,b0){if(this[0]){return bH.event.trigger(e,b0,this[0],true)}},toggle:function(b2){var b0=arguments,e=b2.guid||bH.guid++,b1=0,b3=function(b4){var b5=(bH._data(this,"lastToggle"+b2.guid)||0)%b1;bH._data(this,"lastToggle"+b2.guid,b5+1);b4.preventDefault();return b0[b5].apply(this,arguments)||false};b3.guid=e;while(b1<b0.length){b0[b1++].guid=e}return this.click(b3)},hover:function(e,b0){return this.mouseenter(e).mouseleave(b0||e)}});bH.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu").split(" "),function(b0,e){bH.fn[e]=function(b2,b1){if(b1==null){b1=b2;b2=null}return arguments.length>0?this.on(e,null,b2,b1):this.trigger(e)};if(a4.test(e)){bH.event.fixHooks[e]=bH.event.keyHooks}if(bL.test(e)){bH.event.fixHooks[e]=bH.event.mouseHooks}});
/*
 * Sizzle CSS Selector Engine
 *  Copyright 2012 jQuery Foundation and other contributors
 *  Released under the MIT license
 *  http://sizzlejs.com/
 */
(function(cP,ch){var cU,cp,cg,b3,b9,b7=cP.document,ca=b7.documentElement,cx="undefined",cb=false,b8=true,cf=0,ck=[].slice,cT=[].push,cX=("sizcache"+Math.random()).replace(".",""),cA="[\\x20\\t\\r\\n\\f]",cj="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",ci=cj.replace("w","w#"),c2="([*^$|!~]?=)",cM="\\["+cA+"*("+cj+")"+cA+"*(?:"+c2+cA+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+ci+")|)|)"+cA+"*\\]",c3=":("+cj+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",cC=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",ce=cA+"*([\\x20\\t\\r\\n\\f>+~])"+cA+"*",cd="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+cM+"|"+c3.replace(2,7)+"|[^\\\\(),])+",cV=new RegExp("^"+cA+"+|((?:^|[^\\\\])(?:\\\\.)*)"+cA+"+$","g"),cG=new RegExp("^"+ce),cu=new RegExp(cd+"?(?="+cA+"*,|$)","g"),cK=new RegExp("^(?:(?!,)(?:(?:^|,)"+cA+"*"+cd+")*?|"+cA+"*(.*?))(\\)|$)"),c0=new RegExp(cd.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+ce,"g"),cL=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,cQ=/[\x20\t\r\n\f]*[+~]/,cY=/:not\($/,cq=/h\d/i,cN=/input|select|textarea|button/i,ct=/\\(?!\\)/g,cF={ID:new RegExp("^#("+cj+")"),CLASS:new RegExp("^\\.("+cj+")"),NAME:new RegExp("^\\[name=['\"]?("+cj+")['\"]?\\]"),TAG:new RegExp("^("+cj.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+cM),PSEUDO:new RegExp("^"+c3),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+cA+"*(even|odd|(([+-]|)(\\d*)n|)"+cA+"*(?:([+-]|)"+cA+"*(\\d+)|))"+cA+"*\\)|)","i"),POS:new RegExp(cC,"ig"),needsContext:new RegExp("^"+cA+"*[>+~]|"+cC,"i")},cS={},cr=[],cm={},cv=[],cZ=function(e){e.sizzleFilter=true;return e},b4=function(e){return function(c4){return c4.nodeName.toLowerCase()==="input"&&c4.type===e}},cs=function(e){return function(c5){var c4=c5.nodeName.toLowerCase();return(c4==="input"||c4==="button")&&c5.type===e}},cI=function(c4){var c5=false,c7=b7.createElement("div");try{c5=c4(c7)}catch(c6){}c7=null;return c5},co=cI(function(c4){c4.innerHTML="<select></select>";var e=typeof c4.lastChild.getAttribute("multiple");return e!=="boolean"&&e!=="string"}),b1=cI(function(c4){c4.id=cX+0;c4.innerHTML="<a name='"+cX+"'></a><div name='"+cX+"'></div>";ca.insertBefore(c4,ca.firstChild);var e=b7.getElementsByName&&b7.getElementsByName(cX).length===2+b7.getElementsByName(cX+0).length;b9=!b7.getElementById(cX);ca.removeChild(c4);return e}),b6=cI(function(e){e.appendChild(b7.createComment(""));return e.getElementsByTagName("*").length===0}),cE=cI(function(e){e.innerHTML="<a href='#'></a>";return e.firstChild&&typeof e.firstChild.getAttribute!==cx&&e.firstChild.getAttribute("href")==="#"}),cD=cI(function(e){e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return false}e.lastChild.className="e";return e.getElementsByClassName("e").length!==1});var cO=function(c6,e,c8,db){c8=c8||[];e=e||b7;var c9,c4,da,c5,c7=e.nodeType;if(c7!==1&&c7!==9){return[]}if(!c6||typeof c6!=="string"){return c8}da=cl(e);if(!da&&!db){if((c9=cL.exec(c6))){if((c5=c9[1])){if(c7===9){c4=e.getElementById(c5);if(c4&&c4.parentNode){if(c4.id===c5){c8.push(c4);return c8}}else{return c8}}else{if(e.ownerDocument&&(c4=e.ownerDocument.getElementById(c5))&&cB(e,c4)&&c4.id===c5){c8.push(c4);return c8}}}else{if(c9[2]){cT.apply(c8,ck.call(e.getElementsByTagName(c6),0));return c8}else{if((c5=c9[3])&&cD&&e.getElementsByClassName){cT.apply(c8,ck.call(e.getElementsByClassName(c5),0));return c8}}}}}return cW(c6,e,c8,db,da)};var cH=cO.selectors={cacheLength:50,match:cF,order:["ID","TAG"],attrHandle:{},createPseudo:cZ,find:{ID:b9?function(c6,c5,c4){if(typeof c5.getElementById!==cx&&!c4){var e=c5.getElementById(c6);return e&&e.parentNode?[e]:[]}}:function(c6,c5,c4){if(typeof c5.getElementById!==cx&&!c4){var e=c5.getElementById(c6);return e?e.id===c6||typeof e.getAttributeNode!==cx&&e.getAttributeNode("id").value===c6?[e]:ch:[]}},TAG:b6?function(e,c4){if(typeof c4.getElementsByTagName!==cx){return c4.getElementsByTagName(e)}}:function(e,c7){var c6=c7.getElementsByTagName(e);if(e==="*"){var c8,c5=[],c4=0;for(;(c8=c6[c4]);c4++){if(c8.nodeType===1){c5.push(c8)}}return c5}return c6}},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(ct,"");e[3]=(e[4]||e[5]||"").replace(ct,"");if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1]==="nth"){if(!e[2]){cO.error(e[0])}e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd"));e[4]=+((e[6]+e[7])||e[2]==="odd")}else{if(e[2]){cO.error(e[0])}}return e},PSEUDO:function(e){var c4,c5=e[4];if(cF.CHILD.test(e[0])){return null}if(c5&&(c4=cK.exec(c5))&&c4.pop()){e[0]=e[0].slice(0,c4[0].length-c5.length-1);c5=c4[0].slice(0,-1)}e.splice(2,3,c5||e[3]);return e}},filter:{ID:b9?function(e){e=e.replace(ct,"");return function(c4){return c4.getAttribute("id")===e}}:function(e){e=e.replace(ct,"");return function(c5){var c4=typeof c5.getAttributeNode!==cx&&c5.getAttributeNode("id");return c4&&c4.value===e}},TAG:function(e){if(e==="*"){return function(){return true}}e=e.replace(ct,"").toLowerCase();return function(c4){return c4.nodeName&&c4.nodeName.toLowerCase()===e}},CLASS:function(e){var c4=cS[e];if(!c4){c4=cS[e]=new RegExp("(^|"+cA+")"+e+"("+cA+"|$)");cr.push(e);if(cr.length>cH.cacheLength){delete cS[cr.shift()]}}return function(c5){return c4.test(c5.className||(typeof c5.getAttribute!==cx&&c5.getAttribute("class"))||"")}},ATTR:function(c5,c4,e){if(!c4){return function(c6){return cO.attr(c6,c5)!=null}}return function(c7){var c6=cO.attr(c7,c5),c8=c6+"";if(c6==null){return c4==="!="}switch(c4){case"=":return c8===e;case"!=":return c8!==e;case"^=":return e&&c8.indexOf(e)===0;case"*=":return e&&c8.indexOf(e)>-1;case"$=":return e&&c8.substr(c8.length-e.length)===e;case"~=":return(" "+c8+" ").indexOf(e)>-1;case"|=":return c8===e||c8.substr(0,e.length+1)===e+"-"}}},CHILD:function(c4,c6,c7,c5){if(c4==="nth"){var e=cf++;return function(db){var c8,dc,da=0,c9=db;if(c7===1&&c5===0){return true}c8=db.parentNode;if(c8&&(c8[cX]!==e||!db.sizset)){for(c9=c8.firstChild;c9;c9=c9.nextSibling){if(c9.nodeType===1){c9.sizset=++da;if(c9===db){break}}}c8[cX]=e}dc=db.sizset-c5;if(c7===0){return dc===0}else{return(dc%c7===0&&dc/c7>=0)}}}return function(c9){var c8=c9;switch(c4){case"only":case"first":while((c8=c8.previousSibling)){if(c8.nodeType===1){return false}}if(c4==="first"){return true}c8=c9;case"last":while((c8=c8.nextSibling)){if(c8.nodeType===1){return false}}return true}}},PSEUDO:function(c7,c6,c4,e){var c5=cH.pseudos[c7]||cH.pseudos[c7.toLowerCase()];if(!c5){cO.error("unsupported pseudo: "+c7)}if(!c5.sizzleFilter){return c5}return c5(c6,c4,e)}},pseudos:{not:cZ(function(e,c5,c4){var c6=cc(e.replace(cV,"$1"),c5,c4);return function(c7){return !c6(c7)}}),enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var c4=e.nodeName.toLowerCase();return(c4==="input"&&!!e.checked)||(c4==="option"&&!!e.selected)},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !cH.pseudos.empty(e)},empty:function(c4){var e;c4=c4.firstChild;while(c4){if(c4.nodeName>"@"||(e=c4.nodeType)===3||e===4){return false}c4=c4.nextSibling}return true},contains:cZ(function(e){return function(c4){return(c4.textContent||c4.innerText||b0(c4)).indexOf(e)>-1}}),has:cZ(function(e){return function(c4){return cO(e,c4).length>0}}),header:function(e){return cq.test(e.nodeName)},text:function(c5){var c4,e;return c5.nodeName.toLowerCase()==="input"&&(c4=c5.type)==="text"&&((e=c5.getAttribute("type"))==null||e.toLowerCase()===c4)},radio:b4("radio"),checkbox:b4("checkbox"),file:b4("file"),password:b4("password"),image:b4("image"),submit:cs("submit"),reset:cs("reset"),button:function(c4){var e=c4.nodeName.toLowerCase();return e==="input"&&c4.type==="button"||e==="button"},input:function(e){return cN.test(e.nodeName)},focus:function(e){var c4=e.ownerDocument;return e===c4.activeElement&&(!c4.hasFocus||c4.hasFocus())&&!!(e.type||e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(c5,c4,e){return e?c5.slice(1):[c5[0]]},last:function(c6,c5,c4){var e=c6.pop();return c4?c6:[e]},even:function(c8,c7,c6){var c5=[],c4=c6?1:0,e=c8.length;for(;c4<e;c4=c4+2){c5.push(c8[c4])}return c5},odd:function(c8,c7,c6){var c5=[],c4=c6?0:1,e=c8.length;for(;c4<e;c4=c4+2){c5.push(c8[c4])}return c5},lt:function(c5,c4,e){return e?c5.slice(+c4):c5.slice(0,+c4)},gt:function(c5,c4,e){return e?c5.slice(0,+c4+1):c5.slice(+c4+1)},eq:function(c6,c5,c4){var e=c6.splice(+c5,1);return c4?c6:e}}};cH.setFilters.nth=cH.setFilters.eq;cH.filters=cH.pseudos;if(!cE){cH.attrHandle={href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}}}if(b1){cH.order.push("NAME");cH.find.NAME=function(e,c4){if(typeof c4.getElementsByName!==cx){return c4.getElementsByName(e)}}}if(cD){cH.order.splice(1,0,"CLASS");cH.find.CLASS=function(c5,c4,e){if(typeof c4.getElementsByClassName!==cx&&!e){return c4.getElementsByClassName(c5)}}}try{ck.call(ca.childNodes,0)[0].nodeType}catch(c1){ck=function(c4){var c5,e=[];for(;(c5=this[c4]);c4++){e.push(c5)}return e}}var cl=cO.isXML=function(e){var c4=e&&(e.ownerDocument||e).documentElement;return c4?c4.nodeName!=="HTML":false};var cB=cO.contains=ca.compareDocumentPosition?function(c4,e){return !!(c4.compareDocumentPosition(e)&16)}:ca.contains?function(c4,e){var c6=c4.nodeType===9?c4.documentElement:c4,c5=e.parentNode;return c4===c5||!!(c5&&c5.nodeType===1&&c6.contains&&c6.contains(c5))}:function(c4,e){while((e=e.parentNode)){if(e===c4){return true}}return false};var b0=cO.getText=function(c7){var c6,c4="",c5=0,e=c7.nodeType;if(e){if(e===1||e===9||e===11){if(typeof c7.textContent==="string"){return c7.textContent}else{for(c7=c7.firstChild;c7;c7=c7.nextSibling){c4+=b0(c7)}}}else{if(e===3||e===4){return c7.nodeValue}}}else{for(;(c6=c7[c5]);c5++){c4+=b0(c6)}}return c4};cO.attr=function(c6,c5){var e,c4=cl(c6);if(!c4){c5=c5.toLowerCase()}if(cH.attrHandle[c5]){return cH.attrHandle[c5](c6)}if(co||c4){return c6.getAttribute(c5)}e=c6.getAttributeNode(c5);return e?typeof c6[c5]==="boolean"?c6[c5]?c5:null:e.specified?e.value:null:null};cO.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};[0,0].sort(function(){return(b8=0)});if(ca.compareDocumentPosition){cg=function(c4,e){if(c4===e){cb=true;return 0}return(!c4.compareDocumentPosition||!e.compareDocumentPosition?c4.compareDocumentPosition:c4.compareDocumentPosition(e)&4)?-1:1}}else{cg=function(db,da){if(db===da){cb=true;return 0}else{if(db.sourceIndex&&da.sourceIndex){return db.sourceIndex-da.sourceIndex}}var c8,c4,c5=[],e=[],c7=db.parentNode,c9=da.parentNode,dc=c7;if(c7===c9){return b3(db,da)}else{if(!c7){return -1}else{if(!c9){return 1}}}while(dc){c5.unshift(dc);dc=dc.parentNode}dc=c9;while(dc){e.unshift(dc);dc=dc.parentNode}c8=c5.length;c4=e.length;for(var c6=0;c6<c8&&c6<c4;c6++){if(c5[c6]!==e[c6]){return b3(c5[c6],e[c6])}}return c6===c8?b3(db,e[c6],-1):b3(c5[c6],da,1)};b3=function(c4,e,c5){if(c4===e){return c5}var c6=c4.nextSibling;while(c6){if(c6===e){return -1}c6=c6.nextSibling}return 1}}cO.uniqueSort=function(c4){var c5,e=1;if(cg){cb=b8;c4.sort(cg);if(cb){for(;(c5=c4[e]);e++){if(c5===c4[e-1]){c4.splice(e--,1)}}}}return c4};function cn(c4,c8,c7,c5){var c6=0,e=c8.length;for(;c6<e;c6++){cO(c4,c8[c6],c7,c5)}}function cJ(e,c5,c9,da,c4,c8){var c6,c7=cH.setFilters[c5.toLowerCase()];if(!c7){cO.error(c5)}if(e||!(c6=c4)){cn(e||"*",da,(c6=[]),c4)}return c6.length>0?c7(c6,c9,c8):[]}function cR(dd,e,db,c5,dh){var c8,c4,c7,dj,da,di,dc,dg,de=0,df=dh.length,c6=cF.POS,c9=new RegExp("^"+c6.source+"(?!"+cA+")","i"),dk=function(){var dm=1,dl=arguments.length-2;for(;dm<dl;dm++){if(arguments[dm]===ch){c8[dm]=ch}}};for(;de<df;de++){c6.exec("");dd=dh[de];dj=[];c7=0;da=c5;while((c8=c6.exec(dd))){dg=c6.lastIndex=c8.index+c8[0].length;if(dg>c7){dc=dd.slice(c7,c8.index);c7=dg;di=[e];if(cG.test(dc)){if(da){di=da}da=c5}if((c4=cY.test(dc))){dc=dc.slice(0,-5).replace(cG,"$&*")}if(c8.length>1){c8[0].replace(c9,dk)}da=cJ(dc,c8[1],c8[2],di,da,c4)}}if(da){dj=dj.concat(da);if((dc=dd.slice(c7))&&dc!==")"){if(cG.test(dc)){cn(dc,dj,db,c5)}else{cO(dc,e,db,c5?c5.concat(da):da)}}else{cT.apply(db,dj)}}else{cO(dd,e,db,c5)}}return df===1?db:cO.uniqueSort(db)}function b2(c9,c5,dc){var de,dd,df,c7=[],da=0,db=cK.exec(c9),c4=!db.pop()&&!db.pop(),dg=c4&&c9.match(cu)||[""],e=cH.preFilter,c6=cH.filter,c8=!dc&&c5!==b7;for(;(dd=dg[da])!=null&&c4;da++){c7.push(de=[]);if(c8){dd=" "+dd}while(dd){c4=false;if((db=cG.exec(dd))){dd=dd.slice(db[0].length);c4=de.push({part:db.pop().replace(cV," "),captures:db})}for(df in c6){if((db=cF[df].exec(dd))&&(!e[df]||(db=e[df](db,c5,dc)))){dd=dd.slice(db.shift().length);c4=de.push({part:df,captures:db})}}if(!c4){break}}}if(!c4){cO.error(c9)}return c7}function cy(c7,c6,c5){var e=c6.dir,c4=cf++;if(!c7){c7=function(c8){return c8===c5}}return c6.first?function(c9,c8){while((c9=c9[e])){if(c9.nodeType===1){return c7(c9,c8)&&c9}}}:function(da,c9){var c8,db=c4+"."+cp,dc=db+"."+cU;while((da=da[e])){if(da.nodeType===1){if((c8=da[cX])===dc){return da.sizset}else{if(typeof c8==="string"&&c8.indexOf(db)===0){if(da.sizset){return da}}else{da[cX]=dc;if(c7(da,c9)){da.sizset=true;return da}da.sizset=false}}}}}}function cw(e,c4){return e?function(c7,c6){var c5=c4(c7,c6);return c5&&e(c5===true?c7:c5,c6)}:c4}function cz(c8,c6,e){var c5,c7,c4=0;for(;(c5=c8[c4]);c4++){if(cH.relative[c5.part]){c7=cy(c7,cH.relative[c5.part],c6)}else{c5.captures.push(c6,e);c7=cw(c7,cH.filter[c5.part].apply(null,c5.captures))}}return c7}function b5(e){return function(c6,c5){var c7,c4=0;for(;(c7=e[c4]);c4++){if(c7(c6,c5)){return true}}return false}}var cc=cO.compile=function(e,c6,c4){var c9,c8,c5,c7=cm[e];if(c7&&c7.context===c6){return c7}c8=b2(e,c6,c4);for(c5=0;(c9=c8[c5]);c5++){c8[c5]=cz(c9,c6,c4)}c7=cm[e]=b5(c8);c7.context=c6;c7.runs=c7.dirruns=0;cv.push(e);if(cv.length>cH.cacheLength){delete cm[cv.shift()]}return c7};cO.matches=function(c4,e){return cO(c4,null,null,e)};cO.matchesSelector=function(e,c4){return cO(c4,null,null,[e]).length>0};var cW=function(c7,c4,c9,dd,dc){c7=c7.replace(cV,"$1");var e,de,da,df,c5,c6,dh,di,c8,db=c7.match(cu),dg=c7.match(c0),dj=c4.nodeType;if(cF.POS.test(c7)){return cR(c7,c4,c9,dd,db)}if(dd){e=ck.call(dd,0)}else{if(db&&db.length===1){if(dg.length>1&&dj===9&&!dc&&(db=cF.ID.exec(dg[0]))){c4=cH.find.ID(db[1],c4,dc)[0];if(!c4){return c9}c7=c7.slice(dg.shift().length)}di=((db=cQ.exec(dg[0]))&&!db.index&&c4.parentNode)||c4;c8=dg.pop();c6=c8.split(":not")[0];for(da=0,df=cH.order.length;da<df;da++){dh=cH.order[da];if((db=cF[dh].exec(c6))){e=cH.find[dh]((db[1]||"").replace(ct,""),di,dc);if(e==null){continue}if(c6===c8){c7=c7.slice(0,c7.length-c8.length)+c6.replace(cF[dh],"");if(!c7){cT.apply(c9,ck.call(e,0))}}break}}}}if(c7){de=cc(c7,c4,dc);cp=de.dirruns++;if(e==null){e=cH.find.TAG("*",(cQ.test(c7)&&c4.parentNode)||c4)}for(da=0;(c5=e[da]);da++){cU=de.runs++;if(de(c5,c4)){c9.push(c5)}}}return c9};if(b7.querySelectorAll){(function(){var c8,c9=cW,c7=/'|\\/g,c5=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,c4=[],e=[":active"],c6=ca.matchesSelector||ca.mozMatchesSelector||ca.webkitMatchesSelector||ca.oMatchesSelector||ca.msMatchesSelector;cI(function(da){da.innerHTML="<select><option selected></option></select>";if(!da.querySelectorAll("[selected]").length){c4.push("\\["+cA+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)")}if(!da.querySelectorAll(":checked").length){c4.push(":checked")}});cI(function(da){da.innerHTML="<p test=''></p>";if(da.querySelectorAll("[test^='']").length){c4.push("[*^$]="+cA+"*(?:\"\"|'')")}da.innerHTML="<input type='hidden'>";if(!da.querySelectorAll(":enabled").length){c4.push(":enabled",":disabled")}});c4=c4.length&&new RegExp(c4.join("|"));cW=function(df,db,dg,di,dh){if(!di&&!dh&&(!c4||!c4.test(df))){if(db.nodeType===9){try{cT.apply(dg,ck.call(db.querySelectorAll(df),0));return dg}catch(de){}}else{if(db.nodeType===1&&db.nodeName.toLowerCase()!=="object"){var dd=db.getAttribute("id"),da=dd||cX,dc=cQ.test(df)&&db.parentNode||db;if(dd){da=da.replace(c7,"\\$&")}else{db.setAttribute("id",da)}try{cT.apply(dg,ck.call(dc.querySelectorAll(df.replace(cu,"[id='"+da+"'] $&")),0));return dg}catch(de){}finally{if(!dd){db.removeAttribute("id")}}}}}return c9(df,db,dg,di,dh)};if(c6){cI(function(db){c8=c6.call(db,"div");try{c6.call(db,"[test!='']:sizzle");e.push(cH.match.PSEUDO)}catch(da){}});e=new RegExp(e.join("|"));cO.matchesSelector=function(db,dd){dd=dd.replace(c5,"='$1']");if(!cl(db)&&!e.test(dd)&&(!c4||!c4.test(dd))){try{var da=c6.call(db,dd);if(da||c8||db.document&&db.document.nodeType!==11){return da}}catch(dc){}}return cO(dd,null,null,[db]).length>0}}})()}cO.attr=bH.attr;bH.find=cO;bH.expr=cO.selectors;bH.expr[":"]=bH.expr.pseudos;bH.unique=cO.uniqueSort;bH.text=cO.getText;bH.isXMLDoc=cO.isXML;bH.contains=cO.contains})(a3);var ah=/Until$/,br=/^(?:parents|prev(?:Until|All))/,am=/^.[^:#\[\.,]*$/,A=bH.expr.match.needsContext,bv={children:true,contents:true,next:true,prev:true};bH.fn.extend({find:function(e){var b3,b0,b5,b6,b4,b2,b1=this;if(typeof e!=="string"){return bH(e).filter(function(){for(b3=0,b0=b1.length;b3<b0;b3++){if(bH.contains(b1[b3],this)){return true}}})}b2=this.pushStack("","find",e);for(b3=0,b0=this.length;b3<b0;b3++){b5=b2.length;bH.find(e,this[b3],b2);if(b3>0){for(b6=b5;b6<b2.length;b6++){for(b4=0;b4<b5;b4++){if(b2[b4]===b2[b6]){b2.splice(b6--,1);break}}}}}return b2},has:function(b2){var b1,b0=bH(b2,this),e=b0.length;return this.filter(function(){for(b1=0;b1<e;b1++){if(bH.contains(this,b0[b1])){return true}}})},not:function(e){return this.pushStack(aN(this,e,false),"not",e)},filter:function(e){return this.pushStack(aN(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?A.test(e)?bH(e,this.context).index(this[0])>=0:bH.filter(e,this).length>0:this.filter(e).length>0)},closest:function(b3,b2){var b4,b1=0,e=this.length,b0=[],b5=A.test(b3)||typeof b3!=="string"?bH(b3,b2||this.context):0;for(;b1<e;b1++){b4=this[b1];while(b4&&b4.ownerDocument&&b4!==b2&&b4.nodeType!==11){if(b5?b5.index(b4)>-1:bH.find.matchesSelector(b4,b3)){b0.push(b4);break}b4=b4.parentNode}}b0=b0.length>1?bH.unique(b0):b0;return this.pushStack(b0,"closest",b3)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return bH.inArray(this[0],bH(e))}return bH.inArray(e.jquery?e[0]:e,this)},add:function(e,b0){var b2=typeof e==="string"?bH(e,b0):bH.makeArray(e&&e.nodeType?[e]:e),b1=bH.merge(this.get(),b2);return this.pushStack(aS(b2[0])||aS(b1[0])?b1:bH.unique(b1))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});bH.fn.andSelf=bH.fn.addBack;function aS(e){return !e||!e.parentNode||e.parentNode.nodeType===11}function aZ(b0,e){do{b0=b0[e]}while(b0&&b0.nodeType!==1);return b0}bH.each({parent:function(b0){var e=b0.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return bH.dir(e,"parentNode")},parentsUntil:function(b0,e,b1){return bH.dir(b0,"parentNode",b1)},next:function(e){return aZ(e,"nextSibling")},prev:function(e){return aZ(e,"previousSibling")},nextAll:function(e){return bH.dir(e,"nextSibling")},prevAll:function(e){return bH.dir(e,"previousSibling")},nextUntil:function(b0,e,b1){return bH.dir(b0,"nextSibling",b1)},prevUntil:function(b0,e,b1){return bH.dir(b0,"previousSibling",b1)},siblings:function(e){return bH.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return bH.sibling(e.firstChild)},contents:function(e){return bH.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:bH.merge([],e.childNodes)}},function(e,b0){bH.fn[e]=function(b3,b1){var b2=bH.map(this,b0,b3);if(!ah.test(e)){b1=b3}if(b1&&typeof b1==="string"){b2=bH.filter(b1,b2)}b2=this.length>1&&!bv[e]?bH.unique(b2):b2;if(this.length>1&&br.test(e)){b2=b2.reverse()}return this.pushStack(b2,e,a5.call(arguments).join(","))}});bH.extend({filter:function(b1,e,b0){if(b0){b1=":not("+b1+")"}return e.length===1?bH.find.matchesSelector(e[0],b1)?[e[0]]:[]:bH.find.matches(b1,e)},dir:function(b1,b0,b3){var e=[],b2=b1[b0];while(b2&&b2.nodeType!==9&&(b3===aC||b2.nodeType!==1||!bH(b2).is(b3))){if(b2.nodeType===1){e.push(b2)}b2=b2[b0]}return e},sibling:function(b1,b0){var e=[];for(;b1;b1=b1.nextSibling){if(b1.nodeType===1&&b1!==b0){e.push(b1)}}return e}});function aN(b2,b1,e){b1=b1||0;if(bH.isFunction(b1)){return bH.grep(b2,function(b4,b3){var b5=!!b1.call(b4,b3,b4);return b5===e})}else{if(b1.nodeType){return bH.grep(b2,function(b4,b3){return(b4===b1)===e})}else{if(typeof b1==="string"){var b0=bH.grep(b2,function(b3){return b3.nodeType===1});if(am.test(b1)){return bH.filter(b1,b0,!e)}else{b1=bH.filter(b1,b0)}}}}return bH.grep(b2,function(b4,b3){return(bH.inArray(b4,b1)>=0)===e})}function C(e){var b1=d.split("|"),b0=e.createDocumentFragment();if(b0.createElement){while(b1.length){b0.createElement(b1.pop())}}return b0}var d="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",aw=/ jQuery\d+="(?:null|\d+)"/g,bZ=/^\s+/,az=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,r=/<([\w:]+)/,bU=/<tbody/i,K=/<|&#?\w+;/,ak=/<(?:script|style|link)/i,aq=/<(?:script|object|embed|option|style)/i,L=new RegExp("<(?:"+d+")[\\s/>]","i"),aF=/^(?:checkbox|radio)$/,bS=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,aI=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,U={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},aR=C(q),n=aR.appendChild(q.createElement("div"));U.optgroup=U.option;U.tbody=U.tfoot=U.colgroup=U.caption=U.thead;U.th=U.td;if(!bH.support.htmlSerialize){U._default=[1,"X<div>","</div>"]}bH.fn.extend({text:function(e){return bH.access(this,function(b0){return b0===aC?bH.text(this):this.empty().append((this[0]&&this[0].ownerDocument||q).createTextNode(b0))},null,e,arguments.length)},wrapAll:function(e){if(bH.isFunction(e)){return this.each(function(b1){bH(this).wrapAll(e.call(this,b1))})}if(this[0]){var b0=bH(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){b0.insertBefore(this[0])}b0.map(function(){var b1=this;while(b1.firstChild&&b1.firstChild.nodeType===1){b1=b1.firstChild}return b1}).append(this)}return this},wrapInner:function(e){if(bH.isFunction(e)){return this.each(function(b0){bH(this).wrapInner(e.call(this,b0))})}return this.each(function(){var b0=bH(this),b1=b0.contents();if(b1.length){b1.wrapAll(e)}else{b0.append(e)}})},wrap:function(e){var b0=bH.isFunction(e);return this.each(function(b1){bH(this).wrapAll(b0?e.call(this,b1):e)})},unwrap:function(){return this.parent().each(function(){if(!bH.nodeName(this,"body")){bH(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1||this.nodeType===11){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1||this.nodeType===11){this.insertBefore(e,this.firstChild)}})},before:function(){if(!aS(this[0])){return this.domManip(arguments,false,function(b0){this.parentNode.insertBefore(b0,this)})}if(arguments.length){var e=bH.clean(arguments);return this.pushStack(bH.merge(e,this),"before",this.selector)}},after:function(){if(!aS(this[0])){return this.domManip(arguments,false,function(b0){this.parentNode.insertBefore(b0,this.nextSibling)})}if(arguments.length){var e=bH.clean(arguments);return this.pushStack(bH.merge(this,e),"after",this.selector)}},remove:function(e,b2){var b1,b0=0;for(;(b1=this[b0])!=null;b0++){if(!e||bH.filter(e,[b1]).length){if(!b2&&b1.nodeType===1){bH.cleanData(b1.getElementsByTagName("*"));bH.cleanData([b1])}if(b1.parentNode){b1.parentNode.removeChild(b1)}}}return this},empty:function(){var b0,e=0;for(;(b0=this[e])!=null;e++){if(b0.nodeType===1){bH.cleanData(b0.getElementsByTagName("*"))}while(b0.firstChild){b0.removeChild(b0.firstChild)}}return this},clone:function(b0,e){b0=b0==null?false:b0;e=e==null?b0:e;return this.map(function(){return bH.clone(this,b0,e)})},html:function(e){return bH.access(this,function(b3){var b2=this[0]||{},b1=0,b0=this.length;if(b3===aC){return b2.nodeType===1?b2.innerHTML.replace(aw,""):aC}if(typeof b3==="string"&&!ak.test(b3)&&(bH.support.htmlSerialize||!L.test(b3))&&(bH.support.leadingWhitespace||!bZ.test(b3))&&!U[(r.exec(b3)||["",""])[1].toLowerCase()]){b3=b3.replace(az,"<$1></$2>");try{for(;b1<b0;b1++){b2=this[b1]||{};if(b2.nodeType===1){bH.cleanData(b2.getElementsByTagName("*"));b2.innerHTML=b3}}b2=0}catch(b4){}}if(b2){this.empty().append(b3)}},null,e,arguments.length)},replaceWith:function(e){if(!aS(this[0])){if(bH.isFunction(e)){return this.each(function(b2){var b1=bH(this),b0=b1.html();b1.replaceWith(e.call(this,b2,b0))})}if(typeof e!=="string"){e=bH(e).detach()}return this.each(function(){var b1=this.nextSibling,b0=this.parentNode;bH(this).remove();if(b1){bH(b1).before(e)}else{bH(b0).append(e)}})}return this.length?this.pushStack(bH(bH.isFunction(e)?e():e),"replaceWith",e):this},detach:function(e){return this.remove(e,true)},domManip:function(b5,b9,b8){b5=[].concat.apply([],b5);var b1,b3,b4,b7,b2=0,b6=b5[0],b0=[],e=this.length;if(!bH.support.checkClone&&e>1&&typeof b6==="string"&&bS.test(b6)){return this.each(function(){bH(this).domManip(b5,b9,b8)})}if(bH.isFunction(b6)){return this.each(function(cb){var ca=bH(this);b5[0]=b6.call(this,cb,b9?ca.html():aC);ca.domManip(b5,b9,b8)})}if(this[0]){b1=bH.buildFragment(b5,this,b0);b4=b1.fragment;b3=b4.firstChild;if(b4.childNodes.length===1){b4=b3}if(b3){b9=b9&&bH.nodeName(b3,"tr");for(b7=b1.cacheable||e-1;b2<e;b2++){b8.call(b9&&bH.nodeName(this[b2],"table")?z(this[b2],"tbody"):this[b2],b2===b7?b4:bH.clone(b4,true,true))}}b4=b3=null;if(b0.length){bH.each(b0,function(ca,cb){if(cb.src){if(bH.ajax){bH.ajax({url:cb.src,type:"GET",dataType:"script",async:false,global:false,"throws":true})}else{bH.error("no ajax")}}else{bH.globalEval((cb.text||cb.textContent||cb.innerHTML||"").replace(aI,""))}if(cb.parentNode){cb.parentNode.removeChild(cb)}})}}return this}});function z(b0,e){return b0.getElementsByTagName(e)[0]||b0.appendChild(b0.ownerDocument.createElement(e))}function ap(b6,b0){if(b0.nodeType!==1||!bH.hasData(b6)){return}var b3,b2,e,b5=bH._data(b6),b4=bH._data(b0,b5),b1=b5.events;if(b1){delete b4.handle;b4.events={};for(b3 in b1){for(b2=0,e=b1[b3].length;b2<e;b2++){bH.event.add(b0,b3,b1[b3][b2])}}}if(b4.data){b4.data=bH.extend({},b4.data)}}function H(b0,e){var b1;if(e.nodeType!==1){return}if(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(b0)}b1=e.nodeName.toLowerCase();if(b1==="object"){if(e.parentNode){e.outerHTML=b0.outerHTML}if(bH.support.html5Clone&&(b0.innerHTML&&!bH.trim(e.innerHTML))){e.innerHTML=b0.innerHTML}}else{if(b1==="input"&&aF.test(b0.type)){e.defaultChecked=e.checked=b0.checked;if(e.value!==b0.value){e.value=b0.value}}else{if(b1==="option"){e.selected=b0.defaultSelected}else{if(b1==="input"||b1==="textarea"){e.defaultValue=b0.defaultValue}else{if(b1==="script"&&e.text!==b0.text){e.text=b0.text}}}}}e.removeAttribute(bH.expando)}bH.buildFragment=function(b2,b3,b0){var b1,e,b4,b5=b2[0];b3=b3||q;b3=(b3[0]||b3).ownerDocument||b3[0]||b3;if(typeof b3.createDocumentFragment==="undefined"){b3=q}if(b2.length===1&&typeof b5==="string"&&b5.length<512&&b3===q&&b5.charAt(0)==="<"&&!aq.test(b5)&&(bH.support.checkClone||!bS.test(b5))&&(bH.support.html5Clone||!L.test(b5))){e=true;b1=bH.fragments[b5];b4=b1!==aC}if(!b1){b1=b3.createDocumentFragment();bH.clean(b2,b3,b1,b0);if(e){bH.fragments[b5]=b4&&b1}}return{fragment:b1,cacheable:e}};bH.fragments={};bH.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,b0){bH.fn[e]=function(b1){var b3,b5=0,b4=[],b7=bH(b1),b2=b7.length,b6=this.length===1&&this[0].parentNode;if((b6==null||b6&&b6.nodeType===11&&b6.childNodes.length===1)&&b2===1){b7[b0](this[0]);return this}else{for(;b5<b2;b5++){b3=(b5>0?this.clone(true):this).get();bH(b7[b5])[b0](b3);b4=b4.concat(b3)}return this.pushStack(b4,e,b7.selector)}}});function o(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function bT(e){if(aF.test(e.type)){e.defaultChecked=e.checked}}bH.extend({clone:function(b3,b5,b1){var e,b0,b2,b4;if(bH.support.html5Clone||bH.isXMLDoc(b3)||!L.test("<"+b3.nodeName+">")){b4=b3.cloneNode(true)}else{n.innerHTML=b3.outerHTML;n.removeChild(b4=n.firstChild)}if((!bH.support.noCloneEvent||!bH.support.noCloneChecked)&&(b3.nodeType===1||b3.nodeType===11)&&!bH.isXMLDoc(b3)){H(b3,b4);e=o(b3);b0=o(b4);for(b2=0;e[b2];++b2){if(b0[b2]){H(e[b2],b0[b2])}}}if(b5){ap(b3,b4);if(b1){e=o(b3);b0=o(b4);for(b2=0;e[b2];++b2){ap(e[b2],b0[b2])}}}e=b0=null;return b4},clean:function(cc,b1,e,b2){var b8,b4,cb,cg,b5,cf,b6,b3,b0,ca,ce,b7,b9=0,cd=[];if(!b1||typeof b1.createDocumentFragment==="undefined"){b1=q}for(b4=b1===q&&aR;(cb=cc[b9])!=null;b9++){if(typeof cb==="number"){cb+=""}if(!cb){continue}if(typeof cb==="string"){if(!K.test(cb)){cb=b1.createTextNode(cb)}else{b4=b4||C(b1);b6=b6||b4.appendChild(b1.createElement("div"));cb=cb.replace(az,"<$1></$2>");cg=(r.exec(cb)||["",""])[1].toLowerCase();b5=U[cg]||U._default;cf=b5[0];b6.innerHTML=b5[1]+cb+b5[2];while(cf--){b6=b6.lastChild}if(!bH.support.tbody){b3=bU.test(cb);b0=cg==="table"&&!b3?b6.firstChild&&b6.firstChild.childNodes:b5[1]==="<table>"&&!b3?b6.childNodes:[];for(b8=b0.length-1;b8>=0;--b8){if(bH.nodeName(b0[b8],"tbody")&&!b0[b8].childNodes.length){b0[b8].parentNode.removeChild(b0[b8])}}}if(!bH.support.leadingWhitespace&&bZ.test(cb)){b6.insertBefore(b1.createTextNode(bZ.exec(cb)[0]),b6.firstChild)}cb=b6.childNodes;b6=b4.lastChild}}if(cb.nodeType){cd.push(cb)}else{cd=bH.merge(cd,cb)}}if(b6){b4.removeChild(b6);cb=b6=b4=null}if(!bH.support.appendChecked){for(b9=0;(cb=cd[b9])!=null;b9++){if(bH.nodeName(cb,"input")){bT(cb)}else{if(typeof cb.getElementsByTagName!=="undefined"){bH.grep(cb.getElementsByTagName("input"),bT)}}}}if(e){ce=function(ch){if(!ch.type||bx.test(ch.type)){return b2?b2.push(ch.parentNode?ch.parentNode.removeChild(ch):ch):e.appendChild(ch)}};for(b9=0;(cb=cd[b9])!=null;b9++){if(!(bH.nodeName(cb,"script")&&ce(cb))){e.appendChild(cb);if(typeof cb.getElementsByTagName!=="undefined"){b7=bH.grep(bH.merge([],cb.getElementsByTagName("script")),ce);cd.splice.apply(cd,[b9+1,0].concat(b7));b9+=b7.length}}}}return cd},cleanData:function(b0,b8){var b3,b1,b2,b7,b4=0,b9=bH.expando,e=bH.cache,b5=bH.support.deleteExpando,b6=bH.event.special;for(;(b2=b0[b4])!=null;b4++){if(b8||bH.acceptData(b2)){b1=b2[b9];b3=b1&&e[b1];if(b3){if(b3.events){for(b7 in b3.events){if(b6[b7]){bH.event.remove(b2,b7)}else{bH.removeEvent(b2,b7,b3.handle)}}}if(e[b1]){delete e[b1];if(b5){delete b2[b9]}else{if(b2.removeAttribute){b2.removeAttribute(b9)}else{b2[b9]=null}}bH.deletedIds.push(b1)}}}}}});(function(){var e,b0;bH.uaMatch=function(b2){b2=b2.toLowerCase();var b1=/(chrome)[ \/]([\w.]+)/.exec(b2)||/(webkit)[ \/]([\w.]+)/.exec(b2)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b2)||/(msie) ([\w.]+)/.exec(b2)||b2.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b2)||[];return{browser:b1[1]||"",version:b1[2]||"0"}};e=bH.uaMatch(f.userAgent);b0={};if(e.browser){b0[e.browser]=true;b0.version=e.version}if(b0.webkit){b0.safari=true}bH.browser=b0;bH.sub=function(){function b1(b4,b5){return new b1.fn.init(b4,b5)}bH.extend(true,b1,this);b1.superclass=this;b1.fn=b1.prototype=this();b1.fn.constructor=b1;b1.sub=this.sub;b1.fn.init=function b3(b4,b5){if(b5&&b5 instanceof bH&&!(b5 instanceof b1)){b5=b1(b5)}return bH.fn.init.call(this,b4,b5,b2)};b1.fn.init.prototype=b1.fn;var b2=b1(q);return b1}})();var G,aA,aX,bf=/alpha\([^)]*\)/i,aT=/opacity=([^)]*)/,bl=/^(top|right|bottom|left)$/,a0=/^margin/,a9=new RegExp("^("+by+")(.*)$","i"),X=new RegExp("^("+by+")(?!px)[a-z%]+$","i"),T=new RegExp("^([-+])=("+by+")","i"),bi={},ba={position:"absolute",visibility:"hidden",display:"block"},bB={letterSpacing:0,fontWeight:400,lineHeight:1},bR=["Top","Right","Bottom","Left"],at=["Webkit","O","Moz","ms"],aK=bH.fn.toggle;function b(b2,b0){if(b0 in b2){return b0}var b3=b0.charAt(0).toUpperCase()+b0.slice(1),e=b0,b1=at.length;while(b1--){b0=at[b1]+b3;if(b0 in b2){return b0}}return e}function R(b0,e){b0=e||b0;return bH.css(b0,"display")==="none"||!bH.contains(b0.ownerDocument,b0)}function u(b4,e){var b3,b5,b0=[],b1=0,b2=b4.length;for(;b1<b2;b1++){b3=b4[b1];if(!b3.style){continue}b0[b1]=bH._data(b3,"olddisplay");if(e){if(!b0[b1]&&b3.style.display==="none"){b3.style.display=""}if(b3.style.display===""&&R(b3)){b0[b1]=bH._data(b3,"olddisplay",bD(b3.nodeName))}}else{b5=G(b3,"display");if(!b0[b1]&&b5!=="none"){bH._data(b3,"olddisplay",b5)}}}for(b1=0;b1<b2;b1++){b3=b4[b1];if(!b3.style){continue}if(!e||b3.style.display==="none"||b3.style.display===""){b3.style.display=e?b0[b1]||"":"none"}}return b4}bH.fn.extend({css:function(e,b0){return bH.access(this,function(b2,b1,b3){return b3!==aC?bH.style(b2,b1,b3):bH.css(b2,b1)},e,b0,arguments.length>1)},show:function(){return u(this,true)},hide:function(){return u(this)},toggle:function(b1,b0){var e=typeof b1==="boolean";if(bH.isFunction(b1)&&bH.isFunction(b0)){return aK.apply(this,arguments)}return this.each(function(){if(e?b1:R(this)){bH(this).show()}else{bH(this).hide()}})}});bH.extend({cssHooks:{opacity:{get:function(b1,b0){if(b0){var e=G(b1,"opacity");return e===""?"1":e}}}},cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":bH.support.cssFloat?"cssFloat":"styleFloat"},style:function(b2,b1,b8,b3){if(!b2||b2.nodeType===3||b2.nodeType===8||!b2.style){return}var b6,b7,b9,b4=bH.camelCase(b1),b0=b2.style;b1=bH.cssProps[b4]||(bH.cssProps[b4]=b(b0,b4));b9=bH.cssHooks[b1]||bH.cssHooks[b4];if(b8!==aC){b7=typeof b8;if(b7==="string"&&(b6=T.exec(b8))){b8=(b6[1]+1)*b6[2]+parseFloat(bH.css(b2,b1));b7="number"}if(b8==null||b7==="number"&&isNaN(b8)){return}if(b7==="number"&&!bH.cssNumber[b4]){b8+="px"}if(!b9||!("set" in b9)||(b8=b9.set(b2,b8,b3))!==aC){try{b0[b1]=b8}catch(b5){}}}else{if(b9&&"get" in b9&&(b6=b9.get(b2,false,b3))!==aC){return b6}return b0[b1]}},css:function(b5,b3,b4,b0){var b6,b2,e,b1=bH.camelCase(b3);b3=bH.cssProps[b1]||(bH.cssProps[b1]=b(b5.style,b1));e=bH.cssHooks[b3]||bH.cssHooks[b1];if(e&&"get" in e){b6=e.get(b5,true,b0)}if(b6===aC){b6=G(b5,b3)}if(b6==="normal"&&b3 in bB){b6=bB[b3]}if(b4||b0!==aC){b2=parseFloat(b6);return b4||bH.isNumeric(b2)?b2||0:b6}return b6},swap:function(b3,b2,b4){var b1,b0,e={};for(b0 in b2){e[b0]=b3.style[b0];b3.style[b0]=b2[b0]}b1=b4.call(b3);for(b0 in b2){b3.style[b0]=e[b0]}return b1}});if(a3.getComputedStyle){G=function(b6,b0){var e,b3,b2,b5,b4=getComputedStyle(b6,null),b1=b6.style;if(b4){e=b4[b0];if(e===""&&!bH.contains(b6.ownerDocument.documentElement,b6)){e=bH.style(b6,b0)}if(X.test(e)&&a0.test(b0)){b3=b1.width;b2=b1.minWidth;b5=b1.maxWidth;b1.minWidth=b1.maxWidth=b1.width=e;e=b4.width;b1.width=b3;b1.minWidth=b2;b1.maxWidth=b5}}return e}}else{if(q.documentElement.currentStyle){G=function(b3,b1){var b4,e,b0=b3.currentStyle&&b3.currentStyle[b1],b2=b3.style;if(b0==null&&b2&&b2[b1]){b0=b2[b1]}if(X.test(b0)&&!bl.test(b1)){b4=b2.left;e=b3.runtimeStyle&&b3.runtimeStyle.left;if(e){b3.runtimeStyle.left=b3.currentStyle.left}b2.left=b1==="fontSize"?"1em":b0;b0=b2.pixelLeft+"px";b2.left=b4;if(e){b3.runtimeStyle.left=e}}return b0===""?"auto":b0}}}function aH(e,b1,b2){var b0=a9.exec(b1);return b0?Math.max(0,b0[1]-(b2||0))+(b0[2]||"px"):b1}function au(b2,b0,e,b4){var b1=e===(b4?"border":"content")?4:b0==="width"?1:0,b3=0;for(;b1<4;b1+=2){if(e==="margin"){b3+=bH.css(b2,e+bR[b1],true)}if(b4){if(e==="content"){b3-=parseFloat(G(b2,"padding"+bR[b1]))||0}if(e!=="margin"){b3-=parseFloat(G(b2,"border"+bR[b1]+"Width"))||0}}else{b3+=parseFloat(G(b2,"padding"+bR[b1]))||0;if(e!=="padding"){b3+=parseFloat(G(b2,"border"+bR[b1]+"Width"))||0}}}return b3}function w(b2,b0,e){var b3=b0==="width"?b2.offsetWidth:b2.offsetHeight,b1=true,b4=bH.support.boxSizing&&bH.css(b2,"boxSizing")==="border-box";if(b3<=0){b3=G(b2,b0);if(b3<0||b3==null){b3=b2.style[b0]}if(X.test(b3)){return b3}b1=b4&&(bH.support.boxSizingReliable||b3===b2.style[b0]);b3=parseFloat(b3)||0}return(b3+au(b2,b0,e||(b4?"border":"content"),b1))+"px"}function bD(b1){if(bi[b1]){return bi[b1]}var e=bH("<"+b1+">").appendTo(q.body),b0=e.css("display");e.remove();if(b0==="none"||b0===""){aA=q.body.appendChild(aA||bH.extend(q.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!aX||!aA.createElement){aX=(aA.contentWindow||aA.contentDocument).document;aX.write("<!doctype html><html><body>");aX.close()}e=aX.body.appendChild(aX.createElement(b1));b0=G(e,"display");q.body.removeChild(aA)}bi[b1]=b0;return b0}bH.each(["height","width"],function(b0,e){bH.cssHooks[e]={get:function(b3,b2,b1){if(b2){if(b3.offsetWidth!==0||G(b3,"display")!=="none"){return w(b3,e,b1)}else{return bH.swap(b3,ba,function(){return w(b3,e,b1)})}}},set:function(b2,b3,b1){return aH(b2,b3,b1?au(b2,e,b1,bH.support.boxSizing&&bH.css(b2,"boxSizing")==="border-box"):0)}}});if(!bH.support.opacity){bH.cssHooks.opacity={get:function(b0,e){return aT.test((e&&b0.currentStyle?b0.currentStyle.filter:b0.style.filter)||"")?(0.01*parseFloat(RegExp.$1))+"":e?"1":""},set:function(b3,b4){var b2=b3.style,b0=b3.currentStyle,e=bH.isNumeric(b4)?"alpha(opacity="+b4*100+")":"",b1=b0&&b0.filter||b2.filter||"";b2.zoom=1;if(b4>=1&&bH.trim(b1.replace(bf,""))===""&&b2.removeAttribute){b2.removeAttribute("filter");if(b0&&!b0.filter){return}}b2.filter=bf.test(b1)?b1.replace(bf,e):b1+" "+e}}}bH(function(){if(!bH.support.reliableMarginRight){bH.cssHooks.marginRight={get:function(b0,e){return bH.swap(b0,{display:"inline-block"},function(){if(e){return G(b0,"marginRight")}})}}}if(!bH.support.pixelPosition&&bH.fn.position){bH.each(["top","left"],function(e,b0){bH.cssHooks[b0]={get:function(b3,b2){if(b2){var b1=G(b3,b0);return X.test(b1)?bH(b3).position()[b0]+"px":b1}}}})}});if(bH.expr&&bH.expr.filters){bH.expr.filters.hidden=function(e){return(e.offsetWidth===0&&e.offsetHeight===0)||(!bH.support.reliableHiddenOffsets&&((e.style&&e.style.display)||G(e,"display"))==="none")};bH.expr.filters.visible=function(e){return !bH.expr.filters.hidden(e)}}bH.each({margin:"",padding:"",border:"Width"},function(e,b0){bH.cssHooks[e+b0]={expand:function(b3){var b2,b4=typeof b3==="string"?b3.split(" "):[b3],b1={};for(b2=0;b2<4;b2++){b1[e+bR[b2]+b0]=b4[b2]||b4[b2-2]||b4[0]}return b1}};if(!a0.test(e)){bH.cssHooks[e+b0].set=aH}});var bt=/%20/g,aQ=/\[\]$/,V=/\r?\n/g,bA=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aE=/^(?:select|textarea)/i;bH.fn.extend({serialize:function(){return bH.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?bH.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||aE.test(this.nodeName)||bA.test(this.type))}).map(function(e,b0){var b1=bH(this).val();return b1==null?null:bH.isArray(b1)?bH.map(b1,function(b3,b2){return{name:b0.name,value:b3.replace(V,"\r\n")}}):{name:b0.name,value:b1.replace(V,"\r\n")}}).get()}});bH.param=function(e,b1){var b2,b0=[],b3=function(b4,b5){b5=bH.isFunction(b5)?b5():(b5==null?"":b5);b0[b0.length]=encodeURIComponent(b4)+"="+encodeURIComponent(b5)};if(b1===aC){b1=bH.ajaxSettings&&bH.ajaxSettings.traditional}if(bH.isArray(e)||(e.jquery&&!bH.isPlainObject(e))){bH.each(e,function(){b3(this.name,this.value)})}else{for(b2 in e){m(b2,e[b2],b1,b3)}}return b0.join("&").replace(bt,"+")};function m(b1,b3,b0,b2){var e;if(bH.isArray(b3)){bH.each(b3,function(b5,b4){if(b0||aQ.test(b1)){b2(b1,b4)}else{m(b1+"["+(typeof b4==="object"?b5:"")+"]",b4,b0,b2)}})}else{if(!b0&&bH.type(b3)==="object"){for(e in b3){m(b1+"["+e+"]",b3[e],b0,b2)}}else{b2(b1,b3)}}}var Z,bY,ao=/#.*$/,ae=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,D=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,t=/^(?:GET|HEAD)$/,aD=/^\/\//,bO=/\?/,h=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Q=/([?&])_=[^&]*/,aU=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,bX=bH.fn.load,x={},a7={},aY=["*/"]+["*"];try{Z=aJ.href}catch(be){Z=q.createElement("a");Z.href="";Z=Z.href}bY=aU.exec(Z.toLowerCase())||[];function bJ(e){return function(b3,b5){if(typeof b3!=="string"){b5=b3;b3="*"}var b0,b6,b7,b2=b3.toLowerCase().split(aW),b1=0,b4=b2.length;if(bH.isFunction(b5)){for(;b1<b4;b1++){b0=b2[b1];b7=/^\+/.test(b0);if(b7){b0=b0.substr(1)||"*"}b6=e[b0]=e[b0]||[];b6[b7?"unshift":"push"](b5)}}}}function s(b0,b9,b4,b7,b6,b2){b6=b6||b9.dataTypes[0];b2=b2||{};b2[b6]=true;var b8,b5=b0[b6],b1=0,e=b5?b5.length:0,b3=(b0===x);for(;b1<e&&(b3||!b8);b1++){b8=b5[b1](b9,b4,b7);if(typeof b8==="string"){if(!b3||b2[b8]){b8=aC}else{b9.dataTypes.unshift(b8);b8=s(b0,b9,b4,b7,b8,b2)}}}if((b3||!b8)&&!b2["*"]){b8=s(b0,b9,b4,b7,"*",b2)}return b8}function v(b1,b2){var b0,e,b3=bH.ajaxSettings.flatOptions||{};for(b0 in b2){if(b2[b0]!==aC){(b3[b0]?b1:(e||(e={})))[b0]=b2[b0]}}if(e){bH.extend(true,b1,e)}}bH.fn.load=function(b2,b5,b6){if(typeof b2!=="string"&&bX){return bX.apply(this,arguments)}if(!this.length){return this}var e,b3,b1,b0=this,b4=b2.indexOf(" ");if(b4>=0){e=b2.slice(b4,b2.length);b2=b2.slice(0,b4)}if(bH.isFunction(b5)){b6=b5;b5=aC}else{if(typeof b5==="object"){b3="POST"}}bH.ajax({url:b2,type:b3,dataType:"html",data:b5,complete:function(b8,b7){if(b6){b0.each(b6,b1||[b8.responseText,b7,b8])}}}).done(function(b7){b1=arguments;b0.html(e?bH("<div>").append(b7.replace(h,"")).find(e):b7)});return this};bH.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,b0){bH.fn[b0]=function(b1){return this.on(b0,b1)}});bH.each(["get","post"],function(e,b0){bH[b0]=function(b1,b3,b4,b2){if(bH.isFunction(b3)){b2=b2||b4;b4=b3;b3=aC}return bH.ajax({type:b0,url:b1,data:b3,success:b4,dataType:b2})}});bH.extend({getScript:function(e,b0){return bH.get(e,aC,b0,"script")},getJSON:function(e,b0,b1){return bH.get(e,b0,b1,"json")},ajaxSetup:function(b0,e){if(e){v(b0,bH.ajaxSettings)}else{e=b0;b0=bH.ajaxSettings}v(b0,e);return b0},ajaxSettings:{url:Z,isLocal:D.test(bY[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aY},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a3.String,"text html":true,"text json":bH.parseJSON,"text xml":bH.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:bJ(x),ajaxTransport:bJ(a7),ajax:function(b5,b2){if(typeof b5==="object"){b2=b5;b5=aC}b2=b2||{};var b8,cm,b3,ch,ca,ce,b1,cg,b9=bH.ajaxSetup({},b2),co=b9.context||b9,cc=co!==b9&&(co.nodeType||co instanceof bH)?bH(co):bH.event,cn=bH.Deferred(),cj=bH.Callbacks("once memory"),b6=b9.statusCode||{},cd={},ck={},b4=0,b7="canceled",cf={readyState:0,setRequestHeader:function(cp,cq){if(!b4){var e=cp.toLowerCase();cp=ck[e]=ck[e]||cp;cd[cp]=cq}return this},getAllResponseHeaders:function(){return b4===2?cm:null},getResponseHeader:function(cp){var e;if(b4===2){if(!b3){b3={};while((e=ae.exec(cm))){b3[e[1].toLowerCase()]=e[2]}}e=b3[cp.toLowerCase()]}return e===aC?null:e},overrideMimeType:function(e){if(!b4){b9.mimeType=e}return this},abort:function(e){e=e||b7;if(ch){ch.abort(e)}cb(0,e);return this}};function cb(ct,cp,cu,cr){var e,cx,cv,cs,cw,cq=cp;if(b4===2){return}b4=2;if(ca){clearTimeout(ca)}ch=aC;cm=cr||"";cf.readyState=ct>0?4:0;if(cu){cs=j(b9,cf,cu)}if(ct>=200&&ct<300||ct===304){if(b9.ifModified){cw=cf.getResponseHeader("Last-Modified");if(cw){bH.lastModified[b8]=cw}cw=cf.getResponseHeader("Etag");if(cw){bH.etag[b8]=cw}}if(ct===304){cq="notmodified";e=true}else{e=af(b9,cs);cq=e.state;cx=e.data;cv=e.error;e=!cv}}else{cv=cq;if(!cq||ct){cq="error";if(ct<0){ct=0}}}cf.status=ct;cf.statusText=""+(cp||cq);if(e){cn.resolveWith(co,[cx,cq,cf])}else{cn.rejectWith(co,[cf,cq,cv])}cf.statusCode(b6);b6=aC;if(b1){cc.trigger("ajax"+(e?"Success":"Error"),[cf,b9,e?cx:cv])}cj.fireWith(co,[cf,cq]);if(b1){cc.trigger("ajaxComplete",[cf,b9]);if(!(--bH.active)){bH.event.trigger("ajaxStop")}}}cn.promise(cf);cf.success=cf.done;cf.error=cf.fail;cf.complete=cj.add;cf.statusCode=function(cp){if(cp){var e;if(b4<2){for(e in cp){b6[e]=[b6[e],cp[e]]}}else{e=cp[cf.status];cf.always(e)}}return this};b9.url=((b5||b9.url)+"").replace(ao,"").replace(aD,bY[1]+"//");b9.dataTypes=bH.trim(b9.dataType||"*").toLowerCase().split(aW);if(b9.crossDomain==null){ce=aU.exec(b9.url.toLowerCase());b9.crossDomain=!!(ce&&(ce[1]!=bY[1]||ce[2]!=bY[2]||(ce[3]||(ce[1]==="http:"?80:443))!=(bY[3]||(bY[1]==="http:"?80:443))))}if(b9.data&&b9.processData&&typeof b9.data!=="string"){b9.data=bH.param(b9.data,b9.traditional)}s(x,b9,b2,cf);if(b4===2){return cf}b1=b9.global;b9.type=b9.type.toUpperCase();b9.hasContent=!t.test(b9.type);if(b1&&bH.active++===0){bH.event.trigger("ajaxStart")}if(!b9.hasContent){if(b9.data){b9.url+=(bO.test(b9.url)?"&":"?")+b9.data;delete b9.data}b8=b9.url;if(b9.cache===false){var b0=bH.now(),cl=b9.url.replace(Q,"$1_="+b0);b9.url=cl+((cl===b9.url)?(bO.test(b9.url)?"&":"?")+"_="+b0:"")}}if(b9.data&&b9.hasContent&&b9.contentType!==false||b2.contentType){cf.setRequestHeader("Content-Type",b9.contentType)}if(b9.ifModified){b8=b8||b9.url;if(bH.lastModified[b8]){cf.setRequestHeader("If-Modified-Since",bH.lastModified[b8])}if(bH.etag[b8]){cf.setRequestHeader("If-None-Match",bH.etag[b8])}}cf.setRequestHeader("Accept",b9.dataTypes[0]&&b9.accepts[b9.dataTypes[0]]?b9.accepts[b9.dataTypes[0]]+(b9.dataTypes[0]!=="*"?", "+aY+"; q=0.01":""):b9.accepts["*"]);for(cg in b9.headers){cf.setRequestHeader(cg,b9.headers[cg])}if(b9.beforeSend&&(b9.beforeSend.call(co,cf,b9)===false||b4===2)){return cf.abort()}b7="abort";for(cg in {success:1,error:1,complete:1}){cf[cg](b9[cg])}ch=s(a7,b9,b2,cf);if(!ch){cb(-1,"No Transport")}else{cf.readyState=1;if(b1){cc.trigger("ajaxSend",[cf,b9])}if(b9.async&&b9.timeout>0){ca=setTimeout(function(){cf.abort("timeout")},b9.timeout)}try{b4=1;ch.send(cd,cb)}catch(ci){if(b4<2){cb(-1,ci)}else{throw ci}}}return cf},active:0,lastModified:{},etag:{}});function j(b8,b7,b4){var b3,b5,b2,e,b0=b8.contents,b6=b8.dataTypes,b1=b8.responseFields;for(b5 in b1){if(b5 in b4){b7[b1[b5]]=b4[b5]}}while(b6[0]==="*"){b6.shift();if(b3===aC){b3=b8.mimeType||b7.getResponseHeader("content-type")}}if(b3){for(b5 in b0){if(b0[b5]&&b0[b5].test(b3)){b6.unshift(b5);break}}}if(b6[0] in b4){b2=b6[0]}else{for(b5 in b4){if(!b6[0]||b8.converters[b5+" "+b6[0]]){b2=b5;break}if(!e){e=b5}}b2=b2||e}if(b2){if(b2!==b6[0]){b6.unshift(b2)}return b4[b2]}}function af(ca,b2){var b8,b0,b6,b4,b7=ca.dataTypes.slice(),b1=b7[0],b9={},b3=0;if(ca.dataFilter){b2=ca.dataFilter(b2,ca.dataType)}if(b7[1]){for(b8 in ca.converters){b9[b8.toLowerCase()]=ca.converters[b8]}}for(;(b6=b7[++b3]);){if(b6!=="*"){if(b1!=="*"&&b1!==b6){b8=b9[b1+" "+b6]||b9["* "+b6];if(!b8){for(b0 in b9){b4=b0.split(" ");if(b4[1]===b6){b8=b9[b1+" "+b4[0]]||b9["* "+b4[0]];if(b8){if(b8===true){b8=b9[b0]}else{if(b9[b0]!==true){b6=b4[0];b7.splice(b3--,0,b6)}}break}}}}if(b8!==true){if(b8&&ca["throws"]){b2=b8(b2)}else{try{b2=b8(b2)}catch(b5){return{state:"parsererror",error:b8?b5:"No conversion from "+b1+" to "+b6}}}}}b1=b6}}return{state:"success",data:b2}}var bq=[],ax=/\?/,a6=/(=)\?(?=&|$)|\?\?/,bm=bH.now();bH.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=bq.pop()||(bH.expando+"_"+(bm++));this[e]=true;return e}});bH.ajaxPrefilter("json jsonp",function(b9,b4,b8){var b7,e,b6,b2=b9.data,b0=b9.url,b1=b9.jsonp!==false,b5=b1&&a6.test(b0),b3=b1&&!b5&&typeof b2==="string"&&!(b9.contentType||"").indexOf("application/x-www-form-urlencoded")&&a6.test(b2);if(b9.dataTypes[0]==="jsonp"||b5||b3){b7=b9.jsonpCallback=bH.isFunction(b9.jsonpCallback)?b9.jsonpCallback():b9.jsonpCallback;e=a3[b7];if(b5){b9.url=b0.replace(a6,"$1"+b7)}else{if(b3){b9.data=b2.replace(a6,"$1"+b7)}else{if(b1){b9.url+=(ax.test(b0)?"&":"?")+b9.jsonp+"="+b7}}}b9.converters["script json"]=function(){if(!b6){bH.error(b7+" was not called")}return b6[0]};b9.dataTypes[0]="json";a3[b7]=function(){b6=arguments};b8.always(function(){a3[b7]=e;if(b9[b7]){b9.jsonpCallback=b4.jsonpCallback;bq.push(b7)}if(b6&&bH.isFunction(e)){e(b6[0])}b6=e=aC});return"script"}});bH.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){bH.globalEval(e);return e}}});bH.ajaxPrefilter("script",function(e){if(e.cache===aC){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});bH.ajaxTransport("script",function(b1){if(b1.crossDomain){var e,b0=q.head||q.getElementsByTagName("head")[0]||q.documentElement;return{send:function(b2,b3){e=q.createElement("script");e.async="async";if(b1.scriptCharset){e.charset=b1.scriptCharset}e.src=b1.url;e.onload=e.onreadystatechange=function(b5,b4){if(b4||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(b0&&e.parentNode){b0.removeChild(e)}e=aC;if(!b4){b3(200,"success")}}};b0.insertBefore(e,b0.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var ai,aP=a3.ActiveXObject?function(){for(var e in ai){ai[e](0,1)}}:false,av=0;function bC(){try{return new a3.XMLHttpRequest()}catch(b0){}}function bc(){try{return new a3.ActiveXObject("Microsoft.XMLHTTP")}catch(b0){}}bH.ajaxSettings.xhr=a3.ActiveXObject?function(){return !this.isLocal&&bC()||bc()}:bC;(function(e){bH.extend(bH.support,{ajax:!!e,cors:!!e&&("withCredentials" in e)})})(bH.ajaxSettings.xhr());if(bH.support.ajax){bH.ajaxTransport(function(e){if(!e.crossDomain||bH.support.cors){var b0;return{send:function(b6,b1){var b4,b3,b5=e.xhr();if(e.username){b5.open(e.type,e.url,e.async,e.username,e.password)}else{b5.open(e.type,e.url,e.async)}if(e.xhrFields){for(b3 in e.xhrFields){b5[b3]=e.xhrFields[b3]}}if(e.mimeType&&b5.overrideMimeType){b5.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!b6["X-Requested-With"]){b6["X-Requested-With"]="XMLHttpRequest"}try{for(b3 in b6){b5.setRequestHeader(b3,b6[b3])}}catch(b2){}b5.send((e.hasContent&&e.data)||null);b0=function(cf,b9){var ca,b8,b7,cd,cc;try{if(b0&&(b9||b5.readyState===4)){b0=aC;if(b4){b5.onreadystatechange=bH.noop;if(aP){delete ai[b4]}}if(b9){if(b5.readyState!==4){b5.abort()}}else{ca=b5.status;b7=b5.getAllResponseHeaders();cd={};cc=b5.responseXML;if(cc&&cc.documentElement){cd.xml=cc}try{cd.text=b5.responseText}catch(cf){}try{b8=b5.statusText}catch(ce){b8=""}if(!ca&&e.isLocal&&!e.crossDomain){ca=cd.text?200:404}else{if(ca===1223){ca=204}}}}}catch(cb){if(!b9){b1(-1,cb)}}if(cd){b1(ca,b8,cd,b7)}};if(!e.async){b0()}else{if(b5.readyState===4){setTimeout(b0,0)}else{b4=++av;if(aP){if(!ai){ai={};bH(a3).unload(aP)}ai[b4]=b0}b5.onreadystatechange=b0}}},abort:function(){if(b0){b0(0,1)}}}}})}var M,ac,bP=/^(?:toggle|show|hide)$/,bI=new RegExp("^(?:([-+])=|)("+by+")([a-z%]*)$","i"),bN=/queueHooks$/,ay=[k],a2={"*":[function(b0,b6){var b3,b7,e,b8=this.createTween(b0,b6),b4=bI.exec(b6),b5=b8.cur(),b1=+b5||0,b2=1;if(b4){b3=+b4[2];b7=b4[3]||(bH.cssNumber[b0]?"":"px");if(b7!=="px"&&b1){b1=bH.css(b8.elem,b0,true)||b3||1;do{e=b2=b2||".5";b1=b1/b2;bH.style(b8.elem,b0,b1+b7);b2=b8.cur()/b5}while(b2!==1&&b2!==e)}b8.unit=b7;b8.start=b1;b8.end=b4[1]?b1+(b4[1]+1)*b3:b3}return b8}]};function bk(){setTimeout(function(){M=aC},0);return(M=bH.now())}function bd(b0,e){bH.each(e,function(b5,b3){var b4=(a2[b5]||[]).concat(a2["*"]),b1=0,b2=b4.length;for(;b1<b2;b1++){if(b4[b1].call(b0,b5,b3)){return}}})}function g(b1,b5,b8){var b9,b4=0,e=0,b0=ay.length,b7=bH.Deferred().always(function(){delete b3.elem}),b3=function(){var ce=M||bk(),cb=Math.max(0,b2.startTime+b2.duration-ce),cd=1-(cb/b2.duration||0),ca=0,cc=b2.tweens.length;for(;ca<cc;ca++){b2.tweens[ca].run(cd)}b7.notifyWith(b1,[b2,cd,cb]);if(cd<1&&cc){return cb}else{b7.resolveWith(b1,[b2]);return false}},b2=b7.promise({elem:b1,props:bH.extend({},b5),opts:bH.extend(true,{specialEasing:{}},b8),originalProperties:b5,originalOptions:b8,startTime:M||bk(),duration:b8.duration,tweens:[],createTween:function(cd,ca,cc){var cb=bH.Tween(b1,b2.opts,cd,ca,b2.opts.specialEasing[cd]||b2.opts.easing);b2.tweens.push(cb);return cb},stop:function(cb){var ca=0,cc=cb?b2.tweens.length:0;for(;ca<cc;ca++){b2.tweens[ca].run(1)}if(cb){b7.resolveWith(b1,[b2,cb])}else{b7.rejectWith(b1,[b2,cb])}return this}}),b6=b2.props;al(b6,b2.opts.specialEasing);for(;b4<b0;b4++){b9=ay[b4].call(b2,b1,b6,b2.opts);if(b9){return b9}}bd(b2,b6);if(bH.isFunction(b2.opts.start)){b2.opts.start.call(b1,b2)}bH.fx.timer(bH.extend(b3,{anim:b2,queue:b2.opts.queue,elem:b1}));return b2.progress(b2.opts.progress).done(b2.opts.done,b2.opts.complete).fail(b2.opts.fail).always(b2.opts.always)}function al(b2,b4){var b1,b0,b5,b3,e;for(b1 in b2){b0=bH.camelCase(b1);b5=b4[b0];b3=b2[b1];if(bH.isArray(b3)){b5=b3[1];b3=b2[b1]=b3[0]}if(b1!==b0){b2[b0]=b3;delete b2[b1]}e=bH.cssHooks[b0];if(e&&"expand" in e){b3=e.expand(b3);delete b2[b0];for(b1 in b3){if(!(b1 in b2)){b2[b1]=b3[b1];b4[b1]=b5}}}else{b4[b0]=b5}}}bH.Animation=bH.extend(g,{tweener:function(b0,b3){if(bH.isFunction(b0)){b3=b0;b0=["*"]}else{b0=b0.split(" ")}var b2,e=0,b1=b0.length;for(;e<b1;e++){b2=b0[e];a2[b2]=a2[b2]||[];a2[b2].unshift(b3)}},prefilter:function(b0,e){if(e){ay.unshift(b0)}else{ay.push(b0)}}});function k(b3,b8,e){var b7,b1,ca,b2,ce,cd,cc,cb,b4=this,b0=b3.style,b9={},b6=[],b5=b3.nodeType&&R(b3);if(!e.queue){cc=bH._queueHooks(b3,"fx");if(cc.unqueued==null){cc.unqueued=0;cb=cc.empty.fire;cc.empty.fire=function(){if(!cc.unqueued){cb()}}}cc.unqueued++;b4.always(function(){b4.always(function(){cc.unqueued--;if(!bH.queue(b3,"fx").length){cc.empty.fire()}})})}if(b3.nodeType===1&&("height" in b8||"width" in b8)){e.overflow=[b0.overflow,b0.overflowX,b0.overflowY];if(bH.css(b3,"display")==="inline"&&bH.css(b3,"float")==="none"){if(!bH.support.inlineBlockNeedsLayout||bD(b3.nodeName)==="inline"){b0.display="inline-block"}else{b0.zoom=1}}}if(e.overflow){b0.overflow="hidden";if(!bH.support.shrinkWrapBlocks){b4.done(function(){b0.overflow=e.overflow[0];b0.overflowX=e.overflow[1];b0.overflowY=e.overflow[2]})}}for(b7 in b8){ca=b8[b7];if(bP.exec(ca)){delete b8[b7];if(ca===(b5?"hide":"show")){continue}b6.push(b7)}}b2=b6.length;if(b2){ce=bH._data(b3,"fxshow")||bH._data(b3,"fxshow",{});if(b5){bH(b3).show()}else{b4.done(function(){bH(b3).hide()})}b4.done(function(){var cf;bH.removeData(b3,"fxshow",true);for(cf in b9){bH.style(b3,cf,b9[cf])}});for(b7=0;b7<b2;b7++){b1=b6[b7];cd=b4.createTween(b1,b5?ce[b1]:0);b9[b1]=ce[b1]||bH.style(b3,b1);if(!(b1 in ce)){ce[b1]=cd.start;if(b5){cd.end=cd.start;cd.start=b1==="width"||b1==="height"?1:0}}}}}function I(b1,b0,b3,e,b2){return new I.prototype.init(b1,b0,b3,e,b2)}bH.Tween=I;I.prototype={constructor:I,init:function(b2,b0,b4,e,b3,b1){this.elem=b2;this.prop=b4;this.easing=b3||"swing";this.options=b0;this.start=this.now=this.cur();this.end=e;this.unit=b1||(bH.cssNumber[b4]?"":"px")},cur:function(){var e=I.propHooks[this.prop];return e&&e.get?e.get(this):I.propHooks._default.get(this)},run:function(b1){var b0,e=I.propHooks[this.prop];this.pos=b0=bH.easing[this.easing](b1,this.options.duration*b1,0,1,this.options.duration);this.now=(this.end-this.start)*b0+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(e&&e.set){e.set(this)}else{I.propHooks._default.set(this)}return this}};I.prototype.init.prototype=I.prototype;I.propHooks={_default:{get:function(b0){var e;if(b0.elem[b0.prop]!=null&&(!b0.elem.style||b0.elem.style[b0.prop]==null)){return b0.elem[b0.prop]}e=bH.css(b0.elem,b0.prop,false,"");return !e||e==="auto"?0:e},set:function(e){if(bH.fx.step[e.prop]){bH.fx.step[e.prop](e)}else{if(e.elem.style&&(e.elem.style[bH.cssProps[e.prop]]!=null||bH.cssHooks[e.prop])){bH.style(e.elem,e.prop,e.now+e.unit)}else{e.elem[e.prop]=e.now}}}}};I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(e){if(e.elem.nodeType&&e.elem.parentNode){e.elem[e.prop]=e.now}}};bH.each(["toggle","show","hide"],function(b0,e){var b1=bH.fn[e];bH.fn[e]=function(b2,b4,b3){return b2==null||typeof b2==="boolean"||(!b0&&bH.isFunction(b2)&&bH.isFunction(b4))?b1.apply(this,arguments):this.animate(bG(e,true),b2,b4,b3)}});bH.fn.extend({fadeTo:function(e,b2,b1,b0){return this.filter(R).css("opacity",0).show().end().animate({opacity:b2},e,b1,b0)},animate:function(b5,b2,b4,b3){var b1=bH.isEmptyObject(b5),e=bH.speed(b2,b4,b3),b0=function(){var b6=g(this,bH.extend({},b5),e);if(b1){b6.stop(true)}};return b1||e.queue===false?this.each(b0):this.queue(e.queue,b0)},stop:function(b1,b0,e){var b2=function(b3){var b4=b3.stop;delete b3.stop;b4(e)};if(typeof b1!=="string"){e=b0;b0=b1;b1=aC}if(b0&&b1!==false){this.queue(b1||"fx",[])}return this.each(function(){var b6=true,b3=b1!=null&&b1+"queueHooks",b5=bH.timers,b4=bH._data(this);if(b3){if(b4[b3]&&b4[b3].stop){b2(b4[b3])}}else{for(b3 in b4){if(b4[b3]&&b4[b3].stop&&bN.test(b3)){b2(b4[b3])}}}for(b3=b5.length;b3--;){if(b5[b3].elem===this&&(b1==null||b5[b3].queue===b1)){b5[b3].anim.stop(e);b6=false;b5.splice(b3,1)}}if(b6||!e){bH.dequeue(this,b1)}})}});function bG(b1,b3){var b2,e={height:b1},b0=0;for(;b0<4;b0+=2-b3){b2=bR[b0];e["margin"+b2]=e["padding"+b2]=b1}if(b3){e.opacity=e.width=b1}return e}bH.each({slideDown:bG("show"),slideUp:bG("hide"),slideToggle:bG("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,b0){bH.fn[e]=function(b1,b3,b2){return this.animate(b0,b1,b3,b2)}});bH.speed=function(b1,b2,b0){var e=b1&&typeof b1==="object"?bH.extend({},b1):{complete:b0||!b0&&b2||bH.isFunction(b1)&&b1,duration:b1,easing:b0&&b2||b2&&!bH.isFunction(b2)&&b2};e.duration=bH.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in bH.fx.speeds?bH.fx.speeds[e.duration]:bH.fx.speeds._default;if(e.queue==null||e.queue===true){e.queue="fx"}e.old=e.complete;e.complete=function(){if(bH.isFunction(e.old)){e.old.call(this)}if(e.queue){bH.dequeue(this,e.queue)}};return e};bH.easing={linear:function(e){return e},swing:function(e){return 0.5-Math.cos(e*Math.PI)/2}};bH.timers=[];bH.fx=I.prototype.init;bH.fx.tick=function(){var b1,b0=bH.timers,e=0;for(;e<b0.length;e++){b1=b0[e];if(!b1()&&b0[e]===b1){b0.splice(e--,1)}}if(!b0.length){bH.fx.stop()}};bH.fx.timer=function(e){if(e()&&bH.timers.push(e)&&!ac){ac=setInterval(bH.fx.tick,bH.fx.interval)}};bH.fx.interval=13;bH.fx.stop=function(){clearInterval(ac);ac=null};bH.fx.speeds={slow:600,fast:200,_default:400};bH.fx.step={};if(bH.expr&&bH.expr.filters){bH.expr.filters.animated=function(e){return bH.grep(bH.timers,function(b0){return e===b0.elem}).length}}var bn=/^(?:body|html)$/i;bH.fn.offset=function(cb){if(arguments.length){return cb===aC?this:this.each(function(cc){bH.offset.setOffset(this,cb,cc)})}var b5,b0,b6,b7,b4,b8,e,b3,b9,b2,b1=this[0],ca=b1&&b1.ownerDocument;if(!ca){return}if((b6=ca.body)===b1){return bH.offset.bodyOffset(b1)}b0=ca.documentElement;if(!bH.contains(b0,b1)){return{top:0,left:0}}b5=b1.getBoundingClientRect();b7=bo(ca);b4=b0.clientTop||b6.clientTop||0;b8=b0.clientLeft||b6.clientLeft||0;e=b7.pageYOffset||b0.scrollTop;b3=b7.pageXOffset||b0.scrollLeft;b9=b5.top+e-b4;b2=b5.left+b3-b8;return{top:b9,left:b2}};bH.offset={bodyOffset:function(e){var b1=e.offsetTop,b0=e.offsetLeft;if(bH.support.doesNotIncludeMarginInBodyOffset){b1+=parseFloat(bH.css(e,"marginTop"))||0;b0+=parseFloat(bH.css(e,"marginLeft"))||0}return{top:b1,left:b0}},setOffset:function(b2,cb,b5){var b6=bH.css(b2,"position");if(b6==="static"){b2.style.position="relative"}var b4=bH(b2),b0=b4.offset(),e=bH.css(b2,"top"),b9=bH.css(b2,"left"),ca=(b6==="absolute"||b6==="fixed")&&bH.inArray("auto",[e,b9])>-1,b8={},b7={},b1,b3;if(ca){b7=b4.position();b1=b7.top;b3=b7.left}else{b1=parseFloat(e)||0;b3=parseFloat(b9)||0}if(bH.isFunction(cb)){cb=cb.call(b2,b5,b0)}if(cb.top!=null){b8.top=(cb.top-b0.top)+b1}if(cb.left!=null){b8.left=(cb.left-b0.left)+b3}if("using" in cb){cb.using.call(b2,b8)}else{b4.css(b8)}}};bH.fn.extend({position:function(){if(!this[0]){return}var b1=this[0],b0=this.offsetParent(),b2=this.offset(),e=bn.test(b0[0].nodeName)?{top:0,left:0}:b0.offset();b2.top-=parseFloat(bH.css(b1,"marginTop"))||0;b2.left-=parseFloat(bH.css(b1,"marginLeft"))||0;e.top+=parseFloat(bH.css(b0[0],"borderTopWidth"))||0;e.left+=parseFloat(bH.css(b0[0],"borderLeftWidth"))||0;return{top:b2.top-e.top,left:b2.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||q.body;while(e&&(!bn.test(e.nodeName)&&bH.css(e,"position")==="static")){e=e.offsetParent}return e||q.body})}});bH.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b1,b0){var e=/Y/.test(b0);bH.fn[b1]=function(b2){return bH.access(this,function(b3,b6,b5){var b4=bo(b3);if(b5===aC){return b4?(b0 in b4)?b4[b0]:b4.document.documentElement[b6]:b3[b6]}if(b4){b4.scrollTo(!e?b5:bH(b4).scrollLeft(),e?b5:bH(b4).scrollTop())}else{b3[b6]=b5}},b1,b2,arguments.length,null)}});function bo(e){return bH.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}bH.each({Height:"height",Width:"width"},function(e,b0){bH.each({padding:"inner"+e,content:b0,"":"outer"+e},function(b1,b2){bH.fn[b2]=function(b6,b5){var b4=arguments.length&&(b1||typeof b6!=="boolean"),b3=b1||(b6===true||b5===true?"margin":"border");return bH.access(this,function(b8,b7,b9){var ca;if(bH.isWindow(b8)){return b8.document.documentElement["client"+e]}if(b8.nodeType===9){ca=b8.documentElement;return Math.max(b8.body["scroll"+e],ca["scroll"+e],b8.body["offset"+e],ca["offset"+e],ca["client"+e])}return b9===aC?bH.css(b8,b7,b9,b3):bH.style(b8,b7,b9,b3)},b0,b4?b6:aC,b4)}})});a3.jQuery=a3.$=bH;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return bH})}})(window);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){a.rup_utils={};a.rup_utils.arr=[];a.rup_utils.autoGenerateIdNum=0;a.extend(a.rup_utils,{capitalizedLang:function(){if(a.rup.lang==null){return""}return a.rup.lang.charAt(0).toUpperCase()+a.rup.lang.slice(1)},jsontoarray:function(e){var b=[];function d(k,j){j=j||"";if(k===undefined||k===null){d("",j)}else{if(k.constructor==Object){for(var l in k){var g=j+(j==""?l:"."+l);d(k[l],g)}}else{if(k.constructor==Array){for(var h=0;h<k.length;h++){var f="["+h+"]",g=j+f;d(k[h],g)}}else{if(b[j]==undefined){b[j]=k}else{if(b[j].constructor!=Array){b[j]=[b[j],k]}else{b[j].push(k)}}}}}}d(e);return b},unnestjson:function(d){var e=a.rup_utils.jsontoarray(d);var b={};for(key in e){if(!a.isFunction(e[key])){b[key]=e[key]}}return b},elementFromPoint:function(d,h,g){var f=true,e=g||true;if(!document.elementFromPoint){return null}if(!e){var b;if((b=a(document).scrollTop())>0){f=(document.elementFromPoint(0,b+a(window).height()-1)==null)}else{if((b=a(document).scrollLeft())>0){f=(document.elementFromPoint(b+a(window).width()-1,0)==null)}}e=(b>0)}if(!f){d+=a(document).scrollLeft();h+=a(document).scrollTop()}return document.elementFromPoint(d,h)},firstCharToLowerCase:function(b){return b.substring(0,1).toLowerCase()+b.substring(1)},getJQueryId:function(b,e){var d;if(typeof b==="string"){d=b;if(e===true){d=String(d).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")}return d[0]==="#"?d:"#"+d}return null},queryStringToJson:function(b){function e(n,q,p){if(q.length>1){var o=q.shift();if(typeof n[o]=="undefined"){n[o]=q[0]==""?[]:{}}arguments.callee(n[o],q,p)}else{if(n instanceof Array){n.push(p)}else{n[q]=p}}}var m=b.split("&"),h={},f,d,k,l,j;for(var g=0;g<m.length;g++){f=m[g].split("=");d=decodeURIComponent(f[0]);k=decodeURIComponent(f[1]);l=d.match(/(^[^\[]+)(\[.*\]$)?/);j=l[1];if(l[2]){l=l[2].match(/(?=\[(.*)\]$)/)[1].split("][")}else{l=[]}l.unshift(j);e(h,l,k)}return h},populateForm:function(b,g){var e,f;if(b){for(var d in b){f=a("[name='"+d+"']",g);if(f.is("[ruptype]")){f["rup_"+f.attr("ruptype")]("setRupValue",b[d])}else{if(f.is("input:radio")||f.is("input:checkbox")){f.each(function(){if(a(this).val()==b[d]){a(this).attr("checked","checked")}else{a(this).removeAttr("checked")}})}else{if(f.is("select")){f.val(b[d]).click()}else{if(f.is(":not(img)")){f.val(b[d])}}}}}}},createDate:function(b,e,d){return a.datepicker.formatDate(a.rup.i18n.base.rup_date.dateFormat,new Date(d,e-1,b))},createTime:function(b,e,d){return new Date(null,null,null,b,e,d)},
/*
		 * jQuery CooQuery Plugin v2
		 * http://cooquery.lenonmarcel.com.br/
		 *
		 * Copyright 2009, 2010 Lenon Marcel
		 * Dual licensed under the MIT and GPL licenses.
		 * http://www.opensource.org/licenses/mit-license.php
		 * http://www.gnu.org/licenses/gpl.html
		 *
		 * Date: 2010-01-24 (Sun, 24 January 2010)
		 */
setCookie:function(e,f,d){if(typeof e==="undefined"||typeof f==="undefined"||e===null||f===null){a.rup.errorGestor("["+a.rup.i18nParse(a.rup.i18n.base,"rup_global.metodError")+"setCookie] - "+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.paramsError"));return false}var g=e+"="+encodeURIComponent(f);if(typeof d!=="undefined"&&d!==null){if(d.domain){g+="; domain="+d.domain}if(d.path){g+="; path="+d.path}if(d.duration){var b=new Date();b.setTime(b.getTime()+d.duration*24*60*60*1000);g+="; expires="+b.toGMTString()}if(d.secure){g+="; secure"}}return(document.cookie=g)},delCookie:function(b){if(typeof b==="undefined"||b===null){a.rup.errorGestor("["+a.rup.i18nParse(a.rup.i18n.base,"rup_global.metodError")+"delCookie] - "+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.paramsError"));return false}return a.rup_utils.setCookie(b,"",{duration:-1})},readCookie:function(b){if(typeof b==="undefined"||b===null){a.rup.errorGestor("["+a.rup.i18nParse(a.rup.i18n.base,"rup_global.metodError")+"readCookie] - "+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.paramsError"));return false}var d=document.cookie.match("(?:^|;)\\s*"+b.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")+"=([^;]*)");return(d)?decodeURIComponent(d[1]):null},get:function(b,f){var h=null;if(document.cookie&&document.cookie!=""){var g=document.cookie.split(";");for(var e=0;e<g.length;e++){var d=a.trim(g[e]);if(d.substring(0,b.length+1)==(b+"=")){h=f?a.JSON.decode(decodeURIComponent(d.substring(b.length+1))):decodeURIComponent(d.substring(b.length+1));break}}}return h},set:function(f,h,e){e=a.extend({},e);if(h===null){h="";e.expires=-1}var b="";if(e.expires&&(typeof e.expires=="number"||e.expires.toUTCString)){var d;if(typeof e.expires=="number"){d=new Date();d.setTime(d.getTime()+(e.expires*24*60*60*1000))}else{d=e.expires}b="; expires="+d.toUTCString()}h=e.json?encodeURIComponent(a.JSON.encode(h)):encodeURIComponent(h);var k=e.path?"; path="+(e.path):"";var g=e.domain?"; domain="+(e.domain):"";var j=e.secure?"; secure":"";document.cookie=[f,"=",h,b,k,g,j].join("")},compareObjects:function(b,f){var e=true;if(Object.keys(b).length!==Object.keys(f).length){return false}for(var d in b){if(typeof b[d]=="object"&&typeof f[d]=="object"){e=compareObjects(b[d],f[d]);if(!e){break}}else{if(b[d]!==f[d]){e=false;break}}}return e},escapeId:function(b){if(b){return b.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1")}return""},selectorId:function(b){if((typeof b==="string")&&(b.substring(0,1)!=="#")){return("#"+b)}else{return(b)}},randomIdGenerator:function(b){var d="rupRandomLayerId-"+a.rup_utils.autoGenerateIdNum;b.attr("id",d).addClass("rupRandomLayerId");a.rup_utils.autoGenerateIdNum=a.rup_utils.autoGenerateIdNum+1;return d},setNoPortalParam:function(b){if(b!==undefined&&b!==null){if(a.rup_utils.readCookie("r01PortalInfo")!==null&&b.match("R01HNoPortal")===null&&((a("div.r01gContainer").length>0))||(a("div.r01gApplication").length>0)){return b+(b.match("\\?")===null?"?":"&")+"R01HNoPortal=true"}}return b},aplicatioInPortal:function(){if(!(a.rup_utils.readCookie("r01PortalInfo")!==null&&a("div.r01gContainer").length>0)){return false}else{return true}},relToAbsUrl:function(d){var m=a(location);if(typeof d==="string"){var h=d.substring(0,1);var g=d.substring(1,2);if(a.url(d).attr("protocol")===undefined||a.url(d).attr("protocol")===""){if(h==="/"){if(g===undefined||g!=="/"){return(m.attr("protocol")+"//"+m.attr("host")+d)}else{return(m.attr("protocol")+d)}}else{if(h==="."){if(g===undefined){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamError")+d+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamErrorEnd"));return(undefined)}else{if(g==="/"){var j=a.url(m.attr("href"),true);return(j.attr("base")+j.attr("directory")+d.substring(2,d.length))}else{if(g==="."){var e=m.attr("pathname").split("/");var k=(e.length)-2;if((d.substring(2,3)!==undefined)&&(d.substring(2,3)==="/")){var l=d.split("../");var n=(l.length)-1;if(n>=k){return(m.attr("protocol")+"//"+m.attr("host")+"/"+l[l.length-1])}else{var b="";for(var f=k-n;f>0;f--){b=e[f]+"/"+b}return(m.attr("protocol")+"//"+m.attr("host")+"/"+b+l[l.length-1])}}else{var l=d.split("..");var n=(l.length)-1;if(n>=k){return(m.attr("protocol")+"//"+m.attr("host")+l[l.length-1])}else{var b="";for(var f=k-n;f>0;f--){b=e[f]+"/"+b}return(m.attr("protocol")+"//"+m.attr("host")+"/"+b+l[l.length-1])}}}else{a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamError")+d+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamErrorEnd"));return(undefined)}}}}else{var j=a.url(m.attr("href"),true);return(j.attr("base")+j.attr("directory")+d)}}}else{return(d)}}else{a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamFormatError"));return(undefined)}},printMsg:function(e){var b="";if(typeof e==="string"){return e+"<br/>"}else{if(typeof e==="object"){if(jQuery.isArray(e)){for(var d=0;d<e.length;d++){b+=a.rup_utils.printMsgAux(e[d],1)}return b}else{b+=a.rup_utils.printMsgAux(e,1)}}}return b},printMsgAux:function(g,h){var b="";if(typeof g==="string"){return a("<span>").append(g)[0].outerHTML+"<br/>"}else{if(typeof g==="object"){if(jQuery.isArray(g)){var e=a("<ul>").addClass("rup-maint_feedbackUL");for(var d=0;d<g.length;d++){if(h===1){e.append(a("<li>").append(a.rup_utils.printMsgAux(g[d],h+1)))}else{e.append(a.rup_utils.printMsgAux(g[d],h+1))}}return b+=e[0].outerHTML}else{var f=a("<span>");if(g.style!==undefined){f.addClass(g.style)}if(g.label!==undefined){f.append(g.label)}return f[0].outerHTML+"<br/>"}}}},getUrlVars:function(){if(a.rup.getParams===undefined){var f={},e;var b=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var d=0;d<b.length;d++){e=decodeURIComponent(b[d]).split("=");f[e[0]]=e[1]}a.rup.getParams=f}return a.rup.getParams},getUrlVar:function(b){return a.rup_utils.getUrlVars()[b]},sortArray:function(g,f){function e(l,k,h){var j=l[k];l[k]=l[h];l[h]=j}function d(l,k){for(var h=l.length-1;h>0;h--){for(var j=0;j<h;j++){if(k(l[j],l[j+1])>0){e(j,j+1)}}}}function b(j,h){return j-h}if(!a.isArray(g)){return undefined}if(a.isFunction(f)){d(g,f)}d(g,b)},insertSorted:function(e,b,d){if(!a.isArray(e)){return undefined}e.push(b);a.rup_utils.sortArray(e,d);return a.inArray(b,e)}});a.fn.serializeToObject=function(){var d={},b=this.serializeArrayWithoutNulls();a.each(b,function(){if(d[this.name]){if(!d[this.name].push){d[this.name]=[d[this.name]]}d[this.name].push(this.value||"")}else{d[this.name]=this.value}});return d};a.fn.serializeArrayWithoutNulls=function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||(/select|textarea/i).test(this.nodeName)||(/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i).test(this.type))}).map(function(b,d){var e=jQuery(this).val();if((jQuery(this).hasClass("numeric")||jQuery(this).hasClass("datepicker"))){return{name:d.name,value:null}}return e===null||e===""?null:jQuery.isArray(e)?jQuery.map(e,function(g,f){return{name:d.name,value:g}}):{name:d.name,value:e}}).get()};a.fn.serializeObject=function(){var d={},b=this.serializeArrayNull();a.each(b,function(){if(d[this.name]){if(!d[this.name].push){d[this.name]=[d[this.name]]}d[this.name].push(this.value||"")}else{d[this.name]=this.value}});return d};a.fn.serializeArrayNull=function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||(/select|textarea/i).test(this.nodeName)||(/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i).test(this.type))}).map(function(b,d){var e=jQuery(this).val();if((jQuery(this).hasClass("numeric")||jQuery(this).hasClass("datepicker"))&&e===""){return{name:d.name,value:null}}return e===null?null:jQuery.isArray(e)?jQuery.map(e,function(g,f){return{name:d.name,value:g}}):{name:d.name,value:e}}).get()}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(d){String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};d.extend({set_uda_ajax_mode_on:function(){if(d.ajax!==d.rup_ajax){d.ajaxUDA=d.ajax;d.ajax=d.rup_ajax}},rup_ajax:function(h){var l={cache:false,error:null},j=d.extend({},l,h),g,m,f,k;m=j.error;g=function(p,q,o){var n=d.rup.rupAjaxDefaultError(p,q,o);if(m!=null){d(m(p,q,o))}else{if(n){d.rup.showErrorToUser(n)}}};f=j.complete;k=function(n,o){if(d.ajax===d.rup_ajax&&d.ajaxUDA!==d.rup_ajax){d.ajax=d.ajaxUDA}if(f!=null){f(n,o)}};j.complete=k;j.error=g;j.url=d.rup_utils.setNoPortalParam(j.url);if(typeof d.ajaxUDA==="function"){d.ajaxUDA(j)}else{d.ajax(j)}}});d.rup=d.rup||{};d.extend(d.rup,{i18n:{},appResources:{},lang:null,getBrowserLenguage:function(){return((navigator.language||navigator.userLanguage).split("-")[0].toLowerCase())},browser:{version:d.browser.version,isIE:d.browser.msie?true:false,isSafari:d.browser.safari&&d.browser.webkit?true:false,isChrome:d.browser.safari&&d.browser.webkit?true:false,isFF:d.browser.mozilla?true:false,isOpera:d.browser.opera?true:false},setLiterals:function(f){if(f!==undefined&&f!==null&&f!==""){d.rup.lang=f}d.rup_ajax({url:d.rup.RUP+"/resources/rup.i18n_"+d.rup.lang+".json",dataType:"json",type:"GET",async:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(g){d.rup.i18n.base=g;d.jgrid={};d.extend(d.jgrid,g.rup_grid);d.jgrid.formatter.date.S=new Function("j",g.rup_grid.formatter.date.S)},error:function(g,j,h){alert("Se ha producido un error en el parseo del fichero JSON de literales => "+j+".\n\nError devuelto:\n"+j+": "+g.status+" - "+g.statusText)}})},getFile_i18n:function(){d.rup_ajax({url:d.rup.APP_STATICS+"/resources/"+d.rup.WAR_NAME+".i18n_"+d.rup.lang+".json",dataType:"json",type:"GET",async:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(f){d.rup.i18n.app=f},error:function(f,h,g){alert("Se ha producido un error en el parseo del fichero JSON de literales de la aplicación => "+h+".\n\nError devuelto:\n"+h+": "+f.status+" - "+f.statusText)}})},getFile:function(f){if(f===undefined&&f===null&&f===""){d.rup.errorGestor("No se ha definido el fichero a cargar")}else{if(!d.rup.i18n[f]){d.rup_ajax({url:d.rup.APP_STATICS+"/resources/"+f+".json",dataType:"json",type:"GET",async:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(h,j,g){d.rup.i18n[f]=h},error:function(g,j,h){d.rup.errorGestor("Se ha producido un error en el parseo del fichero JSON de la aplicación => "+j+".<br>Error devuelto:<br>"+h)}})}}},i18nParse:function(j,f,g){if(f!==undefined&&f!==null&&f!==""){var k=f.split("."),l=j;for(var h=0;h<k.length;h++){if(!d.isEmptyObject(l)){l=l[k[h]]}else{if(g===undefined||g===null||g===""){l=f}else{l=g}break}}return(l==undefined)?f:l}else{return"null_i18nCaption"}},i18nTemplate:function(h,f){var j=jQuery.rup.i18nParse(h,f),g=d.makeArray(arguments).slice(2);if(j===undefined){j=""}return j.replace(/\{(\d+)\}/g,function(k,l){return g[l]})},errorGestor:function(f){d.rup_messages("msgError",{title:d.rup.i18nParse(d.rup.i18n.base,"rup_global.developerError"),message:"<p>"+f+"</p>"});throw (f)},iniRup:function(){d.rup.i18n.app={};d.rup.i18n.base={};if(!window.LOCALE_COOKIE_NAME){LOCALE_COOKIE_NAME="language"}if(!window.LOCALE_PARAM_NAME){LOCALE_PARAM_NAME="locale"}d.rup.APP_RESOURCES=APP_RESOURCES;d.rup.APP_STATICS=STATICS+"/"+APP_RESOURCES;d.rup.CTX_PATH=CTX_PATH;d.rup.RUP=RUP;d.rup.STATICS=STATICS;d.rup.WAR_NAME=WAR_NAME;d.rup.AVAILABLE_LANGS=AVAILABLE_LANGS;d.rup.AVAILABLE_LANGS_ARRAY=d.map(d.rup.AVAILABLE_LANGS.split(","),function(g){return g.replace(/^\s*|\s*$/g,"")});d.rup.LAYOUT=LAYOUT;d.rup.LOCALE_COOKIE_NAME=LOCALE_COOKIE_NAME;d.rup.LOCALE_PARAM_NAME=LOCALE_PARAM_NAME;d.rup.IFRAME_ONLY_SUPPORTED_METHODS=["GET","POST"];delete APP_RESOURCES;delete CTX_PATH;delete RUP;delete STATICS;delete WAR_NAME;delete AVAILABLE_LANGS;delete LAYOUT;delete LOCALE_COOKIE_NAME;delete LOCALE_PARAM_NAME;var f=d.rup_utils.get(d.rup.LOCALE_COOKIE_NAME);if(f!==null&&f!==""){if(d.inArray(f,d.rup.AVAILABLE_LANGS_ARRAY)!==-1){this.lang=f}else{alert("La 'cookie' de idioma ("+d.rup.LOCALE_COOKIE_NAME+") no se corresponde con los idiomas soportados.\n\nLa página no se mostrará correctamente.");d.rup._avoidRUPFails();return false}}else{alert("No se ha encontrado la 'cookie' de idioma ("+d.rup.LOCALE_COOKIE_NAME+") requerida por UDA.\nRevise la configuración del navegador.\n\nLa página no se mostrará correctamente.");d.rup._avoidRUPFails();return false}d.rup.setLiterals();d.rup.getFile_i18n()},_avoidRUPFails:function(){var f=d.rup.i18nParse(d.rup.i18n.base,"rup_date.dateFormat");if(f==="rup_date.dateFormat"){d.rup.i18n.base.rup_date={dateFormat:"dd/mm/yy"}}d.jgrid={formatter:{integer:{}}}},getAccessor:function(h,f,g){if(typeof g==="string"){fn=h[g];if(fn===undefined){d.rup.errorGestor(f+' - No Existe el método "'+g+'"  en el patrón.')}else{return fn}}else{if(typeof g==="function"){d.rup.errorGestor(f+" - No es posible pasar funciones al patrón.")}}return undefined},rupAjaxDefaultError:function(k,l,j){var f=null;if(k.status==0){f=d.rup.i18nParse(d.rup.i18n.base,"rup_ajax.httpStatus0")}else{if(k.status==401){f=d.rup.i18nParse(d.rup.i18n.base,"rup_ajax.httpStatus401")}else{if(k.status==404){f=d.rup.i18nParse(d.rup.i18n.base,"rup_ajax.httpStatus404")}else{if(k.status==500){f=d.rup.i18nParse(d.rup.i18n.base,"rup_ajax.httpStatus500")}else{if(k.status==503){f=d.rup.i18nParse(d.rup.i18n.base,"rup_ajax.httpStatus503")}else{if(k.status==406){var h="";try{h=JSON.parse(k.responseText)}catch(g){f=k.responseText}}else{if(k.status==413){var h="";try{h=JSON.parse(k.responseText);f=h.rupFeedback.message.label}catch(g){f=k.responseText}}}}}}}}return f},rupObjectConstructor:function(g,f){if(d[g]===undefined){d[g]=function(l){var l=l,j=typeof l==="string",k=d.makeArray(arguments).slice(1),n=this;if(j&&l.charAt(0)==="_"){return n}if(j){if(l!=="extend"){var h=(d.isEmptyObject(d.data(f))?d.data(f,f):d.data(f)),m=h&&d.isFunction(h[l])?h[l].apply(h,k):"no-function";if(m==="no-function"){return false}else{n=m}}else{f=d.extend.apply(null,[true,f].concat(k[0]))}}else{var h=(d.isEmptyObject(d.data(f))?d.data(f,f):d.data(f));if(h&&f._init!==undefined&&f._init!==null){h._init(d.makeArray(arguments))}}return n}}},rupSelectorObjectConstructor:function(g,f){if(d.fn[g]===undefined){d.fn[g]=function(l){var l=l,j=typeof l==="string",k=d.makeArray(arguments).slice(1),n=this;if(j&&l.charAt(0)==="_"){return n}if(j){if(l!=="extend"){var h=d.extend(this,f),m=h&&d.isFunction(h[l])?h[l].apply(h,k):"no-function";if(m==="no-function"){return false}else{n=m}}else{f=d.fn.extend.apply(null,[true,f].concat(k[0]))}}else{var h=d.extend(this,f);if(h&&f._init!==undefined&&f._init!==null){h._init(d.makeArray(arguments))}}return n}}},showErrorToUser:function(f){if(f!=null&&f!==""){var h=d(".ui-dialog:visible .rup-feedback"),j=h.length!==0?h:d(".rup-feedback");if(j.length!=0){var k={delay:null},g=d("#"+j[0].id);g.rup_feedback("option",k);g.rup_feedback("set",f,"error");g.rup_feedback("show")}else{d.rup_messages("msgError",{title:d.rup.i18nParse(d.rup.i18n.base,"rup_ajax.errorTitle"),message:f})}}}});d.fn.extend({storeEvents:function(){this.each(function(){d(this).data("storedEvents",d.extend(true,{},d._data(d(this)[0],"events")))});d(this).unbind();return this},restoreEvents:function(){this.each(function(){var f=d.data(this,"storedEvents");if(f){d(this).unbind();for(var h in f){for(var g in f[h]){d.event.add(this,h,f[h][g],f[h][g].data)}}}});return this}});d.fn.mousestop={};d.fn.mousestop.defaults={delay:300};d.event.special.mousestop={setup:function(g){var f=this,h=d(this);h.data("mousestop",d.extend(true,{},d.fn.mousestop.defaults,g));h.on({"mouseenter.rup_mousestop":b,"mouseleave.rup_mousestop":a,"mousemove.rup_mousestop":e})},teardown:function(){d(this).removeData("mousestop").off(".rup_mousestop")}};function b(g){var f=this,h=d(this);clearTimeout(f.timeout)}function a(g){var f=this,h=d(this);clearTimeout(f.timeout)}function e(g){var f=this,h=d(this);clearTimeout(f.timeout);f.timeout=setTimeout(function(){h.trigger("mousestop",g)},h.data("mousestop").delay)}d.rup.iniRup()})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){a.rup.compatibility=a.rup.compatibility||{};a.extend(a.rup.compatibility,{menu:{delay:7,outDelay:7,focus:function(b,k){var h,e,l,f,j,g,d;this.blur(b);if(this._hasScroll()){e=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0;l=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0;f=k.offset().top-this.activeMenu.offset().top-e-l;j=this.activeMenu.scrollTop();g=this.activeMenu.height();d=k.height();if(f<0){this.activeMenu.scrollTop(j+f)}else{if(f+d>g){this.activeMenu.scrollTop(j+f-g+d)}}}var m=this.activeMenu;this.active=k.first();if(!(this.active.hasClass("rup_menu_horizontal_children"))){this.element.attr("aria-activedescendant",this.active.children("a").addClass("ui-state-focus").attr("id"))}else{this.element.attr("aria-activedescendant",this.active.children("a").attr("id"));this.active.addClass("ui-state-focus")}this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active");if(this.active.children("a").hasClass("ui-state-active")){this.active.children("a").removeClass("ui-state-active");if(this.active.find("[aria-expanded = 'true']").size()>1){this._close(m)}}else{this._close();h=a("> .ui-menu",k);if((h.length&&(/^focus/.test(b.type)&&k.attr("rupMenu_firsLevel")!=="true"))||(h.length&&(/^click/.test(b.type)&&k.attr("rupMenu_firsLevel")==="true"))){this._startOpening(h)}}this.activeMenu=k.parent()},_create:function(){this.activeMenu=this.element;this.menuId=this.element.attr("id")||"ui-menu-"+idIncrement++;if(this.element.find(".ui-icon").length){this.element.addClass("ui-menu-icons")}this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({id:this.menuId,role:"menu",tabIndex:0}).bind("click.menu",a.proxy(function(b){if(this.options.disabled){b.preventDefault()}},this));if(this.options.disabled){this.element.addClass("ui-state-disabled")}this._bind({"mousedown .ui-menu-item > a":function(b){b.preventDefault()},"click .ui-state-disabled > a":function(b){b.preventDefault()},"click .ui-menu-item:has(a)":function(b){b.stopImmediatePropagation();var d=a(b.currentTarget);if(!(d.attr("rupMenu_firsLevel")!=="true")){if(d.children("[aria-expanded = 'true']").size()>0){this._close(d)}else{this.focus(b,d)}}},"focus .ui-menu-item a":function(b){var d=a(b.currentTarget).parent();this.focus(b,d)},focus:function(b){if(a(b.currentTarget).attr("rup_shift_nofocus")===undefined){if(a("#"+this.menuId).attr("rup_menu_nofocus")===undefined){a(b.currentTarget).find(".ui-menu-item a").first().focus()}}else{a(b.currentTarget).removeAttr("rup_shift_nofocus")}},blur:function(b){this._delay(function(){if(!a.contains(this.element[0],this.document[0].activeElement)){this.collapseAll(b)}})},keydown:"_keydown"});this.restoreScrollEvents();this._bind(this.document,{click:function(b){if(!a(b.target).closest(".ui-menu").length){this.collapseAll(b)}}})},_open:function(e){clearTimeout(this.timer);this.element.find(".ui-menu").not(e.parents()).hide().attr("aria-hidden","true");var b=a.extend({},{of:this.active},a.type(this.options.position)==="function"?this.options.position(this.active):this.options.position);if(e.parent().attr("rupMenu_firsLevel")==="true"){b.my="left top";b.at="left bottom"}var d=widgetMenu(e);d.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(b)},expand:function(d){var b=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").not(".ui-state-disabled").first();if(b&&b.length){this._open(b.parent());this._delay(function(){b.children("a").focus()},this.delay);return true}},collapseAll:function(d,b){clearTimeout(this.timer);this.timer=this._delay(function(){var e;if(b){e=this.element}else{e=a(d&&d.target).closest(this.element.find(".ui-menu"))}if(!e.length){e=this.element}this._close(e);this.blur(d);this.activeMenu=e},this.outDelay)},blur:function(b){clearTimeout(this.timer);if(!this.active){return}if(!(this.active.hasClass("ui-state-focus"))){this.active.find(".ui-state-focus").removeClass("ui-state-focus")}else{this.active.removeClass("ui-state-focus")}this.active=null;this._trigger("blur",b,{item:this.active})},_keydown:function(b){a(b.currentTarget).attr("rup_menu_click","true");b.stopPropagation();var d=((a(b.currentTarget).hasClass("rup_menu_horizontal"))&&(a(b.currentTarget).find(".ui-state-focus").size()===0))||(a(b.currentTarget).find(".ui-state-focus").children().hasClass("rup_menu_horizontal_children_entry"));switch(b.keyCode){case a.ui.keyCode.PAGE_UP:this.previousPage(b);b.preventDefault();b.stopImmediatePropagation();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break;case a.ui.keyCode.PAGE_DOWN:this.nextPage(b);b.preventDefault();b.stopImmediatePropagation();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break;case a.ui.keyCode.HOME:this._move("first","first",b);b.preventDefault();b.stopImmediatePropagation();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break;case a.ui.keyCode.END:this._move("last","last",b);b.preventDefault();b.stopImmediatePropagation();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break;case a.ui.keyCode.UP:b.preventDefault();b.stopImmediatePropagation();if(!d){this.previous(b);a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}else{this.collapse(b);a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}case a.ui.keyCode.DOWN:b.preventDefault();b.stopImmediatePropagation();if(!d){this.next(b);a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}else{this.expand(b);a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}case a.ui.keyCode.LEFT:if(!d){a(b.target).parent().parent().parent().children("a").focus();b.stopImmediatePropagation();b.preventDefault();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}else{this.previous(b);b.stopImmediatePropagation();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}case a.ui.keyCode.RIGHT:if(!d){if(this.expand(b)){b.stopImmediatePropagation()}b.preventDefault();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}else{this.next(b);b.stopImmediatePropagation();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break}case a.ui.keyCode.ENTER:b.stopImmediatePropagation();b.preventDefault();if(this.active===null){this.active=a(b.currentTarget).find(".ui-state-focus")}if(this.active.children("a[aria-haspopup='true']").length){if(this.expand(b)){b.stopImmediatePropagation()}}else{this.select(b);b.stopImmediatePropagation()}b.preventDefault();break;case a.ui.keyCode.ESCAPE:if(this.collapse(b)){b.stopImmediatePropagation()}b.preventDefault();a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus();break;case a.ui.keyCode.TAB:this.collapseAll(b,true);if(!b.shiftKey){var k=a(b.target).parent().parent();if(!(k.children().find("a").last().html()===a(b.target).html())){b.stopImmediatePropagation();b.preventDefault();if(this.active===null){this.active=a(b.currentTarget).find(".ui-state-focus")}if(this.active.children("a[aria-haspopup='true']").length){this.expand(b)}else{this.next(b);a.merge(a(b.currentTarget).find(".ui-state-focus").children("a"),a(b.currentTarget).find(".ui-state-focus").not("li")).focus()}}else{if(k.children().find("a").last().html()!==a(b.currentTarget).find("a").last().html()){b.stopImmediatePropagation();b.preventDefault();var f=k.parent();var j=f.nextAll("[role='presentation']:not(.ui-state-disabled):first");while(j.length===0){f=f.parent();j=f.parent().nextAll("[role='presentation']:not(.ui-state-disabled):first")}j.children("a").focus()}}break}else{a(b.currentTarget).attr("rup_shift_nofocus","true");a(b.currentTarget).focus()}default:clearTimeout(this.filterTimer);var g,e=this.previousFilter||"",h=String.fromCharCode(b.keyCode),l=false;if(h===e){l=true}else{h=e+h}function m(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}g=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+m(h),"i").test(a(this).children("a").text())});g=l&&g.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):g;if(!g.length){h=String.fromCharCode(b.keyCode);g=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+m(h),"i").test(a(this).children("a").text())})}if(g.length){this.focus(b,g);if(g.length>1){this.previousFilter=h;this.filterTimer=this._delay(function(){delete this.previousFilter},1000)}else{delete this.previousFilter}}else{delete this.previousFilter}}},_move:function(f,d,e){var b;if(this.active){if(f==="first"||f==="last"){b=this.active[f==="first"?"prevAll":"nextAll"](".ui-menu-item").not(".ui-state-disabled").eq(-1)}else{b=this.active[f+"All"](".ui-menu-item").not(".ui-state-disabled").eq(0)}}if(!b||!b.length||!this.active){b=this.activeMenu.children(".ui-menu-item")[d]()}this.element.off("mouseleave");this.element.off("mouseover");this.element.one("mousemove",function(g){widgetMenu(g.currentTarget).rupMenu("restoreScrollEvents");widgetMenu(g.currentTarget).off("mousemove")});this.focus(e,b);if(b.is(".ui-state-disabled")){this._move(f,d,e)}},restoreScrollEvents:function(){this._bind({mouseover:function(b){a("#"+this.menuId).attr("rup_menu_nofocus","true")},"mouseover .rup_menu_horizontal_children":function(b){var d=a(b.currentTarget);a(".ui-state-focus").removeClass("ui-state-focus");d.addClass("ui-state-focus");a(d).focus()},"mouseover .ui-menu-item":function(e){a("#"+this.menuId).attr("rup_menu_nofocus","true");e.stopImmediatePropagation();var f=a(e.currentTarget);f.siblings().children(".ui-state-active").removeClass("ui-state-active");if((f.offset().left+f.width()>e.pageX)&&((f.offset().top+a("#"+this.menuId).height()>e.pageY)||(f.offset().top+f.height()>e.pageY))){if(!(a("#"+f.children("a").attr("id")+":focus").size()>0)){var b=e.target;var d=a("#"+f.children("a").attr("id"));a("#"+f.children("a").attr("id")).focus();a("#"+f.children("a").attr("id")).focus()}else{if(!(f.hasClass("rup_menu_horizontal_children"))){if(!(a("#"+f.children("a").attr("id")).hasClass("ui-state-focus"))){a("#"+f.children("a").attr("id")).addClass("ui-state-focus");if(a("#"+f.children("a").attr("id")).attr("role")==="menuitem"){this._startOpening(a(f).children("[role = 'menu']"))}}}}}},mouseleave:function(b){this.collapseAll(b,true);a(".ui-state-focus").removeClass("ui-state-focus");a("#"+this.menuId).removeAttr("rup_menu_nofocus")},"mouseleave .ui-menu-item":function(b){var d=a(b.currentTarget);if(d.attr("rupmenu_firslevel")===undefined||((d.offset().top-1<b.pageY)&&(d.offset().top+a("#"+this.menuId).height()+1<b.pageY))){this._close();a(".ui-state-focus").removeClass("ui-state-focus")}},"mouseleave .rup_menu_horizontal_children_last":function(b){this.collapseAll(b,true);a(".ui-state-focus").removeClass("ui-state-focus")}});this.refresh()}},jstree:{hotkeys:{"ctrl+space":function(b){delete b.target;b.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(b)}return false},"shift+space":function(b){delete b.target;b.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(b)}return false}},rup_extend:{_fn:{cleanCut:function(){this.data.crrm.ct_nodes=false},set_contextmenu_items:function(d){var b=this.get_settings();b.contextmenu.items=d;this._set_settings(b)},set_theme_data:function(b){this.data.themes.theme=b},types_portal_css:function(){var f=this._get_settings().types;var e=f.types,d=f.type_attr,b="",h=this;a.each(e,function(j,k){a.each(k,function(m,l){if(!/^(max_depth|max_children|icon|valid_children)$/.test(m)){h.data.types.attach_to.push(m)}});if(!k.icon){return true}if(k.icon.image||k.icon.position){b+="div.r01gContainer ";if(j=="default"){b+=".jstree-"+h.get_index()+" a > .jstree-icon { "}else{b+=".jstree-"+h.get_index()+" li["+d+'="'+j+'"] > a > .jstree-icon { '}if(k.icon.image){b+=" background-image:url("+k.icon.image+"); "}if(k.icon.position){b+=" background-position:"+k.icon.position+"; "}else{b+=" background-position:0 0; "}b+="} "}});var g=a("#jstree-types-stylesheet");if(g!==undefined){g.remove()}if(b!==""){a.vakata.css.add_sheet({str:b,title:"jstree-porta-types"})}}}}}})})(jQuery);
/*
 * jQuery UI 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(a,e){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.23",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(f,g){return typeof f==="number"?this.each(function(){var h=this;setTimeout(function(){a(h).focus();if(g){g.call(h)}},f)}):this._focus.apply(this,arguments)},scrollParent:function(){var f;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){f=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{f=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!f.length?a(document):f},zIndex:function(j){if(j!==e){return this.css("zIndex",j)}if(this.length){var g=a(this[0]),f,h;while(g.length&&g[0]!==document){f=g.css("position");if(f==="absolute"||f==="relative"||f==="fixed"){h=parseInt(g.css("zIndex"),10);if(!isNaN(h)&&h!==0){return h}}g=g.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(f){f.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});if(!a("<a>").outerWidth(1).jquery){a.each(["Width","Height"],function(h,f){var g=f==="Width"?["Left","Right"]:["Top","Bottom"],j=f.toLowerCase(),l={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function k(o,n,m,p){a.each(g,function(){n-=parseFloat(a.curCSS(o,"padding"+this,true))||0;if(m){n-=parseFloat(a.curCSS(o,"border"+this+"Width",true))||0}if(p){n-=parseFloat(a.curCSS(o,"margin"+this,true))||0}});return n}a.fn["inner"+f]=function(m){if(m===e){return l["inner"+f].call(this)}return this.each(function(){a(this).css(j,k(this,m)+"px")})};a.fn["outer"+f]=function(m,n){if(typeof m!=="number"){return l["outer"+f].call(this,m)}return this.each(function(){a(this).css(j,k(this,m,true,n)+"px")})}})}function d(h,f){var l=h.nodeName.toLowerCase();if("area"===l){var k=h.parentNode,j=k.name,g;if(!h.href||!j||k.nodeName.toLowerCase()!=="map"){return false}g=a("img[usemap=#"+j+"]")[0];return !!g&&b(g)}return(/input|select|textarea|button|object/.test(l)?!h.disabled:"a"==l?h.href||f:f)&&b(h)}function b(f){return !a(f).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(f){return function(g){return !!a.data(g,f)}}):function(h,g,f){return !!a.data(h,f[3])},focusable:function(f){return d(f,!isNaN(a.attr(f,"tabindex")))},tabbable:function(h){var f=a.attr(h,"tabindex"),g=isNaN(f);return(g||f>=0)&&d(h,!g)}});a(function(){var f=document.body,g=f.appendChild(g=document.createElement("div"));g.offsetHeight;a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart" in g;f.removeChild(g).style.display="none"});if(!a.curCSS){a.curCSS=a.css}a.extend(a.ui,{plugin:{add:function(g,h,k){var j=a.ui[g].prototype;for(var f in k){j.plugins[f]=j.plugins[f]||[];j.plugins[f].push([h,k[f]])}},call:function(f,h,g){var k=f.plugins[h];if(!k||!f.element[0].parentNode){return}for(var j=0;j<k.length;j++){if(f.options[k[j][0]]){k[j][1].apply(f.element,g)}}}},contains:function(g,f){return document.compareDocumentPosition?g.compareDocumentPosition(f)&16:g!==f&&g.contains(f)},hasScroll:function(j,g){if(a(j).css("overflow")==="hidden"){return false}var f=(g&&g==="left")?"scrollLeft":"scrollTop",h=false;if(j[f]>0){return true}j[f]=1;h=(j[f]>0);j[f]=0;return h},isOverAxis:function(g,f,h){return(g>f)&&(g<(f+h))},isOver:function(l,g,k,j,f,h){return a.ui.isOverAxis(l,k,f)&&a.ui.isOverAxis(g,j,h)}})})(jQuery);
/*
 * jQuery UI Widget 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,e){if(b.cleanData){var d=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}d(f)}}else{var a=b.fn.remove;b.fn.remove=function(f,g){return this.each(function(){if(!g){if(!f||b.filter(f,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(h){}})}}return a.call(b(this),f,g)})}}b.widget=function(g,j,f){var h=g.split(".")[0],l;g=g.split(".")[1];l=h+"-"+g;if(!f){f=j;j=b.Widget}b.expr[":"][l]=function(m){return !!b.data(m,g)};b[h]=b[h]||{};b[h][g]=function(m,n){if(arguments.length){this._createWidget(m,n)}};var k=new j();k.options=b.extend(true,{},k.options);b[h][g].prototype=b.extend(true,k,{namespace:h,widgetName:g,widgetEventPrefix:b[h][g].prototype.widgetEventPrefix||g,widgetBaseClass:l},f);b.widget.bridge(g,b[h][g])};b.widget.bridge=function(g,f){b.fn[g]=function(k){var h=typeof k==="string",j=Array.prototype.slice.call(arguments,1),l=this;k=!h&&j.length?b.extend.apply(null,[true,k].concat(j)):k;if(h&&k.charAt(0)==="_"){return l}if(h){this.each(function(){var m=b.data(this,g),n=m&&b.isFunction(m[k])?m[k].apply(m,j):m;if(n!==m&&n!==e){l=n;return false}})}else{this.each(function(){var m=b.data(this,g);if(m){m.option(k||{})._init()}else{b.data(this,g,new f(k,this))}})}return l}};b.Widget=function(f,g){if(arguments.length){this._createWidget(f,g)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(g,h){b.data(h,this.widgetName,this);this.element=b(h);this.options=b.extend(true,{},this.options,this._getCreateOptions(),g);var f=this;this.element.bind("remove."+this.widgetName,function(){f.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_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 ui-state-disabled")},widget:function(){return this.element},option:function(g,h){var f=g;if(arguments.length===0){return b.extend({},this.options)}if(typeof g==="string"){if(h===e){return this.options[g]}f={};f[g]=h}this._setOptions(f);return this},_setOptions:function(g){var f=this;b.each(g,function(h,j){f._setOption(h,j)});return this},_setOption:function(f,g){this.options[f]=g;if(f==="disabled"){this.widget()[g?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",g)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(f,g,h){var l,k,j=this.options[f];h=h||{};g=b.Event(g);g.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase();g.target=this.element[0];k=g.originalEvent;if(k){for(l in k){if(!(l in g)){g[l]=k[l]}}}this.element.trigger(g,h);return !(b.isFunction(j)&&j.call(this.element[0],g,h)===false||g.isDefaultPrevented())}}})(jQuery);
/*
 * jQuery UI Mouse 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(b,d){var a=false;b(document).mouseup(function(f){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(f){return e._mouseDown(f)}).bind("click."+this.widgetName,function(f){if(true===b.data(f.target,e.widgetName+".preventClickEvent")){b.removeData(f.target,e.widgetName+".preventClickEvent");f.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(g){if(a){return}(this._mouseStarted&&this._mouseUp(g));this._mouseDownEvent=g;var f=this,h=(g.which==1),e=(typeof this.options.cancel=="string"&&g.target.nodeName?b(g.target).closest(this.options.cancel).length:false);if(!h||e||!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}}if(true===b.data(g.target,this.widgetName+".preventClickEvent")){b.removeData(g.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(j){return f._mouseMove(j)};this._mouseUpDelegate=function(j){return f._mouseUp(j)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);g.preventDefault();a=true;return true},_mouseMove:function(e){if(b.browser.msie&&!(document.documentMode>=9)&&!e.button){return this._mouseUp(e)}if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e))}return !this._mouseStarted},_mouseUp:function(e){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(e.target==this._mouseDownEvent.target){b.data(e.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(e)}return false},_mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance)},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return true}})})(jQuery);
/*
 * jQuery UI Position 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Position
 */
(function(h,j){h.ui=h.ui||{};var e=/left|center|right/,f=/top|center|bottom/,a="center",g={},b=h.fn.position,d=h.fn.offset;h.fn.position=function(l){if(!l||!l.of){return b.apply(this,arguments)}l=h.extend({},l);var p=h(l.of),o=p[0],r=(l.collision||"flip").split(" "),q=l.offset?l.offset.split(" "):[0,0],n,k,m;if(o.nodeType===9){n=p.width();k=p.height();m={top:0,left:0}}else{if(o.setTimeout){n=p.width();k=p.height();m={top:p.scrollTop(),left:p.scrollLeft()}}else{if(o.preventDefault){l.at="left top";n=k=0;m={top:l.of.pageY,left:l.of.pageX}}else{n=p.outerWidth();k=p.outerHeight();m=p.offset()}}}h.each(["my","at"],function(){var s=(l[this]||"").split(" ");if(s.length===1){s=e.test(s[0])?s.concat([a]):f.test(s[0])?[a].concat(s):[a,a]}s[0]=e.test(s[0])?s[0]:a;s[1]=f.test(s[1])?s[1]:a;l[this]=s});if(r.length===1){r[1]=r[0]}q[0]=parseInt(q[0],10)||0;if(q.length===1){q[1]=q[0]}q[1]=parseInt(q[1],10)||0;if(l.at[0]==="right"){m.left+=n}else{if(l.at[0]===a){m.left+=n/2}}if(l.at[1]==="bottom"){m.top+=k}else{if(l.at[1]===a){m.top+=k/2}}m.left+=q[0];m.top+=q[1];return this.each(function(){var v=h(this),x=v.outerWidth(),u=v.outerHeight(),w=parseInt(h.curCSS(this,"marginLeft",true))||0,t=parseInt(h.curCSS(this,"marginTop",true))||0,z=x+w+(parseInt(h.curCSS(this,"marginRight",true))||0),A=u+t+(parseInt(h.curCSS(this,"marginBottom",true))||0),y=h.extend({},m),s;if(l.my[0]==="right"){y.left-=x}else{if(l.my[0]===a){y.left-=x/2}}if(l.my[1]==="bottom"){y.top-=u}else{if(l.my[1]===a){y.top-=u/2}}if(!g.fractions){y.left=Math.round(y.left);y.top=Math.round(y.top)}s={left:y.left-w,top:y.top-t};h.each(["left","top"],function(C,B){if(h.ui.position[r[C]]){h.ui.position[r[C]][B](y,{targetWidth:n,targetHeight:k,elemWidth:x,elemHeight:u,collisionPosition:s,collisionWidth:z,collisionHeight:A,offset:q,my:l.my,at:l.at})}});if(h.fn.bgiframe){v.bgiframe()}v.offset(h.extend(y,{using:l.using}))})};h.ui.position={fit:{left:function(k,l){var n=h(window),m=l.collisionPosition.left+l.collisionWidth-n.width()-n.scrollLeft();k.left=m>0?k.left-m:Math.max(k.left-l.collisionPosition.left,k.left)},top:function(k,l){var n=h(window),m=l.collisionPosition.top+l.collisionHeight-n.height()-n.scrollTop();k.top=m>0?k.top-m:Math.max(k.top-l.collisionPosition.top,k.top)}},flip:{left:function(l,n){if(n.at[0]===a){return}var p=h(window),o=n.collisionPosition.left+n.collisionWidth-p.width()-p.scrollLeft(),k=n.my[0]==="left"?-n.elemWidth:n.my[0]==="right"?n.elemWidth:0,m=n.at[0]==="left"?n.targetWidth:-n.targetWidth,q=-2*n.offset[0];l.left+=n.collisionPosition.left<0?k+m+q:o>0?k+m+q:0},top:function(l,n){if(n.at[1]===a){return}var p=h(window),o=n.collisionPosition.top+n.collisionHeight-p.height()-p.scrollTop(),k=n.my[1]==="top"?-n.elemHeight:n.my[1]==="bottom"?n.elemHeight:0,m=n.at[1]==="top"?n.targetHeight:-n.targetHeight,q=-2*n.offset[1];l.top+=n.collisionPosition.top<0?k+m+q:o>0?k+m+q:0}}};if(!h.offset.setOffset){h.offset.setOffset=function(o,l){if(/static/.test(h.curCSS(o,"position"))){o.style.position="relative"}var n=h(o),q=n.offset(),k=parseInt(h.curCSS(o,"top",true),10)||0,p=parseInt(h.curCSS(o,"left",true),10)||0,m={top:(l.top-q.top)+k,left:(l.left-q.left)+p};if("using" in l){l.using.call(o,m)}else{n.css(m)}};h.fn.offset=function(k){var l=this[0];if(!l||!l.ownerDocument){return null}if(k){if(h.isFunction(k)){return this.each(function(m){h(this).offset(k.call(this,m,h(this).offset()))})}return this.each(function(){h.offset.setOffset(this,k)})}return d.call(this)}}if(!h.curCSS){h.curCSS=h.css}(function(){var k=document.getElementsByTagName("body")[0],r=document.createElement("div"),o,q,l,p,n;o=document.createElement(k?"div":"body");l={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(k){h.extend(l,{position:"absolute",left:"-1000px",top:"-1000px"})}for(var m in l){o.style[m]=l[m]}o.appendChild(r);q=k||document.documentElement;q.insertBefore(o,q.firstChild);r.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";p=h(r).offset(function(s,t){return t}).offset();o.innerHTML="";q.removeChild(o);n=p.top+p.left+(k?2000:0);g.fractions=n>21&&n<22})()}(jQuery));
/*
 * jQuery UI Draggable 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(a,b){a.widget("ui.draggable",a.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(d){var e=this.options;if(this.helper||e.disabled||a(d.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(d);if(!this.handle){return false}if(e.iframeFix){a(e.iframeFix===true?"iframe":e.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})}return true},_mouseStart:function(d){var e=this.options;this.helper=this._createHelper(d);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();if(a.ui.ddmanager){a.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};a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;(e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt));if(e.containment){this._setContainment()}if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions();if(a.ui.ddmanager&&!e.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,d)}this._mouseDrag(d,true);if(a.ui.ddmanager){a.ui.ddmanager.dragStart(this,d)}return true},_mouseDrag:function(d,f){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!f){var e=this._uiHash();if(this._trigger("drag",d,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(a.ui.ddmanager){a.ui.ddmanager.drag(this,d)}return false},_mouseStop:function(f){var h=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){h=a.ui.ddmanager.drop(this,f)}if(this.dropped){h=this.dropped;this.dropped=false}var e=this.element[0],g=false;while(e&&(e=e.parentNode)){if(e==document){g=true}}if(!g&&this.options.helper==="original"){return false}if((this.options.revert=="invalid"&&!h)||(this.options.revert=="valid"&&h)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,h))){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(d._trigger("stop",f)!==false){d._clear()}})}else{if(this._trigger("stop",f)!==false){this._clear()}}return false},_mouseUp:function(d){if(this.options.iframeFix===true){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}if(a.ui.ddmanager){a.ui.ddmanager.dragStop(this,d)}return a.ui.mouse.prototype._mouseUp.call(this,d)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(d){var e=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target){e=true}});return e},_createHelper:function(e){var f=this.options;var d=a.isFunction(f.helper)?a(f.helper.apply(this.element[0],[e])):(f.helper=="clone"?this.element.clone().removeAttr("id"):this.element);if(!d.parents("body").length){d.appendTo((f.appendTo=="parent"?this.element[0].parentNode:f.appendTo))}if(d[0]!=this.element[0]&&!(/(fixed|absolute)/).test(d.css("position"))){d.css("position","absolute")}return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string"){d=d.split(" ")}if(a.isArray(d)){d={left:+d[0],top:+d[1]||0}}if("left" in d){this.offset.click.left=d.left+this.margins.left}if("right" in d){this.offset.click.left=this.helperProportions.width-d.right+this.margins.left}if("top" in d){this.offset.click.top=d.top+this.margins.top}if("bottom" in d){this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){d={top:0,left:0}}return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.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),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var g=this.options;if(g.containment=="parent"){g.containment=this.helper[0].parentNode}if(g.containment=="document"||g.containment=="window"){this.containment=[g.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,g.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(g.containment=="document"?0:a(window).scrollLeft())+a(g.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(g.containment=="document"?0:a(window).scrollTop())+(a(g.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(g.containment)&&g.containment.constructor!=Array){var h=a(g.containment);var e=h[0];if(!e){return}var f=h.offset();var d=(a(e).css("overflow")!="hidden");this.containment=[(parseInt(a(e).css("borderLeftWidth"),10)||0)+(parseInt(a(e).css("paddingLeft"),10)||0),(parseInt(a(e).css("borderTopWidth"),10)||0)+(parseInt(a(e).css("paddingTop"),10)||0),(d?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(a(e).css("borderLeftWidth"),10)||0)-(parseInt(a(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(d?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(a(e).css("borderTopWidth"),10)||0)-(parseInt(a(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=h}else{if(g.containment.constructor==Array){this.containment=g.containment}}},_convertPositionTo:function(h,k){if(!k){k=this.position}var f=h=="absolute"?1:-1;var g=this.options,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(e[0].tagName);return{top:(k.top+this.offset.relative.top*f+this.offset.parent.top*f-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:e.scrollTop()))*f)),left:(k.left+this.offset.relative.left*f+this.offset.parent.left*f-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:e.scrollLeft())*f))}},_generatePosition:function(e){var f=this.options,n=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,k=(/(html|body)/i).test(n[0].tagName);var j=e.pageX;var h=e.pageY;if(this.originalPosition){var d;if(this.containment){if(this.relative_container){var m=this.relative_container.offset();d=[this.containment[0]+m.left,this.containment[1]+m.top,this.containment[2]+m.left,this.containment[3]+m.top]}else{d=this.containment}if(e.pageX-this.offset.click.left<d[0]){j=d[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<d[1]){h=d[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>d[2]){j=d[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>d[3]){h=d[3]+this.offset.click.top}}if(f.grid){var l=f.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/f.grid[1])*f.grid[1]:this.originalPageY;h=d?(!(l-this.offset.click.top<d[1]||l-this.offset.click.top>d[3])?l:(!(l-this.offset.click.top<d[1])?l-f.grid[1]:l+f.grid[1])):l;var g=f.grid[0]?this.originalPageX+Math.round((j-this.originalPageX)/f.grid[0])*f.grid[0]:this.originalPageX;j=d?(!(g-this.offset.click.left<d[0]||g-this.offset.click.left>d[2])?g:(!(g-this.offset.click.left<d[0])?g-f.grid[0]:g+f.grid[0])):g}}return{top:(h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(k?0:n.scrollTop())))),left:(j-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():k?0:n.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(d,e,f){f=f||this._uiHash();a.ui.plugin.call(this,d,[e,f]);if(d=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.Widget.prototype._trigger.call(this,d,e,f)},plugins:{},_uiHash:function(d){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.23"});a.ui.plugin.add("draggable","connectToSortable",{start:function(e,g){var f=a(this).data("draggable"),h=f.options,d=a.extend({},g,{item:f.element});f.sortables=[];a(h.connectToSortable).each(function(){var j=a.data(this,"sortable");if(j&&!j.options.disabled){f.sortables.push({instance:j,shouldRevert:j.options.revert});j.refreshPositions();j._trigger("activate",e,d)}})},stop:function(e,g){var f=a(this).data("draggable"),d=a.extend({},g,{item:f.element});a.each(f.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;f.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(e);this.instance.options.helper=this.instance.options._helper;if(f.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",e,d)}})},drag:function(e,h){var g=a(this).data("draggable"),d=this;var f=function(l){var r=this.offset.click.top,q=this.offset.click.left;var j=this.positionAbs.top,n=this.positionAbs.left;var m=l.height,p=l.width;var s=l.top,k=l.left;return a.ui.isOver(j+r,n+q,s,k,m,p)};a.each(g.sortables,function(j){this.instance.positionAbs=g.positionAbs;this.instance.helperProportions=g.helperProportions;this.instance.offset.click=g.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(d).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return h.helper[0]};e.target=this.instance.currentItem[0];this.instance._mouseCapture(e,true);this.instance._mouseStart(e,true,true);this.instance.offset.click.top=g.offset.click.top;this.instance.offset.click.left=g.offset.click.left;this.instance.offset.parent.left-=g.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=g.offset.parent.top-this.instance.offset.parent.top;g._trigger("toSortable",e);g.dropped=this.instance.element;g.currentItem=g.element;this.instance.fromOutside=g}if(this.instance.currentItem){this.instance._mouseDrag(e)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",e,this.instance._uiHash(this.instance));this.instance._mouseStop(e,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}g._trigger("fromSortable",e);g.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(e,f){var d=a("body"),g=a(this).data("draggable").options;if(d.css("cursor")){g._cursor=d.css("cursor")}d.css("cursor",g.cursor)},stop:function(d,e){var f=a(this).data("draggable").options;if(f._cursor){a("body").css("cursor",f._cursor)}}});a.ui.plugin.add("draggable","opacity",{start:function(e,f){var d=a(f.helper),g=a(this).data("draggable").options;if(d.css("opacity")){g._opacity=d.css("opacity")}d.css("opacity",g.opacity)},stop:function(d,e){var f=a(this).data("draggable").options;if(f._opacity){a(e.helper).css("opacity",f._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(e,f){var d=a(this).data("draggable");if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){d.overflowOffset=d.scrollParent.offset()}},drag:function(f,g){var e=a(this).data("draggable"),h=e.options,d=false;if(e.scrollParent[0]!=document&&e.scrollParent[0].tagName!="HTML"){if(!h.axis||h.axis!="x"){if((e.overflowOffset.top+e.scrollParent[0].offsetHeight)-f.pageY<h.scrollSensitivity){e.scrollParent[0].scrollTop=d=e.scrollParent[0].scrollTop+h.scrollSpeed}else{if(f.pageY-e.overflowOffset.top<h.scrollSensitivity){e.scrollParent[0].scrollTop=d=e.scrollParent[0].scrollTop-h.scrollSpeed}}}if(!h.axis||h.axis!="y"){if((e.overflowOffset.left+e.scrollParent[0].offsetWidth)-f.pageX<h.scrollSensitivity){e.scrollParent[0].scrollLeft=d=e.scrollParent[0].scrollLeft+h.scrollSpeed}else{if(f.pageX-e.overflowOffset.left<h.scrollSensitivity){e.scrollParent[0].scrollLeft=d=e.scrollParent[0].scrollLeft-h.scrollSpeed}}}}else{if(!h.axis||h.axis!="x"){if(f.pageY-a(document).scrollTop()<h.scrollSensitivity){d=a(document).scrollTop(a(document).scrollTop()-h.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<h.scrollSensitivity){d=a(document).scrollTop(a(document).scrollTop()+h.scrollSpeed)}}}if(!h.axis||h.axis!="y"){if(f.pageX-a(document).scrollLeft()<h.scrollSensitivity){d=a(document).scrollLeft(a(document).scrollLeft()-h.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<h.scrollSensitivity){d=a(document).scrollLeft(a(document).scrollLeft()+h.scrollSpeed)}}}}if(d!==false&&a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(e,f)}}});a.ui.plugin.add("draggable","snap",{start:function(e,f){var d=a(this).data("draggable"),g=d.options;d.snapElements=[];a(g.snap.constructor!=String?(g.snap.items||":data(draggable)"):g.snap).each(function(){var j=a(this);var h=j.offset();if(this!=d.element[0]){d.snapElements.push({item:this,width:j.outerWidth(),height:j.outerHeight(),top:h.top,left:h.left})}})},drag:function(v,q){var h=a(this).data("draggable"),s=h.options;var z=s.snapTolerance;var y=q.offset.left,x=y+h.helperProportions.width,g=q.offset.top,f=g+h.helperProportions.height;for(var w=h.snapElements.length-1;w>=0;w--){var u=h.snapElements[w].left,p=u+h.snapElements[w].width,n=h.snapElements[w].top,B=n+h.snapElements[w].height;if(!((u-z<y&&y<p+z&&n-z<g&&g<B+z)||(u-z<y&&y<p+z&&n-z<f&&f<B+z)||(u-z<x&&x<p+z&&n-z<g&&g<B+z)||(u-z<x&&x<p+z&&n-z<f&&f<B+z))){if(h.snapElements[w].snapping){(h.options.snap.release&&h.options.snap.release.call(h.element,v,a.extend(h._uiHash(),{snapItem:h.snapElements[w].item})))}h.snapElements[w].snapping=false;continue}if(s.snapMode!="inner"){var e=Math.abs(n-f)<=z;var A=Math.abs(B-g)<=z;var k=Math.abs(u-x)<=z;var m=Math.abs(p-y)<=z;if(e){q.position.top=h._convertPositionTo("relative",{top:n-h.helperProportions.height,left:0}).top-h.margins.top}if(A){q.position.top=h._convertPositionTo("relative",{top:B,left:0}).top-h.margins.top}if(k){q.position.left=h._convertPositionTo("relative",{top:0,left:u-h.helperProportions.width}).left-h.margins.left}if(m){q.position.left=h._convertPositionTo("relative",{top:0,left:p}).left-h.margins.left}}var j=(e||A||k||m);if(s.snapMode!="outer"){var e=Math.abs(n-g)<=z;var A=Math.abs(B-f)<=z;var k=Math.abs(u-y)<=z;var m=Math.abs(p-x)<=z;if(e){q.position.top=h._convertPositionTo("relative",{top:n,left:0}).top-h.margins.top}if(A){q.position.top=h._convertPositionTo("relative",{top:B-h.helperProportions.height,left:0}).top-h.margins.top}if(k){q.position.left=h._convertPositionTo("relative",{top:0,left:u}).left-h.margins.left}if(m){q.position.left=h._convertPositionTo("relative",{top:0,left:p-h.helperProportions.width}).left-h.margins.left}}if(!h.snapElements[w].snapping&&(e||A||k||m||j)){(h.options.snap.snap&&h.options.snap.snap.call(h.element,v,a.extend(h._uiHash(),{snapItem:h.snapElements[w].item})))}h.snapElements[w].snapping=(e||A||k||m||j)}}});a.ui.plugin.add("draggable","stack",{start:function(e,f){var h=a(this).data("draggable").options;var g=a.makeArray(a(h.stack)).sort(function(k,j){return(parseInt(a(k).css("zIndex"),10)||0)-(parseInt(a(j).css("zIndex"),10)||0)});if(!g.length){return}var d=parseInt(g[0].style.zIndex)||0;a(g).each(function(j){this.style.zIndex=d+j});this[0].style.zIndex=d+g.length}});a.ui.plugin.add("draggable","zIndex",{start:function(e,f){var d=a(f.helper),g=a(this).data("draggable").options;if(d.css("zIndex")){g._zIndex=d.css("zIndex")}d.css("zIndex",g.zIndex)},stop:function(d,e){var f=a(this).data("draggable").options;if(f._zIndex){a(e.helper).css("zIndex",f._zIndex)}}})})(jQuery);
/*
 * jQuery UI Droppable 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Droppables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 */
(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var e=this.options,d=e.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(d)?d:function(f){return f.is(d)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[e.scope]=a.ui.ddmanager.droppables[e.scope]||[];a.ui.ddmanager.droppables[e.scope].push(this);(e.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var d=a.ui.ddmanager.droppables[this.options.scope];for(var e=0;e<d.length;e++){if(d[e]==this){d.splice(e,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(d,e){if(d=="accept"){this.accept=a.isFunction(e)?e:function(f){return f.is(e)}}a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var d=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(d&&this._trigger("activate",e,this.ui(d)))},_deactivate:function(e){var d=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(d&&this._trigger("deactivate",e,this.ui(d)))},_over:function(e){var d=a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0]){return}if(this.accept.call(this.element[0],(d.currentItem||d.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",e,this.ui(d))}},_out:function(e){var d=a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0]){return}if(this.accept.call(this.element[0],(d.currentItem||d.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",e,this.ui(d))}},_drop:function(e,f){var d=f||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0]){return false}var g=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var h=a.data(this,"droppable");if(h.options.greedy&&!h.options.disabled&&h.options.scope==d.options.scope&&h.accept.call(h.element[0],(d.currentItem||d.element))&&a.ui.intersect(d,a.extend(h,{offset:h.element.offset()}),h.options.tolerance)){g=true;return false}});if(g){return false}if(this.accept.call(this.element[0],(d.currentItem||d.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",e,this.ui(d));return this.element}return false},ui:function(d){return{draggable:(d.currentItem||d.element),helper:d.helper,position:d.position,offset:d.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.23"});a.ui.intersect=function(u,m,q){if(!m.offset){return false}var f=(u.positionAbs||u.position.absolute).left,e=f+u.helperProportions.width,p=(u.positionAbs||u.position.absolute).top,o=p+u.helperProportions.height;var h=m.offset.left,d=h+m.proportions.width,s=m.offset.top,n=s+m.proportions.height;switch(q){case"fit":return(h<=f&&e<=d&&s<=p&&o<=n);break;case"intersect":return(h<f+(u.helperProportions.width/2)&&e-(u.helperProportions.width/2)<d&&s<p+(u.helperProportions.height/2)&&o-(u.helperProportions.height/2)<n);break;case"pointer":var j=((u.positionAbs||u.position.absolute).left+(u.clickOffset||u.offset.click).left),k=((u.positionAbs||u.position.absolute).top+(u.clickOffset||u.offset.click).top),g=a.ui.isOver(k,j,s,h,m.proportions.height,m.proportions.width);return g;break;case"touch":return((p>=s&&p<=n)||(o>=s&&o<=n)||(p<s&&o>n))&&((f>=h&&f<=d)||(e>=h&&e<=d)||(f<h&&e>d));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(g,k){var d=a.ui.ddmanager.droppables[g.options.scope]||[];var h=k?k.type:null;var l=(g.currentItem||g.element).find(":data(droppable)").andSelf();droppablesLoop:for(var f=0;f<d.length;f++){if(d[f].options.disabled||(g&&!d[f].accept.call(d[f].element[0],(g.currentItem||g.element)))){continue}for(var e=0;e<l.length;e++){if(l[e]==d[f].element[0]){d[f].proportions.height=0;continue droppablesLoop}}d[f].visible=d[f].element.css("display")!="none";if(!d[f].visible){continue}if(h=="mousedown"){d[f]._activate.call(d[f],k)}d[f].offset=d[f].element.offset();d[f].proportions={width:d[f].element[0].offsetWidth,height:d[f].element[0].offsetHeight}}},drop:function(d,e){var f=false;a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(d,this,this.options.tolerance)){f=this._drop.call(this,e)||f}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(d.currentItem||d.element))){this.isout=1;this.isover=0;this._deactivate.call(this,e)}});return f},dragStart:function(d,e){d.element.parents(":not(body,html)").bind("scroll.droppable",function(){if(!d.options.refreshPositions){a.ui.ddmanager.prepareOffsets(d,e)}})},drag:function(d,e){if(d.options.refreshPositions){a.ui.ddmanager.prepareOffsets(d,e)}a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var g=a.ui.intersect(d,this,this.options.tolerance);var j=!g&&this.isover==1?"isout":(g&&this.isover==0?"isover":null);if(!j){return}var h;if(this.options.greedy){var f=this.element.parents(":data(droppable):eq(0)");if(f.length){h=a.data(f[0],"droppable");h.greedyChild=(j=="isover"?1:0)}}if(h&&j=="isover"){h.isover=0;h.isout=1;h._out.call(h,e)}this[j]=1;this[j=="isout"?"isover":"isout"]=0;this[j=="isover"?"_over":"_out"].call(this,e);if(h&&j=="isout"){h.isout=0;h.isover=1;h._over.call(h,e)}})},dragStop:function(d,e){d.element.parents(":not(body,html)").unbind("scroll.droppable");if(!d.options.refreshPositions){a.ui.ddmanager.prepareOffsets(d,e)}}}})(jQuery);
/*
 * jQuery UI Resizable 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Resizables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d,e){d.widget("ui.resizable",d.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var g=this,l=this.options;this.element.addClass("ui-resizable");d.extend(this,{_aspectRatio:!!(l.aspectRatio),aspectRatio:l.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:l.helper||l.ghost||l.animate?l.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(d('<div class="ui-wrapper" style="overflow: hidden;"></div>').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=l.handles||(!d(".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 m=this.handles.split(",");this.handles={};for(var h=0;h<m.length;h++){var k=d.trim(m[h]),f="ui-resizable-"+k;var j=d('<div class="ui-resizable-handle '+f+'"></div>');j.css({zIndex:l.zIndex});if("se"==k){j.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[k]=".ui-resizable-"+k;this.element.append(j)}}this._renderAxis=function(r){r=r||this.element;for(var o in this.handles){if(this.handles[o].constructor==String){this.handles[o]=d(this.handles[o],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var p=d(this.handles[o],this.element),q=0;q=/sw|ne|nw|se|n|s/.test(o)?p.outerHeight():p.outerWidth();var n=["padding",/ne|nw|n/.test(o)?"Top":/se|sw|s/.test(o)?"Bottom":/^e$/.test(o)?"Right":"Left"].join("");r.css(n,q);this._proportionallyResize()}if(!d(this.handles[o]).length){continue}}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!g.resizing){if(this.className){var n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}g.axis=n&&n[1]?n[1]:"se"}});if(l.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){if(l.disabled){return}d(this).removeClass("ui-resizable-autohide");g._handles.show()},function(){if(l.disabled){return}if(!g.resizing){d(this).addClass("ui-resizable-autohide");g._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var f=function(h){d(h).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){f(this.element);var g=this.element;g.after(this.originalElement.css({position:g.css("position"),width:g.outerWidth(),height:g.outerHeight(),top:g.css("top"),left:g.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);f(this.originalElement);return this},_mouseCapture:function(g){var h=false;for(var f in this.handles){if(d(this.handles[f])[0]==g.target){h=true}}return !this.options.disabled&&h},_mouseStart:function(h){var l=this.options,g=this.element.position(),f=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(f.is(".ui-draggable")||(/absolute/).test(f.css("position"))){f.css({position:"absolute",top:g.top,left:g.left})}this._renderProxy();var m=b(this.helper.css("left")),j=b(this.helper.css("top"));if(l.containment){m+=d(l.containment).scrollLeft()||0;j+=d(l.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:m,top:j};this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()};this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()};this.originalPosition={left:m,top:j};this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()};this.originalMousePosition={left:h.pageX,top:h.pageY};this.aspectRatio=(typeof l.aspectRatio=="number")?l.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var k=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",k=="auto"?this.axis+"-resize":k);f.addClass("ui-resizable-resizing");this._propagate("start",h);return true},_mouseDrag:function(f){var j=this.helper,h=this.options,p={},s=this,l=this.originalMousePosition,q=this.axis;var t=(f.pageX-l.left)||0,r=(f.pageY-l.top)||0;var k=this._change[q];if(!k){return false}var n=k.apply(this,[f,t,r]),m=d.browser.msie&&d.browser.version<7,g=this.sizeDiff;this._updateVirtualBoundaries(f.shiftKey);if(this._aspectRatio||f.shiftKey){n=this._updateRatio(n,f)}n=this._respectSize(n,f);this._propagate("resize",f);j.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(n);this._trigger("resize",f,this.ui());return false},_mouseStop:function(j){this.resizing=false;var k=this.options,p=this;if(this._helper){var h=this._proportionallyResizeElements,f=h.length&&(/textarea/i).test(h[0].nodeName),g=f&&d.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,m=f?0:p.sizeDiff.width;var q={width:(p.helper.width()-m),height:(p.helper.height()-g)},l=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,n=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;if(!k.animate){this.element.css(d.extend(q,{top:n,left:l}))}p.helper.height(p.size.height);p.helper.width(p.size.width);if(this._helper&&!k.animate){this._proportionallyResize()}}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",j);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(h){var l=this.options,k,j,g,m,f;f={minWidth:a(l.minWidth)?l.minWidth:0,maxWidth:a(l.maxWidth)?l.maxWidth:Infinity,minHeight:a(l.minHeight)?l.minHeight:0,maxHeight:a(l.maxHeight)?l.maxHeight:Infinity};if(this._aspectRatio||h){k=f.minHeight*this.aspectRatio;g=f.minWidth/this.aspectRatio;j=f.maxHeight*this.aspectRatio;m=f.maxWidth/this.aspectRatio;if(k>f.minWidth){f.minWidth=k}if(g>f.minHeight){f.minHeight=g}if(j<f.maxWidth){f.maxWidth=j}if(m<f.maxHeight){f.maxHeight=m}}this._vBoundaries=f},_updateCache:function(f){var g=this.options;this.offset=this.helper.offset();if(a(f.left)){this.position.left=f.left}if(a(f.top)){this.position.top=f.top}if(a(f.height)){this.size.height=f.height}if(a(f.width)){this.size.width=f.width}},_updateRatio:function(j,h){var k=this.options,l=this.position,g=this.size,f=this.axis;if(a(j.height)){j.width=(j.height*this.aspectRatio)}else{if(a(j.width)){j.height=(j.width/this.aspectRatio)}}if(f=="sw"){j.left=l.left+(g.width-j.width);j.top=null}if(f=="nw"){j.top=l.top+(g.height-j.height);j.left=l.left+(g.width-j.width)}return j},_respectSize:function(n,h){var l=this.helper,k=this._vBoundaries,t=this._aspectRatio||h.shiftKey,s=this.axis,v=a(n.width)&&k.maxWidth&&(k.maxWidth<n.width),p=a(n.height)&&k.maxHeight&&(k.maxHeight<n.height),j=a(n.width)&&k.minWidth&&(k.minWidth>n.width),u=a(n.height)&&k.minHeight&&(k.minHeight>n.height);if(j){n.width=k.minWidth}if(u){n.height=k.minHeight}if(v){n.width=k.maxWidth}if(p){n.height=k.maxHeight}var g=this.originalPosition.left+this.originalSize.width,r=this.position.top+this.size.height;var m=/sw|nw|w/.test(s),f=/nw|ne|n/.test(s);if(j&&m){n.left=g-k.minWidth}if(v&&m){n.left=g-k.maxWidth}if(u&&f){n.top=r-k.minHeight}if(p&&f){n.top=r-k.maxHeight}var q=!n.width&&!n.height;if(q&&!n.left&&n.top){n.top=null}else{if(q&&!n.top&&n.left){n.left=null}}return n},_proportionallyResize:function(){var l=this.options;if(!this._proportionallyResizeElements.length){return}var h=this.helper||this.element;for(var g=0;g<this._proportionallyResizeElements.length;g++){var j=this._proportionallyResizeElements[g];if(!this.borderDif){var f=[j.css("borderTopWidth"),j.css("borderRightWidth"),j.css("borderBottomWidth"),j.css("borderLeftWidth")],k=[j.css("paddingTop"),j.css("paddingRight"),j.css("paddingBottom"),j.css("paddingLeft")];this.borderDif=d.map(f,function(m,o){var n=parseInt(m,10)||0,p=parseInt(k[o],10)||0;return n+p})}if(d.browser.msie&&!(!(d(h).is(":hidden")||d(h).parents(":hidden").length))){continue}j.css({height:(h.height()-this.borderDif[0]-this.borderDif[2])||0,width:(h.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var g=this.element,k=this.options;this.elementOffset=g.offset();if(this._helper){this.helper=this.helper||d('<div style="overflow:hidden;"></div>');var f=d.browser.msie&&d.browser.version<7,h=(f?1:0),j=(f?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+j,height:this.element.outerHeight()+j,position:"absolute",left:this.elementOffset.left-h+"px",top:this.elementOffset.top-h+"px",zIndex:++k.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(h,g,f){return{width:this.originalSize.width+g}},w:function(j,g,f){var l=this.options,h=this.originalSize,k=this.originalPosition;return{left:k.left+g,width:h.width-g}},n:function(j,g,f){var l=this.options,h=this.originalSize,k=this.originalPosition;return{top:k.top+f,height:h.height-f}},s:function(h,g,f){return{height:this.originalSize.height+f}},se:function(h,g,f){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[h,g,f]))},sw:function(h,g,f){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[h,g,f]))},ne:function(h,g,f){return d.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[h,g,f]))},nw:function(h,g,f){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[h,g,f]))}},_propagate:function(g,f){d.ui.plugin.call(this,g,[f,this.ui()]);(g!="resize"&&this._trigger(g,f,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}}});d.extend(d.ui.resizable,{version:"1.8.23"});d.ui.plugin.add("resizable","alsoResize",{start:function(g,h){var f=d(this).data("resizable"),k=f.options;var j=function(l){d(l).each(function(){var m=d(this);m.data("resizable-alsoresize",{width:parseInt(m.width(),10),height:parseInt(m.height(),10),left:parseInt(m.css("left"),10),top:parseInt(m.css("top"),10)})})};if(typeof(k.alsoResize)=="object"&&!k.alsoResize.parentNode){if(k.alsoResize.length){k.alsoResize=k.alsoResize[0];j(k.alsoResize)}else{d.each(k.alsoResize,function(l){j(l)})}}else{j(k.alsoResize)}},resize:function(h,k){var g=d(this).data("resizable"),l=g.options,j=g.originalSize,n=g.originalPosition;var m={height:(g.size.height-j.height)||0,width:(g.size.width-j.width)||0,top:(g.position.top-n.top)||0,left:(g.position.left-n.left)||0},f=function(o,p){d(o).each(function(){var s=d(this),t=d(this).data("resizable-alsoresize"),r={},q=p&&p.length?p:s.parents(k.originalElement[0]).length?["width","height"]:["width","height","top","left"];d.each(q,function(u,w){var v=(t[w]||0)+(m[w]||0);if(v&&v>=0){r[w]=v||null}});s.css(r)})};if(typeof(l.alsoResize)=="object"&&!l.alsoResize.nodeType){d.each(l.alsoResize,function(o,p){f(o,p)})}else{f(l.alsoResize)}},stop:function(f,g){d(this).removeData("resizable-alsoresize")}});d.ui.plugin.add("resizable","animate",{stop:function(k,q){var r=d(this).data("resizable"),l=r.options;var j=r._proportionallyResizeElements,f=j.length&&(/textarea/i).test(j[0].nodeName),g=f&&d.ui.hasScroll(j[0],"left")?0:r.sizeDiff.height,n=f?0:r.sizeDiff.width;var h={width:(r.size.width-n),height:(r.size.height-g)},m=(parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left))||null,p=(parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top))||null;r.element.animate(d.extend(h,p&&m?{top:p,left:m}:{}),{duration:l.animateDuration,easing:l.animateEasing,step:function(){var o={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};if(j&&j.length){d(j[0]).css({width:o.width,height:o.height})}r._updateCache(o);r._propagate("resize",k)}})}});d.ui.plugin.add("resizable","containment",{start:function(g,t){var v=d(this).data("resizable"),l=v.options,n=v.element;var h=l.containment,m=(h instanceof d)?h.get(0):(/parent/.test(h))?n.parent().get(0):h;if(!m){return}v.containerElement=d(m);if(/document/.test(h)||h==document){v.containerOffset={left:0,top:0};v.containerPosition={left:0,top:0};v.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var r=d(m),k=[];d(["Top","Right","Left","Bottom"]).each(function(p,o){k[p]=b(r.css("padding"+o))});v.containerOffset=r.offset();v.containerPosition=r.position();v.containerSize={height:(r.innerHeight()-k[3]),width:(r.innerWidth()-k[1])};var s=v.containerOffset,f=v.containerSize.height,q=v.containerSize.width,j=(d.ui.hasScroll(m,"left")?m.scrollWidth:q),u=(d.ui.hasScroll(m)?m.scrollHeight:f);v.parentData={element:m,left:s.left,top:s.top,width:j,height:u}}},resize:function(h,s){var v=d(this).data("resizable"),k=v.options,g=v.containerSize,r=v.containerOffset,p=v.size,q=v.position,t=v._aspectRatio||h.shiftKey,f={top:0,left:0},j=v.containerElement;if(j[0]!=document&&(/static/).test(j.css("position"))){f=r}if(q.left<(v._helper?r.left:0)){v.size.width=v.size.width+(v._helper?(v.position.left-r.left):(v.position.left-f.left));if(t){v.size.height=v.size.width/v.aspectRatio}v.position.left=k.helper?r.left:0}if(q.top<(v._helper?r.top:0)){v.size.height=v.size.height+(v._helper?(v.position.top-r.top):v.position.top);if(t){v.size.width=v.size.height*v.aspectRatio}v.position.top=v._helper?r.top:0}v.offset.left=v.parentData.left+v.position.left;v.offset.top=v.parentData.top+v.position.top;var n=Math.abs((v._helper?v.offset.left-f.left:(v.offset.left-f.left))+v.sizeDiff.width),u=Math.abs((v._helper?v.offset.top-f.top:(v.offset.top-r.top))+v.sizeDiff.height);var m=v.containerElement.get(0)==v.element.parent().get(0),l=/relative|absolute/.test(v.containerElement.css("position"));if(m&&l){n-=v.parentData.left}if(n+v.size.width>=v.parentData.width){v.size.width=v.parentData.width-n;if(t){v.size.height=v.size.width/v.aspectRatio}}if(u+v.size.height>=v.parentData.height){v.size.height=v.parentData.height-u;if(t){v.size.width=v.size.height*v.aspectRatio}}},stop:function(g,q){var s=d(this).data("resizable"),j=s.options,n=s.position,p=s.containerOffset,f=s.containerPosition,k=s.containerElement;var l=d(s.helper),t=l.offset(),r=l.outerWidth()-s.sizeDiff.width,m=l.outerHeight()-s.sizeDiff.height;if(s._helper&&!j.animate&&(/relative/).test(k.css("position"))){d(this).css({left:t.left-f.left-p.left,width:r,height:m})}if(s._helper&&!j.animate&&(/static/).test(k.css("position"))){d(this).css({left:t.left-f.left-p.left,width:r,height:m})}}});d.ui.plugin.add("resizable","ghost",{start:function(h,j){var f=d(this).data("resizable"),k=f.options,g=f.size;f.ghost=f.originalElement.clone();f.ghost.css({opacity:0.25,display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof k.ghost=="string"?k.ghost:"");f.ghost.appendTo(f.helper)},resize:function(g,h){var f=d(this).data("resizable"),j=f.options;if(f.ghost){f.ghost.css({position:"relative",height:f.size.height,width:f.size.width})}},stop:function(g,h){var f=d(this).data("resizable"),j=f.options;if(f.ghost&&f.helper){f.helper.get(0).removeChild(f.ghost.get(0))}}});d.ui.plugin.add("resizable","grid",{resize:function(f,p){var r=d(this).data("resizable"),j=r.options,m=r.size,k=r.originalSize,l=r.originalPosition,q=r.axis,n=j._aspectRatio||f.shiftKey;j.grid=typeof j.grid=="number"?[j.grid,j.grid]:j.grid;var h=Math.round((m.width-k.width)/(j.grid[0]||1))*(j.grid[0]||1),g=Math.round((m.height-k.height)/(j.grid[1]||1))*(j.grid[1]||1);if(/^(se|s|e)$/.test(q)){r.size.width=k.width+h;r.size.height=k.height+g}else{if(/^(ne)$/.test(q)){r.size.width=k.width+h;r.size.height=k.height+g;r.position.top=l.top-g}else{if(/^(sw)$/.test(q)){r.size.width=k.width+h;r.size.height=k.height+g;r.position.left=l.left-h}else{r.size.width=k.width+h;r.size.height=k.height+g;r.position.top=l.top-g;r.position.left=l.left-h}}}}});var b=function(f){return parseInt(f,10)||0};var a=function(f){return !isNaN(parseInt(f,10))}})(jQuery);
/*
 * jQuery UI Selectable 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Selectables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var d=this;this.element.addClass("ui-selectable");this.dragged=false;var e;this.refresh=function(){e=a(d.options.filter,d.element[0]);e.addClass("ui-selectee");e.each(function(){var f=a(this);var g=f.offset();a.data(this,"selectable-item",{element:this,$element:f,left:g.left,top:g.top,right:g.left+f.outerWidth(),bottom:g.top+f.outerHeight(),startselected:false,selected:f.hasClass("ui-selected"),selecting:f.hasClass("ui-selecting"),unselecting:f.hasClass("ui-unselecting")})})};this.refresh();this.selectees=e.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(f){var d=this;this.opos=[f.pageX,f.pageY];if(this.options.disabled){return}var e=this.options;this.selectees=a(e.filter,this.element[0]);this._trigger("start",f);a(e.appendTo).append(this.helper);this.helper.css({left:f.clientX,top:f.clientY,width:0,height:0});if(e.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var g=a.data(this,"selectable-item");g.startselected=true;if(!f.metaKey&&!f.ctrlKey){g.$element.removeClass("ui-selected");g.selected=false;g.$element.addClass("ui-unselecting");g.unselecting=true;d._trigger("unselecting",f,{unselecting:g.element})}});a(f.target).parents().andSelf().each(function(){var h=a.data(this,"selectable-item");if(h){var g=(!f.metaKey&&!f.ctrlKey)||!h.$element.hasClass("ui-selected");h.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");h.unselecting=!g;h.selecting=g;h.selected=g;if(g){d._trigger("selecting",f,{selecting:h.element})}else{d._trigger("unselecting",f,{unselecting:h.element})}return false}})},_mouseDrag:function(l){var e=this;this.dragged=true;if(this.options.disabled){return}var g=this.options;var f=this.opos[0],k=this.opos[1],d=l.pageX,j=l.pageY;if(f>d){var h=d;d=f;f=h}if(k>j){var h=j;j=k;k=h}this.helper.css({left:f,top:k,width:d-f,height:j-k});this.selectees.each(function(){var m=a.data(this,"selectable-item");if(!m||m.element==e.element[0]){return}var n=false;if(g.tolerance=="touch"){n=(!(m.left>d||m.right<f||m.top>j||m.bottom<k))}else{if(g.tolerance=="fit"){n=(m.left>f&&m.right<d&&m.top>k&&m.bottom<j)}}if(n){if(m.selected){m.$element.removeClass("ui-selected");m.selected=false}if(m.unselecting){m.$element.removeClass("ui-unselecting");m.unselecting=false}if(!m.selecting){m.$element.addClass("ui-selecting");m.selecting=true;e._trigger("selecting",l,{selecting:m.element})}}else{if(m.selecting){if((l.metaKey||l.ctrlKey)&&m.startselected){m.$element.removeClass("ui-selecting");m.selecting=false;m.$element.addClass("ui-selected");m.selected=true}else{m.$element.removeClass("ui-selecting");m.selecting=false;if(m.startselected){m.$element.addClass("ui-unselecting");m.unselecting=true}e._trigger("unselecting",l,{unselecting:m.element})}}if(m.selected){if(!l.metaKey&&!l.ctrlKey&&!m.startselected){m.$element.removeClass("ui-selected");m.selected=false;m.$element.addClass("ui-unselecting");m.unselecting=true;e._trigger("unselecting",l,{unselecting:m.element})}}}});return false},_mouseStop:function(f){var d=this;this.dragged=false;var e=this.options;a(".ui-unselecting",this.element[0]).each(function(){var g=a.data(this,"selectable-item");g.$element.removeClass("ui-unselecting");g.unselecting=false;g.startselected=false;d._trigger("unselected",f,{unselected:g.element})});a(".ui-selecting",this.element[0]).each(function(){var g=a.data(this,"selectable-item");g.$element.removeClass("ui-selecting").addClass("ui-selected");g.selecting=false;g.selected=true;g.startselected=true;d._trigger("selected",f,{selected:g.element})});this._trigger("stop",f);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.23"})})(jQuery);
/*
 * jQuery UI Sortable 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Sortables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){var d=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?d.axis==="x"||(/left|right/).test(this.items[0].item.css("float"))||(/inline|table-cell/).test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit();this.ready=true},destroy:function(){a.Widget.prototype.destroy.call(this);this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--){this.items[d].item.removeData(this.widgetName+"-item")}return this},_setOption:function(d,e){if(d==="disabled"){this.options[d]=e;this.widget()[e?"addClass":"removeClass"]("ui-sortable-disabled")}else{a.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(h,j){var g=this;if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(h);var f=null,e=this,d=a(h.target).parents().each(function(){if(a.data(this,g.widgetName+"-item")==e){f=a(this);return false}});if(a.data(h.target,g.widgetName+"-item")==e){f=a(h.target)}if(!f){return false}if(this.options.handle&&!j){var k=false;a(this.options.handle,f).find("*").andSelf().each(function(){if(this==h.target){k=true}});if(!k){return false}}this.currentItem=f;this._removeCurrentsFromItems();return true},_mouseStart:function(g,h,d){var j=this.options,e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(g);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:g.pageX-this.offset.left,top:g.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(g);this.originalPageX=g.pageX;this.originalPageY=g.pageY;(j.cursorAt&&this._adjustOffsetFromHelper(j.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(j.containment){this._setContainment()}if(j.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",j.cursor)}if(j.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",j.opacity)}if(j.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",j.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",g,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!d){for(var f=this.containers.length-1;f>=0;f--){this.containers[f]._trigger("activate",g,e._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!j.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,g)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(g);return true},_mouseDrag:function(h){this.position=this._generatePosition(h);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var j=this.options,d=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-h.pageY<j.scrollSensitivity){this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+j.scrollSpeed}else{if(h.pageY-this.overflowOffset.top<j.scrollSensitivity){this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-j.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-h.pageX<j.scrollSensitivity){this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+j.scrollSpeed}else{if(h.pageX-this.overflowOffset.left<j.scrollSensitivity){this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-j.scrollSpeed}}}else{if(h.pageY-a(document).scrollTop()<j.scrollSensitivity){d=a(document).scrollTop(a(document).scrollTop()-j.scrollSpeed)}else{if(a(window).height()-(h.pageY-a(document).scrollTop())<j.scrollSensitivity){d=a(document).scrollTop(a(document).scrollTop()+j.scrollSpeed)}}if(h.pageX-a(document).scrollLeft()<j.scrollSensitivity){d=a(document).scrollLeft(a(document).scrollLeft()-j.scrollSpeed)}else{if(a(window).width()-(h.pageX-a(document).scrollLeft())<j.scrollSensitivity){d=a(document).scrollLeft(a(document).scrollLeft()+j.scrollSpeed)}}}if(d!==false&&a.ui.ddmanager&&!j.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,h)}}this.positionAbs=this._convertPositionTo("absolute");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"}for(var f=this.items.length-1;f>=0;f--){var g=this.items[f],e=g.item[0],k=this._intersectsWithPointer(g);if(!k){continue}if(e!=this.currentItem[0]&&this.placeholder[k==1?"next":"prev"]()[0]!=e&&!a.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],e):true)){this.direction=k==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(g)){this._rearrange(h,g)}else{break}this._trigger("change",h,this._uiHash());break}}this._contactContainers(h);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,h)}this._trigger("sort",h,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(e,f){if(!e){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,e)}if(this.options.revert){var d=this;var g=d.placeholder.offset();d.reverting=true;a(this.helper).animate({left:g.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:g.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(e)})}else{this._clear(e,f)}return false},cancel:function(){var d=this;if(this.dragging){this._mouseUp({target:null});if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,d._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,d._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(f){var d=this._getItemsAsjQuery(f&&f.connected);var e=[];f=f||{};a(d).each(function(){var g=(a(f.item||this).attr(f.attribute||"id")||"").match(f.expression||(/(.+)[-=_](.+)/));if(g){e.push((f.key||g[1]+"[]")+"="+(f.key&&f.expression?g[1]:g[2]))}});if(!e.length&&f.key){e.push(f.key+"=")}return e.join("&")},toArray:function(f){var d=this._getItemsAsjQuery(f&&f.connected);var e=[];f=f||{};d.each(function(){e.push(a(f.item||this).attr(f.attribute||"id")||"")});return e},_intersectsWith:function(o){var f=this.positionAbs.left,e=f+this.helperProportions.width,n=this.positionAbs.top,m=n+this.helperProportions.height;var g=o.left,d=g+o.width,p=o.top,k=p+o.height;var q=this.offset.click.top,j=this.offset.click.left;var h=(n+q)>p&&(n+q)<k&&(f+j)>g&&(f+j)<d;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>o[this.floating?"width":"height"])){return h}else{return(g<f+(this.helperProportions.width/2)&&e-(this.helperProportions.width/2)<d&&p<n+(this.helperProportions.height/2)&&m-(this.helperProportions.height/2)<k)}},_intersectsWithPointer:function(f){var g=(this.options.axis==="x")||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,f.top,f.height),e=(this.options.axis==="y")||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,f.left,f.width),j=g&&e,d=this._getDragVerticalDirection(),h=this._getDragHorizontalDirection();if(!j){return false}return this.floating?(((h&&h=="right")||d=="down")?2:1):(d&&(d=="down"?2:1))},_intersectsWithSides:function(g){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,g.top+(g.height/2),g.height),f=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,g.left+(g.width/2),g.width),d=this._getDragVerticalDirection(),h=this._getDragHorizontalDirection();if(this.floating&&h){return((h=="right"&&f)||(h=="left"&&!f))}else{return d&&((d=="down"&&e)||(d=="up"&&!e))}},_getDragVerticalDirection:function(){var d=this.positionAbs.top-this.lastPositionAbs.top;return d!=0&&(d>0?"down":"up")},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left")},refresh:function(d){this._refreshItems(d);this.refreshPositions();return this},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(d){var n=this;var k=[];var g=[];var l=this._connectWith();if(l&&d){for(var f=l.length-1;f>=0;f--){var m=a(l[f]);for(var e=m.length-1;e>=0;e--){var h=a.data(m[e],this.widgetName);if(h&&h!=this&&!h.options.disabled){g.push([a.isFunction(h.options.items)?h.options.items.call(h.element):a(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}}}}g.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var f=g.length-1;f>=0;f--){g[f][0].each(function(){k.push(this)})}return a(k)},_removeCurrentsFromItems:function(){var f=this.currentItem.find(":data("+this.widgetName+"-item)");for(var e=0;e<this.items.length;e++){for(var d=0;d<f.length;d++){if(f[d]==this.items[e].item[0]){this.items.splice(e,1)}}}},_refreshItems:function(d){this.items=[];this.containers=[this];var l=this.items;var r=this;var h=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],d,{item:this.currentItem}):a(this.options.items,this.element),this]];var n=this._connectWith();if(n&&this.ready){for(var g=n.length-1;g>=0;g--){var o=a(n[g]);for(var f=o.length-1;f>=0;f--){var k=a.data(o[f],this.widgetName);if(k&&k!=this&&!k.options.disabled){h.push([a.isFunction(k.options.items)?k.options.items.call(k.element[0],d,{item:this.currentItem}):a(k.options.items,k.element),k]);this.containers.push(k)}}}}for(var g=h.length-1;g>=0;g--){var m=h[g][1];var e=h[g][0];for(var f=0,p=e.length;f<p;f++){var q=a(e[f]);q.data(this.widgetName+"-item",m);l.push({item:q,instance:m,width:0,height:0,left:0,top:0})}}},refreshPositions:function(d){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var f=this.items.length-1;f>=0;f--){var g=this.items[f];if(g.instance!=this.currentContainer&&this.currentContainer&&g.item[0]!=this.currentItem[0]){continue}var e=this.options.toleranceElement?a(this.options.toleranceElement,g.item):g.item;if(!d){g.width=e.outerWidth();g.height=e.outerHeight()}var h=e.offset();g.left=h.left;g.top=h.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var f=this.containers.length-1;f>=0;f--){var h=this.containers[f].element.offset();this.containers[f].containerCache.left=h.left;this.containers[f].containerCache.top=h.top;this.containers[f].containerCache.width=this.containers[f].element.outerWidth();this.containers[f].containerCache.height=this.containers[f].element.outerHeight()}}return this},_createPlaceholder:function(f){var d=f||this,g=d.options;if(!g.placeholder||g.placeholder.constructor==String){var e=g.placeholder;g.placeholder={element:function(){var h=a(document.createElement(d.currentItem[0].nodeName)).addClass(e||d.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e){h.style.visibility="hidden"}return h},update:function(h,j){if(e&&!g.forcePlaceholderSize){return}if(!j.height()){j.height(d.currentItem.innerHeight()-parseInt(d.currentItem.css("paddingTop")||0,10)-parseInt(d.currentItem.css("paddingBottom")||0,10))}if(!j.width()){j.width(d.currentItem.innerWidth()-parseInt(d.currentItem.css("paddingLeft")||0,10)-parseInt(d.currentItem.css("paddingRight")||0,10))}}}}d.placeholder=a(g.placeholder.element.call(d.element,d.currentItem));d.currentItem.after(d.placeholder);g.placeholder.update(d,d.placeholder)},_contactContainers:function(d){var f=null,m=null;for(var h=this.containers.length-1;h>=0;h--){if(a.ui.contains(this.currentItem[0],this.containers[h].element[0])){continue}if(this._intersectsWith(this.containers[h].containerCache)){if(f&&a.ui.contains(this.containers[h].element[0],f.element[0])){continue}f=this.containers[h];m=h}else{if(this.containers[h].containerCache.over){this.containers[h]._trigger("out",d,this._uiHash(this));this.containers[h].containerCache.over=0}}}if(!f){return}if(this.containers.length===1){this.containers[m]._trigger("over",d,this._uiHash(this));this.containers[m].containerCache.over=1}else{if(this.currentContainer!=this.containers[m]){var l=10000;var k=null;var e=this.positionAbs[this.containers[m].floating?"left":"top"];for(var g=this.items.length-1;g>=0;g--){if(!a.ui.contains(this.containers[m].element[0],this.items[g].item[0])){continue}var n=this.containers[m].floating?this.items[g].item.offset().left:this.items[g].item.offset().top;if(Math.abs(n-e)<l){l=Math.abs(n-e);k=this.items[g];this.direction=(n-e>0)?"down":"up"}}if(!k&&!this.options.dropOnEmpty){return}this.currentContainer=this.containers[m];k?this._rearrange(d,k,null,true):this._rearrange(d,null,this.containers[m].element,true);this._trigger("change",d,this._uiHash());this.containers[m]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[m]._trigger("over",d,this._uiHash(this));this.containers[m].containerCache.over=1}}},_createHelper:function(e){var f=this.options;var d=a.isFunction(f.helper)?a(f.helper.apply(this.element[0],[e,this.currentItem])):(f.helper=="clone"?this.currentItem.clone():this.currentItem);if(!d.parents("body").length){a(f.appendTo!="parent"?f.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0])}if(d[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(d[0].style.width==""||f.forceHelperSize){d.width(this.currentItem.width())}if(d[0].style.height==""||f.forceHelperSize){d.height(this.currentItem.height())}return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string"){d=d.split(" ")}if(a.isArray(d)){d={left:+d[0],top:+d[1]||0}}if("left" in d){this.offset.click.left=d.left+this.margins.left}if("right" in d){this.offset.click.left=this.helperProportions.width-d.right+this.margins.left}if("top" in d){this.offset.click.top=d.top+this.margins.top}if("bottom" in d){this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){d={top:0,left:0}}return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.currentItem.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var g=this.options;if(g.containment=="parent"){g.containment=this.helper[0].parentNode}if(g.containment=="document"||g.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(g.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(g.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(g.containment)){var e=a(g.containment)[0];var f=a(g.containment).offset();var d=(a(e).css("overflow")!="hidden");this.containment=[f.left+(parseInt(a(e).css("borderLeftWidth"),10)||0)+(parseInt(a(e).css("paddingLeft"),10)||0)-this.margins.left,f.top+(parseInt(a(e).css("borderTopWidth"),10)||0)+(parseInt(a(e).css("paddingTop"),10)||0)-this.margins.top,f.left+(d?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(a(e).css("borderLeftWidth"),10)||0)-(parseInt(a(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,f.top+(d?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(a(e).css("borderTopWidth"),10)||0)-(parseInt(a(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(h,k){if(!k){k=this.position}var f=h=="absolute"?1:-1;var g=this.options,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(e[0].tagName);return{top:(k.top+this.offset.relative.top*f+this.offset.parent.top*f-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:e.scrollTop()))*f)),left:(k.left+this.offset.relative.left*f+this.offset.parent.left*f-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:e.scrollLeft())*f))}},_generatePosition:function(g){var k=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=(/(html|body)/i).test(d[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var f=g.pageX;var e=g.pageY;if(this.originalPosition){if(this.containment){if(g.pageX-this.offset.click.left<this.containment[0]){f=this.containment[0]+this.offset.click.left}if(g.pageY-this.offset.click.top<this.containment[1]){e=this.containment[1]+this.offset.click.top}if(g.pageX-this.offset.click.left>this.containment[2]){f=this.containment[2]+this.offset.click.left}if(g.pageY-this.offset.click.top>this.containment[3]){e=this.containment[3]+this.offset.click.top}}if(k.grid){var j=this.originalPageY+Math.round((e-this.originalPageY)/k.grid[1])*k.grid[1];e=this.containment?(!(j-this.offset.click.top<this.containment[1]||j-this.offset.click.top>this.containment[3])?j:(!(j-this.offset.click.top<this.containment[1])?j-k.grid[1]:j+k.grid[1])):j;var h=this.originalPageX+Math.round((f-this.originalPageX)/k.grid[0])*k.grid[0];f=this.containment?(!(h-this.offset.click.left<this.containment[0]||h-this.offset.click.left>this.containment[2])?h:(!(h-this.offset.click.left<this.containment[0])?h-k.grid[0]:h+k.grid[0])):h}}return{top:(e-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(l?0:d.scrollTop())))),left:(f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():l?0:d.scrollLeft())))}},_rearrange:function(j,h,e,g){e?e[0].appendChild(this.placeholder[0]):h.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?h.item[0]:h.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var f=this,d=this.counter;window.setTimeout(function(){if(d==f.counter){f.refreshPositions(!g)}},0)},_clear:function(f,g){this.reverting=false;var h=[],d=this;if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS){if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static"){this._storedCSS[e]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!g){h.push(function(j){this._trigger("receive",j,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!g){h.push(function(j){this._trigger("update",j,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!g){h.push(function(j){this._trigger("remove",j,this._uiHash())})}for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!g){h.push((function(j){return function(k){j._trigger("receive",k,this._uiHash(this))}}).call(this,this.containers[e]));h.push((function(j){return function(k){j._trigger("update",k,this._uiHash(this))}}).call(this,this.containers[e]))}}}for(var e=this.containers.length-1;e>=0;e--){if(!g){h.push((function(j){return function(k){j._trigger("deactivate",k,this._uiHash(this))}}).call(this,this.containers[e]))}if(this.containers[e].containerCache.over){h.push((function(j){return function(k){j._trigger("out",k,this._uiHash(this))}}).call(this,this.containers[e]));this.containers[e].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!g){this._trigger("beforeStop",f,this._uiHash());for(var e=0;e<h.length;e++){h[e].call(this,f)}this._trigger("stop",f,this._uiHash())}this.fromOutside=false;return false}if(!g){this._trigger("beforeStop",f,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!g){for(var e=0;e<h.length;e++){h[e].call(this,f)}this._trigger("stop",f,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(e){var d=e||this;return{helper:d.helper,placeholder:d.placeholder||a([]),position:d.position,originalPosition:d.originalPosition,offset:d.positionAbs,item:d.currentItem,sender:e?e.element:null}}});a.extend(a.ui.sortable,{version:"1.8.23"})})(jQuery);
/*
 * jQuery UI Accordion 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var d=this,e=d.options;d.running=0;d.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");d.headers=d.element.find(e.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(e.disabled){return}a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(e.disabled){return}a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(e.disabled){return}a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(e.disabled){return}a(this).removeClass("ui-state-focus")});d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(e.navigation){var f=d.element.find("a").filter(e.navigationFilter).eq(0);if(f.length){var g=f.closest(".ui-accordion-header");if(g.length){d.active=g}else{d.active=f.closest(".ui-accordion-content").prev()}}}d.active=d._findActive(d.active||e.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");d.active.next().addClass("ui-accordion-content-active");d._createIcons();d.resize();d.element.attr("role","tablist");d.headers.attr("role","tab").bind("keydown.accordion",function(h){return d._keydown(h)}).next().attr("role","tabpanel");d.headers.not(d.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();if(!d.active.length){d.headers.eq(0).attr("tabIndex",0)}else{d.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0})}if(!a.browser.safari){d.headers.find("a").attr("tabIndex",-1)}if(e.event){d.headers.bind(e.event.split(" ").join(".accordion ")+".accordion",function(h){d._clickHandler.call(d,h,this);h.preventDefault()})}},_createIcons:function(){var d=this.options;if(d.icons){a("<span></span>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var d=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var e=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(d.autoHeight||d.fillHeight){e.css("height","")}return a.Widget.prototype.destroy.call(this)},_setOption:function(d,e){a.Widget.prototype._setOption.apply(this,arguments);if(d=="active"){this.activate(e)}if(d=="icons"){this._destroyIcons();if(e){this._createIcons()}}if(d=="disabled"){this.headers.add(this.headers.next())[e?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")}},_keydown:function(g){if(this.options.disabled||g.altKey||g.ctrlKey){return}var h=a.ui.keyCode,f=this.headers.length,d=this.headers.index(g.target),e=false;switch(g.keyCode){case h.RIGHT:case h.DOWN:e=this.headers[(d+1)%f];break;case h.LEFT:case h.UP:e=this.headers[(d-1+f)%f];break;case h.SPACE:case h.ENTER:this._clickHandler({target:g.target},g.target);g.preventDefault()}if(e){a(g.target).attr("tabIndex",-1);a(e).attr("tabIndex",0);e.focus();return false}return true},resize:function(){var d=this.options,f;if(d.fillSpace){if(a.browser.msie){var e=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}f=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",e)}this.headers.each(function(){f-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,f-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else{if(d.autoHeight){f=0;this.headers.next().each(function(){f=Math.max(f,a(this).height("").height())}).height(f)}}return this},activate:function(d){this.options.active=d;var e=this._findActive(d)[0];this._clickHandler({target:e},e);return this},_findActive:function(d){return d?typeof d==="number"?this.headers.filter(":eq("+d+")"):this.headers.not(this.headers.not(d)):d===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(d,h){var n=this.options;if(n.disabled){return}if(!d.target){if(!n.collapsible){return}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(n.icons.headerSelected).addClass(n.icons.header);this.active.next().addClass("ui-accordion-content-active");var k=this.active.next(),g={options:n,newHeader:a([]),oldHeader:n.active,newContent:a([]),oldContent:k},e=(this.active=a([]));this._toggle(e,k,g);return}var j=a(d.currentTarget||h),l=j[0]===this.active[0];n.active=n.collapsible&&l?false:this.headers.index(j);if(this.running||(!n.collapsible&&l)){return}var f=this.active,e=j.next(),k=this.active.next(),g={options:n,newHeader:l&&n.collapsible?a([]):j,oldHeader:this.active,newContent:l&&n.collapsible?a([]):e,oldContent:k},m=this.headers.index(this.active[0])>this.headers.index(j[0]);this.active=l?a([]):j;this._toggle(e,k,g,l,m);f.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(n.icons.headerSelected).addClass(n.icons.header);if(!l){j.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(n.icons.header).addClass(n.icons.headerSelected);j.next().addClass("ui-accordion-content-active")}return},_toggle:function(d,k,h,l,m){var o=this,p=o.options;o.toShow=d;o.toHide=k;o.data=h;var e=function(){if(!o){return}return o._completed.apply(o,arguments)};o._trigger("changestart",null,o.data);o.running=k.size()===0?d.size():k.size();if(p.animated){var g={};if(p.collapsible&&l){g={toShow:a([]),toHide:k,complete:e,down:m,autoHeight:p.autoHeight||p.fillSpace}}else{g={toShow:d,toHide:k,complete:e,down:m,autoHeight:p.autoHeight||p.fillSpace}}if(!p.proxied){p.proxied=p.animated}if(!p.proxiedDuration){p.proxiedDuration=p.duration}p.animated=a.isFunction(p.proxied)?p.proxied(g):p.proxied;p.duration=a.isFunction(p.proxiedDuration)?p.proxiedDuration(g):p.proxiedDuration;var n=a.ui.accordion.animations,f=p.duration,j=p.animated;if(j&&!n[j]&&!a.easing[j]){j="slide"}if(!n[j]){n[j]=function(q){this.slide(q,{easing:j,duration:f||700})}}n[j](g)}else{if(p.collapsible&&l){d.toggle()}else{k.hide();d.show()}e(true)}k.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur();d.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(d){this.running=d?0:--this.running;if(this.running){return}if(this.options.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length){this.toHide.parent()[0].className=this.toHide.parent()[0].className}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.8.23",animations:{slide:function(m,k){m=a.extend({easing:"swing",duration:300},m,k);if(!m.toHide.size()){m.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},m);return}if(!m.toShow.size()){m.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},m);return}var e=m.toShow.css("overflow"),j=0,f={},h={},g=["height","paddingTop","paddingBottom"],d;var l=m.toShow;d=l[0].style.width;l.width(l.parent().width()-parseFloat(l.css("paddingLeft"))-parseFloat(l.css("paddingRight"))-(parseFloat(l.css("borderLeftWidth"))||0)-(parseFloat(l.css("borderRightWidth"))||0));a.each(g,function(n,p){h[p]="hide";var o=(""+a.css(m.toShow[0],p)).match(/^([\d+-.]+)(.*)$/);f[p]={value:o[1],unit:o[2]||"px"}});m.toShow.css({height:0,overflow:"hidden"}).show();m.toHide.filter(":hidden").each(m.complete).end().filter(":visible").animate(h,{step:function(n,o){if(o.prop=="height"){j=(o.end-o.start===0)?0:(o.now-o.start)/(o.end-o.start)}m.toShow[0].style[o.prop]=(j*f[o.prop].value)+f[o.prop].unit},duration:m.duration,easing:m.easing,complete:function(){if(!m.autoHeight){m.toShow.css("height","")}m.toShow.css({width:d,overflow:e});m.complete()}})},bounceslide:function(d){this.slide(d,{easing:d.down?"easeOutBounce":"swing",duration:d.down?1000:200})}}})})(jQuery);
/*
 * jQuery UI Autocomplete 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Autocomplete
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 */
(function(a,b){var d=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var e=this,g=this.element[0].ownerDocument,f;this.isMultiLine=this.element.is("textarea");this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(h){if(e.options.disabled||e.element.propAttr("readOnly")){return}f=false;var j=a.ui.keyCode;switch(h.keyCode){case j.PAGE_UP:e._move("previousPage",h);break;case j.PAGE_DOWN:e._move("nextPage",h);break;case j.UP:e._keyEvent("previous",h);break;case j.DOWN:e._keyEvent("next",h);break;case j.ENTER:case j.NUMPAD_ENTER:if(e.menu.active){f=true;h.preventDefault()}case j.TAB:if(!e.menu.active){return}e.menu.select(h);break;case j.ESCAPE:e.element.val(e.term);e.close(h);break;default:clearTimeout(e.searching);e.searching=setTimeout(function(){if(e.term!=e.element.val()){e.selectedItem=null;e.search(null,h)}},e.options.delay);break}}).bind("keypress.autocomplete",function(h){if(f){f=false;h.preventDefault()}}).bind("focus.autocomplete",function(){if(e.options.disabled){return}e.selectedItem=null;e.previous=e.element.val()}).bind("blur.autocomplete",function(h){if(e.options.disabled){return}clearTimeout(e.searching);e.closing=setTimeout(function(){e.close(h);e._change(h)},150)});this._initSource();this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",g)[0]).mousedown(function(h){var j=e.menu.element[0];if(!a(h.target).closest(".ui-menu-item").length){setTimeout(function(){a(document).one("mousedown",function(k){if(k.target!==e.element[0]&&k.target!==j&&!a.ui.contains(j,k.target)){e.close()}})},1)}setTimeout(function(){clearTimeout(e.closing)},13)}).menu({focus:function(j,k){var h=k.item.data("item.autocomplete");if(false!==e._trigger("focus",j,{item:h})){if(/^key/.test(j.originalEvent.type)){e.element.val(h.value)}}},selected:function(k,l){var j=l.item.data("item.autocomplete"),h=e.previous;if(e.element[0]!==g.activeElement){e.element.focus();e.previous=h;setTimeout(function(){e.previous=h;e.selectedItem=j},1)}if(false!==e._trigger("select",k,{item:j})){e.element.val(j.value)}e.term=e.element.val();e.close(k);e.selectedItem=j},blur:function(h,j){if(e.menu.element.is(":visible")&&(e.element.val()!==e.term)){e.element.val(e.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(a.fn.bgiframe){this.menu.element.bgiframe()}e.beforeunloadHandler=function(){e.element.removeAttr("autocomplete")};a(window).bind("beforeunload",e.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();a(window).unbind("beforeunload",this.beforeunloadHandler);a.Widget.prototype.destroy.call(this)},_setOption:function(e,f){a.Widget.prototype._setOption.apply(this,arguments);if(e==="source"){this._initSource()}if(e==="appendTo"){this.menu.element.appendTo(a(f||"body",this.element[0].ownerDocument)[0])}if(e==="disabled"&&f&&this.xhr){this.xhr.abort()}},_initSource:function(){var e=this,g,f;if(a.isArray(this.options.source)){g=this.options.source;this.source=function(j,h){h(a.ui.autocomplete.filter(g,j.term))}}else{if(typeof this.options.source==="string"){f=this.options.source;this.source=function(j,h){if(e.xhr){e.xhr.abort()}e.xhr=a.ajax({url:f,data:j,dataType:"json",success:function(l,k){h(l)},error:function(){h([])}})}}else{this.source=this.options.source}}},search:function(f,e){f=f!=null?f:this.element.val();this.term=this.element.val();if(f.length<this.options.minLength){return this.close(e)}clearTimeout(this.closing);if(this._trigger("search",e)===false){return}return this._search(f)},_search:function(e){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:e},this._response())},_response:function(){var f=this,e=++d;return function(g){if(e===d){f.__response(g)}f.pending--;if(!f.pending){f.element.removeClass("ui-autocomplete-loading")}}},__response:function(e){if(!this.options.disabled&&e&&e.length){e=this._normalize(e);this._suggest(e);this._trigger("open")}else{this.close()}},close:function(e){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",e)}},_change:function(e){if(this.previous!==this.element.val()){this._trigger("change",e,{item:this.selectedItem})}},_normalize:function(e){if(e.length&&e[0].label&&e[0].value){return e}return a.map(e,function(f){if(typeof f==="string"){return{label:f,value:f}}return a.extend({label:f.label||f.value,value:f.value||f.label},f)})},_suggest:function(e){var f=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(f,e);this.menu.deactivate();this.menu.refresh();f.show();this._resizeMenu();f.position(a.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new a.Event("mouseover"))}},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(g,f){var e=this;a.each(f,function(h,j){e._renderItem(g,j)})},_renderItem:function(e,f){return a("<li></li>").data("item.autocomplete",f).append(a("<a></a>").text(f.label)).appendTo(e)},_move:function(f,e){if(!this.menu.element.is(":visible")){this.search(null,e);return}if(this.menu.first()&&/^previous/.test(f)||this.menu.last()&&/^next/.test(f)){this.element.val(this.term);this.menu.deactivate();return}this.menu[f](e)},widget:function(){return this.menu.element},_keyEvent:function(f,e){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(f,e);e.preventDefault()}}});a.extend(a.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(g,e){var f=new RegExp(a.ui.autocomplete.escapeRegex(e),"i");return a.grep(g,function(h){return f.test(h.label||h.value||h)})}})}(jQuery));(function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(d){if(!a(d.target).closest(".ui-menu-item a").length){return}d.preventDefault();b.select(d)});this.refresh()},refresh:function(){var d=this;var b=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");b.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(e){d.activate(e,a(this).parent())}).mouseleave(function(){d.deactivate()})},activate:function(f,e){this.deactivate();if(this.hasScroll()){var g=e.offset().top-this.element.offset().top,b=this.element.scrollTop(),d=this.element.height();if(g<0){this.element.scrollTop(b+g)}else{if(g>=d){this.element.scrollTop(b+g-d+e.height())}}}this.active=e.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",f,{item:e})},deactivate:function(){if(!this.active){return}this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(b){this.move("next",".ui-menu-item:first",b)},previous:function(b){this.move("prev",".ui-menu-item:last",b)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(f,e,d){if(!this.active){this.activate(d,this.element.children(e));return}var b=this.active[f+"All"](".ui-menu-item").eq(0);if(b.length){this.activate(d,b)}else{this.activate(d,this.element.children(e))}},nextPage:function(e){if(this.hasScroll()){if(!this.active||this.last()){this.activate(e,this.element.children(".ui-menu-item:first"));return}var f=this.active.offset().top,d=this.element.height(),b=this.element.children(".ui-menu-item").filter(function(){var g=a(this).offset().top-f-d+a(this).height();return g<10&&g>-10});if(!b.length){b=this.element.children(".ui-menu-item:last")}this.activate(e,b)}else{this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(e){if(this.hasScroll()){if(!this.active||this.first()){this.activate(e,this.element.children(".ui-menu-item:last"));return}var f=this.active.offset().top,d=this.element.height(),b=this.element.children(".ui-menu-item").filter(function(){var g=a(this).offset().top-f+d-a(this).height();return g<10&&g>-10});if(!b.length){b=this.element.children(".ui-menu-item:first")}this.activate(e,b)}else{this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(b){this._trigger("selected",b,{item:this.active})}})}(jQuery));
/*
 * jQuery UI Button 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Button
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(g,b){var m,f,a,j,k="ui-button ui-widget ui-state-default ui-corner-all",d="ui-state-hover ui-state-active ",h="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",l=function(){var n=g(this).find(":ui-button");setTimeout(function(){n.button("refresh")},1)},e=function(o){var n=o.name,p=o.form,q=g([]);if(n){if(p){q=g(p).find("[name='"+n+"']")}else{q=g("[name='"+n+"']",o.ownerDocument).filter(function(){return !this.form})}}return q};g.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!=="boolean"){this.options.disabled=!!this.element.propAttr("disabled")}else{this.element.propAttr("disabled",this.options.disabled)}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var n=this,p=this.options,q=this.type==="checkbox"||this.type==="radio",r="ui-state-hover"+(!q?" ui-state-active":""),o="ui-state-focus";if(p.label===null){p.label=this.buttonElement.html()}this.buttonElement.addClass(k).attr("role","button").bind("mouseenter.button",function(){if(p.disabled){return}g(this).addClass("ui-state-hover");if(this===m){g(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){if(p.disabled){return}g(this).removeClass(r)}).bind("click.button",function(s){if(p.disabled){s.preventDefault();s.stopImmediatePropagation()}});this.element.bind("focus.button",function(){n.buttonElement.addClass(o)}).bind("blur.button",function(){n.buttonElement.removeClass(o)});if(q){this.element.bind("change.button",function(){if(j){return}n.refresh()});this.buttonElement.bind("mousedown.button",function(s){if(p.disabled){return}j=false;f=s.pageX;a=s.pageY}).bind("mouseup.button",function(s){if(p.disabled){return}if(f!==s.pageX||a!==s.pageY){j=true}})}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(p.disabled||j){return false}g(this).toggleClass("ui-state-active");n.buttonElement.attr("aria-pressed",n.element[0].checked)})}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(p.disabled||j){return false}g(this).addClass("ui-state-active");n.buttonElement.attr("aria-pressed","true");var s=n.element[0];e(s).not(s).map(function(){return g(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")})}else{this.buttonElement.bind("mousedown.button",function(){if(p.disabled){return false}g(this).addClass("ui-state-active");m=this;g(document).one("mouseup",function(){m=null})}).bind("mouseup.button",function(){if(p.disabled){return false}g(this).removeClass("ui-state-active")}).bind("keydown.button",function(s){if(p.disabled){return false}if(s.keyCode==g.ui.keyCode.SPACE||s.keyCode==g.ui.keyCode.ENTER){g(this).addClass("ui-state-active")}}).bind("keyup.button",function(){g(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(s){if(s.keyCode===g.ui.keyCode.SPACE){g(this).click()}})}}}this._setOption("disabled",p.disabled);this._resetButton()},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox"}else{if(this.element.is(":radio")){this.type="radio"}else{if(this.element.is("input")){this.type="input"}else{this.type="button"}}}if(this.type==="checkbox"||this.type==="radio"){var n=this.element.parents().filter(":last"),p="label[for='"+this.element.attr("id")+"']";this.buttonElement=n.find(p);if(!this.buttonElement.length){n=n.length?n.siblings():this.element.siblings();this.buttonElement=n.filter(p);if(!this.buttonElement.length){this.buttonElement=n.find(p)}}this.element.addClass("ui-helper-hidden-accessible");var o=this.element.is(":checked");if(o){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",o)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(k+" "+d+" "+h).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}g.Widget.prototype.destroy.call(this)},_setOption:function(n,o){g.Widget.prototype._setOption.apply(this,arguments);if(n==="disabled"){if(o){this.element.propAttr("disabled",true)}else{this.element.propAttr("disabled",false)}return}this._resetButton()},refresh:function(){var n=this.element.is(":disabled");if(n!==this.options.disabled){this._setOption("disabled",n)}if(this.type==="radio"){e(this.element[0]).each(function(){if(g(this).is(":checked")){g(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true")}else{g(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}})}else{if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true")}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")}}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var r=this.buttonElement.removeClass(h),p=g("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(r.empty()).text(),o=this.options.icons,n=o.primary&&o.secondary,q=[];if(o.primary||o.secondary){if(this.options.text){q.push("ui-button-text-icon"+(n?"s":(o.primary?"-primary":"-secondary")))}if(o.primary){r.prepend("<span class='ui-button-icon-primary ui-icon "+o.primary+"'></span>")}if(o.secondary){r.append("<span class='ui-button-icon-secondary ui-icon "+o.secondary+"'></span>")}if(!this.options.text){q.push(n?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){r.attr("title",p)}}}else{q.push("ui-button-text-only")}r.addClass(q.join(" "))}});g.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(n,o){if(n==="disabled"){this.buttons.button("option",n,o)}g.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var n=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return g(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(n?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(n?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return g(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");g.Widget.prototype.destroy.call(this)}})}(jQuery));
/*
 * jQuery UI Dialog 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Dialog
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  jquery.ui.button.js
 *	jquery.ui.draggable.js
 *	jquery.ui.mouse.js
 *	jquery.ui.position.js
 *	jquery.ui.resizable.js
 */
(function(e,f){var b="ui-dialog ui-widget ui-widget-content ui-corner-all ",a={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},d={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};e.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:{my:"center",at:"center",collision:"fit",using:function(h){var g=e(this).css(h).offset().top;if(g<0){e(this).css("top",h.top-g)}}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle=""}this.options.title=this.options.title||this.originalTitle;var p=this,q=p.options,n=q.title||"&#160;",h=e.ui.dialog.getTitleId(p.element),o=(p.uiDialog=e("<div></div>")).appendTo(document.body).hide().addClass(b+q.dialogClass).css({zIndex:q.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(r){if(q.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE){p.close(r);r.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(r){p.moveToTop(false,r)}),k=p.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(o),j=(p.uiDialogTitlebar=e("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(o),m=e('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){m.addClass("ui-state-hover")},function(){m.removeClass("ui-state-hover")}).focus(function(){m.addClass("ui-state-focus")}).blur(function(){m.removeClass("ui-state-focus")}).click(function(r){p.close(r);return false}).appendTo(j),l=(p.uiDialogTitlebarCloseText=e("<span></span>")).addClass("ui-icon ui-icon-closethick").text(q.closeText).appendTo(m),g=e("<span></span>").addClass("ui-dialog-title").attr("id",h).html(n).prependTo(j);if(e.isFunction(q.beforeclose)&&!e.isFunction(q.beforeClose)){q.beforeClose=q.beforeclose}j.find("*").add(j).disableSelection();if(q.draggable&&e.fn.draggable){p._makeDraggable()}if(q.resizable&&e.fn.resizable){p._makeResizable()}p._createButtons(q.buttons);p._isOpen=false;if(e.fn.bgiframe){o.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var g=this;if(g.overlay){g.overlay.destroy()}g.uiDialog.hide();g.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");g.uiDialog.remove();if(g.originalTitle){g.element.attr("title",g.originalTitle)}return g},widget:function(){return this.uiDialog},close:function(k){var g=this,j,h;if(false===g._trigger("beforeClose",k)){return}if(g.overlay){g.overlay.destroy()}g.uiDialog.unbind("keypress.ui-dialog");g._isOpen=false;if(g.options.hide){g.uiDialog.hide(g.options.hide,function(){g._trigger("close",k)})}else{g.uiDialog.hide();g._trigger("close",k)}e.ui.dialog.overlay.resize();if(g.options.modal){j=0;e(".ui-dialog").each(function(){if(this!==g.uiDialog[0]){h=e(this).css("z-index");if(!isNaN(h)){j=Math.max(j,h)}}});e.ui.dialog.maxZ=j}return g},isOpen:function(){return this._isOpen},moveToTop:function(l,k){var g=this,j=g.options,h;if((j.modal&&!l)||(!j.stack&&!j.modal)){return g._trigger("focus",k)}if(j.zIndex>e.ui.dialog.maxZ){e.ui.dialog.maxZ=j.zIndex}if(g.overlay){e.ui.dialog.maxZ+=1;g.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ)}h={scrollTop:g.element.scrollTop(),scrollLeft:g.element.scrollLeft()};e.ui.dialog.maxZ+=1;g.uiDialog.css("z-index",e.ui.dialog.maxZ);g.element.attr(h);g._trigger("focus",k);return g},open:function(){if(this._isOpen){return}var h=this,j=h.options,g=h.uiDialog;h.overlay=j.modal?new e.ui.dialog.overlay(h):null;h._size();h._position(j.position);g.show(j.show);h.moveToTop(true);if(j.modal){g.bind("keydown.ui-dialog",function(m){if(m.keyCode!==e.ui.keyCode.TAB){return}var l=e(":tabbable",this),n=l.filter(":first"),k=l.filter(":last");if(m.target===k[0]&&!m.shiftKey){n.focus(1);return false}else{if(m.target===n[0]&&m.shiftKey){k.focus(1);return false}}})}e(h.element.find(":tabbable").get().concat(g.find(".ui-dialog-buttonpane :tabbable").get().concat(g.get()))).eq(0).focus();h._isOpen=true;h._trigger("open");return h},_createButtons:function(k){var j=this,g=false,h=e("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),l=e("<div></div>").addClass("ui-dialog-buttonset").appendTo(h);j.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof k==="object"&&k!==null){e.each(k,function(){return !(g=true)})}if(g){e.each(k,function(m,o){o=e.isFunction(o)?{click:o,text:m}:o;var n=e('<button type="button"></button>').click(function(){o.click.apply(j.element[0],arguments)}).appendTo(l);e.each(o,function(p,q){if(p==="click"){return}if(p in n){n[p](q)}else{n.attr(p,q)}});if(e.fn.button){n.button()}});h.appendTo(j.uiDialog)}},_makeDraggable:function(){var g=this,k=g.options,l=e(document),j;function h(m){return{position:m.position,offset:m.offset}}g.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(m,n){j=k.height==="auto"?"auto":e(this).height();e(this).height(e(this).height()).addClass("ui-dialog-dragging");g._trigger("dragStart",m,h(n))},drag:function(m,n){g._trigger("drag",m,h(n))},stop:function(m,n){k.position=[n.position.left-l.scrollLeft(),n.position.top-l.scrollTop()];e(this).removeClass("ui-dialog-dragging").height(j);g._trigger("dragStop",m,h(n));e.ui.dialog.overlay.resize()}})},_makeResizable:function(m){m=(m===f?this.options.resizable:m);var h=this,l=h.options,g=h.uiDialog.css("position"),k=(typeof m==="string"?m:"n,e,s,w,se,sw,ne,nw");function j(n){return{originalPosition:n.originalPosition,originalSize:n.originalSize,position:n.position,size:n.size}}h.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:h.element,maxWidth:l.maxWidth,maxHeight:l.maxHeight,minWidth:l.minWidth,minHeight:h._minHeight(),handles:k,start:function(n,o){e(this).addClass("ui-dialog-resizing");h._trigger("resizeStart",n,j(o))},resize:function(n,o){h._trigger("resize",n,j(o))},stop:function(n,o){e(this).removeClass("ui-dialog-resizing");l.height=e(this).height();l.width=e(this).width();h._trigger("resizeStop",n,j(o));e.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;if(g.height==="auto"){return g.minHeight}else{return Math.min(g.minHeight,g.height)}},_position:function(h){var j=[],k=[0,0],g;if(h){if(typeof h==="string"||(typeof h==="object"&&"0" in h)){j=h.split?h.split(" "):[h[0],h[1]];if(j.length===1){j[1]=j[0]}e.each(["left","top"],function(m,l){if(+j[m]===j[m]){k[m]=j[m];j[m]=l}});h={my:j.join(" "),at:j.join(" "),offset:k.join(" ")}}h=e.extend({},e.ui.dialog.prototype.options.position,h)}else{h=e.ui.dialog.prototype.options.position}g=this.uiDialog.is(":visible");if(!g){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position(e.extend({of:window},h));if(!g){this.uiDialog.hide()}},_setOptions:function(k){var h=this,g={},j=false;e.each(k,function(l,m){h._setOption(l,m);if(l in a){j=true}if(l in d){g[l]=m}});if(j){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",g)}},_setOption:function(k,l){var h=this,g=h.uiDialog;switch(k){case"beforeclose":k="beforeClose";break;case"buttons":h._createButtons(l);break;case"closeText":h.uiDialogTitlebarCloseText.text(""+l);break;case"dialogClass":g.removeClass(h.options.dialogClass).addClass(b+l);break;case"disabled":if(l){g.addClass("ui-dialog-disabled")}else{g.removeClass("ui-dialog-disabled")}break;case"draggable":var j=g.is(":data(draggable)");if(j&&!l){g.draggable("destroy")}if(!j&&l){h._makeDraggable()}break;case"position":h._position(l);break;case"resizable":var m=g.is(":data(resizable)");if(m&&!l){g.resizable("destroy")}if(m&&typeof l==="string"){g.resizable("option","handles",l)}if(!m&&l!==false){h._makeResizable(l)}break;case"title":e(".ui-dialog-title",h.uiDialogTitlebar).html(""+(l||"&#160;"));break}e.Widget.prototype._setOption.apply(h,arguments)},_size:function(){var l=this.options,h,k,g=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(l.minWidth>l.width){l.width=l.minWidth}h=this.uiDialog.css({height:"auto",width:l.width}).height();k=Math.max(0,l.minHeight-h);if(l.height==="auto"){if(e.support.minHeight){this.element.css({minHeight:k,height:"auto"})}else{this.uiDialog.show();var j=this.element.css("height","auto").height();if(!g){this.uiDialog.hide()}this.element.height(Math.max(j,k))}}else{this.element.height(Math.max(l.height-h,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});e.extend(e.ui.dialog,{version:"1.8.23",uuid:0,maxZ:0,getTitleId:function(g){var h=g.attr("id");if(!h){this.uuid+=1;h=this.uuid}return"ui-dialog-title-"+h},overlay:function(g){this.$el=e.ui.dialog.overlay.create(g)}});e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "),create:function(h){if(this.instances.length===0){setTimeout(function(){if(e.ui.dialog.overlay.instances.length){e(document).bind(e.ui.dialog.overlay.events,function(j){if(e(j.target).zIndex()<e.ui.dialog.overlay.maxZ){return false}})}},1);e(document).bind("keydown.dialog-overlay",function(j){if(h.options.closeOnEscape&&!j.isDefaultPrevented()&&j.keyCode&&j.keyCode===e.ui.keyCode.ESCAPE){h.close(j);j.preventDefault()}});e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize)}var g=(this.oldInstances.pop()||e("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if(e.fn.bgiframe){g.bgiframe()}this.instances.push(g);return g},destroy:function(g){var h=e.inArray(g,this.instances);if(h!=-1){this.oldInstances.push(this.instances.splice(h,1)[0])}if(this.instances.length===0){e([document,window]).unbind(".dialog-overlay")}g.remove();var j=0;e.each(this.instances,function(){j=Math.max(j,this.css("z-index"))});this.maxZ=j},height:function(){var h,g;if(e.browser.msie&&e.browser.version<7){h=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);g=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(h<g){return e(window).height()+"px"}else{return h+"px"}}else{return e(document).height()+"px"}},width:function(){var g,h;if(e.browser.msie){g=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);h=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(g<h){return e(window).width()+"px"}else{return g+"px"}}else{return e(document).width()+"px"}},resize:function(){var g=e([]);e.each(e.ui.dialog.overlay.instances,function(){g=g.add(this)});g.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}});e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})}(jQuery));
/*
 * jQuery UI Slider 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(b,d){var a=5;b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var f=this,l=this.options,k=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),j="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",e=(l.values&&l.values.length)||1,h=[];this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(l.disabled?" ui-slider-disabled ui-disabled":""));this.range=b([]);if(l.range){if(l.range===true){if(!l.values){l.values=[this._valueMin(),this._valueMin()]}if(l.values.length&&l.values.length!==2){l.values=[l.values[0],l.values[0]]}}this.range=b("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+((l.range==="min"||l.range==="max")?" ui-slider-range-"+l.range:""))}for(var g=k.length;g<e;g+=1){h.push(j)}this.handles=k.add(b(h.join("")).appendTo(f.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(m){m.preventDefault()}).hover(function(){if(!l.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!l.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(m){b(this).data("index.ui-slider-handle",m)});this.handles.keydown(function(q){var n=b(this).data("index.ui-slider-handle"),r,o,m,p;if(f.options.disabled){return}switch(q.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:q.preventDefault();if(!f._keySliding){f._keySliding=true;b(this).addClass("ui-state-active");r=f._start(q,n);if(r===false){return}}break}p=f.options.step;if(f.options.values&&f.options.values.length){o=m=f.values(n)}else{o=m=f.value()}switch(q.keyCode){case b.ui.keyCode.HOME:m=f._valueMin();break;case b.ui.keyCode.END:m=f._valueMax();break;case b.ui.keyCode.PAGE_UP:m=f._trimAlignValue(o+((f._valueMax()-f._valueMin())/a));break;case b.ui.keyCode.PAGE_DOWN:m=f._trimAlignValue(o-((f._valueMax()-f._valueMin())/a));break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(o===f._valueMax()){return}m=f._trimAlignValue(o+p);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(o===f._valueMin()){return}m=f._trimAlignValue(o-p);break}f._slide(q,n,m)}).keyup(function(n){var m=b(this).data("index.ui-slider-handle");if(f._keySliding){f._keySliding=false;f._stop(n,m);f._change(n,m);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(g){var h=this.options,l,n,f,j,q,m,p,k,e;if(h.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();l={x:g.pageX,y:g.pageY};n=this._normValueFromMouse(l);f=this._valueMax()-this._valueMin()+1;q=this;this.handles.each(function(o){var r=Math.abs(n-q.values(o));if(f>r){f=r;j=b(this);m=o}});if(h.range===true&&this.values(1)===h.min){m+=1;j=b(this.handles[m])}p=this._start(g,m);if(p===false){return false}this._mouseSliding=true;q._handleIndex=m;j.addClass("ui-state-active").focus();k=j.offset();e=!b(g.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=e?{left:0,top:0}:{left:g.pageX-k.left-(j.width()/2),top:g.pageY-k.top-(j.height()/2)-(parseInt(j.css("borderTopWidth"),10)||0)-(parseInt(j.css("borderBottomWidth"),10)||0)+(parseInt(j.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(g,m,n)}this._animateOff=true;return true},_mouseStart:function(e){return true},_mouseDrag:function(g){var e={x:g.pageX,y:g.pageY},f=this._normValueFromMouse(e);this._slide(g,this._handleIndex,f);return false},_mouseStop:function(e){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(e,this._handleIndex);this._change(e,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(f){var e,j,h,g,k;if(this.orientation==="horizontal"){e=this.elementSize.width;j=f.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{e=this.elementSize.height;j=f.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}h=(j/e);if(h>1){h=1}if(h<0){h=0}if(this.orientation==="vertical"){h=1-h}g=this._valueMax()-this._valueMin();k=this._valueMin()+h*g;return this._trimAlignValue(k)},_start:function(g,f){var e={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(f);e.values=this.values()}return this._trigger("start",g,e)},_slide:function(j,h,g){var e,f,k;if(this.options.values&&this.options.values.length){e=this.values(h?0:1);if((this.options.values.length===2&&this.options.range===true)&&((h===0&&g>e)||(h===1&&g<e))){g=e}if(g!==this.values(h)){f=this.values();f[h]=g;k=this._trigger("slide",j,{handle:this.handles[h],value:g,values:f});e=this.values(h?0:1);if(k!==false){this.values(h,g,true)}}}else{if(g!==this.value()){k=this._trigger("slide",j,{handle:this.handles[h],value:g});if(k!==false){this.value(g)}}}},_stop:function(g,f){var e={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(f);e.values=this.values()}this._trigger("stop",g,e)},_change:function(g,f){if(!this._keySliding&&!this._mouseSliding){var e={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(f);e.values=this.values()}this._trigger("change",g,e)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e);this._refreshValue();this._change(null,0);return}return this._value()},values:function(f,j){var h,e,g;if(arguments.length>1){this.options.values[f]=this._trimAlignValue(j);this._refreshValue();this._change(null,f);return}if(arguments.length){if(b.isArray(arguments[0])){h=this.options.values;e=arguments[0];for(g=0;g<h.length;g+=1){h[g]=this._trimAlignValue(e[g]);this._change(null,g)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(f)}else{return this.value()}}}else{return this._values()}},_setOption:function(f,g){var e,h=0;if(b.isArray(this.options.values)){h=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(f){case"disabled":if(g){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(e=0;e<h;e+=1){this._change(null,e)}this._animateOff=false;break}},_value:function(){var e=this.options.value;e=this._trimAlignValue(e);return e},_values:function(e){var h,g,f;if(arguments.length){h=this.options.values[e];h=this._trimAlignValue(h);return h}else{g=this.options.values.slice();for(f=0;f<g.length;f+=1){g[f]=this._trimAlignValue(g[f])}return g}},_trimAlignValue:function(h){if(h<=this._valueMin()){return this._valueMin()}if(h>=this._valueMax()){return this._valueMax()}var e=(this.options.step>0)?this.options.step:1,g=(h-this._valueMin())%e,f=h-g;if(Math.abs(g)*2>=e){f+=(g>0)?e:(-e)}return parseFloat(f.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var h=this.options.range,g=this.options,p=this,f=(!this._animateOff)?g.animate:false,j,e={},k,m,l,n;if(this.options.values&&this.options.values.length){this.handles.each(function(q,o){j=(p.values(q)-p._valueMin())/(p._valueMax()-p._valueMin())*100;e[p.orientation==="horizontal"?"left":"bottom"]=j+"%";b(this).stop(1,1)[f?"animate":"css"](e,g.animate);if(p.options.range===true){if(p.orientation==="horizontal"){if(q===0){p.range.stop(1,1)[f?"animate":"css"]({left:j+"%"},g.animate)}if(q===1){p.range[f?"animate":"css"]({width:(j-k)+"%"},{queue:false,duration:g.animate})}}else{if(q===0){p.range.stop(1,1)[f?"animate":"css"]({bottom:(j)+"%"},g.animate)}if(q===1){p.range[f?"animate":"css"]({height:(j-k)+"%"},{queue:false,duration:g.animate})}}}k=j})}else{m=this.value();l=this._valueMin();n=this._valueMax();j=(n!==l)?(m-l)/(n-l)*100:0;e[p.orientation==="horizontal"?"left":"bottom"]=j+"%";this.handle.stop(1,1)[f?"animate":"css"](e,g.animate);if(h==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[f?"animate":"css"]({width:j+"%"},g.animate)}if(h==="max"&&this.orientation==="horizontal"){this.range[f?"animate":"css"]({width:(100-j)+"%"},{queue:false,duration:g.animate})}if(h==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[f?"animate":"css"]({height:j+"%"},g.animate)}if(h==="max"&&this.orientation==="vertical"){this.range[f?"animate":"css"]({height:(100-j)+"%"},{queue:false,duration:g.animate})}}}});b.extend(b.ui.slider,{version:"1.8.23"})}(jQuery));
/*
 * jQuery UI Tabs 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Tabs
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(e,g){var d=0,b=0;function f(){return ++d}function a(){return ++b}e.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(h,j){if(h=="selected"){if(this.options.collapsible&&j==this.options.selected){return}this.select(j)}else{this.options[h]=j;this._tabify()}},_tabId:function(h){return h.title&&h.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+f()},_sanitizeSelector:function(h){return h.replace(/:/g,"\\:")},_cookie:function(){var h=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a());return e.cookie.apply(null,[h].concat(e.makeArray(arguments)))},_ui:function(j,h){return{tab:j,panel:h,index:this.anchors.index(j)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var h=e(this);h.html(h.data("label.tabs")).removeData("label.tabs")})},_tabify:function(u){var v=this,k=this.options,j=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=e(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return e("a",this)[0]});this.panels=e([]);this.anchors.each(function(x,o){var w=e(o).attr("href");var y=w.split("#")[0],z;if(y&&(y===location.toString().split("#")[0]||(z=e("base")[0])&&y===z.href)){w=o.hash;o.href=w}if(j.test(w)){v.panels=v.panels.add(v.element.find(v._sanitizeSelector(w)))}else{if(w&&w!=="#"){e.data(o,"href.tabs",w);e.data(o,"load.tabs",w.replace(/#.*$/,""));var B=v._tabId(o);o.href="#"+B;var A=v.element.find("#"+B);if(!A.length){A=e(k.panelTemplate).attr("id",B).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(v.panels[x-1]||v.list);A.data("destroy.tabs",true)}v.panels=v.panels.add(A)}else{k.disabled.push(x)}}});if(u){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(k.selected===g){if(location.hash){this.anchors.each(function(w,o){if(o.hash==location.hash){k.selected=w;return false}})}if(typeof k.selected!=="number"&&k.cookie){k.selected=parseInt(v._cookie(),10)}if(typeof k.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){k.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}k.selected=k.selected||(this.lis.length?0:-1)}else{if(k.selected===null){k.selected=-1}}k.selected=((k.selected>=0&&this.anchors[k.selected])||k.selected<0)?k.selected:0;k.disabled=e.unique(k.disabled.concat(e.map(this.lis.filter(".ui-state-disabled"),function(w,o){return v.lis.index(w)}))).sort();if(e.inArray(k.selected,k.disabled)!=-1){k.disabled.splice(e.inArray(k.selected,k.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(k.selected>=0&&this.anchors.length){v.element.find(v._sanitizeSelector(v.anchors[k.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(k.selected).addClass("ui-tabs-selected ui-state-active");v.element.queue("tabs",function(){v._trigger("show",null,v._ui(v.anchors[k.selected],v.element.find(v._sanitizeSelector(v.anchors[k.selected].hash))[0]))});this.load(k.selected)}e(window).bind("unload",function(){v.lis.add(v.anchors).unbind(".tabs");v.lis=v.anchors=v.panels=null})}else{k.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[k.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(k.cookie){this._cookie(k.selected,k.cookie)}for(var n=0,t;(t=this.lis[n]);n++){e(t)[e.inArray(n,k.disabled)!=-1&&!e(t).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(k.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(k.event!=="mouseover"){var m=function(w,o){if(o.is(":not(.ui-state-disabled)")){o.addClass("ui-state-"+w)}};var q=function(w,o){o.removeClass("ui-state-"+w)};this.lis.bind("mouseover.tabs",function(){m("hover",e(this))});this.lis.bind("mouseout.tabs",function(){q("hover",e(this))});this.anchors.bind("focus.tabs",function(){m("focus",e(this).closest("li"))});this.anchors.bind("blur.tabs",function(){q("focus",e(this).closest("li"))})}var h,p;if(k.fx){if(e.isArray(k.fx)){h=k.fx[0];p=k.fx[1]}else{h=p=k.fx}}function l(o,w){o.css("display","");if(!e.support.opacity&&w.opacity){o[0].style.removeAttribute("filter")}}var r=p?function(o,w){e(o).closest("li").addClass("ui-tabs-selected ui-state-active");w.hide().removeClass("ui-tabs-hide").animate(p,p.duration||"normal",function(){l(w,p);v._trigger("show",null,v._ui(o,w[0]))})}:function(o,w){e(o).closest("li").addClass("ui-tabs-selected ui-state-active");w.removeClass("ui-tabs-hide");v._trigger("show",null,v._ui(o,w[0]))};var s=h?function(w,o){o.animate(h,h.duration||"normal",function(){v.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");l(o,h);v.element.dequeue("tabs")})}:function(w,o,x){v.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");v.element.dequeue("tabs")};this.anchors.bind(k.event+".tabs",function(){var w=this,y=e(w).closest("li"),o=v.panels.filter(":not(.ui-tabs-hide)"),x=v.element.find(v._sanitizeSelector(w.hash));if((y.hasClass("ui-tabs-selected")&&!k.collapsible)||y.hasClass("ui-state-disabled")||y.hasClass("ui-state-processing")||v.panels.filter(":animated").length||v._trigger("select",null,v._ui(this,x[0]))===false){this.blur();return false}k.selected=v.anchors.index(this);v.abort();if(k.collapsible){if(y.hasClass("ui-tabs-selected")){k.selected=-1;if(k.cookie){v._cookie(k.selected,k.cookie)}v.element.queue("tabs",function(){s(w,o)}).dequeue("tabs");this.blur();return false}else{if(!o.length){if(k.cookie){v._cookie(k.selected,k.cookie)}v.element.queue("tabs",function(){r(w,x)});v.load(v.anchors.index(this));this.blur();return false}}}if(k.cookie){v._cookie(k.selected,k.cookie)}if(x.length){if(o.length){v.element.queue("tabs",function(){s(w,o)})}v.element.queue("tabs",function(){r(w,x)});v.load(v.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(e.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(h){if(typeof h=="string"){h=this.anchors.index(this.anchors.filter("[href$='"+h+"']"))}return h},destroy:function(){var h=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var j=e.data(this,"href.tabs");if(j){this.href=j}var k=e(this).unbind(".tabs");e.each(["href","load","cache"],function(l,m){k.removeData(m+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(e.data(this,"destroy.tabs")){e(this).remove()}else{e(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(h.cookie){this._cookie(null,h.cookie)}return this},add:function(l,k,j){if(j===g){j=this.anchors.length}var h=this,n=this.options,q=e(n.tabTemplate.replace(/#\{href\}/g,l).replace(/#\{label\}/g,k)),p=!l.indexOf("#")?l.replace("#",""):this._tabId(e("a",q)[0]);q.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var m=h.element.find("#"+p);if(!m.length){m=e(n.panelTemplate).attr("id",p).data("destroy.tabs",true)}m.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(j>=this.lis.length){q.appendTo(this.list);m.appendTo(this.list[0].parentNode)}else{q.insertBefore(this.lis[j]);m.insertBefore(this.panels[j])}n.disabled=e.map(n.disabled,function(r,o){return r>=j?++r:r});this._tabify();if(this.anchors.length==1){n.selected=0;q.addClass("ui-tabs-selected ui-state-active");m.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){h._trigger("show",null,h._ui(h.anchors[0],h.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[j],this.panels[j]));return this},remove:function(h){h=this._getIndex(h);var k=this.options,l=this.lis.eq(h).remove(),j=this.panels.eq(h).remove();if(l.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(h+(h+1<this.anchors.length?1:-1))}k.disabled=e.map(e.grep(k.disabled,function(o,m){return o!=h}),function(o,m){return o>=h?--o:o});this._tabify();this._trigger("remove",null,this._ui(l.find("a")[0],j[0]));return this},enable:function(h){h=this._getIndex(h);var j=this.options;if(e.inArray(h,j.disabled)==-1){return}this.lis.eq(h).removeClass("ui-state-disabled");j.disabled=e.grep(j.disabled,function(l,k){return l!=h});this._trigger("enable",null,this._ui(this.anchors[h],this.panels[h]));return this},disable:function(j){j=this._getIndex(j);var h=this,k=this.options;if(j!=k.selected){this.lis.eq(j).addClass("ui-state-disabled");k.disabled.push(j);k.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[j],this.panels[j]))}return this},select:function(h){h=this._getIndex(h);if(h==-1){if(this.options.collapsible&&this.options.selected!=-1){h=this.options.selected}else{return this}}this.anchors.eq(h).trigger(this.options.event+".tabs");return this},load:function(l){l=this._getIndex(l);var j=this,n=this.options,h=this.anchors.eq(l)[0],k=e.data(h,"load.tabs");this.abort();if(!k||this.element.queue("tabs").length!==0&&e.data(h,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(l).addClass("ui-state-processing");if(n.spinner){var m=e("span",h);m.data("label.tabs",m.html()).html(n.spinner)}this.xhr=e.ajax(e.extend({},n.ajaxOptions,{url:k,success:function(p,o){j.element.find(j._sanitizeSelector(h.hash)).html(p);j._cleanup();if(n.cache){e.data(h,"cache.tabs",true)}j._trigger("load",null,j._ui(j.anchors[l],j.panels[l]));try{n.ajaxOptions.success(p,o)}catch(q){}},error:function(q,o,p){j._cleanup();j._trigger("load",null,j._ui(j.anchors[l],j.panels[l]));try{n.ajaxOptions.error(q,o,l,h)}catch(p){}}}));j.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(j,h){this.anchors.eq(j).removeData("cache.tabs").data("load.tabs",h);return this},length:function(){return this.anchors.length}});e.extend(e.ui.tabs,{version:"1.8.23"});e.extend(e.ui.tabs.prototype,{rotation:null,rotate:function(k,m){var h=this,n=this.options;var j=h._rotate||(h._rotate=function(o){clearTimeout(h.rotation);h.rotation=setTimeout(function(){var p=n.selected;h.select(++p<h.anchors.length?p:0)},k);if(o){o.stopPropagation()}});var l=h._unrotate||(h._unrotate=!m?function(o){if(o.clientX){h.rotate(null)}}:function(o){j()});if(k){this.element.bind("tabsshow",j);this.anchors.bind(n.event+".tabs",l);j()}else{clearTimeout(h.rotation);this.element.unbind("tabsshow",j);this.anchors.unbind(n.event+".tabs",l);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
/*
 * jQuery UI Datepicker 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Datepicker
 *
 * Depends:
 *	jquery.ui.core.js
 */
(function($,undefined){$.extend($.ui,{datepicker:{version:"1.8.23"}});var PROP_NAME="datepicker";var dpuuid=new Date().getTime();var instActive;function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){if(this.debug){console.log.apply("",arguments)}},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}this._attachments(input,inst);input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});this._autoSize(inst);$.data(target,PROP_NAME,inst);if(inst.settings.disabled){this._disableDatepicker(target)}},_attachments:function(input,inst){var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove()}if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}input.unbind("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove()}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0]){$.datepicker._hideDatepicker()}else{if($.datepicker._datepickerShowing&&$.datepicker._lastInput!=input[0]){$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0])}else{$.datepicker._showDatepicker(input[0])}}return false})}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var date=new Date(2009,12-1,20);var dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){var findMax=function(names){var max=0;var maxI=0;for(var i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i}}return maxI};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay())}inst.input.attr("size",this._formatDate(inst,date).length)}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target)}inst.dpDiv.css("display","block")},_dialogDatepicker:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){this.uuid+=1;var id="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; top: -100px; width: 0px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});date=(date&&date.constructor==Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker()}var date=this._getDateDatepicker(target,true);var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate)}if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate)}this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:var sel=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}var onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){var dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{$.datepicker._hideDatepicker()}return false;break;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_doKeyUp:function(event){var inst=$.datepicker._getInst(event.target);if(inst.input.val()!=inst.lastVal){try{var date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst)}}catch(err){$.datepicker.log(err)}}return true},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!=inst){$.datepicker._curInst.dpDiv.stop(true,true);if(inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0])}}var beforeShow=$.datepicker._get(inst,"beforeShow");var beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return}extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim");var duration=$.datepicker._get(inst,"duration");var postProcess=function(){var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){var borders=$.datepicker._getBorders(inst.dpDiv);cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}};inst.dpDiv.zIndex($(input).zIndex()+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim||"show"]((showAnim?duration:null),postProcess)}if(!showAnim||!duration){postProcess()}if(inst.input.is(":visible")&&!inst.input.is(":disabled")){inst.input.focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var self=this;self.maxRows=4;var borders=$.datepicker._getBorders(inst.dpDiv);instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));this._attachHandlers(inst);var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}inst.dpDiv.find("."+this._dayOverClass+" a").mouseover();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst==$.datepicker._curInst&&$.datepicker._datepickerShowing&&inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&inst.input[0]!=document.activeElement){inst.input.focus()}if(inst.yearshtml){var origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml)}origyearshtml=inst.yearshtml=null},0)}},_getBorders:function(elem){var convert=function(value){return{thin:1,medium:2,thick:3}[value]||value};return[parseFloat(convert(elem.css("border-left-width"))),parseFloat(convert(elem.css("border-top-width")))]},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft());var viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset},_findPos:function(obj){var inst=this._getInst(obj);var isRTL=this._get(inst,"isRTL");while(obj&&(obj.type=="hidden"||obj.nodeType!=1||$.expr.filters.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"]}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(this._datepickerShowing){var showAnim=this._get(inst,"showAnim");var duration=this._get(inst,"duration");var postProcess=function(){$.datepicker._tidyDialog(inst)};if($.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess)}if(!showAnim){postProcess()}this._datepickerShowing=false;var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if((($target[0].id!=$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length==0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)))||($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=inst)){$.datepicker._hideDatepicker()}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input.focus()}this._lastInput=null}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);var dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){var isDoubled=lookAhead(match);var size=(match=="@"?14:(match=="!"?20:(match=="y"&&isDoubled?4:(match=="o"?3:2))));var digits=new RegExp("^\\d{1,"+size+"}");var num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue}iValue+=num[0].length;return parseInt(num[0],10)};var getName=function(match,shortNames,longNames){var names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]]}).sort(function(a,b){return -(a[1].length-b[1].length)});var index=-1;$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()==name.toLowerCase()){index=pair[0];iValue+=name.length;return false}});if(index!=-1){return index+1}else{throw"Unknown name at position "+iValue}};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":var date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(iValue<value.length){throw"Extra/unparsed characters found in date: "+value.substring(iValue)}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst,noDefault){if(inst.input.val()==inst.lastVal){return}var dateFormat=this._get(inst,"dateFormat");var dates=inst.lastVal=inst.input?inst.input.val():null;var date,defaultDate;date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);dates=(noDefault?"":dates)}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()))},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst))}catch(e){}var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};var newDate=(date==null||date===""?defaultDate:(typeof date=="string"?offsetString(date):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()=="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0)}return this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,noChange){var clear=!date;var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;var newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)&&!noChange){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths");var id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(id,-stepMonths,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(id,+stepMonths,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(id)},selectDay:function(){window["DP_jQuery_"+dpuuid].datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},selectMonth:function(){window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(id,this,"M");return false},selectYear:function(){window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(id,this,"Y");return false}};$(this).bind(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")])})},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var showWeek=this._get(inst,"showWeek");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var selectOtherMonths=this._get(inst,"selectOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";this.maxRows=4;for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group';if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break}}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,"weekHeader")+"</th>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var curRows=Math.ceil((leadDays+daysInMonth)/7);var numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody=(!showWeek?"":'<td class="ui-datepicker-week-col">'+this._get(inst,"calculateWeek")(printDate)+"</td>");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()==currentDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":' data-handler="selectDay" data-event="click" data-month="'+printDate.getMonth()+'" data-year="'+printDate.getFullYear()+'"')+">"+(otherMonth&&!showOtherMonths?"&#xa0;":(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()==currentDate.getTime()?" ui-state-active":"")+(otherMonth?" ui-priority-secondary":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span>"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")}if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var thisYear=new Date().getFullYear();var determineYear=function(value){var year=(value.match(/c[+-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year)};var year=determineYear(years[0]);var endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;year<=endYear;year++){inst.yearshtml+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null}}html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var newDate=(minDate&&date<minDate?minDate:date);newDate=(maxDate&&newDate>maxDate?maxDate:newDate);return newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime()))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.bind("mouseout",function(event){var elem=$(event.target).closest(selector);if(!elem.length){return}elem.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(event){var elem=$(event.target).closest(selector);if($.datepicker._isDisabledDatepicker(instActive.inline?dpDiv.parent()[0]:instActive.input[0])||!elem.length){return}elem.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");elem.addClass("ui-state-hover");if(elem.hasClass("ui-datepicker-prev")){elem.addClass("ui-datepicker-prev-hover")}if(elem.hasClass("ui-datepicker-next")){elem.addClass("ui-datepicker-next-hover")}})}function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!this.length){return this}if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate"||options=="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.8.23";window["DP_jQuery_"+dpuuid]=$})(jQuery);
/*
 * jQuery UI Progressbar 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Progressbar
 *
 * Depends:
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 */
(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();a.Widget.prototype.destroy.apply(this,arguments)},value:function(d){if(d===b){return this._value()}this._setOption("value",d);return this},_setOption:function(d,e){if(d==="value"){this.options.value=e;this._refreshValue();if(this._value()===this.options.max){this._trigger("complete")}}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var d=this.options.value;if(typeof d!=="number"){d=0}return Math.min(this.options.max,Math.max(this.min,d))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value();var d=this._percentage();if(this.oldValue!==e){this.oldValue=e;this._trigger("change")}this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(d.toFixed(0)+"%");this.element.attr("aria-valuenow",e)}});a.extend(a.ui.progressbar,{version:"1.8.23"})})(jQuery);
/*
 * jQuery UI Effects 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/
 */
jQuery.effects||(function(j,f){j.effects={};j.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(q,p){j.fx.step[p]=function(r){if(!r.colorInit){r.start=o(r.elem,p);r.end=m(r.end);r.colorInit=true}r.elem.style[p]="rgb("+Math.max(Math.min(parseInt((r.pos*(r.end[0]-r.start[0]))+r.start[0],10),255),0)+","+Math.max(Math.min(parseInt((r.pos*(r.end[1]-r.start[1]))+r.start[1],10),255),0)+","+Math.max(Math.min(parseInt((r.pos*(r.end[2]-r.start[2]))+r.start[2],10),255),0)+")"}});function m(q){var p;if(q&&q.constructor==Array&&q.length==3){return q}if(p=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(q)){return[parseInt(p[1],10),parseInt(p[2],10),parseInt(p[3],10)]}if(p=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(q)){return[parseFloat(p[1])*2.55,parseFloat(p[2])*2.55,parseFloat(p[3])*2.55]}if(p=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(q)){return[parseInt(p[1],16),parseInt(p[2],16),parseInt(p[3],16)]}if(p=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(q)){return[parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16),parseInt(p[3]+p[3],16)]}if(p=/rgba\(0, 0, 0, 0\)/.exec(q)){return a.transparent}return a[j.trim(q).toLowerCase()]}function o(r,p){var q;do{q=(j.curCSS||j.css)(r,p);if(q!=""&&q!="transparent"||j.nodeName(r,"body")){break}p="backgroundColor"}while(r=r.parentNode);return m(q)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var g=["add","remove","toggle"],d={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function h(){var s=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,t={},q,r;if(s&&s.length&&s[0]&&s[s[0]]){var p=s.length;while(p--){q=s[p];if(typeof s[q]=="string"){r=q.replace(/\-(\w)/g,function(u,v){return v.toUpperCase()});t[r]=s[q]}}}else{for(q in s){if(typeof s[q]==="string"){t[q]=s[q]}}}return t}function b(q){var p,r;for(p in q){r=q[p];if(r==null||j.isFunction(r)||p in d||(/scrollbar/).test(p)||(!(/color/i).test(p)&&isNaN(parseFloat(r)))){delete q[p]}}return q}function k(p,r){var s={_:0},q;for(q in r){if(p[q]!=r[q]){s[q]=r[q]}}return s}j.effects.animateClass=function(p,q,s,r){if(j.isFunction(s)){r=s;s=null}return this.queue(function(){var w=j(this),t=w.attr("style")||" ",x=b(h.call(this)),v,u=w.attr("class")||"";j.each(g,function(y,z){if(p[z]){w[z+"Class"](p[z])}});v=b(h.call(this));w.attr("class",u);w.animate(k(x,v),{queue:false,duration:q,easing:s,complete:function(){j.each(g,function(y,z){if(p[z]){w[z+"Class"](p[z])}});if(typeof w.attr("style")=="object"){w.attr("style").cssText="";w.attr("style").cssText=t}else{w.attr("style",t)}if(r){r.apply(this,arguments)}j.dequeue(this)}})})};j.fn.extend({_addClass:j.fn.addClass,addClass:function(q,p,s,r){return p?j.effects.animateClass.apply(this,[{add:q},p,s,r]):this._addClass(q)},_removeClass:j.fn.removeClass,removeClass:function(q,p,s,r){return p?j.effects.animateClass.apply(this,[{remove:q},p,s,r]):this._removeClass(q)},_toggleClass:j.fn.toggleClass,toggleClass:function(r,q,p,t,s){if(typeof q=="boolean"||q===f){if(!p){return this._toggleClass(r,q)}else{return j.effects.animateClass.apply(this,[(q?{add:r}:{remove:r}),p,t,s])}}else{return j.effects.animateClass.apply(this,[{toggle:r},q,p,t])}},switchClass:function(p,r,q,t,s){return j.effects.animateClass.apply(this,[{add:r,remove:p},q,t,s])}});j.extend(j.effects,{version:"1.8.23",save:function(q,r){for(var p=0;p<r.length;p++){if(r[p]!==null){q.data("ec.storage."+r[p],q[0].style[r[p]])}}},restore:function(q,r){for(var p=0;p<r.length;p++){if(r[p]!==null){q.css(r[p],q.data("ec.storage."+r[p]))}}},setMode:function(p,q){if(q=="toggle"){q=p.is(":hidden")?"show":"hide"}return q},getBaseline:function(q,r){var s,p;switch(q[0]){case"top":s=0;break;case"middle":s=0.5;break;case"bottom":s=1;break;default:s=q[0]/r.height}switch(q[1]){case"left":p=0;break;case"center":p=0.5;break;case"right":p=1;break;default:p=q[1]/r.width}return{x:p,y:s}},createWrapper:function(p){if(p.parent().is(".ui-effects-wrapper")){return p.parent()}var q={width:p.outerWidth(true),height:p.outerHeight(true),"float":p.css("float")},t=j("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),s=document.activeElement;try{s.id}catch(r){s=document.body}p.wrap(t);if(p[0]===s||j.contains(p[0],s)){j(s).focus()}t=p.parent();if(p.css("position")=="static"){t.css({position:"relative"});p.css({position:"relative"})}else{j.extend(q,{position:p.css("position"),zIndex:p.css("z-index")});j.each(["top","left","bottom","right"],function(u,v){q[v]=p.css(v);if(isNaN(parseInt(q[v],10))){q[v]="auto"}});p.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return t.css(q).show()},removeWrapper:function(p){var q,r=document.activeElement;if(p.parent().is(".ui-effects-wrapper")){q=p.parent().replaceWith(p);if(p[0]===r||j.contains(p[0],r)){j(r).focus()}return q}return p},setTransition:function(q,s,p,r){r=r||{};j.each(s,function(u,t){var v=q.cssUnit(t);if(v[0]>0){r[t]=v[0]*p+v[1]}});return r}});function e(q,p,r,s){if(typeof q=="object"){s=p;r=null;p=q;q=p.effect}if(j.isFunction(p)){s=p;r=null;p={}}if(typeof p=="number"||j.fx.speeds[p]){s=r;r=p;p={}}if(j.isFunction(r)){s=r;r=null}p=p||{};r=r||p.duration;r=j.fx.off?0:typeof r=="number"?r:r in j.fx.speeds?j.fx.speeds[r]:j.fx.speeds._default;s=s||p.complete;return[q,p,r,s]}function n(p){if(!p||typeof p==="number"||j.fx.speeds[p]){return true}if(typeof p==="string"&&!j.effects[p]){return true}return false}j.fn.extend({effect:function(s,r,u,w){var q=e.apply(this,arguments),t={options:q[1],duration:q[2],callback:q[3]},v=t.options.mode,p=j.effects[s];if(j.fx.off||!p){if(v){return this[v](t.duration,t.callback)}else{return this.each(function(){if(t.callback){t.callback.call(this)}})}}return p.call(this,t)},_show:j.fn.show,show:function(q){if(n(q)){return this._show.apply(this,arguments)}else{var p=e.apply(this,arguments);p[1].mode="show";return this.effect.apply(this,p)}},_hide:j.fn.hide,hide:function(q){if(n(q)){return this._hide.apply(this,arguments)}else{var p=e.apply(this,arguments);p[1].mode="hide";return this.effect.apply(this,p)}},__toggle:j.fn.toggle,toggle:function(q){if(n(q)||typeof q==="boolean"||j.isFunction(q)){return this.__toggle.apply(this,arguments)}else{var p=e.apply(this,arguments);p[1].mode="toggle";return this.effect.apply(this,p)}},cssUnit:function(p){var q=this.css(p),r=[];j.each(["em","px","%","pt"],function(s,t){if(q.indexOf(t)>0){r=[parseFloat(q),t]}});return r}});var l={};j.each(["Quad","Cubic","Quart","Quint","Expo"],function(q,p){l[p]=function(r){return Math.pow(r,q+2)}});j.extend(l,{Sine:function(q){return 1-Math.cos(q*Math.PI/2)},Circ:function(q){return 1-Math.sqrt(1-q*q)},Elastic:function(q){return q===0||q===1?q:-Math.pow(2,8*(q-1))*Math.sin(((q-1)*80-7.5)*Math.PI/15)},Back:function(q){return q*q*(3*q-2)},Bounce:function(s){var q,r=4;while(s<((q=Math.pow(2,--r))-1)/11){}return 1/Math.pow(4,3-r)-7.5625*Math.pow((q*3-2)/22-s,2)}});j.each(l,function(q,p){j.easing["easeIn"+q]=p;j.easing["easeOut"+q]=function(r){return 1-p(1-r)};j.easing["easeInOut"+q]=function(r){return r<0.5?p(r*2)/2:p(r*-2+2)/-2+1}})})(jQuery);
/*
 * jQuery UI Effects Blind 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Blind
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.blind=function(d){return this.queue(function(){var f=a(this),e=["position","top","bottom","left","right"];var k=a.effects.setMode(f,d.options.mode||"hide");var j=d.options.direction||"vertical";a.effects.save(f,e);f.show();var m=a.effects.createWrapper(f).css({overflow:"hidden"});var g=(j=="vertical")?"height":"width";var l=(j=="vertical")?m.height():m.width();if(k=="show"){m.css(g,0)}var h={};h[g]=k=="show"?l:0;m.animate(h,d.duration,d.options.easing,function(){if(k=="hide"){f.hide()}a.effects.restore(f,e);a.effects.removeWrapper(f);if(d.callback){d.callback.apply(f[0],arguments)}f.dequeue()})})}})(jQuery);
/*
 * jQuery UI Effects Bounce 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Bounce
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.bounce=function(d){return this.queue(function(){var g=a(this),n=["position","top","bottom","left","right"];var m=a.effects.setMode(g,d.options.mode||"effect");var p=d.options.direction||"up";var e=d.options.distance||20;var f=d.options.times||5;var j=d.duration||250;if(/show|hide/.test(m)){n.push("opacity")}a.effects.save(g,n);g.show();a.effects.createWrapper(g);var h=(p=="up"||p=="down")?"top":"left";var r=(p=="up"||p=="left")?"pos":"neg";var e=d.options.distance||(h=="top"?g.outerHeight(true)/3:g.outerWidth(true)/3);if(m=="show"){g.css("opacity",0).css(h,r=="pos"?-e:e)}if(m=="hide"){e=e/(f*2)}if(m!="hide"){f--}if(m=="show"){var k={opacity:1};k[h]=(r=="pos"?"+=":"-=")+e;g.animate(k,j/2,d.options.easing);e=e/2;f--}for(var l=0;l<f;l++){var q={},o={};q[h]=(r=="pos"?"-=":"+=")+e;o[h]=(r=="pos"?"+=":"-=")+e;g.animate(q,j/2,d.options.easing).animate(o,j/2,d.options.easing);e=(m=="hide")?e*2:e/2}if(m=="hide"){var k={opacity:0};k[h]=(r=="pos"?"-=":"+=")+e;g.animate(k,j/2,d.options.easing,function(){g.hide();a.effects.restore(g,n);a.effects.removeWrapper(g);if(d.callback){d.callback.apply(this,arguments)}})}else{var q={},o={};q[h]=(r=="pos"?"-=":"+=")+e;o[h]=(r=="pos"?"+=":"-=")+e;g.animate(q,j/2,d.options.easing).animate(o,j/2,d.options.easing,function(){a.effects.restore(g,n);a.effects.removeWrapper(g);if(d.callback){d.callback.apply(this,arguments)}})}g.queue("fx",function(){g.dequeue()});g.dequeue()})}})(jQuery);
/*
 * jQuery UI Effects Clip 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Clip
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.clip=function(d){return this.queue(function(){var h=a(this),m=["position","top","bottom","left","right","height","width"];var l=a.effects.setMode(h,d.options.mode||"hide");var n=d.options.direction||"vertical";a.effects.save(h,m);h.show();var e=a.effects.createWrapper(h).css({overflow:"hidden"});var g=h[0].tagName=="IMG"?e:h;var j={size:(n=="vertical")?"height":"width",position:(n=="vertical")?"top":"left"};var f=(n=="vertical")?g.height():g.width();if(l=="show"){g.css(j.size,0);g.css(j.position,f/2)}var k={};k[j.size]=l=="show"?f:0;k[j.position]=l=="show"?0:f/2;g.animate(k,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){if(l=="hide"){h.hide()}a.effects.restore(h,m);a.effects.removeWrapper(h);if(d.callback){d.callback.apply(h[0],arguments)}h.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Drop 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Drop
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.drop=function(d){return this.queue(function(){var g=a(this),f=["position","top","bottom","left","right","opacity"];var l=a.effects.setMode(g,d.options.mode||"hide");var k=d.options.direction||"left";a.effects.save(g,f);g.show();a.effects.createWrapper(g);var h=(k=="up"||k=="down")?"top":"left";var e=(k=="up"||k=="left")?"pos":"neg";var m=d.options.distance||(h=="top"?g.outerHeight(true)/2:g.outerWidth(true)/2);if(l=="show"){g.css("opacity",0).css(h,e=="pos"?-m:m)}var j={opacity:l=="show"?1:0};j[h]=(l=="show"?(e=="pos"?"+=":"-="):(e=="pos"?"-=":"+="))+m;g.animate(j,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){if(l=="hide"){g.hide()}a.effects.restore(g,f);a.effects.removeWrapper(g);if(d.callback){d.callback.apply(this,arguments)}g.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Explode 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Explode
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.explode=function(d){return this.queue(function(){var m=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3;var g=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3;d.options.mode=d.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):d.options.mode;var l=a(this).show().css("visibility","hidden");var n=l.offset();n.top-=parseInt(l.css("marginTop"),10)||0;n.left-=parseInt(l.css("marginLeft"),10)||0;var k=l.outerWidth(true);var e=l.outerHeight(true);for(var h=0;h<m;h++){for(var f=0;f<g;f++){l.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(k/g),top:-h*(e/m)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:k/g,height:e/m,left:n.left+f*(k/g)+(d.options.mode=="show"?(f-Math.floor(g/2))*(k/g):0),top:n.top+h*(e/m)+(d.options.mode=="show"?(h-Math.floor(m/2))*(e/m):0),opacity:d.options.mode=="show"?0:1}).animate({left:n.left+f*(k/g)+(d.options.mode=="show"?0:(f-Math.floor(g/2))*(k/g)),top:n.top+h*(e/m)+(d.options.mode=="show"?0:(h-Math.floor(m/2))*(e/m)),opacity:d.options.mode=="show"?1:0},d.duration||500)}}setTimeout(function(){d.options.mode=="show"?l.css({visibility:"visible"}):l.css({visibility:"visible"}).hide();if(d.callback){d.callback.apply(l[0])}l.dequeue();a("div.ui-effects-explode").remove()},d.duration||500)})}})(jQuery);
/*
 * jQuery UI Effects Fade 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Fade
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.fade=function(d){return this.queue(function(){var e=a(this),f=a.effects.setMode(e,d.options.mode||"hide");e.animate({opacity:f},{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){(d.callback&&d.callback.apply(this,arguments));e.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Fold 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Fold
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.fold=function(d){return this.queue(function(){var g=a(this),n=["position","top","bottom","left","right"];var k=a.effects.setMode(g,d.options.mode||"hide");var r=d.options.size||15;var q=!(!d.options.horizFirst);var j=d.duration?d.duration/2:a.fx.speeds._default/2;a.effects.save(g,n);g.show();var f=a.effects.createWrapper(g).css({overflow:"hidden"});var l=((k=="show")!=q);var h=l?["width","height"]:["height","width"];var e=l?[f.width(),f.height()]:[f.height(),f.width()];var m=/([0-9]+)%/.exec(r);if(m){r=parseInt(m[1],10)/100*e[k=="hide"?0:1]}if(k=="show"){f.css(q?{height:0,width:r}:{height:r,width:0})}var p={},o={};p[h[0]]=k=="show"?e[0]:r;o[h[1]]=k=="show"?e[1]:0;f.animate(p,j,d.options.easing).animate(o,j,d.options.easing,function(){if(k=="hide"){g.hide()}a.effects.restore(g,n);a.effects.removeWrapper(g);if(d.callback){d.callback.apply(g[0],arguments)}g.dequeue()})})}})(jQuery);
/*
 * jQuery UI Effects Highlight 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Highlight
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.highlight=function(d){return this.queue(function(){var f=a(this),e=["backgroundImage","backgroundColor","opacity"],h=a.effects.setMode(f,d.options.mode||"show"),g={backgroundColor:f.css("backgroundColor")};if(h=="hide"){g.opacity=0}a.effects.save(f,e);f.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(g,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){(h=="hide"&&f.hide());a.effects.restore(f,e);(h=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"));(d.callback&&d.callback.apply(this,arguments));f.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Pulsate 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Pulsate
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.pulsate=function(d){return this.queue(function(){var h=a(this),l=a.effects.setMode(h,d.options.mode||"show"),k=((d.options.times||5)*2)-1,j=d.duration?d.duration/2:a.fx.speeds._default/2,e=h.is(":visible"),f=0;if(!e){h.css("opacity",0).show();f=1}if((l=="hide"&&e)||(l=="show"&&!e)){k--}for(var g=0;g<k;g++){h.animate({opacity:f},j,d.options.easing);f=(f+1)%2}h.animate({opacity:f},j,d.options.easing,function(){if(f==0){h.hide()}(d.callback&&d.callback.apply(this,arguments))});h.queue("fx",function(){h.dequeue()}).dequeue()})}})(jQuery);
/*
 * jQuery UI Effects Scale 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Scale
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.puff=function(d){return this.queue(function(){var h=a(this),j=a.effects.setMode(h,d.options.mode||"hide"),g=parseInt(d.options.percent,10)||150,f=g/100,e={height:h.height(),width:h.width()};a.extend(d.options,{fade:true,mode:j,percent:j=="hide"?g:100,from:j=="hide"?e:{height:e.height*f,width:e.width*f}});h.effect("scale",d.options,d.duration,d.callback);h.dequeue()})};a.effects.scale=function(d){return this.queue(function(){var j=a(this);var f=a.extend(true,{},d.options);var m=a.effects.setMode(j,d.options.mode||"effect");var k=parseInt(d.options.percent,10)||(parseInt(d.options.percent,10)==0?0:(m=="hide"?0:100));var l=d.options.direction||"both";var e=d.options.origin;if(m!="effect"){f.origin=e||["middle","center"];f.restore=true}var h={height:j.height(),width:j.width()};j.from=d.options.from||(m=="show"?{height:0,width:0}:h);var g={y:l!="horizontal"?(k/100):1,x:l!="vertical"?(k/100):1};j.to={height:h.height*g.y,width:h.width*g.x};if(d.options.fade){if(m=="show"){j.from.opacity=0;j.to.opacity=1}if(m=="hide"){j.from.opacity=1;j.to.opacity=0}}f.from=j.from;f.to=j.to;f.mode=m;j.effect("size",f,d.duration,d.callback);j.dequeue()})};a.effects.size=function(d){return this.queue(function(){var e=a(this),q=["position","top","bottom","left","right","width","height","overflow","opacity"];var p=["position","top","bottom","left","right","overflow","opacity"];var m=["width","height","overflow"];var s=["fontSize"];var n=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var j=a.effects.setMode(e,d.options.mode||"effect");var l=d.options.restore||false;var g=d.options.scale||"both";var r=d.options.origin;var f={height:e.height(),width:e.width()};e.from=d.options.from||f;e.to=d.options.to||f;if(r){var k=a.effects.getBaseline(r,f);e.from.top=(f.height-e.from.height)*k.y;e.from.left=(f.width-e.from.width)*k.x;e.to.top=(f.height-e.to.height)*k.y;e.to.left=(f.width-e.to.width)*k.x}var o={from:{y:e.from.height/f.height,x:e.from.width/f.width},to:{y:e.to.height/f.height,x:e.to.width/f.width}};if(g=="box"||g=="both"){if(o.from.y!=o.to.y){q=q.concat(n);e.from=a.effects.setTransition(e,n,o.from.y,e.from);e.to=a.effects.setTransition(e,n,o.to.y,e.to)}if(o.from.x!=o.to.x){q=q.concat(h);e.from=a.effects.setTransition(e,h,o.from.x,e.from);e.to=a.effects.setTransition(e,h,o.to.x,e.to)}}if(g=="content"||g=="both"){if(o.from.y!=o.to.y){q=q.concat(s);e.from=a.effects.setTransition(e,s,o.from.y,e.from);e.to=a.effects.setTransition(e,s,o.to.y,e.to)}}a.effects.save(e,l?q:p);e.show();a.effects.createWrapper(e);e.css("overflow","hidden").css(e.from);if(g=="content"||g=="both"){n=n.concat(["marginTop","marginBottom"]).concat(s);h=h.concat(["marginLeft","marginRight"]);m=q.concat(n).concat(h);e.find("*[width]").each(function(){var u=a(this);if(l){a.effects.save(u,m)}var t={height:u.height(),width:u.width()};u.from={height:t.height*o.from.y,width:t.width*o.from.x};u.to={height:t.height*o.to.y,width:t.width*o.to.x};if(o.from.y!=o.to.y){u.from=a.effects.setTransition(u,n,o.from.y,u.from);u.to=a.effects.setTransition(u,n,o.to.y,u.to)}if(o.from.x!=o.to.x){u.from=a.effects.setTransition(u,h,o.from.x,u.from);u.to=a.effects.setTransition(u,h,o.to.x,u.to)}u.css(u.from);u.animate(u.to,d.duration,d.options.easing,function(){if(l){a.effects.restore(u,m)}})})}e.animate(e.to,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){if(e.to.opacity===0){e.css("opacity",e.from.opacity)}if(j=="hide"){e.hide()}a.effects.restore(e,l?q:p);a.effects.removeWrapper(e);if(d.callback){d.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Shake 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Shake
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.shake=function(d){return this.queue(function(){var g=a(this),n=["position","top","bottom","left","right"];var m=a.effects.setMode(g,d.options.mode||"effect");var p=d.options.direction||"left";var e=d.options.distance||20;var f=d.options.times||3;var j=d.duration||d.options.duration||140;a.effects.save(g,n);g.show();a.effects.createWrapper(g);var h=(p=="up"||p=="down")?"top":"left";var r=(p=="up"||p=="left")?"pos":"neg";var k={},q={},o={};k[h]=(r=="pos"?"-=":"+=")+e;q[h]=(r=="pos"?"+=":"-=")+e*2;o[h]=(r=="pos"?"-=":"+=")+e*2;g.animate(k,j,d.options.easing);for(var l=1;l<f;l++){g.animate(q,j,d.options.easing).animate(o,j,d.options.easing)}g.animate(q,j,d.options.easing).animate(k,j/2,d.options.easing,function(){a.effects.restore(g,n);a.effects.removeWrapper(g);if(d.callback){d.callback.apply(this,arguments)}});g.queue("fx",function(){g.dequeue()});g.dequeue()})}})(jQuery);
/*
 * jQuery UI Effects Slide 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Slide
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.slide=function(d){return this.queue(function(){var g=a(this),f=["position","top","bottom","left","right"];var l=a.effects.setMode(g,d.options.mode||"show");var k=d.options.direction||"left";a.effects.save(g,f);g.show();a.effects.createWrapper(g).css({overflow:"hidden"});var h=(k=="up"||k=="down")?"top":"left";var e=(k=="up"||k=="left")?"pos":"neg";var m=d.options.distance||(h=="top"?g.outerHeight(true):g.outerWidth(true));if(l=="show"){g.css(h,e=="pos"?(isNaN(m)?"-"+m:-m):m)}var j={};j[h]=(l=="show"?(e=="pos"?"+=":"-="):(e=="pos"?"-=":"+="))+m;g.animate(j,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){if(l=="hide"){g.hide()}a.effects.restore(g,f);a.effects.removeWrapper(g);if(d.callback){d.callback.apply(this,arguments)}g.dequeue()}})})}})(jQuery);
/*
 * jQuery UI Effects Transfer 1.8.23
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Transfer
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a,b){a.effects.transfer=function(d){return this.queue(function(){var h=a(this),k=a(d.options.to),g=k.offset(),j={top:g.top,left:g.left,height:k.innerHeight(),width:k.innerWidth()},f=h.offset(),e=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(d.options.className).css({top:f.top,left:f.left,height:h.innerHeight(),width:h.innerWidth(),position:"absolute"}).animate(j,d.duration,d.options.easing,function(){e.remove();(d.callback&&d.callback.apply(h[0],arguments));h.dequeue()})})}})(jQuery);(function(a){a.fn.multiDatesPicker=function(b){var l=arguments;var m=this;var j=new Date();var e=new Date(0);var k={};function d(o){return o=="avoided"?"avoidedDates":"selectedDates"}function g(o,p){this.multiDatesPicker[d(p)].splice(o,1)}function f(o,p){if(h.gotDate.call(this,o,p)===false){var q=d(p);this.multiDatesPicker[q].push(n(o,"object"));this.multiDatesPicker[q].sort(h.compareDates)}}function n(o,p){return h.dateConvert(o,p)}var h={init:function(o){$this=a(this);this.multiDatesPicker.changed=false;if(o){this.multiDatesPicker.originalBeforeShow=o.beforeShow;this.multiDatesPicker.originalOnSelect=o.onSelect;this.multiDatesPicker.originalBeforeShowDay=o.beforeShowDay;this.multiDatesPicker.originalOnClose=o.onClose;this.multiDatesPicker.minDate=a.datepicker._determineDate(this,o.minDate,e);this.multiDatesPicker.firstAvailableDay=h.compareDates(this.multiDatesPicker.minDate,e);if(o.addDates){h.addDates.call(this,o.addDates)}if(o.addAvoidedDates){h.addDates.call(this,o.addAvoidedDates,"avoided")}if(o.mode){h.setMode.call(this,o.mode)}}$this.datepicker(o);k={beforeShow:function(p,q){this.multiDatesPicker.changed=false;if(this.multiDatesPicker.originalBeforeShow){this.multiDatesPicker.originalBeforeShow.call(this,p,q)}},onSelect:function(x,u){this.multiDatesPicker.changed=true;if(x){a(this).multiDatesPicker("toggleDate",x);var r=h.dateConvert(x,"object")}var w=a(this).multiDatesPicker("getDates");var v=this.multiDatesPicker.mode.options;if(w.length>0){if(this.multiDatesPicker.mode.modeName=="normal"){if(v.pickableRange){var p=h.compareDates(this.multiDatesPicker.minDate,j);var z=p+v.pickableRangeDelay+pickableRange;var t=h.compareDates(w[0],p);var q=t+v.pickableRange;if(q>z){p=z-v.pickableRange+1}else{z=q;p=t}var y;do{y=0;for(var s in this.multiDatesPicker.avoidedDates){if(h.compareDates(this.multiDatesPicker.avoidedDates[s],p)>=0&&h.compareDates(this.multiDatesPicker.avoidedDates[s],z)<=0){y++}}z=z+y}while(y!=0);a(this).datepicker("option","minDate",p);a(this).datepicker("option","maxDate",z)}}}if(this.tagName=="INPUT"){a(this).val(a(this).multiDatesPicker("getDates","string"))}if(this.multiDatesPicker.originalOnSelect&&x){this.multiDatesPicker.originalOnSelect.call(this,x,u)}},beforeShowDay:function(q){var s=a(this).multiDatesPicker("gotDate",q)!==false;var u=s?"ui-state-highlight":"";var r=a(this).multiDatesPicker("gotDate",q,"avoided")!==false;var p=this.multiDatesPicker.mode.options.maxPicks==a(this).multiDatesPicker("getDates").length;var t=(r||(p&&!u))?false:true;if(this.multiDatesPicker.originalBeforeShowDay){this.multiDatesPicker.originalBeforeShowDay.call(this,q)}return[t,u]},onClose:function(q,p){if(this.tagName=="INPUT"&&this.multiDatesPicker.changed){a(p.dpDiv[0]).stop(false,true);setTimeout('$("#'+p.id+'").datepicker("show")',50)}if(this.multiDatesPicker.originalOnClose){this.multiDatesPicker.originalOnClose.call(this,q,p)}}};$this.datepicker("option",k)},compareDates:function(s,q){var p=[s,q];var t=new Array();var o=1000*60*60*24;for(i in p){t.push(n(p[i],"object"))}var r=(t[0].getTime()-t[1].getTime())/o;return(-1<r&&r<1)?0:(r<0)?Math.ceil(r*-1)*-1:Math.ceil(r)},sumDays:function(o,q){var p=typeof o;obj_date=n(o,"object");obj_date.setDate(obj_date.getDate()+q);return n(obj_date,p)},dateConvert:function(p,o){if(typeof p=="undefined"){p=new Date(0)}if(o!="string"&&o!="object"){a.error('Date format "'+o+'" not supported on jQuery.multiDatesPicker')}if(typeof p==o){return p}var q=typeof p+"->"+o;switch(q){case"object->string":return a.datepicker.formatDate(a.datepicker._defaults.dateFormat,p);case"string->object":return a.datepicker.parseDate(a.datepicker._defaults.dateFormat,p);default:a.error('Conversion "'+q+'" not allowed on jQuery.multiDatesPicker')}},gotDate:function(o,q){for(var p=0;p<this.multiDatesPicker[d(q)].length;p++){if(h.compareDates(this.multiDatesPicker[d(q)][p],o)==0){return p}}return false},getDates:function(p,o){switch(p){case"object":return this.multiDatesPicker[d(o)];default:var q=new Array();for(i in this.multiDatesPicker[d(o)]){q.push(n(this.multiDatesPicker[d(o)][i],"string"))}return q}},addDates:function(p,o){switch(typeof p){case"object":case"array":if(p.length){for(i in p){f.call(this,p[i],o)}break}case"string":f.call(this,p,o);break;default:a.error('Date format "'+typeof p+'" not allowed on jQuery.multiDatesPicker')}a(this).datepicker("refresh")},removeDates:function(o,p){if(typeof index=="array"){for(i in o){g.call(this,i,p)}}else{g.call(this,o,p)}a(this).datepicker("refresh")},resetDates:function(o){this.multiDatesPicker[d(o)]=[];a(this).datepicker("refresh")},toggleDate:function(q,t){var p=h.gotDate.call(this,q);var u=this.multiDatesPicker.mode;switch(u.modeName){case"daysRange":this.multiDatesPicker.selectedDates=[];var o=u.options.autoselectRange[1];var s=u.options.autoselectRange[0];if(o<s){o=u.options.autoselectRange[0];s=u.options.autoselectRange[1]}for(var r=s;r<o;r++){h.addDates.call(this,h.sumDays(q,r))}break;default:if(p===false){h.addDates.call(this,q)}else{h.removeDates.call(this,p)}break}},setMode:function(p){this.multiDatesPicker.mode.modeName=p.modeName;switch(p.modeName){case"normal":for(option in p.options){switch(option){case"maxPicks":case"minPicks":case"pickableRange":case"pickableRangeDelay":case"adjustRangeToAvoided":this.multiDatesPicker.mode.options[option]=p.options[option];break;default:a.error("Option "+option+" does not exist for setMode on jQuery.multiDatesPicker")}}break;case"daysRange":case"weeksRange":var o=1;for(option in p.options){switch(option){case"autoselectRange":o--;case"pickableRange":case"pickableRangeDelay":case"adjustRangeToAvoided":this.multiDatesPicker.mode.options[option]=p.options[option];break;default:a.error("Option "+option+" does not exist for setMode on jQuery.multiDatesPicker")}}if(o>0){a.error("Some mandatory options not specified!")}break}if(p.options.pickableRange){a(this).datepicker("option","maxDate",p.options.pickableRange+(p.options.pickableRangeDelay||0));a(this).datepicker("option","minDate",this.multiDatesPicker.minDate)}if(k.onSelect){k.onSelect()}a(this).datepicker("refresh")}};this.each(function(){if(!this.multiDatesPicker){this.multiDatesPicker={selectedDates:[],avoidedDates:[],mode:{modeName:"normal",options:{adjustRangeToAvoided:true}}}}if(h[b]){var o=h[b].apply(this,Array.prototype.slice.call(l,1));switch(b){case"getDates":case"gotDate":case"sumDays":case"compareDates":case"dateConvert":m=o}return o}else{if(typeof b==="object"||!b){return h.init.apply(this,l)}else{a.error("Method "+b+" does not exist on jQuery.multiDatesPicker")}}});return m}})(jQuery);(function($){$.ui.timepicker=$.ui.timepicker||{};if($.ui.timepicker.version){return}$.extend($.ui,{timepicker:{version:"1.0.1"}});function Timepicker(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",ampm:false,amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"hh:mm tt",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",timezoneText:"Time Zone"};this._defaults={showButtonPanel:true,timeOnly:false,showHour:true,showMinute:true,showSecond:false,showMillisec:false,showTimezone:false,showTime:true,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,hour:0,minute:0,second:0,millisec:0,timezone:null,useLocalTimezone:false,defaultTimezone:"+0000",hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,minDateTime:null,maxDateTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,alwaysSetTime:true,separator:" ",altFieldTimeOnly:true,showTimepicker:true,timezoneIso8601:false,timezoneList:null,addSliderAccess:false,sliderAccessArgs:null};$.extend(this._defaults,this.regional[""])}$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,timezone_select:null,hour:0,minute:0,second:0,millisec:0,timezone:null,defaultTimezone:"+0000",hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_newInst:function($input,o){var tp_inst=new Timepicker(),inlineSettings={};for(var attrName in this._defaults){var attrValue=$input.attr("time:"+attrName);if(attrValue){try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}tp_inst._defaults=$.extend({},this._defaults,inlineSettings,o,{beforeShow:function(input,dp_inst){if($.isFunction(o.beforeShow)){return o.beforeShow(input,dp_inst,tp_inst)}},onChangeMonthYear:function(year,month,dp_inst){tp_inst._updateDateTime(dp_inst);if($.isFunction(o.onChangeMonthYear)){o.onChangeMonthYear.call($input[0],year,month,dp_inst,tp_inst)}},onClose:function(dateText,dp_inst){if(tp_inst.timeDefined===true&&$input.val()!==""){tp_inst._updateDateTime(dp_inst)}if($.isFunction(o.onClose)){o.onClose.call($input[0],dateText,dp_inst,tp_inst)}},timepicker:tp_inst});tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(val){return val.toUpperCase()});tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(val){return val.toUpperCase()});if(tp_inst._defaults.timezoneList===null){var timezoneList=[];for(var i=-11;i<=12;i++){timezoneList.push((i>=0?"+":"-")+("0"+Math.abs(i).toString()).slice(-2)+"00")}if(tp_inst._defaults.timezoneIso8601){timezoneList=$.map(timezoneList,function(val){return val=="+0000"?"Z":(val.substring(0,3)+":"+val.substring(3))})}tp_inst._defaults.timezoneList=timezoneList}tp_inst.timezone=tp_inst._defaults.timezone;tp_inst.hour=tp_inst._defaults.hour;tp_inst.minute=tp_inst._defaults.minute;tp_inst.second=tp_inst._defaults.second;tp_inst.millisec=tp_inst._defaults.millisec;tp_inst.ampm="";tp_inst.$input=$input;if(o.altField){tp_inst.$altInput=$(o.altField).css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})}if(tp_inst._defaults.minDate===0||tp_inst._defaults.minDateTime===0){tp_inst._defaults.minDate=new Date()}if(tp_inst._defaults.maxDate===0||tp_inst._defaults.maxDateTime===0){tp_inst._defaults.maxDate=new Date()}if(tp_inst._defaults.minDate!==undefined&&tp_inst._defaults.minDate instanceof Date){tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())}if(tp_inst._defaults.minDateTime!==undefined&&tp_inst._defaults.minDateTime instanceof Date){tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())}if(tp_inst._defaults.maxDate!==undefined&&tp_inst._defaults.maxDate instanceof Date){tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())}if(tp_inst._defaults.maxDateTime!==undefined&&tp_inst._defaults.maxDateTime instanceof Date){tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())}return tp_inst},_addTimePicker:function(dp_inst){var currDT=(this.$altInput&&this._defaults.altFieldTimeOnly)?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(currDT);this._limitMinMaxDateTime(dp_inst,false);this._injectTimePicker()},_parseTime:function(timeString,withDate){if(!this.inst){this.inst=$.datepicker._getInst(this.$input[0])}if(withDate||!this._defaults.timeOnly){var dp_dateFormat=$.datepicker._get(this.inst,"dateFormat");try{var parseRes=parseDateTimeInternal(dp_dateFormat,this._defaults.timeFormat,timeString,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!parseRes.timeObj){return false}$.extend(this,parseRes.timeObj)}catch(err){return false}return true}else{var timeObj=$.datepicker.parseTime(this._defaults.timeFormat,timeString,this._defaults);if(!timeObj){return false}$.extend(this,timeObj);return true}},_injectTimePicker:function(){var $dp=this.inst.dpDiv,o=this._defaults,tp_inst=this,hourMax=parseInt((o.hourMax-((o.hourMax-o.hourMin)%o.stepHour)),10),minMax=parseInt((o.minuteMax-((o.minuteMax-o.minuteMin)%o.stepMinute)),10),secMax=parseInt((o.secondMax-((o.secondMax-o.secondMin)%o.stepSecond)),10),millisecMax=parseInt((o.millisecMax-((o.millisecMax-o.millisecMin)%o.stepMillisec)),10),dp_id=this.inst.id.toString().replace(/([^A-Za-z0-9_])/g,"");if($dp.find("div#ui-timepicker-div-"+dp_id).length===0&&o.showTimepicker){var noDisplay=' style="display:none;"',html='<div class="ui-timepicker-div" id="ui-timepicker-div-'+dp_id+'"><dl><dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_'+dp_id+'"'+((o.showTime)?"":noDisplay)+">"+o.timeText+'</dt><dd class="ui_tpicker_time" id="ui_tpicker_time_'+dp_id+'"'+((o.showTime)?"":noDisplay)+'></dd><dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_'+dp_id+'"'+((o.showHour)?"":noDisplay)+">"+o.hourText+"</dt>",hourGridSize=0,minuteGridSize=0,secondGridSize=0,millisecGridSize=0,size=null;html+='<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_'+dp_id+'"'+((o.showHour)?"":noDisplay)+"></div>";if(o.showHour&&o.hourGrid>0){html+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';for(var h=o.hourMin;h<=hourMax;h+=parseInt(o.hourGrid,10)){hourGridSize++;var tmph=(o.ampm&&h>12)?h-12:h;if(tmph<10){tmph="0"+tmph}if(o.ampm){if(h===0){tmph=12+"a"}else{if(h<12){tmph+="a"}else{tmph+="p"}}}html+="<td>"+tmph+"</td>"}html+="</tr></table></div>"}html+="</dd>";html+='<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_'+dp_id+'"'+((o.showMinute)?"":noDisplay)+">"+o.minuteText+'</dt><dd class="ui_tpicker_minute"><div id="ui_tpicker_minute_'+dp_id+'"'+((o.showMinute)?"":noDisplay)+"></div>";if(o.showMinute&&o.minuteGrid>0){html+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';for(var m=o.minuteMin;m<=minMax;m+=parseInt(o.minuteGrid,10)){minuteGridSize++;html+="<td>"+((m<10)?"0":"")+m+"</td>"}html+="</tr></table></div>"}html+="</dd>";html+='<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_'+dp_id+'"'+((o.showSecond)?"":noDisplay)+">"+o.secondText+'</dt><dd class="ui_tpicker_second"><div id="ui_tpicker_second_'+dp_id+'"'+((o.showSecond)?"":noDisplay)+"></div>";if(o.showSecond&&o.secondGrid>0){html+='<div style="padding-left: 1px"><table><tr>';for(var s=o.secondMin;s<=secMax;s+=parseInt(o.secondGrid,10)){secondGridSize++;html+="<td>"+((s<10)?"0":"")+s+"</td>"}html+="</tr></table></div>"}html+="</dd>";html+='<dt class="ui_tpicker_millisec_label" id="ui_tpicker_millisec_label_'+dp_id+'"'+((o.showMillisec)?"":noDisplay)+">"+o.millisecText+'</dt><dd class="ui_tpicker_millisec"><div id="ui_tpicker_millisec_'+dp_id+'"'+((o.showMillisec)?"":noDisplay)+"></div>";if(o.showMillisec&&o.millisecGrid>0){html+='<div style="padding-left: 1px"><table><tr>';for(var l=o.millisecMin;l<=millisecMax;l+=parseInt(o.millisecGrid,10)){millisecGridSize++;html+="<td>"+((l<10)?"0":"")+l+"</td>"}html+="</tr></table></div>"}html+="</dd>";html+='<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_'+dp_id+'"'+((o.showTimezone)?"":noDisplay)+">"+o.timezoneText+"</dt>";html+='<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_'+dp_id+'"'+((o.showTimezone)?"":noDisplay)+"></dd>";html+="</dl></div>";var $tp=$(html);if(o.timeOnly===true){$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+o.timeOnlyTitle+"</div></div>");$dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()}this.hour_slider=$tp.find("#ui_tpicker_hour_"+dp_id).slider({orientation:"horizontal",value:this.hour,min:o.hourMin,max:hourMax,step:o.stepHour,slide:function(event,ui){tp_inst.hour_slider.slider("option","value",ui.value);tp_inst._onTimeChange()}});this.minute_slider=$tp.find("#ui_tpicker_minute_"+dp_id).slider({orientation:"horizontal",value:this.minute,min:o.minuteMin,max:minMax,step:o.stepMinute,slide:function(event,ui){tp_inst.minute_slider.slider("option","value",ui.value);tp_inst._onTimeChange()}});this.second_slider=$tp.find("#ui_tpicker_second_"+dp_id).slider({orientation:"horizontal",value:this.second,min:o.secondMin,max:secMax,step:o.stepSecond,slide:function(event,ui){tp_inst.second_slider.slider("option","value",ui.value);tp_inst._onTimeChange()}});this.millisec_slider=$tp.find("#ui_tpicker_millisec_"+dp_id).slider({orientation:"horizontal",value:this.millisec,min:o.millisecMin,max:millisecMax,step:o.stepMillisec,slide:function(event,ui){tp_inst.millisec_slider.slider("option","value",ui.value);tp_inst._onTimeChange()}});this.timezone_select=$tp.find("#ui_tpicker_timezone_"+dp_id).append("<select></select>").find("select");$.fn.append.apply(this.timezone_select,$.map(o.timezoneList,function(val,idx){return $("<option />").val(typeof val=="object"?val.value:val).text(typeof val=="object"?val.label:val)}));if(typeof(this.timezone)!="undefined"&&this.timezone!==null&&this.timezone!==""){var local_date=new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12);var local_timezone=timeZoneString(local_date);if(local_timezone==this.timezone){selectLocalTimeZone(tp_inst)}else{this.timezone_select.val(this.timezone)}}else{if(typeof(this.hour)!="undefined"&&this.hour!==null&&this.hour!==""){this.timezone_select.val(o.defaultTimezone)}else{selectLocalTimeZone(tp_inst)}}this.timezone_select.change(function(){tp_inst._defaults.useLocalTimezone=false;tp_inst._onTimeChange()});if(o.showHour&&o.hourGrid>0){size=100*hourGridSize*o.hourGrid/(hourMax-o.hourMin);$tp.find(".ui_tpicker_hour table").css({width:size+"%",marginLeft:(size/(-2*hourGridSize))+"%",borderCollapse:"collapse"}).find("td").each(function(index){$(this).click(function(){var h=$(this).html();if(o.ampm){var ap=h.substring(2).toLowerCase(),aph=parseInt(h.substring(0,2),10);if(ap=="a"){if(aph==12){h=0}else{h=aph}}else{if(aph==12){h=12}else{h=aph+12}}}tp_inst.hour_slider.slider("option","value",h);tp_inst._onTimeChange();tp_inst._onSelectHandler()}).css({cursor:"pointer",width:(100/hourGridSize)+"%",textAlign:"center",overflow:"hidden"})})}if(o.showMinute&&o.minuteGrid>0){size=100*minuteGridSize*o.minuteGrid/(minMax-o.minuteMin);$tp.find(".ui_tpicker_minute table").css({width:size+"%",marginLeft:(size/(-2*minuteGridSize))+"%",borderCollapse:"collapse"}).find("td").each(function(index){$(this).click(function(){tp_inst.minute_slider.slider("option","value",$(this).html());tp_inst._onTimeChange();tp_inst._onSelectHandler()}).css({cursor:"pointer",width:(100/minuteGridSize)+"%",textAlign:"center",overflow:"hidden"})})}if(o.showSecond&&o.secondGrid>0){$tp.find(".ui_tpicker_second table").css({width:size+"%",marginLeft:(size/(-2*secondGridSize))+"%",borderCollapse:"collapse"}).find("td").each(function(index){$(this).click(function(){tp_inst.second_slider.slider("option","value",$(this).html());tp_inst._onTimeChange();tp_inst._onSelectHandler()}).css({cursor:"pointer",width:(100/secondGridSize)+"%",textAlign:"center",overflow:"hidden"})})}if(o.showMillisec&&o.millisecGrid>0){$tp.find(".ui_tpicker_millisec table").css({width:size+"%",marginLeft:(size/(-2*millisecGridSize))+"%",borderCollapse:"collapse"}).find("td").each(function(index){$(this).click(function(){tp_inst.millisec_slider.slider("option","value",$(this).html());tp_inst._onTimeChange();tp_inst._onSelectHandler()}).css({cursor:"pointer",width:(100/millisecGridSize)+"%",textAlign:"center",overflow:"hidden"})})}var $buttonPanel=$dp.find(".ui-datepicker-buttonpane");if($buttonPanel.length){$buttonPanel.before($tp)}else{$dp.append($tp)}this.$timeObj=$tp.find("#ui_tpicker_time_"+dp_id);if(this.inst!==null){var timeDefined=this.timeDefined;this._onTimeChange();this.timeDefined=timeDefined}var onSelectDelegate=function(){tp_inst._onSelectHandler()};this.hour_slider.bind("slidestop",onSelectDelegate);this.minute_slider.bind("slidestop",onSelectDelegate);this.second_slider.bind("slidestop",onSelectDelegate);this.millisec_slider.bind("slidestop",onSelectDelegate);if(this._defaults.addSliderAccess){var sliderAccessArgs=this._defaults.sliderAccessArgs;setTimeout(function(){if($tp.find(".ui-slider-access").length===0){$tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);var sliderAccessWidth=$tp.find(".ui-slider-access:eq(0)").outerWidth(true);if(sliderAccessWidth){$tp.find("table:visible").each(function(){var $g=$(this),oldWidth=$g.outerWidth(),oldMarginLeft=$g.css("marginLeft").toString().replace("%",""),newWidth=oldWidth-sliderAccessWidth,newMarginLeft=((oldMarginLeft*newWidth)/oldWidth)+"%";$g.css({width:newWidth,marginLeft:newMarginLeft})})}}},0)}}},_limitMinMaxDateTime:function(dp_inst,adjustSliders){var o=this._defaults,dp_date=new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay);if(!this._defaults.showTimepicker){return}if($.datepicker._get(dp_inst,"minDateTime")!==null&&$.datepicker._get(dp_inst,"minDateTime")!==undefined&&dp_date){var minDateTime=$.datepicker._get(dp_inst,"minDateTime"),minDateTimeDate=new Date(minDateTime.getFullYear(),minDateTime.getMonth(),minDateTime.getDate(),0,0,0,0);if(this.hourMinOriginal===null||this.minuteMinOriginal===null||this.secondMinOriginal===null||this.millisecMinOriginal===null){this.hourMinOriginal=o.hourMin;this.minuteMinOriginal=o.minuteMin;this.secondMinOriginal=o.secondMin;this.millisecMinOriginal=o.millisecMin}if(dp_inst.settings.timeOnly||minDateTimeDate.getTime()==dp_date.getTime()){this._defaults.hourMin=minDateTime.getHours();if(this.hour<=this._defaults.hourMin){this.hour=this._defaults.hourMin;this._defaults.minuteMin=minDateTime.getMinutes();if(this.minute<=this._defaults.minuteMin){this.minute=this._defaults.minuteMin;this._defaults.secondMin=minDateTime.getSeconds()}else{if(this.second<=this._defaults.secondMin){this.second=this._defaults.secondMin;this._defaults.millisecMin=minDateTime.getMilliseconds()}else{if(this.millisec<this._defaults.millisecMin){this.millisec=this._defaults.millisecMin}this._defaults.millisecMin=this.millisecMinOriginal}}}else{this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal}}else{this._defaults.hourMin=this.hourMinOriginal;this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal}}if($.datepicker._get(dp_inst,"maxDateTime")!==null&&$.datepicker._get(dp_inst,"maxDateTime")!==undefined&&dp_date){var maxDateTime=$.datepicker._get(dp_inst,"maxDateTime"),maxDateTimeDate=new Date(maxDateTime.getFullYear(),maxDateTime.getMonth(),maxDateTime.getDate(),0,0,0,0);if(this.hourMaxOriginal===null||this.minuteMaxOriginal===null||this.secondMaxOriginal===null){this.hourMaxOriginal=o.hourMax;this.minuteMaxOriginal=o.minuteMax;this.secondMaxOriginal=o.secondMax;this.millisecMaxOriginal=o.millisecMax}if(dp_inst.settings.timeOnly||maxDateTimeDate.getTime()==dp_date.getTime()){this._defaults.hourMax=maxDateTime.getHours();if(this.hour>=this._defaults.hourMax){this.hour=this._defaults.hourMax;this._defaults.minuteMax=maxDateTime.getMinutes();if(this.minute>=this._defaults.minuteMax){this.minute=this._defaults.minuteMax;this._defaults.secondMax=maxDateTime.getSeconds()}else{if(this.second>=this._defaults.secondMax){this.second=this._defaults.secondMax;this._defaults.millisecMax=maxDateTime.getMilliseconds()}else{if(this.millisec>this._defaults.millisecMax){this.millisec=this._defaults.millisecMax}this._defaults.millisecMax=this.millisecMaxOriginal}}}else{this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal}}else{this._defaults.hourMax=this.hourMaxOriginal;this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal}}if(adjustSliders!==undefined&&adjustSliders===true){var hourMax=parseInt((this._defaults.hourMax-((this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour)),10),minMax=parseInt((this._defaults.minuteMax-((this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute)),10),secMax=parseInt((this._defaults.secondMax-((this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond)),10),millisecMax=parseInt((this._defaults.millisecMax-((this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec)),10);if(this.hour_slider){this.hour_slider.slider("option",{min:this._defaults.hourMin,max:hourMax}).slider("value",this.hour)}if(this.minute_slider){this.minute_slider.slider("option",{min:this._defaults.minuteMin,max:minMax}).slider("value",this.minute)}if(this.second_slider){this.second_slider.slider("option",{min:this._defaults.secondMin,max:secMax}).slider("value",this.second)}if(this.millisec_slider){this.millisec_slider.slider("option",{min:this._defaults.millisecMin,max:millisecMax}).slider("value",this.millisec)}}},_onTimeChange:function(){var hour=(this.hour_slider)?this.hour_slider.slider("value"):false,minute=(this.minute_slider)?this.minute_slider.slider("value"):false,second=(this.second_slider)?this.second_slider.slider("value"):false,millisec=(this.millisec_slider)?this.millisec_slider.slider("value"):false,timezone=(this.timezone_select)?this.timezone_select.val():false,o=this._defaults;if(typeof(hour)=="object"){hour=false}if(typeof(minute)=="object"){minute=false}if(typeof(second)=="object"){second=false}if(typeof(millisec)=="object"){millisec=false}if(typeof(timezone)=="object"){timezone=false}if(hour!==false){hour=parseInt(hour,10)}if(minute!==false){minute=parseInt(minute,10)}if(second!==false){second=parseInt(second,10)}if(millisec!==false){millisec=parseInt(millisec,10)}var ampm=o[hour<12?"amNames":"pmNames"][0];var hasChanged=(hour!=this.hour||minute!=this.minute||second!=this.second||millisec!=this.millisec||(this.ampm.length>0&&(hour<12)!=($.inArray(this.ampm.toUpperCase(),this.amNames)!==-1))||timezone!=this.timezone);if(hasChanged){if(hour!==false){this.hour=hour}if(minute!==false){this.minute=minute}if(second!==false){this.second=second}if(millisec!==false){this.millisec=millisec}if(timezone!==false){this.timezone=timezone}if(!this.inst){this.inst=$.datepicker._getInst(this.$input[0])}this._limitMinMaxDateTime(this.inst,true)}if(o.ampm){this.ampm=ampm}this.formattedTime=$.datepicker.formatTime(this._defaults.timeFormat,this,this._defaults);if(this.$timeObj){this.$timeObj.text(this.formattedTime+o.timeSuffix)}this.timeDefined=true;if(hasChanged){this._updateDateTime()}},_onSelectHandler:function(){var onSelect=this._defaults.onSelect;var inputEl=this.$input?this.$input[0]:null;if(onSelect&&inputEl){onSelect.apply(inputEl,[this.formattedDateTime,this])}},_formatTime:function(time,format){time=time||{hour:this.hour,minute:this.minute,second:this.second,millisec:this.millisec,ampm:this.ampm,timezone:this.timezone};var tmptime=(format||this._defaults.timeFormat).toString();tmptime=$.datepicker.formatTime(tmptime,time,this._defaults);if(arguments.length){return tmptime}else{this.formattedTime=tmptime}},_updateDateTime:function(dp_inst){dp_inst=this.inst||dp_inst;var dt=$.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay)),dateFmt=$.datepicker._get(dp_inst,"dateFormat"),formatCfg=$.datepicker._getFormatConfig(dp_inst),timeAvailable=dt!==null&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(dateFmt,(dt===null?new Date():dt),formatCfg);var formattedDateTime=this.formattedDate;if(this._defaults.timeOnly===true){formattedDateTime=this.formattedTime}else{if(this._defaults.timeOnly!==true&&(this._defaults.alwaysSetTime||timeAvailable)){formattedDateTime+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix}}this.formattedDateTime=formattedDateTime;if(!this._defaults.showTimepicker){this.$input.val(this.formattedDate)}else{if(this.$altInput&&this._defaults.altFieldTimeOnly===true){this.$altInput.val(this.formattedTime);this.$input.val(this.formattedDate)}else{if(this.$altInput){this.$altInput.val(formattedDateTime);this.$input.val(formattedDateTime)}else{this.$input.val(formattedDateTime)}}}this.$input.trigger("change")}});$.fn.extend({timepicker:function(o){o=o||{};var tmp_args=arguments;if(typeof o=="object"){tmp_args[0]=$.extend(o,{timeOnly:true})}return $(this).each(function(){$.fn.datetimepicker.apply($(this),tmp_args)})},datetimepicker:function(o){o=o||{};var tmp_args=arguments;if(typeof(o)=="string"){if(o=="getDate"){return $.fn.datepicker.apply($(this[0]),tmp_args)}else{return this.each(function(){var $t=$(this);$t.datepicker.apply($t,tmp_args)})}}else{return this.each(function(){var $t=$(this);$t.datepicker($.timepicker._newInst($t,o)._defaults)})}}});$.datepicker.parseDateTime=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var parseRes=parseDateTimeInternal(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings);if(parseRes.timeObj){var t=parseRes.timeObj;parseRes.date.setHours(t.hour,t.minute,t.second,t.millisec)}return parseRes.date};$.datepicker.parseTime=function(timeFormat,timeString,options){var getPatternAmpm=function(amNames,pmNames){var markers=[];if(amNames){$.merge(markers,amNames)}if(pmNames){$.merge(markers,pmNames)}markers=$.map(markers,function(val){return val.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")});return"("+markers.join("|")+")?"};var getFormatPositions=function(timeFormat){var finds=timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z)/g),orders={h:-1,m:-1,s:-1,l:-1,t:-1,z:-1};if(finds){for(var i=0;i<finds.length;i++){if(orders[finds[i].toString().charAt(0)]==-1){orders[finds[i].toString().charAt(0)]=i+1}}}return orders};var o=extendRemove(extendRemove({},$.timepicker._defaults),options||{});var regstr="^"+timeFormat.toString().replace(/h{1,2}/ig,"(\\d?\\d)").replace(/m{1,2}/ig,"(\\d?\\d)").replace(/s{1,2}/ig,"(\\d?\\d)").replace(/l{1}/ig,"(\\d?\\d?\\d)").replace(/t{1,2}/ig,getPatternAmpm(o.amNames,o.pmNames)).replace(/z{1}/ig,"(z|[-+]\\d\\d:?\\d\\d)?").replace(/\s/g,"\\s?")+o.timeSuffix+"$",order=getFormatPositions(timeFormat),ampm="",treg;treg=timeString.match(new RegExp(regstr,"i"));var resTime={hour:0,minute:0,second:0,millisec:0};if(treg){if(order.t!==-1){if(treg[order.t]===undefined||treg[order.t].length===0){ampm="";resTime.ampm=""}else{ampm=$.inArray(treg[order.t],o.amNames)!==-1?"AM":"PM";resTime.ampm=o[ampm=="AM"?"amNames":"pmNames"][0]}}if(order.h!==-1){if(ampm=="AM"&&treg[order.h]=="12"){resTime.hour=0}else{if(ampm=="PM"&&treg[order.h]!="12"){resTime.hour=parseInt(treg[order.h],10)+12}else{resTime.hour=Number(treg[order.h])}}}if(order.m!==-1){resTime.minute=Number(treg[order.m])}if(order.s!==-1){resTime.second=Number(treg[order.s])}if(order.l!==-1){resTime.millisec=Number(treg[order.l])}if(order.z!==-1&&treg[order.z]!==undefined){var tz=treg[order.z].toUpperCase();switch(tz.length){case 1:tz=o.timezoneIso8601?"Z":"+0000";break;case 5:if(o.timezoneIso8601){tz=tz.substring(1)=="0000"?"Z":tz.substring(0,3)+":"+tz.substring(3)}break;case 6:if(!o.timezoneIso8601){tz=tz=="Z"||tz.substring(1)=="00:00"?"+0000":tz.replace(/:/,"")}else{if(tz.substring(1)=="00:00"){tz="Z"}}break}resTime.timezone=tz}return resTime}return false};$.datepicker.formatTime=function(format,time,options){options=options||{};options=$.extend($.timepicker._defaults,options);time=$.extend({hour:0,minute:0,second:0,millisec:0,timezone:"+0000"},time);var tmptime=format;var ampmName=options.amNames[0];var hour=parseInt(time.hour,10);if(options.ampm){if(hour>11){ampmName=options.pmNames[0];if(hour>12){hour=hour%12}}if(hour===0){hour=12}}tmptime=tmptime.replace(/(?:hh?|mm?|ss?|[tT]{1,2}|[lz])/g,function(match){switch(match.toLowerCase()){case"hh":return("0"+hour).slice(-2);case"h":return hour;case"mm":return("0"+time.minute).slice(-2);case"m":return time.minute;case"ss":return("0"+time.second).slice(-2);case"s":return time.second;case"l":return("00"+time.millisec).slice(-3);case"z":return time.timezone;case"t":case"tt":if(options.ampm){if(match.length==1){ampmName=ampmName.charAt(0)}return match.charAt(0)=="T"?ampmName.toUpperCase():ampmName.toLowerCase()}return""}});tmptime=$.trim(tmptime);return tmptime};$.datepicker._base_selectDate=$.datepicker._selectDate;$.datepicker._selectDate=function(id,dateStr){var inst=this._getInst($(id)[0]),tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._limitMinMaxDateTime(inst,true);inst.inline=inst.stay_open=true;this._base_selectDate(id,dateStr);inst.inline=inst.stay_open=false;this._notifyChange(inst);this._updateDatepicker(inst)}else{this._base_selectDate(id,dateStr)}};$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker;$.datepicker._updateDatepicker=function(inst){var input=inst.input[0];if($.datepicker._curInst&&$.datepicker._curInst!=inst&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!=input){return}if(typeof(inst.stay_open)!=="boolean"||inst.stay_open===false){this._base_updateDatepicker(inst);var tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._addTimePicker(inst);if(tp_inst._defaults.useLocalTimezone){var date=new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay,12);selectLocalTimeZone(tp_inst,date);tp_inst._onTimeChange()}}}};$.datepicker._base_doKeyPress=$.datepicker._doKeyPress;$.datepicker._doKeyPress=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if($.datepicker._get(inst,"constrainInput")){var ampm=tp_inst._defaults.ampm,dateChars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat")),datetimeChars=tp_inst._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,ampm?"APM":"").replace(/Tt/g,ampm?"AaPpMm":"").replace(/tT/g,ampm?"AaPpMm":"").replace(/T/g,ampm?"AP":"").replace(/tt/g,ampm?"apm":"").replace(/t/g,ampm?"ap":"")+" "+tp_inst._defaults.separator+tp_inst._defaults.timeSuffix+(tp_inst._defaults.showTimezone?tp_inst._defaults.timezoneList.join(""):"")+(tp_inst._defaults.amNames.join(""))+(tp_inst._defaults.pmNames.join(""))+dateChars,chr=String.fromCharCode(event.charCode===undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!dateChars||datetimeChars.indexOf(chr)>-1)}}return $.datepicker._base_doKeyPress(event)};$.datepicker._base_doKeyUp=$.datepicker._doKeyUp;$.datepicker._doKeyUp=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if(tp_inst._defaults.timeOnly&&(inst.input.val()!=inst.lastVal)){try{$.datepicker._updateDatepicker(inst)}catch(err){$.datepicker.log(err)}}}return $.datepicker._base_doKeyUp(event)};$.datepicker._base_gotoToday=$.datepicker._gotoToday;$.datepicker._gotoToday=function(id){var inst=this._getInst($(id)[0]),$dp=inst.dpDiv;this._base_gotoToday(id);var tp_inst=this._get(inst,"timepicker");selectLocalTimeZone(tp_inst);var now=new Date();this._setTime(inst,now);$(".ui-datepicker-today",$dp).click()};$.datepicker._disableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate");if(tp_inst){tp_inst._defaults.showTimepicker=false;tp_inst._updateDateTime(inst)}};$.datepicker._enableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate");if(tp_inst){tp_inst._defaults.showTimepicker=true;tp_inst._addTimePicker(inst);tp_inst._updateDateTime(inst)}};$.datepicker._setTime=function(inst,date){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var defaults=tp_inst._defaults,hour=date?date.getHours():defaults.hour,minute=date?date.getMinutes():defaults.minute,second=date?date.getSeconds():defaults.second,millisec=date?date.getMilliseconds():defaults.millisec;var hourEq=hour===defaults.hourMin,minuteEq=minute===defaults.minuteMin,secondEq=second===defaults.secondMin;var reset=false;if(hour<defaults.hourMin||hour>defaults.hourMax){reset=true}else{if((minute<defaults.minuteMin||minute>defaults.minuteMax)&&hourEq){reset=true}else{if((second<defaults.secondMin||second>defaults.secondMax)&&hourEq&&minuteEq){reset=true}else{if((millisec<defaults.millisecMin||millisec>defaults.millisecMax)&&hourEq&&minuteEq&&secondEq){reset=true}}}}if(reset){hour=defaults.hourMin;minute=defaults.minuteMin;second=defaults.secondMin;millisec=defaults.millisecMin}tp_inst.hour=hour;tp_inst.minute=minute;tp_inst.second=second;tp_inst.millisec=millisec;if(tp_inst.hour_slider){tp_inst.hour_slider.slider("value",hour)}if(tp_inst.minute_slider){tp_inst.minute_slider.slider("value",minute)}if(tp_inst.second_slider){tp_inst.second_slider.slider("value",second)}if(tp_inst.millisec_slider){tp_inst.millisec_slider.slider("value",millisec)}tp_inst._onTimeChange();tp_inst._updateDateTime(inst)}};$.datepicker._setTimeDatepicker=function(target,date,withDate){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");if(tp_inst){this._setDateFromField(inst);var tp_date;if(date){if(typeof date=="string"){tp_inst._parseTime(date,withDate);tp_date=new Date();tp_date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec)}else{tp_date=new Date(date.getTime())}if(tp_date.toString()=="Invalid Date"){tp_date=undefined}this._setTime(inst,tp_date)}}};$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker;$.datepicker._setDateDatepicker=function(target,date){var inst=this._getInst(target);if(!inst){return}var tp_date=(date instanceof Date)?new Date(date.getTime()):date;this._updateDatepicker(inst);this._base_setDateDatepicker.apply(this,arguments);this._setTimeDatepicker(target,tp_date,true)};$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker;$.datepicker._getDateDatepicker=function(target,noDefault){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");if(tp_inst){this._setDateFromField(inst,noDefault);var date=this._getDate(inst);if(date&&tp_inst._parseTime($(target).val(),tp_inst.timeOnly)){date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec)}return date}return this._base_getDateDatepicker(target,noDefault)};$.datepicker._base_parseDate=$.datepicker.parseDate;$.datepicker.parseDate=function(format,value,settings){var splitRes=splitDateTime(format,value,settings);return $.datepicker._base_parseDate(format,splitRes[0],settings)};$.datepicker._base_formatDate=$.datepicker._formatDate;$.datepicker._formatDate=function(inst,day,month,year){var tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._updateDateTime(inst);return tp_inst.$input.val()}return this._base_formatDate(inst)};$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker;$.datepicker._optionDatepicker=function(target,name,value){var inst=this._getInst(target);if(!inst){return null}var tp_inst=this._get(inst,"timepicker");if(tp_inst){var min=null,max=null,onselect=null;if(typeof name=="string"){if(name==="minDate"||name==="minDateTime"){min=value}else{if(name==="maxDate"||name==="maxDateTime"){max=value}else{if(name==="onSelect"){onselect=value}}}}else{if(typeof name=="object"){if(name.minDate){min=name.minDate}else{if(name.minDateTime){min=name.minDateTime}else{if(name.maxDate){max=name.maxDate}else{if(name.maxDateTime){max=name.maxDateTime}}}}}}if(min){if(min===0){min=new Date()}else{min=new Date(min)}tp_inst._defaults.minDate=min;tp_inst._defaults.minDateTime=min}else{if(max){if(max===0){max=new Date()}else{max=new Date(max)}tp_inst._defaults.maxDate=max;tp_inst._defaults.maxDateTime=max}else{if(onselect){tp_inst._defaults.onSelect=onselect}}}}if(value===undefined){return this._base_optionDatepicker(target,name)}return this._base_optionDatepicker(target,name,value)};function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]===null||props[name]===undefined){target[name]=props[name]}}return target}var splitDateTime=function(dateFormat,dateTimeString,dateSettings){try{var date=$.datepicker._base_parseDate(dateFormat,dateTimeString,dateSettings)}catch(err){if(err.indexOf(":")>=0){var dateStringLength=dateTimeString.length-(err.length-err.indexOf(":")-2);var timeString=dateTimeString.substring(dateStringLength);return[dateTimeString.substring(0,dateStringLength),dateTimeString.substring(dateStringLength)]}else{throw err}}return[dateTimeString,""]};var parseDateTimeInternal=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var date;var splitRes=splitDateTime(dateFormat,dateTimeString,dateSettings);date=$.datepicker._base_parseDate(dateFormat,splitRes[0],dateSettings);if(splitRes[1]!==""){var timeString=splitRes[1];var separator=timeSettings&&timeSettings.separator?timeSettings.separator:$.timepicker._defaults.separator;if(timeString.indexOf(separator)!==0){throw"Missing time separator"}timeString=timeString.substring(separator.length);var parsedTime=$.datepicker.parseTime(timeFormat,timeString,timeSettings);if(parsedTime===null){throw"Wrong time format"}return{date:date,timeObj:parsedTime}}else{return{date:date}}};var selectLocalTimeZone=function(tp_inst,date){if(tp_inst&&tp_inst.timezone_select){tp_inst._defaults.useLocalTimezone=true;var now=typeof date!=="undefined"?date:new Date();var tzoffset=timeZoneString(now);if(tp_inst._defaults.timezoneIso8601){tzoffset=tzoffset.substring(0,3)+":"+tzoffset.substring(3)}tp_inst.timezone_select.val(tzoffset)}};var timeZoneString=function(date){var off=date.getTimezoneOffset()*-10100/60;var timezone=(off>=0?"+":"-")+Math.abs(off).toString().substr(1);return timezone};$.timepicker=new Timepicker();$.timepicker.version="1.0.1"})(jQuery);(function(a){a.widget("ui.autocomplete",{options:{minLength:1,delay:300},_create:function(){var b=this,d=this.element[0].ownerDocument;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(e){var f=a.ui.keyCode;switch(e.keyCode){case f.PAGE_UP:b._move("previousPage",e);break;case f.PAGE_DOWN:b._move("nextPage",e);break;case f.UP:b._move("previous",e);e.preventDefault();break;case f.DOWN:b._move("next",e);e.preventDefault();break;case f.ENTER:if(b.menu.active){e.preventDefault()}case f.TAB:if(!b.menu.active){return}b.menu.select();break;case f.ESCAPE:b.element.val(b.term);b.close(e);break;case f.SHIFT:case f.CONTROL:case 18:break;default:clearTimeout(b.searching);b.searching=setTimeout(function(){b.search(null,e)},b.options.delay);break}}).bind("focus.autocomplete",function(){b.previous=b.element.val()}).bind("blur.autocomplete",function(e){clearTimeout(b.searching);b.closing=setTimeout(function(){b.close(e)},150)});this._initSource();this.response=function(){return b._response.apply(b,arguments)};this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo("body",d).menu({focus:function(f,g){var e=g.item.data("item.autocomplete");if(false!==b._trigger("focus",null,{item:e})){if(/^key/.test(f.originalEvent.type)){b.element.val(e.value)}}},selected:function(f,g){var e=g.item.data("item.autocomplete");if(false!==b._trigger("select",f,{item:e})){b.element.val(e.value)}b.close(f);b.previous=b.element.val();if(b.element[0]!==d.activeElement){b.element.focus()}},blur:function(e,f){if(b.menu.element.is(":visible")){b.element.val(b.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(a.fn.bgiframe){this.menu.element.bgiframe()}},destroy:function(){this.element.removeClass("ui-autocomplete-input ui-widget ui-widget-content").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();a.Widget.prototype.destroy.call(this)},_setOption:function(b){a.Widget.prototype._setOption.apply(this,arguments);if(b==="source"){this._initSource()}},_initSource:function(){var d,b;if(a.isArray(this.options.source)){d=this.options.source;this.source=function(f,e){var g=new RegExp(a.ui.autocomplete.escapeRegex(f.term),"i");e(a.grep(d,function(h){return g.test(h.label||h.value||h)}))}}else{if(typeof this.options.source==="string"){b=this.options.source;this.source=function(f,e){a.getJSON(b,f,e)}}else{this.source=this.options.source}}},search:function(d,b){d=d!=null?d:this.element.val();if(d.length<this.options.minLength){return this.close(b)}clearTimeout(this.closing);if(this._trigger("search")===false){return}return this._search(d)},_search:function(b){this.term=this.element.addClass("ui-autocomplete-loading").val();this.source({term:b},this.response)},_response:function(b){if(b.length){b=this._normalize(b);this._suggest(b);this._trigger("open")}else{this.close()}this.element.removeClass("ui-autocomplete-loading")},close:function(b){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this._trigger("close",b);this.menu.element.hide();this.menu.deactivate()}if(this.previous!==this.element.val()){this._trigger("change",b)}},_normalize:function(b){if(b.length&&b[0].label&&b[0].value){return b}return a.map(b,function(d){if(typeof d==="string"){return{label:d,value:d}}return a.extend({label:d.label||d.value,value:d.value||d.label},d)})},_suggest:function(b){var d=this.menu.element.empty().zIndex(this.element.zIndex()+1),e,f;this._renderMenu(d,b);this.menu.deactivate();this.menu.refresh();this.menu.element.show().position({my:"left top",at:"left bottom",of:this.element,collision:"none"});e=d.width("").width();f=this.element.width();d.width(Math.max(e,f))},_renderMenu:function(e,d){var b=this;a.each(d,function(f,g){b._renderItem(e,g)})},_renderItem:function(b,d){return a("<li></li>").data("item.autocomplete",d).append("<a>"+d.label+"</a>").appendTo(b)},_move:function(d,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(d)||this.menu.last()&&/^next/.test(d)){this.element.val(this.term);this.menu.deactivate();return}this.menu[d](b)},widget:function(){return this.menu.element}});a.extend(a.ui.autocomplete,{escapeRegex:function(b){return b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")}})}(jQuery));(function(a){a.widget("ui.selectmenu",{getter:"value",version:"1.8",eventPrefix:"selectmenu",options:{transferClasses:true,style:"dropdown",positionOptions:{my:"left top",at:"left bottom",offset:null},width:null,menuWidth:null,handleWidth:26,maxHeight:null,icons:null,format:null,bgImage:function(){},wrapperElement:""},_create:function(){var b=this,g=this.options;var f=this.element.attr("id")||"ui-selectmenu-"+Math.random().toString(16).slice(2,10);this.ids=[f+"-button",f+"-menu"];this._safemouseup=true;this.newelement=a('<a class="'+this.widgetBaseClass+' ui-widget ui-state-default ui-corner-all" id="'+this.ids[0]+'" role="button" href="#" tabindex="0" aria-haspopup="true" aria-owns="'+this.ids[1]+'"></a>').insertAfter(this.element);this.newelement.wrap(g.wrapperElement);var e=this.element.attr("tabindex");if(e){this.newelement.attr("tabindex",e)}this.newelement.data("selectelement",this.element);this.selectmenuIcon=a('<span class="'+this.widgetBaseClass+'-icon ui-icon"></span>').prependTo(this.newelement);this.newelement.prepend('<span class="'+b.widgetBaseClass+'-status" />');a('label[for="'+this.element.attr("id")+'"]').attr("for",this.ids[0]).bind("click.selectmenu",function(){b.newelement[0].focus();return false});this.newelement.bind("mousedown.selectmenu",function(h){b._toggle(h,true);if(g.style=="popup"){b._safemouseup=false;setTimeout(function(){b._safemouseup=true},300)}return false}).bind("click.selectmenu",function(){return false}).bind("keydown.selectmenu",function(j){var h=false;switch(j.keyCode){case a.ui.keyCode.ENTER:h=true;break;case a.ui.keyCode.SPACE:b._toggle(j);break;case a.ui.keyCode.UP:if(j.altKey){b.open(j)}else{b._moveSelection(-1)}break;case a.ui.keyCode.DOWN:if(j.altKey){b.open(j)}else{b._moveSelection(1)}break;case a.ui.keyCode.LEFT:b._moveSelection(-1);break;case a.ui.keyCode.RIGHT:b._moveSelection(1);break;case a.ui.keyCode.TAB:h=true;break;default:h=true;b._typeAhead(j.keyCode,"mouseup");break}return h}).bind("mouseover.selectmenu focus.selectmenu",function(){if(!g.disabled){a(this).addClass(b.widgetBaseClass+"-focus ui-state-hover")}}).bind("mouseout.selectmenu blur.selectmenu",function(){if(!g.disabled){a(this).removeClass(b.widgetBaseClass+"-focus ui-state-hover")}});a(document).bind("mousedown.selectmenu",function(h){b.close(h)});this.element.bind("click.selectmenu",function(){b._refreshValue()}).bind("focus.selectmenu",function(){if(this.newelement){this.newelement[0].focus()}});var d=this.element.width();this.newelement.width((g.width)?g.width:d);this.element.hide();this.list=a('<ul class="'+b.widgetBaseClass+'-menu ui-widget ui-widget-content" aria-hidden="true" role="listbox" aria-labelledby="'+this.ids[0]+'" id="'+this.ids[1]+'"></ul>').appendTo("body");this.list.wrap(g.wrapperElement);this.list.bind("keydown.selectmenu",function(j){var h=false;switch(j.keyCode){case a.ui.keyCode.UP:if(j.altKey){b.close(j,true)}else{b._moveFocus(-1)}break;case a.ui.keyCode.DOWN:if(j.altKey){b.close(j,true)}else{b._moveFocus(1)}break;case a.ui.keyCode.LEFT:b._moveFocus(-1);break;case a.ui.keyCode.RIGHT:b._moveFocus(1);break;case a.ui.keyCode.HOME:b._moveFocus(":first");break;case a.ui.keyCode.PAGE_UP:b._scrollPage("up");break;case a.ui.keyCode.PAGE_DOWN:b._scrollPage("down");break;case a.ui.keyCode.END:b._moveFocus(":last");break;case a.ui.keyCode.ENTER:case a.ui.keyCode.SPACE:b.close(j,true);a(j.target).parents("li:eq(0)").trigger("mouseup");break;case a.ui.keyCode.TAB:h=true;b.close(j,true);break;case a.ui.keyCode.ESCAPE:b.close(j,true);break;default:h=true;break}return h});a(window).bind("resize.selectmenu",function(){a.proxy(b._refreshPosition,this)})},_init:function(){var p=this,f=this.options;var b=[];this.element.find("option").each(function(){b.push({value:a(this).attr("value"),text:p._formatText(a(this).text()),selected:a(this).attr("selected"),classes:a(this).attr("class"),parentOptGroup:a(this).parent("optgroup").attr("label"),bgImage:f.bgImage.call(a(this))})});var m=(p.options.style=="popup")?" ui-state-active":"";this.list.html("");for(var k=0;k<b.length;k++){var e=a('<li role="presentation"><a href="#" tabindex="-1" role="option" aria-selected="false">'+b[k].text+"</a></li>").data("index",k).addClass(b[k].classes).data("optionClasses",b[k].classes||"").bind("mouseup.selectmenu",function(j){if(p._safemouseup){var o=a(this).data("index")!=p._selectedIndex();p.index(a(this).data("index"));p.select(j);if(o){p.change(j)}p.close(j,true)}return false}).bind("click.selectmenu",function(){return false}).bind("mouseover.selectmenu focus.selectmenu",function(){p._selectedOptionLi().addClass(m);p._focusedOptionLi().removeClass(p.widgetBaseClass+"-item-focus ui-state-hover");a(this).removeClass("ui-state-active").addClass(p.widgetBaseClass+"-item-focus ui-state-hover")}).bind("mouseout.selectmenu blur.selectmenu",function(){a(this).removeClass(p.widgetBaseClass+"-item-focus ui-state-hover")});if(b[k].parentOptGroup){var l=p.widgetBaseClass+"-group-"+b[k].parentOptGroup.replace(/[^a-zA-Z0-9]/g,"");if(this.list.find("li."+l).size()){this.list.find("li."+l+":last ul").append(e)}else{a('<li role="presentation" class="'+p.widgetBaseClass+"-group "+l+'"><span class="'+p.widgetBaseClass+'-group-label">'+b[k].parentOptGroup+"</span><ul></ul></li>").appendTo(this.list).find("ul").append(e)}}else{e.appendTo(this.list)}this.list.bind("mousedown.selectmenu mouseup.selectmenu",function(){return false});if(f.icons){for(var h in f.icons){if(e.is(f.icons[h].find)){e.data("optionClasses",b[k].classes+" "+p.widgetBaseClass+"-hasIcon").addClass(p.widgetBaseClass+"-hasIcon");var n=f.icons[h].icon||"";e.find("a:eq(0)").prepend('<span class="'+p.widgetBaseClass+"-item-icon ui-icon "+n+'"></span>');if(b[k].bgImage){e.find("span").css("background-image",b[k].bgImage)}}}}}var d=(f.style=="dropdown")?true:false;this.newelement.toggleClass(p.widgetBaseClass+"-dropdown",d).toggleClass(p.widgetBaseClass+"-popup",!d);this.list.toggleClass(p.widgetBaseClass+"-menu-dropdown ui-corner-bottom",d).toggleClass(p.widgetBaseClass+"-menu-popup ui-corner-all",!d).find("li:first").toggleClass("ui-corner-top",!d).end().find("li:last").addClass("ui-corner-bottom");this.selectmenuIcon.toggleClass("ui-icon-triangle-1-s",d).toggleClass("ui-icon-triangle-2-n-s",!d);if(f.transferClasses){var q=this.element.attr("class")||"";this.newelement.add(this.list).addClass(q)}var g=this.element.width();if(f.style=="dropdown"){this.list.width((f.menuWidth)?f.menuWidth:((f.width)?f.width:g))}else{this.list.width((f.menuWidth)?f.menuWidth:((f.width)?f.width-f.handleWidth:g-f.handleWidth))}if(f.maxHeight){if(f.maxHeight<this.list.height()){this.list.height(f.maxHeight)}}else{if(!f.format&&(a(window).height()/3)<this.list.height()){f.maxHeight=a(window).height()/3;this.list.height(f.maxHeight)}}this._optionLis=this.list.find("li:not(."+p.widgetBaseClass+"-group)");if(this.element.attr("disabled")==true){this.disable()}this.index(this._selectedIndex());window.setTimeout(function(){p._refreshPosition()},200)},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled").unbind(".selectmenu");a(window).unbind(".selectmenu");a(document).unbind(".selectmenu");a("label[for="+this.newelement.attr("id")+"]").attr("for",this.element.attr("id")).unbind(".selectmenu");if(this.options.wrapperElement){this.newelement.find(this.options.wrapperElement).remove();this.list.find(this.options.wrapperElement).remove()}else{this.newelement.remove();this.list.remove()}this.element.show();a.Widget.prototype.destroy.apply(this,arguments)},_typeAhead:function(f,e){var b=this;if(!b._prevChar){b._prevChar=["",0]}var h=String.fromCharCode(f);c=h.toLowerCase();var d=false;function g(j,k){d=true;a(j).trigger(e);b._prevChar[1]=k}this.list.find("li a").each(function(j){if(!d){var k=a(this).text();if(k.indexOf(h)==0||k.indexOf(c)==0){if(b._prevChar[0]==h){if(b._prevChar[1]<j){g(this,j)}}else{g(this,j)}}}});this._prevChar[0]=h},_uiHash:function(){var b=this.index();return{index:b,option:a("option",this.element).get(b),value:this.element[0].value}},open:function(e){var d=this;var b=this.newelement.attr("aria-disabled");if(b!="true"){this._refreshPosition();this._closeOthers(e);this.newelement.addClass("ui-state-active");this.list.addClass(d.widgetBaseClass+"-open").attr("aria-hidden",false).find("li:not(."+d.widgetBaseClass+"-group):eq("+this._selectedIndex()+") a")[0].focus();this._optionLis.removeClass("ui-selectmenu-item-selected ui-state-hover");this._optionLis.eq(this.index()).addClass("ui-selectmenu-item-selected ui-state-hover");if(this.options.style=="dropdown"){this.newelement.removeClass("ui-corner-all").addClass("ui-corner-top")}this._refreshPosition();this.list.css("z-index",this.list.css("z-index")+1);this._trigger("open",e,this._uiHash())}},close:function(d,b){if(this.newelement.is(".ui-state-active")){this.newelement.removeClass("ui-state-active");this.list.attr("aria-hidden",true).removeClass(this.widgetBaseClass+"-open");if(this.options.style=="dropdown"){this.newelement.removeClass("ui-corner-top").addClass("ui-corner-all")}if(b){this.newelement.focus()}this._trigger("close",d,this._uiHash())}},change:function(b){this.element.trigger("change");this._trigger("change",b,this._uiHash())},select:function(b){this._trigger("select",b,this._uiHash())},_closeOthers:function(b){a("."+this.widgetBaseClass+".ui-state-active").not(this.newelement).each(function(){a(this).data("selectelement").selectmenu("close",b)});a("."+this.widgetBaseClass+".ui-state-hover").trigger("mouseout")},_toggle:function(d,b){if(this.list.is("."+this.widgetBaseClass+"-open")){this.close(d,b)}else{this.open(d)}},_formatText:function(b){return this.options.format?this.options.format(b):b},_selectedIndex:function(){return this.element[0].selectedIndex},_selectedOptionLi:function(){return this._optionLis.eq(this._selectedIndex())},_focusedOptionLi:function(){return this.list.find("."+this.widgetBaseClass+"-item-selected")},_moveSelection:function(e){var d=parseInt(this._selectedOptionLi().data("index"),10);var b=d+e;return this._optionLis.eq(b).trigger("mouseup")},_moveFocus:function(f){if(!isNaN(f)){var e=parseInt(this._focusedOptionLi().data("index")||0,10);var d=e+f}else{var d=parseInt(this._optionLis.filter(f).data("index"),10)}if(d<0){d=0}if(d>this._optionLis.size()-1){d=this._optionLis.size()-1}var b=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1000);this._focusedOptionLi().find("a:eq(0)").attr("id","");this._optionLis.eq(d).find("a:eq(0)").attr("id",b).focus();this.list.attr("aria-activedescendant",b);this._focusedOptionLi().removeClass("ui-selectmenu-item-selected ui-state-hover");this._optionLis.eq(d).addClass("ui-selectmenu-item-selected ui-state-hover");this.index(d)},_scrollPage:function(d){var b=Math.floor(this.list.outerHeight()/this.list.find("li:first").outerHeight());b=(d=="up")?-b:b;this._moveFocus(b)},_setOption:function(b,d){this.options[b]=d;if(b=="disabled"){this.close();this.element.add(this.newelement).add(this.list)[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d)}},index:function(b){if(arguments.length){this.element[0].selectedIndex=b;this._refreshValue()}else{return this._selectedIndex()}},value:function(b){if(arguments.length){if(typeof b=="number"){this.index(b)}else{if(typeof b=="string"){this.element[0].value=b;this._refreshValue()}}}else{return this.element[0].value}},_refreshValue:function(){var e=(this.options.style=="popup")?" ui-state-active":"";var d=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1000);this.list.find("."+this.widgetBaseClass+"-item-selected").removeClass(this.widgetBaseClass+"-item-selected"+e).find("a").attr("aria-selected","false").attr("id","");this._selectedOptionLi().addClass(this.widgetBaseClass+"-item-selected"+e).find("a").attr("aria-selected","true").attr("id",d);var b=this.newelement.data("optionClasses")?this.newelement.data("optionClasses"):"";var f=this._selectedOptionLi().data("optionClasses")?this._selectedOptionLi().data("optionClasses"):"";this.newelement.removeClass(b).data("optionClasses",f).addClass(f).find("."+this.widgetBaseClass+"-status").html(this._selectedOptionLi().find("a:eq(0)").html());this.list.attr("aria-activedescendant",d)},_refreshPosition:function(){var e=this.options;if(e.style=="popup"&&!e.positionOptions.offset){var d=this._selectedOptionLi();var b="0 -"+(d.outerHeight()+d.offset().top-this.list.offset().top)}this.list.css({zIndex:this.element.zIndex()}).position({of:e.positionOptions.of||this.newelement,my:e.positionOptions.my,at:e.positionOptions.at,offset:e.positionOptions.offset||b})}})})(jQuery);(function(b,d){var a=0;b.widget("ech.multiselect",{options:{header:true,height:175,minWidth:225,classes:"",checkAllText:"Check all",uncheckAllText:"Uncheck all",noneSelectedText:"Select options",selectedText:"# selected",selectedList:0,show:null,hide:null,autoOpen:false,multiple:true,position:{}},_create:function(){var h=this.element.hide(),k=this.options;this.speed=b.fx.speeds._default;this._isOpen=false;var g=(this.button=b('<button type="button"><span class="ui-icon ui-icon-triangle-1-s"></span></button>')).addClass("ui-multiselect ui-widget ui-state-default ui-corner-all").addClass(k.classes).attr({title:h.attr("title"),"aria-haspopup":true,tabIndex:h.attr("tabIndex")}).insertAfter(h),e=(this.buttonlabel=b("<span />")).html(k.noneSelectedText).appendTo(g),j=(this.menu=b("<div />")).attr("id","rup-multiCombo_"+b(this.element).attr("id")).addClass("ui-multiselect-menu ui-widget ui-widget-content ui-corner-all").addClass(k.classes).appendTo(document.body),m=(this.header=b("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(j),f=(this.headerLinkContainer=b("<ul />")).addClass("ui-helper-reset").html(function(){if(k.header===true){return'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+k.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+k.uncheckAllText+"</span></a></li>"}else{if(typeof k.header==="string"){return"<li>"+k.header+"</li>"}else{return""}}}).append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>').appendTo(m),l=(this.checkboxContainer=b("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(j);this._bindEvents();this.refresh(true);if(!k.multiple){j.addClass("ui-multiselect-single")}},_init:function(){if(this.options.header===false){this.header.hide()}if(!this.options.multiple){this.headerLinkContainer.find(".ui-multiselect-all, .ui-multiselect-none").hide()}if(this.options.autoOpen){this.open()}if(this.element.is(":disabled")){this.disable()}},refresh:function(k){var g=this.element,j=this.options,h=this.menu,m=this.checkboxContainer,e=[],f="",l=g.attr("id")||a++;g.find("option").each(function(p){var q=b(this),v=this.parentNode,t=this.innerHTML,x=this.title,u=this.value,o="ui-multiselect-"+(this.id||l+"-option-"+p),y=this.disabled,n=this.selected,s=["ui-corner-all"],r=(y?"ui-multiselect-disabled ":" ")+this.className,w;if(v.tagName==="OPTGROUP"){w=v.getAttribute("label");if(b.inArray(w,e)===-1){f+='<li class="ui-multiselect-optgroup-label '+v.className+'"><a href="#">'+w+"</a></li>";e.push(w)}}if(y){s.push("ui-state-disabled")}if(n&&!j.multiple){s.push("ui-state-active")}f+='<li class="'+r+'">';f+='<label for="'+o+'" title="'+x+'" class="'+s.join(" ")+'">';f+='<input id="'+o+'" name="multiselect_'+l+'" type="'+(j.multiple?"checkbox":"radio")+'" value="'+u+'" title="'+t+'"';if(n){f+=' checked="checked"';f+=' aria-selected="true"'}if(y){f+=' disabled="disabled"';f+=' aria-disabled="true"'}f+=" /><span>"+t+"</span></label></li>"});m.html(f);this.labels=h.find("label");this.inputs=this.labels.children("input");this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();if(!k){this._trigger("refresh")}},update:function(){var j=this.options,f=this.inputs,e=f.filter(":checked"),g=e.length,h;if(g===0){h=j.noneSelectedText}else{if(b.isFunction(j.selectedText)){h=j.selectedText.call(this,g,f.length,e.get())}else{if(/\d/.test(j.selectedList)&&j.selectedList>0&&g<=j.selectedList){h=e.map(function(){return b(this).next().html()}).get().join(", ")}else{h=j.selectedText.replace("#",g).replace("#",f.length)}}}this.buttonlabel.html(h);return h},_bindEvents:function(){var e=this,f=this.button;function g(){e[e._isOpen?"close":"open"]();return false}f.find("span").bind("click.multiselect",g);f.bind({click:g,keypress:function(h){switch(h.which){case 27:case 38:case 37:e.close();break;case 39:case 40:e.open();break}},mouseenter:function(){if(!f.hasClass("ui-state-disabled")){b(this).addClass("ui-state-hover")}},mouseleave:function(){b(this).removeClass("ui-state-hover")},focus:function(){if(!f.hasClass("ui-state-disabled")){b(this).addClass("ui-state-focus")}},blur:function(){b(this).removeClass("ui-state-focus")}});this.header.delegate("a","click.multiselect",function(h){if(b(this).hasClass("ui-multiselect-close")){e.close()}else{e[b(this).hasClass("ui-multiselect-all")?"checkAll":"uncheckAll"]()}h.preventDefault()});this.menu.delegate("li.ui-multiselect-optgroup-label a","click.multiselect",function(m){m.preventDefault();var l=b(this),k=l.parent().nextUntil("li.ui-multiselect-optgroup-label").find("input:visible:not(:disabled)"),h=k.get(),j=l.parent().text();if((e._trigger("beforeoptgrouptoggle",m,{inputs:h,label:j})===false)||(!h.length)){return}e._toggleChecked(k.filter(":checked").length!==k.length,k);e._trigger("optgrouptoggle",m,{inputs:h,label:j,checked:h[0].checked})}).delegate("label","mouseenter.multiselect",function(){if(!b(this).hasClass("ui-state-disabled")){e.labels.removeClass("ui-state-hover");b(this).addClass("ui-state-hover").find("input:not(:disabled)").focus()}}).delegate("label","keydown.multiselect",function(h){h.preventDefault();switch(h.which){case 9:case 27:e.close();break;case 38:case 40:case 37:case 39:e._traverse(h.which,this);break;case 13:b(this).find("input")[0].click();break}}).delegate('input[type="checkbox"], input[type="radio"]',"click.multiselect",function(l){var k=b(this),m=this.value,j=this.checked,h=e.element.find("option");if(this.disabled||e._trigger("click",l,{value:m,text:this.title,checked:j})===false){l.preventDefault();return}k.focus();k.attr("aria-selected",j);h.each(function(){if(this.value===m){this.selected=j}else{if(!e.options.multiple){this.selected=false}}});if(!e.options.multiple){e.labels.removeClass("ui-state-active");k.closest("label").toggleClass("ui-state-active",j);e.close()}e.element.trigger("change");setTimeout(b.proxy(e.update,e),10)});b(document).bind("mousedown.multiselect",function(h){if(e._isOpen&&!b.contains(e.menu[0],h.target)&&!b.contains(e.button[0],h.target)&&h.target!==e.button[0]){e.close()}});b(this.element[0].form).bind("reset.multiselect",function(){setTimeout(b.proxy(e.refresh,e),10)})},_setButtonWidth:function(){var e=this.element.outerWidth(),f=this.options;if(/\d/.test(f.minWidth)&&e<f.minWidth){e=f.minWidth}this.button.width(e)},_setMenuWidth:function(){var e=this.menu,f=this.button.outerWidth()-parseInt(e.css("padding-left"),10)-parseInt(e.css("padding-right"),10)-parseInt(e.css("border-right-width"),10)-parseInt(e.css("border-left-width"),10);e.width(f||this.button.outerWidth())},_traverse:function(j,k){var g=b(k),f=j===38||j===37,e=g.parent()[f?"prevAll":"nextAll"]("li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)")[f?"last":"first"]();if(!e.length){var h=this.menu.find("ul").last();this.menu.find("label")[f?"last":"first"]().trigger("mouseover");h.scrollTop(f?h.height():0)}else{e.find("label").trigger("mouseover")}},_toggleState:function(f,e){return function(){if(!this.disabled){this[f]=e}if(e){this.setAttribute("aria-selected",true)}else{this.removeAttribute("aria-selected")}}},_toggleChecked:function(e,j){var h=(j&&j.length)?j:this.labels.find("input:enabled"),g=this;h.each(this._toggleState("checked",e));h.eq(0).focus();this.update();var f=h.map(function(){return this.value}).get();this.element.find("option").each(function(){if(!this.disabled&&b.inArray(this.value,f)>-1){g._toggleState("selected",e).call(this)}});if(h.length){this.element.trigger("change")}},_toggleDisabled:function(f){this.button.attr({disabled:f,"aria-disabled":f})[f?"addClass":"removeClass"]("ui-state-disabled");var e=this.menu.find("input");var g="ech-multiselect-disabled";if(f){e=e.filter(":enabled").data(g,true)}else{e=e.filter(function(){return b.data(this,g)===true}).removeData(g)}e.attr({disabled:f,"arial-disabled":f}).parent()[f?"addClass":"removeClass"]("ui-state-disabled");this.element.attr({disabled:f,"aria-disabled":f})},open:function(k){var p=this,j=this.button,f=this.menu,h=this.speed,g=this.options,l=[];if(this._trigger("beforeopen")===false||j.hasClass("ui-state-disabled")||this._isOpen){return}var n=f.find("ul").last(),q=g.show,m=j.offset();if(b.isArray(g.show)){q=g.show[0];h=g.show[1]||p.speed}if(q){l=[q,h]}n.scrollTop(0).height(g.height);if(b.ui.position&&!b.isEmptyObject(g.position)){g.position.of=g.position.of||j;f.show().position(g.position).hide()}else{f.css({top:m.top+j.outerHeight(),left:m.left})}f.show();this.labels.eq(0).trigger("mouseover").trigger("mouseenter").find("input:enabled").trigger("focus");j.addClass("ui-state-active");this._isOpen=true;this._trigger("open")},close:function(){if(this._trigger("beforeclose")===false){return}var h=this.options,f=h.hide,g=this.speed,e=[];if(b.isArray(h.hide)){f=h.hide[0];g=h.hide[1]||this.speed}if(f){e=[f,g]}b.fn.hide.apply(this.menu,e);this.button.removeClass("ui-state-active").trigger("blur").trigger("mouseleave");this._isOpen=false;this._trigger("close")},enable:function(){this._toggleDisabled(false)},disable:function(){this._toggleDisabled(true)},checkAll:function(f){this._toggleChecked(true);this._trigger("checkAll")},uncheckAll:function(){this._toggleChecked(false);this._trigger("uncheckAll")},getChecked:function(){return this.menu.find("input").filter(":checked")},destroy:function(){b.Widget.prototype.destroy.call(this);this.button.remove();this.menu.remove();this.element.show();return this},isOpen:function(){return this._isOpen},widget:function(){return this.menu},getButton:function(){return this.button},_setOption:function(e,f){var g=this.menu;switch(e){case"header":g.find("div.ui-multiselect-header")[f?"show":"hide"]();break;case"checkAllText":g.find("a.ui-multiselect-all span").eq(-1).text(f);break;case"uncheckAllText":g.find("a.ui-multiselect-none span").eq(-1).text(f);break;case"height":g.find("ul").last().height(parseInt(f,10));break;case"minWidth":this.options[e]=parseInt(f,10);this._setButtonWidth();this._setMenuWidth();break;case"selectedText":case"selectedList":case"noneSelectedText":this.options[e]=f;this.update();break;case"classes":g.add(this.button).removeClass(this.options.classes).addClass(f);break;case"multiple":g.toggleClass("ui-multiselect-single",!f);this.options.multiple=f;this.element[0].multiple=f;this.refresh()}b.Widget.prototype._setOption.apply(this,arguments)}})})(jQuery);(function($){$.jgrid=$.jgrid||{};$.extend($.jgrid,{version:"4.4.4",htmlDecode:function(value){if(value&&(value=="&nbsp;"||value=="&#160;"||(value.length===1&&value.charCodeAt(0)===160))){return""}return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/\"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},format:function(format){var args=$.makeArray(arguments).slice(1);if(format==null){format=""}return format.replace(/\{(\d+)\}/g,function(m,i){return args[i]})},msie:navigator.appName=="Microsoft Internet Explorer",msiever:function(){var rv=-1;var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){rv=parseFloat(RegExp.$1)}return rv},getCellIndex:function(cell){var c=$(cell);if(c.is("tr")){return -1}c=(!c.is("td")&&!c.is("th")?c.closest("td,th"):c)[0];if($.jgrid.msie){return $.inArray(c,c.parentNode.cells)}return c.cellIndex},stripHtml:function(v){v=String(v);var regexp=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(v){v=v.replace(regexp,"");return(v&&v!=="&nbsp;"&&v!=="&#160;")?v.replace(/\"/g,"'"):""}return v},stripPref:function(pref,id){var obj=$.type(pref);if(obj=="string"||obj=="number"){pref=String(pref);id=pref!==""?String(id).replace(String(pref),""):id}return id},stringToDoc:function(xmlString){var xmlDoc;if(typeof xmlString!=="string"){return xmlString}try{var parser=new DOMParser();xmlDoc=parser.parseFromString(xmlString,"text/xml")}catch(e){xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;xmlDoc.loadXML(xmlString)}return(xmlDoc&&xmlDoc.documentElement&&xmlDoc.documentElement.tagName!="parsererror")?xmlDoc:null},parse:function(jsonString){var js=jsonString;if(js.substr(0,9)=="while(1);"){js=js.substr(9)}if(js.substr(0,2)=="/*"){js=js.substr(2,js.length-4)}if(!js){js="{}"}return($.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function")?JSON.parse(js):eval("("+js+")")},parseDate:function(format,date){var tsp={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},k,hl,dM,regdate=/[\\\/:_;.,\t\T\s-]/;if(date&&date!=null){date=$.trim(date);date=date.split(regdate);if($.jgrid.formatter.date.masks[format]!==undefined){format=$.jgrid.formatter.date.masks[format]}format=format.split(regdate);var dfmt=$.jgrid.formatter.date.monthNames;var afmt=$.jgrid.formatter.date.AmPm;var h12to24=function(ampm,h){if(ampm===0){if(h===12){h=0}}else{if(h!==12){h+=12}}return h};for(k=0,hl=format.length;k<hl;k++){if(format[k]=="M"){dM=$.inArray(date[k],dfmt);if(dM!==-1&&dM<12){date[k]=dM+1;tsp.m=date[k]}}if(format[k]=="F"){dM=$.inArray(date[k],dfmt);if(dM!==-1&&dM>11){date[k]=dM+1-12;tsp.m=date[k]}}if(format[k]=="a"){dM=$.inArray(date[k],afmt);if(dM!==-1&&dM<2&&date[k]==afmt[dM]){date[k]=dM;tsp.h=h12to24(date[k],tsp.h)}}if(format[k]=="A"){dM=$.inArray(date[k],afmt);if(dM!==-1&&dM>1&&date[k]==afmt[dM]){date[k]=dM-2;tsp.h=h12to24(date[k],tsp.h)}}if(format[k]==="g"){tsp.h=parseInt(date[k],10)}if(date[k]!==undefined){tsp[format[k].toLowerCase()]=parseInt(date[k],10)}}tsp.m=parseInt(tsp.m,10)-1;var ty=tsp.y;if(ty>=70&&ty<=99){tsp.y=1900+tsp.y}else{if(ty>=0&&ty<=69){tsp.y=2000+tsp.y}}if(tsp.j!==undefined){tsp.d=tsp.j}if(tsp.n!==undefined){tsp.m=parseInt(tsp.n,10)-1}}return new Date(tsp.y,tsp.m,tsp.d,tsp.h,tsp.i,tsp.s,tsp.u)},jqID:function(sid){return String(sid).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")},guid:1,uidPref:"jqg",randId:function(prefix){return(prefix||$.jgrid.uidPref)+($.jgrid.guid++)},getAccessor:function(obj,expr){var ret,p,prm=[],i;if(typeof expr==="function"){return expr(obj)}ret=obj[expr];if(ret===undefined){try{if(typeof expr==="string"){prm=expr.split(".")}i=prm.length;if(i){ret=obj;while(ret&&i--){p=prm.shift();ret=ret[p]}}}catch(e){}}return ret},getXmlData:function(obj,expr,returnObj){var ret,m=typeof expr==="string"?expr.match(/^(.*)\[(\w+)\]$/):null;if(typeof expr==="function"){return expr(obj)}if(m&&m[2]){return m[1]?$(m[1],obj).attr(m[2]):$(obj).attr(m[2])}ret=$(expr,obj);if(returnObj){return ret}return ret.length>0?$(ret).text():undefined},cellWidth:function(){var $testDiv=$("<div class='ui-jqgrid' style='left:10000px'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;'></td></tr></table></div>"),testCell=$testDiv.appendTo("body").find("td").width();$testDiv.remove();return testCell!==5},cell_width:true,ajaxOptions:{},from:function(source){var QueryObject=function(d,q){if(typeof d==="string"){d=$.data(d)}var self=this,_data=d,_usecase=true,_trim=false,_query=q,_stripNum=/[\$,%]/g,_lastCommand=null,_lastField=null,_orDepth=0,_negate=false,_queuedOperator="",_sorting=[],_useProperties=true;if(typeof d==="object"&&d.push){if(d.length>0){if(typeof d[0]!=="object"){_useProperties=false}else{_useProperties=true}}}else{throw"data provides is not an array"}this._hasData=function(){return _data===null?false:_data.length===0?false:true};this._getStr=function(s){var phrase=[];if(_trim){phrase.push("jQuery.trim(")}phrase.push("String("+s+")");if(_trim){phrase.push(")")}if(!_usecase){phrase.push(".toLowerCase()")}return phrase.join("")};this._strComp=function(val){if(typeof val==="string"){return".toString()"}return""};this._group=function(f,u){return({field:f.toString(),unique:u,items:[]})};this._toStr=function(phrase){if(_trim){phrase=$.trim(phrase)}phrase=phrase.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"');return _usecase?phrase:phrase.toLowerCase()};this._funcLoop=function(func){var results=[];$.each(_data,function(i,v){results.push(func(v))});return results};this._append=function(s){var i;if(_query===null){_query=""}else{_query+=_queuedOperator===""?" && ":_queuedOperator}for(i=0;i<_orDepth;i++){_query+="("}if(_negate){_query+="!"}_query+="("+s+")";_negate=false;_queuedOperator="";_orDepth=0};this._setCommand=function(f,c){_lastCommand=f;_lastField=c};this._resetNegate=function(){_negate=false};this._repeatCommand=function(f,v){if(_lastCommand===null){return self}if(f!==null&&v!==null){return _lastCommand(f,v)}if(_lastField===null){return _lastCommand(f)}if(!_useProperties){return _lastCommand(f)}return _lastCommand(_lastField,f)};this._equals=function(a,b){return(self._compare(a,b,1)===0)};this._compare=function(a,b,d){var toString=Object.prototype.toString;if(d===undefined){d=1}if(a===undefined){a=null}if(b===undefined){b=null}if(a===null&&b===null){return 0}if(a===null&&b!==null){return 1}if(a!==null&&b===null){return -1}if(toString.call(a)==="[object Date]"&&toString.call(b)==="[object Date]"){if(a<b){return -d}if(a>b){return d}return 0}if(!_usecase&&typeof a!=="number"&&typeof b!=="number"){a=String(a);b=String(b)}if(a<b){return -d}if(a>b){return d}return 0};this._performSort=function(){if(_sorting.length===0){return}_data=self._doSort(_data,0)};this._doSort=function(d,q){var by=_sorting[q].by,dir=_sorting[q].dir,type=_sorting[q].type,dfmt=_sorting[q].datefmt;if(q==_sorting.length-1){return self._getOrder(d,by,dir,type,dfmt)}q++;var values=self._getGroup(d,by,dir,type,dfmt),results=[],i,j,sorted;for(i=0;i<values.length;i++){sorted=self._doSort(values[i].items,q);for(j=0;j<sorted.length;j++){results.push(sorted[j])}}return results};this._getOrder=function(data,by,dir,type,dfmt){var sortData=[],_sortData=[],newDir=dir=="a"?1:-1,i,ab,j,findSortKey;if(type===undefined){type="text"}if(type=="float"||type=="number"||type=="currency"||type=="numeric"){findSortKey=function($cell){var key=parseFloat(String($cell).replace(_stripNum,""));return isNaN(key)?0:key}}else{if(type=="int"||type=="integer"){findSortKey=function($cell){return $cell?parseFloat(String($cell).replace(_stripNum,"")):0}}else{if(type=="date"||type=="datetime"){findSortKey=function($cell){return $.jgrid.parseDate(dfmt,$cell).getTime()}}else{if($.isFunction(type)){findSortKey=type}else{findSortKey=function($cell){$cell=$cell?$.trim(String($cell)):"";return _usecase?$cell:$cell.toLowerCase()}}}}}$.each(data,function(i,v){ab=by!==""?$.jgrid.getAccessor(v,by):v;if(ab===undefined){ab=""}ab=findSortKey(ab,v);_sortData.push({vSort:ab,index:i})});_sortData.sort(function(a,b){a=a.vSort;b=b.vSort;return self._compare(a,b,newDir)});j=0;var nrec=data.length;while(j<nrec){i=_sortData[j].index;sortData.push(data[i]);j++}return sortData};this._getGroup=function(data,by,dir,type,dfmt){var results=[],group=null,last=null,val;$.each(self._getOrder(data,by,dir,type,dfmt),function(i,v){val=$.jgrid.getAccessor(v,by);if(val==null){val=""}if(!self._equals(last,val)){last=val;if(group!==null){results.push(group)}group=self._group(by,val)}group.items.push(v)});if(group!==null){results.push(group)}return results};this.ignoreCase=function(){_usecase=false;return self};this.useCase=function(){_usecase=true;return self};this.trim=function(){_trim=true;return self};this.noTrim=function(){_trim=false;return self};this.execute=function(){var match=_query,results=[];if(match===null){return self}$.each(_data,function(){if(eval(match)){results.push(this)}});_data=results;return self};this.data=function(){return _data};this.select=function(f){self._performSort();if(!self._hasData()){return[]}self.execute();if($.isFunction(f)){var results=[];$.each(_data,function(i,v){results.push(f(v))});return results}return _data};this.hasMatch=function(){if(!self._hasData()){return false}self.execute();return _data.length>0};this.andNot=function(f,v,x){_negate=!_negate;return self.and(f,v,x)};this.orNot=function(f,v,x){_negate=!_negate;return self.or(f,v,x)};this.not=function(f,v,x){return self.andNot(f,v,x)};this.and=function(f,v,x){_queuedOperator=" && ";if(f===undefined){return self}return self._repeatCommand(f,v,x)};this.or=function(f,v,x){_queuedOperator=" || ";if(f===undefined){return self}return self._repeatCommand(f,v,x)};this.orBegin=function(){_orDepth++;return self};this.orEnd=function(){if(_query!==null){_query+=")"}return self};this.isNot=function(f){_negate=!_negate;return self.is(f)};this.is=function(f){self._append("this."+f);self._resetNegate();return self};this._compareValues=function(func,f,v,how,t){var fld;if(_useProperties){fld="jQuery.jgrid.getAccessor(this,'"+f+"')"}else{fld="this"}if(v===undefined){v=null}var val=v,swst=t.stype===undefined?"text":t.stype;if(v!==null){switch(swst){case"int":case"integer":val=(isNaN(Number(val))||val==="")?"0":val;fld="parseInt("+fld+",10)";val="parseInt("+val+",10)";break;case"float":case"number":case"numeric":val=String(val).replace(_stripNum,"");val=(isNaN(Number(val))||val==="")?"0":val;fld="parseFloat("+fld+")";val="parseFloat("+val+")";break;case"date":case"datetime":val=String($.jgrid.parseDate(t.newfmt||"Y-m-d",val).getTime());fld='jQuery.jgrid.parseDate("'+t.srcfmt+'",'+fld+").getTime()";break;default:fld=self._getStr(fld);val=self._getStr('"'+self._toStr(val)+'"')}}self._append(fld+" "+how+" "+val);self._setCommand(func,f);self._resetNegate();return self};this.equals=function(f,v,t){return self._compareValues(self.equals,f,v,"==",t)};this.notEquals=function(f,v,t){return self._compareValues(self.equals,f,v,"!==",t)};this.isNull=function(f,v,t){return self._compareValues(self.equals,f,null,"===",t)};this.greater=function(f,v,t){return self._compareValues(self.greater,f,v,">",t)};this.less=function(f,v,t){return self._compareValues(self.less,f,v,"<",t)};this.greaterOrEquals=function(f,v,t){return self._compareValues(self.greaterOrEquals,f,v,">=",t)};this.lessOrEquals=function(f,v,t){return self._compareValues(self.lessOrEquals,f,v,"<=",t)};this.startsWith=function(f,v){var val=(v==null)?f:v,length=_trim?$.trim(val.toString()).length:val.toString().length;if(_useProperties){self._append(self._getStr("jQuery.jgrid.getAccessor(this,'"+f+"')")+".substr(0,"+length+") == "+self._getStr('"'+self._toStr(v)+'"'))}else{length=_trim?$.trim(v.toString()).length:v.toString().length;self._append(self._getStr("this")+".substr(0,"+length+") == "+self._getStr('"'+self._toStr(f)+'"'))}self._setCommand(self.startsWith,f);self._resetNegate();return self};this.endsWith=function(f,v){var val=(v==null)?f:v,length=_trim?$.trim(val.toString()).length:val.toString().length;if(_useProperties){self._append(self._getStr("jQuery.jgrid.getAccessor(this,'"+f+"')")+".substr("+self._getStr("jQuery.jgrid.getAccessor(this,'"+f+"')")+".length-"+length+","+length+') == "'+self._toStr(v)+'"')}else{self._append(self._getStr("this")+".substr("+self._getStr("this")+'.length-"'+self._toStr(f)+'".length,"'+self._toStr(f)+'".length) == "'+self._toStr(f)+'"')}self._setCommand(self.endsWith,f);self._resetNegate();return self};this.contains=function(f,v){if(_useProperties){self._append(self._getStr("jQuery.jgrid.getAccessor(this,'"+f+"')")+'.indexOf("'+self._toStr(v)+'",0) > -1')}else{self._append(self._getStr("this")+'.indexOf("'+self._toStr(f)+'",0) > -1')}self._setCommand(self.contains,f);self._resetNegate();return self};this.groupBy=function(by,dir,type,datefmt){if(!self._hasData()){return null}return self._getGroup(_data,by,dir,type,datefmt)};this.orderBy=function(by,dir,stype,dfmt){dir=dir==null?"a":$.trim(dir.toString().toLowerCase());if(stype==null){stype="text"}if(dfmt==null){dfmt="Y-m-d"}if(dir=="desc"||dir=="descending"){dir="d"}if(dir=="asc"||dir=="ascending"){dir="a"}_sorting.push({by:by,dir:dir,type:stype,datefmt:dfmt});return self};return self};return new QueryObject(source,null)},getMethod:function(name){return this.getAccessor($.fn.jqGrid,name)},extend:function(methods){$.extend($.fn.jqGrid,methods);if(!this.no_legacy_api){$.fn.extend(methods)}}});$.fn.jqGrid=function(pin){if(typeof pin==="string"){var fn=$.jgrid.getMethod(pin);if(!fn){throw ("jqGrid - No such method: "+pin)}var args=$.makeArray(arguments).slice(1);return fn.apply(this,args)}return this.each(function(){if(this.grid){return}var p=$.extend(true,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:true,pginput:true,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:false,selarrrow:[],savedRow:[],shrinkToFit:true,xmlReader:{},jsonReader:{},subGrid:false,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,onInitGrid:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,beforeProcessing:null,onHeaderClick:null,viewrecords:false,loadonce:false,multiselect:false,multikey:false,editurl:null,search:false,caption:"",hidegrid:true,hiddengrid:false,postData:{},userData:{},treeGrid:false,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:false,gridstate:"visible",cellEdit:false,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[false,""],scroll:false,multiboxonly:false,deselectAfterSort:true,scrollrows:false,autowidth:false,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:false,rownumWidth:25,rownumbers:false,pagerpos:"center",recordpos:"right",footerrow:false,userDataOnFooter:false,hoverrows:true,altclass:"ui-priority-secondary",viewsortcols:[false,"vertical",true],resizeclass:"",autoencode:false,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:false,headertitles:false,scrollTimeout:40,data:[],_index:{},grouping:false,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:false,sortitems:[],sortnames:[],summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus",minusicon:"ui-icon-circlesmall-minus",displayField:[]},ignoreCase:false,cmTemplate:{},idPrefix:""},$.jgrid.defaults,pin||{});var ts=this,grid={headers:[],cols:[],footers:[],dragStart:function(i,x,y){this.resizing={idx:i,startX:x.clientX,sOL:y[0]};this.hDiv.style.cursor="col-resize";this.curGbox=$("#rs_m"+$.jgrid.jqID(p.id),"#gbox_"+$.jgrid.jqID(p.id));this.curGbox.css({display:"block",left:y[0],top:y[1],height:y[2]});$(ts).triggerHandler("jqGridResizeStart",[x,i]);if($.isFunction(p.resizeStart)){p.resizeStart.call(this,x,i)}document.onselectstart=function(){return false}},dragMove:function(x){if(this.resizing){var diff=x.clientX-this.resizing.startX,h=this.headers[this.resizing.idx],newWidth=p.direction==="ltr"?h.width+diff:h.width-diff,hn,nWn;if(newWidth>33){this.curGbox.css({left:this.resizing.sOL+diff});if(p.forceFit===true){hn=this.headers[this.resizing.idx+p.nv];nWn=p.direction==="ltr"?hn.width-diff:hn.width+diff;if(nWn>33){h.newWidth=newWidth;hn.newWidth=nWn}}else{this.newWidth=p.direction==="ltr"?p.tblwidth+diff:p.tblwidth-diff;h.newWidth=newWidth}}}},dragEnd:function(){this.hDiv.style.cursor="default";if(this.resizing){var idx=this.resizing.idx,nw=this.headers[idx].newWidth||this.headers[idx].width;nw=parseInt(nw,10);this.resizing=false;$("#rs_m"+$.jgrid.jqID(p.id)).css("display","none");p.colModel[idx].width=nw;this.headers[idx].width=nw;this.headers[idx].el.style.width=nw+"px";this.cols[idx].style.width=nw+"px";if(this.footers.length>0){this.footers[idx].style.width=nw+"px"}if(p.forceFit===true){nw=this.headers[idx+p.nv].newWidth||this.headers[idx+p.nv].width;this.headers[idx+p.nv].width=nw;this.headers[idx+p.nv].el.style.width=nw+"px";this.cols[idx+p.nv].style.width=nw+"px";if(this.footers.length>0){this.footers[idx+p.nv].style.width=nw+"px"}p.colModel[idx+p.nv].width=nw}else{p.tblwidth=this.newWidth||p.tblwidth;$("table:first",this.bDiv).css("width",p.tblwidth+"px");$("table:first",this.hDiv).css("width",p.tblwidth+"px");this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(p.footerrow){$("table:first",this.sDiv).css("width",p.tblwidth+"px");this.sDiv.scrollLeft=this.bDiv.scrollLeft}}$(ts).triggerHandler("jqGridResizeStop",[nw,idx]);if($.isFunction(p.resizeStop)){p.resizeStop.call(this,nw,idx)}}this.curGbox=null;document.onselectstart=function(){return true}},populateVisible:function(){if(grid.timer){clearTimeout(grid.timer)}grid.timer=null;var dh=$(grid.bDiv).height();if(!dh){return}var table=$("table:first",grid.bDiv);var rows,rh;if(table[0].rows.length){try{rows=table[0].rows[1];rh=rows?$(rows).outerHeight()||grid.prevRowHeight:grid.prevRowHeight}catch(pv){rh=grid.prevRowHeight}}if(!rh){return}grid.prevRowHeight=rh;var rn=p.rowNum;var scrollTop=grid.scrollTop=grid.bDiv.scrollTop;var ttop=Math.round(table.position().top)-scrollTop;var tbot=ttop+table.height();var div=rh*rn;var page,npage,empty;if(tbot<dh&&ttop<=0&&(p.lastpage===undefined||parseInt((tbot+scrollTop+div-1)/div,10)<=p.lastpage)){npage=parseInt((dh-tbot+div-1)/div,10);if(tbot>=0||npage<2||p.scroll===true){page=Math.round((tbot+scrollTop)/div)+1;ttop=-1}else{ttop=1}}if(ttop>0){page=parseInt(scrollTop/div,10)+1;npage=parseInt((scrollTop+dh)/div,10)+2-page;empty=true}if(npage){if(p.lastpage&&(page>p.lastpage||p.lastpage==1||(page===p.page&&page===p.lastpage))){return}if(grid.hDiv.loading){grid.timer=setTimeout(grid.populateVisible,p.scrollTimeout)}else{p.page=page;if(empty){grid.selectionPreserver(table[0]);grid.emptyRows.call(table[0],false,false)}grid.populate(npage)}}},scrollGrid:function(e){if(p.scroll){var scrollTop=grid.bDiv.scrollTop;if(grid.scrollTop===undefined){grid.scrollTop=0}if(scrollTop!=grid.scrollTop){grid.scrollTop=scrollTop;if(grid.timer){clearTimeout(grid.timer)}grid.timer=setTimeout(grid.populateVisible,p.scrollTimeout)}}grid.hDiv.scrollLeft=grid.bDiv.scrollLeft;if(p.footerrow){grid.sDiv.scrollLeft=grid.bDiv.scrollLeft}if(e){e.stopPropagation()}},selectionPreserver:function(ts){var p=ts.p,sr=p.selrow,sra=p.selarrrow?$.makeArray(p.selarrrow):null,left=ts.grid.bDiv.scrollLeft,restoreSelection=function(){var i;p.selrow=null;p.selarrrow=[];if(p.multiselect&&sra&&sra.length>0){for(i=0;i<sra.length;i++){if(sra[i]!=sr){$(ts).jqGrid("setSelection",sra[i],false,null)}}}if(sr){$(ts).jqGrid("setSelection",sr,false,null)}ts.grid.bDiv.scrollLeft=left;$(ts).unbind(".selectionPreserver",restoreSelection)};$(ts).bind("jqGridGridComplete.selectionPreserver",restoreSelection)}};if(this.tagName.toUpperCase()!="TABLE"){alert("Element is not a table");return}if(document.documentMode!==undefined){if(document.documentMode<=5){alert("Grid can not be used in this ('quirks') mode!");return}}$(this).empty().attr("tabindex","0");this.p=p;this.p.useProp=!!$.fn.prop;var i,dir;if(this.p.colNames.length===0){for(i=0;i<this.p.colModel.length;i++){this.p.colNames[i]=this.p.colModel[i].label||this.p.colModel[i].name}}if(this.p.colNames.length!==this.p.colModel.length){alert($.jgrid.errors.model);return}var gv=$("<div class='ui-jqgrid-view'></div>"),isMSIE=$.jgrid.msie;ts.p.direction=$.trim(ts.p.direction.toLowerCase());if($.inArray(ts.p.direction,["ltr","rtl"])==-1){ts.p.direction="ltr"}dir=ts.p.direction;$(gv).insertBefore(this);$(this).removeClass("scroll").appendTo(gv);var eg=$("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");$(eg).attr({id:"gbox_"+this.id,dir:dir}).insertBefore(gv);$(gv).attr("id","gview_"+this.id).appendTo(eg);$("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").insertBefore(gv);$("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(gv);$(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});var sortkeys=["shiftKey","altKey","ctrlKey"],intNum=function(val,defval){val=parseInt(val,10);if(isNaN(val)){return defval||0}return val},formatCol=function(pos,rowInd,tv,rawObject,rowId,rdata){var cm=ts.p.colModel[pos],ral=cm.align,result='style="',clas=cm.classes,nm=cm.name,celp,acp=[];if(ral){result+="text-align:"+ral+";"}if(cm.hidden===true){result+="display:none;"}if(rowInd===0){result+="width: "+grid.headers[pos].width+"px;"}else{if(cm.cellattr&&$.isFunction(cm.cellattr)){celp=cm.cellattr.call(ts,rowId,tv,rawObject,cm,rdata);if(celp&&typeof celp==="string"){celp=celp.replace(/style/i,"style").replace(/title/i,"title");if(celp.indexOf("title")>-1){cm.title=false}if(celp.indexOf("class")>-1){clas=undefined}acp=celp.split("style");if(acp.length===2){acp[1]=$.trim(acp[1].replace("=",""));if(acp[1].indexOf("'")===0||acp[1].indexOf('"')===0){acp[1]=acp[1].substring(1)}result+=acp[1].replace(/'/gi,'"')}else{result+='"'}}}}if(!acp.length){acp[0]="";result+='"'}result+=(clas!==undefined?(' class="'+clas+'"'):"")+((cm.title&&tv)?(' title="'+$.jgrid.stripHtml(tv)+'"'):"");result+=' aria-describedby="'+ts.p.id+"_"+nm+'"';return result+acp[0]},cellVal=function(val){return val==null||val===""?"&#160;":(ts.p.autoencode?$.jgrid.htmlEncode(val):String(val))},formatter=function(rowId,cellval,colpos,rwdat,_act){var cm=ts.p.colModel[colpos],v;if(cm.formatter!==undefined){rowId=String(ts.p.idPrefix)!==""?$.jgrid.stripPref(ts.p.idPrefix,rowId):rowId;var opts={rowId:rowId,colModel:cm,gid:ts.p.id,pos:colpos};if($.isFunction(cm.formatter)){v=cm.formatter.call(ts,cellval,opts,rwdat,_act)}else{if($.fmatter){v=$.fn.fmatter.call(ts,cm.formatter,cellval,opts,rwdat,_act)}else{v=cellVal(cellval)}}}else{v=cellVal(cellval)}return v},addCell=function(rowId,cell,pos,irow,srvr,rdata){var v,prp;v=formatter(rowId,cell,pos,srvr,"add");prp=formatCol(pos,irow,v,srvr,rowId,rdata);return'<td role="gridcell" '+prp+">"+v+"</td>"},addMulti=function(rowid,pos,irow,checked){var v='<input role="checkbox" type="checkbox" id="jqg_'+ts.p.id+"_"+rowid+'" class="cbox" name="jqg_'+ts.p.id+"_"+rowid+'"'+(checked?'checked="checked"':"")+"/>",prp=formatCol(pos,irow,"",null,rowid,true);return'<td role="gridcell" '+prp+">"+v+"</td>"},addRowNum=function(pos,irow,pG,rN){var v=(parseInt(pG,10)-1)*parseInt(rN,10)+1+irow,prp=formatCol(pos,irow,v,null,irow,true);return'<td role="gridcell" class="ui-state-default jqgrid-rownum" '+prp+">"+v+"</td>"},reader=function(datatype){var field,f=[],j=0,i;for(i=0;i<ts.p.colModel.length;i++){field=ts.p.colModel[i];if(field.name!=="cb"&&field.name!=="subgrid"&&field.name!=="rn"){f[j]=datatype=="local"?field.name:((datatype=="xml"||datatype==="xmlstring")?field.xmlmap||field.name:field.jsonmap||field.name);j++}}return f},orderedCols=function(offset){var order=ts.p.remapColumns;if(!order||!order.length){order=$.map(ts.p.colModel,function(v,i){return i})}if(offset){order=$.map(order,function(v){return v<offset?null:v-offset})}return order},emptyRows=function(scroll,locdata){var firstrow;if(this.p.deepempty){$(this.rows).slice(1).remove()}else{firstrow=this.rows.length>0?this.rows[0]:null;$(this.firstChild).empty().append(firstrow)}if(scroll&&this.p.scroll){$(this.grid.bDiv.firstChild).css({height:"auto"});$(this.grid.bDiv.firstChild.firstChild).css({height:0,display:"none"});if(this.grid.bDiv.scrollTop!==0){this.grid.bDiv.scrollTop=0}}if(locdata===true&&this.p.treeGrid){this.p.data=[];this.p._index={}}},refreshIndex=function(){var datalen=ts.p.data.length,idname,i,val,ni=ts.p.rownumbers===true?1:0,gi=ts.p.multiselect===true?1:0,si=ts.p.subGrid===true?1:0;if(ts.p.keyIndex===false||ts.p.loadonce===true){idname=ts.p.localReader.id}else{idname=ts.p.colModel[ts.p.keyIndex+gi+si+ni].name}for(i=0;i<datalen;i++){val=$.jgrid.getAccessor(ts.p.data[i],idname);if(val===undefined){val=String(i+1)}ts.p._index[val]=i}},constructTr=function(id,hide,altClass,rd,cur,selected){var tabindex="-1",restAttr="",attrName,style=hide?"display:none;":"",classes="ui-widget-content jqgrow ui-row-"+ts.p.direction+altClass+(selected?" ui-state-highlight":""),rowAttrObj=$.isFunction(ts.p.rowattr)?ts.p.rowattr.call(ts,rd,cur):{};if(!$.isEmptyObject(rowAttrObj)){if(rowAttrObj.hasOwnProperty("id")){id=rowAttrObj.id;delete rowAttrObj.id}if(rowAttrObj.hasOwnProperty("tabindex")){tabindex=rowAttrObj.tabindex;delete rowAttrObj.tabindex}if(rowAttrObj.hasOwnProperty("style")){style+=rowAttrObj.style;delete rowAttrObj.style}if(rowAttrObj.hasOwnProperty("class")){classes+=" "+rowAttrObj["class"];delete rowAttrObj["class"]}try{delete rowAttrObj.role}catch(ra){}for(attrName in rowAttrObj){if(rowAttrObj.hasOwnProperty(attrName)){restAttr+=" "+attrName+"="+rowAttrObj[attrName]}}}return'<tr role="row" id="'+id+'" tabindex="'+tabindex+'" class="'+classes+'"'+(style===""?"":' style="'+style+'"')+restAttr+">"},addXmlData=function(xml,t,rcnt,more,adjust){var startReq=new Date(),locdata=(ts.p.datatype!="local"&&ts.p.loadonce)||ts.p.datatype=="xmlstring",xmlid="_id_",xmlRd=ts.p.xmlReader,frd=ts.p.datatype=="local"?"local":"xml";if(locdata){ts.p.data=[];ts.p._index={};ts.p.localReader.id=xmlid}ts.p.reccount=0;if($.isXMLDoc(xml)){if(ts.p.treeANode===-1&&!ts.p.scroll){emptyRows.call(ts,false,true);rcnt=1}else{rcnt=rcnt>1?rcnt:1}}else{return}var self=$(ts),i,fpos,ir=0,v,gi=ts.p.multiselect===true?1:0,si=0,addSubGridCell,ni=ts.p.rownumbers===true?1:0,idn,getId,f=[],F,rd={},xmlr,rid,rowData=[],cn=(ts.p.altRows===true)?" "+ts.p.altclass:"",cn1;if(ts.p.subGrid===true){si=1;addSubGridCell=$.jgrid.getMethod("addSubGridCell")}if(!xmlRd.repeatitems){f=reader(frd)}if(ts.p.keyIndex===false){idn=$.isFunction(xmlRd.id)?xmlRd.id.call(ts,xml):xmlRd.id}else{idn=ts.p.keyIndex}if(f.length>0&&!isNaN(idn)){if(ts.p.remapColumns&&ts.p.remapColumns.length){idn=$.inArray(idn,ts.p.remapColumns)}idn=f[idn]}if(String(idn).indexOf("[")===-1){if(f.length){getId=function(trow,k){return $(idn,trow).text()||k}}else{getId=function(trow,k){return $(xmlRd.cell,trow).eq(idn).text()||k}}}else{getId=function(trow,k){return trow.getAttribute(idn.replace(/[\[\]]/g,""))||k}}ts.p.userData={};ts.p.page=$.jgrid.getXmlData(xml,xmlRd.page)||ts.p.page||0;ts.p.lastpage=$.jgrid.getXmlData(xml,xmlRd.total);if(ts.p.lastpage===undefined){ts.p.lastpage=1}ts.p.records=$.jgrid.getXmlData(xml,xmlRd.records)||0;if($.isFunction(xmlRd.userdata)){ts.p.userData=xmlRd.userdata.call(ts,xml)||{}}else{$.jgrid.getXmlData(xml,xmlRd.userdata,true).each(function(){ts.p.userData[this.getAttribute("name")]=$(this).text()})}var gxml=$.jgrid.getXmlData(xml,xmlRd.root,true);gxml=$.jgrid.getXmlData(gxml,xmlRd.row,true);if(!gxml){gxml=[]}var gl=gxml.length,j=0,grpdata=[],rn=parseInt(ts.p.rowNum,10),br=ts.p.scroll?$.jgrid.randId():1,altr;if(gl>0&&ts.p.page<=0){ts.p.page=1}if(gxml&&gl){if(adjust){rn*=adjust+1}var afterInsRow=$.isFunction(ts.p.afterInsertRow),hiderow=false,groupingPrepare;if(ts.p.grouping){hiderow=ts.p.groupingView.groupCollapse===true;groupingPrepare=$.jgrid.getMethod("groupingPrepare")}while(j<gl){xmlr=gxml[j];rid=getId(xmlr,br+j);rid=ts.p.idPrefix+rid;altr=rcnt===0?0:rcnt+1;cn1=(altr+j)%2==1?cn:"";var iStartTrTag=rowData.length;rowData.push("");if(ni){rowData.push(addRowNum(0,j,ts.p.page,ts.p.rowNum))}if(gi){rowData.push(addMulti(rid,ni,j,false))}if(si){rowData.push(addSubGridCell.call(self,gi+ni,j+rcnt))}if(xmlRd.repeatitems){if(!F){F=orderedCols(gi+si+ni)}var cells=$.jgrid.getXmlData(xmlr,xmlRd.cell,true);$.each(F,function(k){var cell=cells[this];if(!cell){return false}v=cell.textContent||cell.text;rd[ts.p.colModel[k+gi+si+ni].name]=v;rowData.push(addCell(rid,v,k+gi+si+ni,j+rcnt,xmlr,rd))})}else{for(i=0;i<f.length;i++){v=$.jgrid.getXmlData(xmlr,f[i]);rd[ts.p.colModel[i+gi+si+ni].name]=v;rowData.push(addCell(rid,v,i+gi+si+ni,j+rcnt,xmlr,rd))}}rowData[iStartTrTag]=constructTr(rid,hiderow,cn1,rd,xmlr,false);rowData.push("</tr>");if(ts.p.grouping){grpdata=groupingPrepare.call(self,rowData,grpdata,rd,j);rowData=[]}if(locdata||ts.p.treeGrid===true){rd[xmlid]=rid;ts.p.data.push(rd);ts.p._index[rid]=ts.p.data.length-1}if(ts.p.gridview===false){$("tbody:first",t).append(rowData.join(""));self.triggerHandler("jqGridAfterInsertRow",[rid,rd,xmlr]);if(afterInsRow){ts.p.afterInsertRow.call(ts,rid,rd,xmlr)}rowData=[]}rd={};ir++;j++;if(ir==rn){break}}}if(ts.p.gridview===true){fpos=ts.p.treeANode>-1?ts.p.treeANode:0;if(ts.p.grouping){self.jqGrid("groupingRender",grpdata,ts.p.colModel.length);grpdata=null}else{if(ts.p.treeGrid===true&&fpos>0){$(ts.rows[fpos]).after(rowData.join(""))}else{$("tbody:first",t).append(rowData.join(""))}}}if(ts.p.subGrid===true){try{self.jqGrid("addSubGrid",gi+ni)}catch(_){}}ts.p.totaltime=new Date()-startReq;if(ir>0){if(ts.p.records===0){ts.p.records=gl}}rowData=null;if(ts.p.treeGrid===true){try{self.jqGrid("setTreeNode",fpos+1,ir+fpos+1)}catch(e){}}if(!ts.p.treeGrid&&!ts.p.scroll){ts.grid.bDiv.scrollTop=0}ts.p.reccount=ir;ts.p.treeANode=-1;if(ts.p.userDataOnFooter){self.jqGrid("footerData","set",ts.p.userData,true)}if(locdata){ts.p.records=gl;ts.p.lastpage=Math.ceil(gl/rn)}if(!more){ts.updatepager(false,true)}if(locdata){while(ir<gl){xmlr=gxml[ir];rid=getId(xmlr,ir+br);rid=ts.p.idPrefix+rid;if(xmlRd.repeatitems){if(!F){F=orderedCols(gi+si+ni)}var cells2=$.jgrid.getXmlData(xmlr,xmlRd.cell,true);$.each(F,function(k){var cell=cells2[this];if(!cell){return false}v=cell.textContent||cell.text;rd[ts.p.colModel[k+gi+si+ni].name]=v})}else{for(i=0;i<f.length;i++){v=$.jgrid.getXmlData(xmlr,f[i]);rd[ts.p.colModel[i+gi+si+ni].name]=v}}rd[xmlid]=rid;ts.p.data.push(rd);ts.p._index[rid]=ts.p.data.length-1;rd={};ir++}}},addJSONData=function(data,t,rcnt,more,adjust){var startReq=new Date();if(data){if(ts.p.treeANode===-1&&!ts.p.scroll){emptyRows.call(ts,false,true);rcnt=1}else{rcnt=rcnt>1?rcnt:1}}else{return}var dReader,locid="_id_",frd,locdata=(ts.p.datatype!="local"&&ts.p.loadonce)||ts.p.datatype=="jsonstring";if(locdata){ts.p.data=[];ts.p._index={};ts.p.localReader.id=locid}ts.p.reccount=0;if(ts.p.datatype=="local"){dReader=ts.p.localReader;frd="local"}else{dReader=ts.p.jsonReader;frd="json"}var self=$(ts),ir=0,v,i,j,f=[],F,cur,gi=ts.p.multiselect?1:0,si=0,addSubGridCell,ni=ts.p.rownumbers===true?1:0,len,drows,idn,rd={},fpos,idr,rowData=[],cn=(ts.p.altRows===true)?" "+ts.p.altclass:"",cn1,lp;ts.p.page=$.jgrid.getAccessor(data,dReader.page)||ts.p.page||0;lp=$.jgrid.getAccessor(data,dReader.total);if(ts.p.subGrid===true){si=1;addSubGridCell=$.jgrid.getMethod("addSubGridCell")}ts.p.lastpage=lp===undefined?1:lp;ts.p.records=$.jgrid.getAccessor(data,dReader.records)||0;ts.p.userData=$.jgrid.getAccessor(data,dReader.userdata)||{};if(!dReader.repeatitems){F=f=reader(frd)}if(ts.p.keyIndex===false){idn=$.isFunction(dReader.id)?dReader.id.call(ts,data):dReader.id}else{idn=ts.p.keyIndex}if(f.length>0&&!isNaN(idn)){if(ts.p.remapColumns&&ts.p.remapColumns.length){idn=$.inArray(idn,ts.p.remapColumns)}idn=f[idn]}drows=$.jgrid.getAccessor(data,dReader.root);if(!drows){drows=[]}len=drows.length;i=0;if(len>0&&ts.p.page<=0){ts.p.page=1}var rn=parseInt(ts.p.rowNum,10),br=ts.p.scroll?$.jgrid.randId():1,altr,selected=false,selr;if(adjust){rn*=adjust+1}if(ts.p.datatype==="local"&&!ts.p.deselectAfterSort){selected=true}var afterInsRow=$.isFunction(ts.p.afterInsertRow),grpdata=[],hiderow=false,groupingPrepare;if(ts.p.grouping){hiderow=ts.p.groupingView.groupCollapse===true;groupingPrepare=$.jgrid.getMethod("groupingPrepare")}while(i<len){cur=drows[i];idr=$.jgrid.getAccessor(cur,idn);if(idr===undefined){idr=br+i;if(f.length===0){if(dReader.cell){var ccur=$.jgrid.getAccessor(cur,dReader.cell);idr=ccur!==undefined?ccur[idn]||idr:idr;ccur=null}}}idr=ts.p.idPrefix+idr;altr=rcnt===1?0:rcnt;cn1=(altr+i)%2==1?cn:"";if(selected){if(ts.p.multiselect){selr=($.inArray(idr,ts.p.selarrrow)!==-1)}else{selr=(idr===ts.p.selrow)}}var iStartTrTag=rowData.length;rowData.push("");if(ni){rowData.push(addRowNum(0,i,ts.p.page,ts.p.rowNum))}if(gi){rowData.push(addMulti(idr,ni,i,selr))}if(si){rowData.push(addSubGridCell.call(self,gi+ni,i+rcnt))}if(dReader.repeatitems){if(dReader.cell){cur=$.jgrid.getAccessor(cur,dReader.cell)}if(!F){F=orderedCols(gi+si+ni)}}for(j=0;j<F.length;j++){v=$.jgrid.getAccessor(cur,F[j]);rd[ts.p.colModel[j+gi+si+ni].name]=v;rowData.push(addCell(idr,v,j+gi+si+ni,i+rcnt,cur,rd))}rowData[iStartTrTag]=constructTr(idr,hiderow,cn1,rd,cur,selr);rowData.push("</tr>");if(ts.p.grouping){grpdata=groupingPrepare.call(self,rowData,grpdata,rd,i);rowData=[]}if(locdata||ts.p.treeGrid===true){rd[locid]=idr;ts.p.data.push(rd);ts.p._index[idr]=ts.p.data.length-1}if(ts.p.gridview===false){$("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(""));self.triggerHandler("jqGridAfterInsertRow",[idr,rd,cur]);if(afterInsRow){ts.p.afterInsertRow.call(ts,idr,rd,cur)}rowData=[]}rd={};ir++;i++;if(ir==rn){break}}if(ts.p.gridview===true){fpos=ts.p.treeANode>-1?ts.p.treeANode:0;if(ts.p.grouping){self.jqGrid("groupingRender",grpdata,ts.p.colModel.length);grpdata=null}else{if(ts.p.treeGrid===true&&fpos>0){$(ts.rows[fpos]).after(rowData.join(""))}else{$("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(""))}}}if(ts.p.subGrid===true){try{self.jqGrid("addSubGrid",gi+ni)}catch(_){}}ts.p.totaltime=new Date()-startReq;if(ir>0){if(ts.p.records===0){ts.p.records=len}}rowData=null;if(ts.p.treeGrid===true){try{self.jqGrid("setTreeNode",fpos+1,ir+fpos+1)}catch(e){}}if(!ts.p.treeGrid&&!ts.p.scroll){ts.grid.bDiv.scrollTop=0}ts.p.reccount=ir;ts.p.treeANode=-1;if(ts.p.userDataOnFooter){self.jqGrid("footerData","set",ts.p.userData,true)}if(locdata){ts.p.records=len;ts.p.lastpage=Math.ceil(len/rn)}if(!more){ts.updatepager(false,true)}if(locdata){while(ir<len&&drows[ir]){cur=drows[ir];idr=$.jgrid.getAccessor(cur,idn);if(idr===undefined){idr=br+ir;if(f.length===0){if(dReader.cell){var ccur2=$.jgrid.getAccessor(cur,dReader.cell);idr=ccur2[idn]||idr;ccur2=null}}}if(cur){idr=ts.p.idPrefix+idr;if(dReader.repeatitems){if(dReader.cell){cur=$.jgrid.getAccessor(cur,dReader.cell)}if(!F){F=orderedCols(gi+si+ni)}}for(j=0;j<F.length;j++){v=$.jgrid.getAccessor(cur,F[j]);rd[ts.p.colModel[j+gi+si+ni].name]=v}rd[locid]=idr;ts.p.data.push(rd);ts.p._index[idr]=ts.p.data.length-1;rd={}}ir++}}},addLocalData=function(){var st,fndsort=false,cmtypes={},grtypes=[],grindexes=[],srcformat,sorttype,newformat;if(!$.isArray(ts.p.data)){return}var grpview=ts.p.grouping?ts.p.groupingView:false,lengrp,gin;$.each(ts.p.colModel,function(){sorttype=this.sorttype||"text";if(sorttype=="date"||sorttype=="datetime"){if(this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"){if(this.formatoptions&&this.formatoptions.srcformat){srcformat=this.formatoptions.srcformat}else{srcformat=$.jgrid.formatter.date.srcformat}if(this.formatoptions&&this.formatoptions.newformat){newformat=this.formatoptions.newformat}else{newformat=$.jgrid.formatter.date.newformat}}else{srcformat=newformat=this.datefmt||"Y-m-d"}cmtypes[this.name]={stype:sorttype,srcfmt:srcformat,newfmt:newformat}}else{cmtypes[this.name]={stype:sorttype,srcfmt:"",newfmt:""}}if(ts.p.grouping){for(gin=0,lengrp=grpview.groupField.length;gin<lengrp;gin++){if(this.name==grpview.groupField[gin]){var grindex=this.name;if(this.index){grindex=this.index}grtypes[gin]=cmtypes[grindex];grindexes[gin]=grindex}}}if(!fndsort&&(this.index==ts.p.sortname||this.name==ts.p.sortname)){st=this.name;fndsort=true}});if(ts.p.treeGrid){$(ts).jqGrid("SortTree",st,ts.p.sortorder,cmtypes[st].stype,cmtypes[st].srcfmt);return}var compareFnMap={eq:function(queryObj){return queryObj.equals},ne:function(queryObj){return queryObj.notEquals},lt:function(queryObj){return queryObj.less},le:function(queryObj){return queryObj.lessOrEquals},gt:function(queryObj){return queryObj.greater},ge:function(queryObj){return queryObj.greaterOrEquals},cn:function(queryObj){return queryObj.contains},nc:function(queryObj,op){return op==="OR"?queryObj.orNot().contains:queryObj.andNot().contains},bw:function(queryObj){return queryObj.startsWith},bn:function(queryObj,op){return op==="OR"?queryObj.orNot().startsWith:queryObj.andNot().startsWith},en:function(queryObj,op){return op==="OR"?queryObj.orNot().endsWith:queryObj.andNot().endsWith},ew:function(queryObj){return queryObj.endsWith},ni:function(queryObj,op){return op==="OR"?queryObj.orNot().equals:queryObj.andNot().equals},"in":function(queryObj){return queryObj.equals},nu:function(queryObj){return queryObj.isNull},nn:function(queryObj,op){return op==="OR"?queryObj.orNot().isNull:queryObj.andNot().isNull}},query=$.jgrid.from(ts.p.data);if(ts.p.ignoreCase){query=query.ignoreCase()}function tojLinq(group){var s=0,index,gor,ror,opr,rule;if(group.groups!=null){gor=group.groups.length&&group.groupOp.toString().toUpperCase()==="OR";if(gor){query.orBegin()}for(index=0;index<group.groups.length;index++){if(s>0&&gor){query.or()}try{tojLinq(group.groups[index])}catch(e){alert(e)}s++}if(gor){query.orEnd()}}if(group.rules!=null){try{ror=group.rules.length&&group.groupOp.toString().toUpperCase()==="OR";if(ror){query.orBegin()}for(index=0;index<group.rules.length;index++){rule=group.rules[index];opr=group.groupOp.toString().toUpperCase();if(compareFnMap[rule.op]&&rule.field){if(s>0&&opr&&opr==="OR"){query=query.or()}query=compareFnMap[rule.op](query,opr)(rule.field,rule.data,cmtypes[rule.field])}s++}if(ror){query.orEnd()}}catch(g){alert(g)}}}if(ts.p.search===true){var srules=ts.p.postData.filters;if(srules){if(typeof srules==="string"){srules=$.jgrid.parse(srules)}tojLinq(srules)}else{try{query=compareFnMap[ts.p.postData.searchOper](query)(ts.p.postData.searchField,ts.p.postData.searchString,cmtypes[ts.p.postData.searchField])}catch(se){}}}if(ts.p.grouping){for(gin=0;gin<lengrp;gin++){query.orderBy(grindexes[gin],grpview.groupOrder[gin],grtypes[gin].stype,grtypes[gin].srcfmt)}}if(st&&ts.p.sortorder&&fndsort){if(ts.p.sortorder.toUpperCase()=="DESC"){query.orderBy(ts.p.sortname,"d",cmtypes[st].stype,cmtypes[st].srcfmt)}else{query.orderBy(ts.p.sortname,"a",cmtypes[st].stype,cmtypes[st].srcfmt)}}var queryResults=query.select(),recordsperpage=parseInt(ts.p.rowNum,10),total=queryResults.length,page=parseInt(ts.p.page,10),totalpages=Math.ceil(total/recordsperpage),retresult={};queryResults=queryResults.slice((page-1)*recordsperpage,page*recordsperpage);query=null;cmtypes=null;retresult[ts.p.localReader.total]=totalpages;retresult[ts.p.localReader.page]=page;retresult[ts.p.localReader.records]=total;retresult[ts.p.localReader.root]=queryResults;retresult[ts.p.localReader.userdata]=ts.p.userData;queryResults=null;return retresult},updatepager=function(rn,dnd){var cp,last,base,from,to,tot,fmt,pgboxes="",sppg,tspg=ts.p.pager?"_"+$.jgrid.jqID(ts.p.pager.substr(1)):"",tspg_t=ts.p.toppager?"_"+ts.p.toppager.substr(1):"";base=parseInt(ts.p.page,10)-1;if(base<0){base=0}base=base*parseInt(ts.p.rowNum,10);to=base+ts.p.reccount;if(ts.p.scroll){var rows=$("tbody:first > tr:gt(0)",ts.grid.bDiv);base=to-rows.length;ts.p.reccount=rows.length;var rh=rows.outerHeight()||ts.grid.prevRowHeight;if(rh){var top=base*rh;var height=parseInt(ts.p.records,10)*rh;$(">div:first",ts.grid.bDiv).css({height:height}).children("div:first").css({height:top,display:top?"":"none"})}ts.grid.bDiv.scrollLeft=ts.grid.hDiv.scrollLeft}pgboxes=ts.p.pager||"";pgboxes+=ts.p.toppager?(pgboxes?","+ts.p.toppager:ts.p.toppager):"";if(pgboxes){fmt=$.jgrid.formatter.integer||{};cp=intNum(ts.p.page);last=intNum(ts.p.lastpage);$(".selbox",pgboxes)[this.p.useProp?"prop":"attr"]("disabled",false);if(ts.p.pginput===true){$(".ui-pg-input",pgboxes).val(ts.p.page);sppg=ts.p.toppager?"#sp_1"+tspg+",#sp_1"+tspg_t:"#sp_1"+tspg;$(sppg).html($.fmatter?$.fmatter.util.NumberFormat(ts.p.lastpage,fmt):ts.p.lastpage)}if(ts.p.viewrecords){if(ts.p.reccount===0){$(".ui-paging-info",pgboxes).html(ts.p.emptyrecords)}else{from=base+1;tot=ts.p.records;if($.fmatter){from=$.fmatter.util.NumberFormat(from,fmt);to=$.fmatter.util.NumberFormat(to,fmt);tot=$.fmatter.util.NumberFormat(tot,fmt)}$(".ui-paging-info",pgboxes).html($.jgrid.format(ts.p.recordtext,from,to,tot))}}if(ts.p.pgbuttons===true){if(cp<=0){cp=last=0}if(cp==1||cp===0){$("#first"+tspg+", #prev"+tspg).addClass("ui-state-disabled").removeClass("ui-state-hover");if(ts.p.toppager){$("#first_t"+tspg_t+", #prev_t"+tspg_t).addClass("ui-state-disabled").removeClass("ui-state-hover")}}else{$("#first"+tspg+", #prev"+tspg).removeClass("ui-state-disabled");if(ts.p.toppager){$("#first_t"+tspg_t+", #prev_t"+tspg_t).removeClass("ui-state-disabled")}}if(cp==last||cp===0){$("#next"+tspg+", #last"+tspg).addClass("ui-state-disabled").removeClass("ui-state-hover");if(ts.p.toppager){$("#next_t"+tspg_t+", #last_t"+tspg_t).addClass("ui-state-disabled").removeClass("ui-state-hover")}}else{$("#next"+tspg+", #last"+tspg).removeClass("ui-state-disabled");if(ts.p.toppager){$("#next_t"+tspg_t+", #last_t"+tspg_t).removeClass("ui-state-disabled")}}}}if(rn===true&&ts.p.rownumbers===true){$("td.jqgrid-rownum",ts.rows).each(function(i){$(this).html(base+1+i)})}if(dnd&&ts.p.jqgdnd){$(ts).jqGrid("gridDnD","updateDnD")}$(ts).triggerHandler("jqGridGridComplete");if($.isFunction(ts.p.gridComplete)){ts.p.gridComplete.call(ts)}$(ts).triggerHandler("jqGridAfterGridComplete")},beginReq=function(){ts.grid.hDiv.loading=true;if(ts.p.hiddengrid){return}switch(ts.p.loadui){case"disable":break;case"enable":$("#load_"+$.jgrid.jqID(ts.p.id)).show();break;case"block":$("#lui_"+$.jgrid.jqID(ts.p.id)).show();$("#load_"+$.jgrid.jqID(ts.p.id)).show();break}},endReq=function(){ts.grid.hDiv.loading=false;switch(ts.p.loadui){case"disable":break;case"enable":$("#load_"+$.jgrid.jqID(ts.p.id)).hide();break;case"block":$("#lui_"+$.jgrid.jqID(ts.p.id)).hide();$("#load_"+$.jgrid.jqID(ts.p.id)).hide();break}},populate=function(npage){if(!ts.grid.hDiv.loading){var pvis=ts.p.scroll&&npage===false,prm={},dt,dstr,pN=ts.p.prmNames;if(ts.p.page<=0){ts.p.page=1}if(pN.search!==null){prm[pN.search]=ts.p.search}if(pN.nd!==null){prm[pN.nd]=new Date().getTime()}if(pN.rows!==null){prm[pN.rows]=ts.p.rowNum}if(pN.page!==null){prm[pN.page]=ts.p.page}if(pN.sort!==null){prm[pN.sort]=ts.p.sortname}if(pN.order!==null){prm[pN.order]=ts.p.sortorder}if(ts.p.rowTotal!==null&&pN.totalrows!==null){prm[pN.totalrows]=ts.p.rowTotal}var lcf=$.isFunction(ts.p.loadComplete),lc=lcf?ts.p.loadComplete:null;var adjust=0;npage=npage||1;if(npage>1){if(pN.npage!==null){prm[pN.npage]=npage;adjust=npage-1;npage=1}else{lc=function(req){ts.p.page++;ts.grid.hDiv.loading=false;if(lcf){ts.p.loadComplete.call(ts,req)}populate(npage-1)}}}else{if(pN.npage!==null){delete ts.p.postData[pN.npage]}}if(ts.p.grouping){$(ts).jqGrid("groupingSetup");var grp=ts.p.groupingView,gi,gs="";for(gi=0;gi<grp.groupField.length;gi++){var index=grp.groupField[gi];$.each(ts.p.colModel,function(cmIndex,cmValue){if(cmValue.name==index&&cmValue.index){index=cmValue.index}});gs+=index+" "+grp.groupOrder[gi]+", "}prm[pN.sort]=gs+prm[pN.sort]}$.extend(ts.p.postData,prm);var rcnt=!ts.p.scroll?1:ts.rows.length-1;var bfr=$(ts).triggerHandler("jqGridBeforeRequest");if(bfr===false||bfr==="stop"){return}if($.isFunction(ts.p.datatype)){ts.p.datatype.call(ts,ts.p.postData,"load_"+ts.p.id);return}if($.isFunction(ts.p.beforeRequest)){bfr=ts.p.beforeRequest.call(ts);if(bfr===undefined){bfr=true}if(bfr===false){return}}dt=ts.p.datatype.toLowerCase();switch(dt){case"json":case"jsonp":case"xml":case"script":$.ajax($.extend({url:ts.p.url,type:ts.p.mtype,dataType:dt,data:$.isFunction(ts.p.serializeGridData)?ts.p.serializeGridData.call(ts,ts.p.postData):ts.p.postData,success:function(data,st,xhr){if($.isFunction(ts.p.beforeProcessing)){if(ts.p.beforeProcessing.call(ts,data,st,xhr)===false){endReq();return}}if(dt==="xml"){addXmlData(data,ts.grid.bDiv,rcnt,npage>1,adjust)}else{addJSONData(data,ts.grid.bDiv,rcnt,npage>1,adjust)}$(ts).triggerHandler("jqGridLoadComplete",[data]);if(lc){lc.call(ts,data)}$(ts).triggerHandler("jqGridAfterLoadComplete",[data]);if(pvis){ts.grid.populateVisible()}if(ts.p.loadonce||ts.p.treeGrid){ts.p.datatype="local"}data=null;if(npage===1){endReq()}},error:function(xhr,st,err){if($.isFunction(ts.p.loadError)){ts.p.loadError.call(ts,xhr,st,err)}if(npage===1){endReq()}xhr=null},beforeSend:function(xhr,settings){var gotoreq=true;if($.isFunction(ts.p.loadBeforeSend)){gotoreq=ts.p.loadBeforeSend.call(ts,xhr,settings)}if(gotoreq===undefined){gotoreq=true}if(gotoreq===false){return false}beginReq()}},$.jgrid.ajaxOptions,ts.p.ajaxGridOptions));break;case"xmlstring":beginReq();dstr=$.jgrid.stringToDoc(ts.p.datastr);addXmlData(dstr,ts.grid.bDiv);$(ts).triggerHandler("jqGridLoadComplete",[dstr]);if(lcf){ts.p.loadComplete.call(ts,dstr)}$(ts).triggerHandler("jqGridAfterLoadComplete",[dstr]);ts.p.datatype="local";ts.p.datastr=null;endReq();break;case"jsonstring":beginReq();if(typeof ts.p.datastr==="string"){dstr=$.jgrid.parse(ts.p.datastr)}else{dstr=ts.p.datastr}addJSONData(dstr,ts.grid.bDiv);$(ts).triggerHandler("jqGridLoadComplete",[dstr]);if(lcf){ts.p.loadComplete.call(ts,dstr)}$(ts).triggerHandler("jqGridAfterLoadComplete",[dstr]);ts.p.datatype="local";ts.p.datastr=null;endReq();break;case"local":case"clientside":beginReq();ts.p.datatype="local";var req=addLocalData();addJSONData(req,ts.grid.bDiv,rcnt,npage>1,adjust);$(ts).triggerHandler("jqGridLoadComplete",[req]);if(lc){lc.call(ts,req)}$(ts).triggerHandler("jqGridAfterLoadComplete",[req]);if(pvis){ts.grid.populateVisible()}endReq();break}}},setHeadCheckBox=function(checked){$("#cb_"+$.jgrid.jqID(ts.p.id),ts.grid.hDiv)[ts.p.useProp?"prop":"attr"]("checked",checked);var fid=ts.p.frozenColumns?ts.p.id+"_frozen":"";if(fid){$("#cb_"+$.jgrid.jqID(ts.p.id),ts.grid.fhDiv)[ts.p.useProp?"prop":"attr"]("checked",checked)}},setPager=function(pgid,tp){var sep="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",pginp="",pgl="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",str="",pgcnt,lft,cent,rgt,twd,tdw,i,clearVals=function(onpaging){var ret;if($.isFunction(ts.p.onPaging)){ret=ts.p.onPaging.call(ts,onpaging)}ts.p.selrow=null;if(ts.p.multiselect){ts.p.selarrrow=[];setHeadCheckBox(false)}ts.p.savedRow=[];if(ret=="stop"){return false}return true};pgid=pgid.substr(1);tp+="_"+pgid;pgcnt="pg_"+pgid;lft=pgid+"_left";cent=pgid+"_center";rgt=pgid+"_right";$("#"+$.jgrid.jqID(pgid)).append("<div id='"+pgcnt+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+lft+"' align='left'></td><td id='"+cent+"' align='center' style='white-space:pre;'></td><td id='"+rgt+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(ts.p.rowList.length>0){str="<td dir='"+dir+"'>";str+="<select class='ui-pg-selbox' role='listbox'>";for(i=0;i<ts.p.rowList.length;i++){str+='<option role="option" value="'+ts.p.rowList[i]+'"'+((ts.p.rowNum==ts.p.rowList[i])?' selected="selected"':"")+">"+ts.p.rowList[i]+"</option>"}str+="</select></td>"}if(dir=="rtl"){pgl+=str}if(ts.p.pginput===true){pginp="<td dir='"+dir+"'>"+$.jgrid.format(ts.p.pgtext||"","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1_"+$.jgrid.jqID(pgid)+"'></span>")+"</td>"}if(ts.p.pgbuttons===true){var po=["first"+tp,"prev"+tp,"next"+tp,"last"+tp];if(dir=="rtl"){po.reverse()}pgl+="<td id='"+po[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";pgl+="<td id='"+po[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";pgl+=pginp!==""?sep+pginp+sep:"";pgl+="<td id='"+po[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";pgl+="<td id='"+po[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else{if(pginp!==""){pgl+=pginp}}if(dir=="ltr"){pgl+=str}pgl+="</tr></tbody></table>";if(ts.p.viewrecords===true){$("td#"+pgid+"_"+ts.p.recordpos,"#"+pgcnt).append("<div dir='"+dir+"' style='text-align:"+ts.p.recordpos+"' class='ui-paging-info'></div>")}$("td#"+pgid+"_"+ts.p.pagerpos,"#"+pgcnt).append(pgl);tdw=$(".ui-jqgrid").css("font-size")||"11px";$(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");twd=$(pgl).clone().appendTo("#testpg").width();$("#testpg").remove();if(twd>0){if(pginp!==""){twd+=50}$("td#"+pgid+"_"+ts.p.pagerpos,"#"+pgcnt).width(twd)}ts.p._nvtd=[];ts.p._nvtd[0]=twd?Math.floor((ts.p.width-twd)/2):Math.floor(ts.p.width/3);ts.p._nvtd[1]=0;pgl=null;$(".ui-pg-selbox","#"+pgcnt).bind("change",function(){if(!clearVals("records")){return false}ts.p.page=Math.round(ts.p.rowNum*(ts.p.page-1)/this.value-0.5)+1;ts.p.rowNum=this.value;if(ts.p.pager){$(".ui-pg-selbox",ts.p.pager).val(this.value)}if(ts.p.toppager){$(".ui-pg-selbox",ts.p.toppager).val(this.value)}populate();return false});if(ts.p.pgbuttons===true){$(".ui-pg-button","#"+pgcnt).hover(function(){if($(this).hasClass("ui-state-disabled")){this.style.cursor="default"}else{$(this).addClass("ui-state-hover");this.style.cursor="pointer"}},function(){if(!$(this).hasClass("ui-state-disabled")){$(this).removeClass("ui-state-hover");this.style.cursor="default"}});$("#first"+$.jgrid.jqID(tp)+", #prev"+$.jgrid.jqID(tp)+", #next"+$.jgrid.jqID(tp)+", #last"+$.jgrid.jqID(tp)).click(function(){var cp=intNum(ts.p.page,1),last=intNum(ts.p.lastpage,1),selclick=false,fp=true,pp=true,np=true,lp=true;if(last===0||last===1){fp=false;pp=false;np=false;lp=false}else{if(last>1&&cp>=1){if(cp===1){fp=false;pp=false}else{if(cp===last){np=false;lp=false}}}else{if(last>1&&cp===0){np=false;lp=false;cp=last-1}}}if(!clearVals(this.id)){return false}if(this.id==="first"+tp&&fp){ts.p.page=1;selclick=true}if(this.id==="prev"+tp&&pp){ts.p.page=(cp-1);selclick=true}if(this.id==="next"+tp&&np){ts.p.page=(cp+1);selclick=true}if(this.id==="last"+tp&&lp){ts.p.page=last;selclick=true}if(selclick){populate()}return false})}if(ts.p.pginput===true){$("input.ui-pg-input","#"+pgcnt).keypress(function(e){var key=e.charCode||e.keyCode||0;if(key==13){if(!clearVals("user")){return false}ts.p.page=($(this).val()>0)?$(this).val():ts.p.page;populate();return false}return this})}},sortData=function(index,idxcol,reload,sor){if(!ts.p.colModel[idxcol].sortable){return}var so;if(ts.p.savedRow.length>0){return}if(!reload){if(ts.p.lastsort==idxcol){if(ts.p.sortorder=="asc"){ts.p.sortorder="desc"}else{if(ts.p.sortorder=="desc"){ts.p.sortorder="asc"}}}else{ts.p.sortorder=ts.p.colModel[idxcol].firstsortorder||"asc"}ts.p.page=1}if(sor){if(ts.p.lastsort==idxcol&&ts.p.sortorder==sor&&!reload){return}ts.p.sortorder=sor}var previousSelectedTh=ts.grid.headers[ts.p.lastsort].el,newSelectedTh=ts.grid.headers[idxcol].el;$("span.ui-grid-ico-sort",previousSelectedTh).addClass("ui-state-disabled");$(previousSelectedTh).attr("aria-selected","false");$("span.ui-icon-"+ts.p.sortorder,newSelectedTh).removeClass("ui-state-disabled");$(newSelectedTh).attr("aria-selected","true");if(!ts.p.viewsortcols[0]){if(ts.p.lastsort!=idxcol){$("span.s-ico",previousSelectedTh).hide();$("span.s-ico",newSelectedTh).show()}}index=index.substring(5+ts.p.id.length+1);ts.p.sortname=ts.p.colModel[idxcol].index||index;so=ts.p.sortorder;if($(ts).triggerHandler("jqGridSortCol",[index,idxcol,so])==="stop"){ts.p.lastsort=idxcol;return}if($.isFunction(ts.p.onSortCol)){if(ts.p.onSortCol.call(ts,index,idxcol,so)=="stop"){ts.p.lastsort=idxcol;return}}if(ts.p.datatype=="local"){if(ts.p.deselectAfterSort){$(ts).jqGrid("resetSelection")}}else{ts.p.selrow=null;if(ts.p.multiselect){setHeadCheckBox(false)}ts.p.selarrrow=[];ts.p.savedRow=[]}if(ts.p.scroll){var sscroll=ts.grid.bDiv.scrollLeft;emptyRows.call(ts,true,false);ts.grid.hDiv.scrollLeft=sscroll}if(ts.p.subGrid&&ts.p.datatype=="local"){$("td.sgexpanded","#"+$.jgrid.jqID(ts.p.id)).each(function(){$(this).trigger("click")})}populate();ts.p.lastsort=idxcol;if(ts.p.sortname!=index&&idxcol){ts.p.lastsort=idxcol}},setColWidth=function(){var initwidth=0,brd=$.jgrid.cell_width?0:intNum(ts.p.cellLayout,0),vc=0,lvc,scw=intNum(ts.p.scrollOffset,0),cw,hs=false,aw,gw=0,cl=0,cr;$.each(ts.p.colModel,function(){if(this.hidden===undefined){this.hidden=false}if(ts.p.grouping&&ts.p.autowidth){var ind=$.inArray(this.name,ts.p.groupingView.groupField);if(ind!==-1){this.hidden=!ts.p.groupingView.groupColumnShow[ind]}}this.widthOrg=cw=intNum(this.width,0);if(this.hidden===false){initwidth+=cw+brd;if(this.fixed){gw+=cw+brd}else{vc++}cl++}});if(isNaN(ts.p.width)){ts.p.width=initwidth+((ts.p.shrinkToFit===false&&!isNaN(ts.p.height))?scw:0)}grid.width=ts.p.width;ts.p.tblwidth=initwidth;if(ts.p.shrinkToFit===false&&ts.p.forceFit===true){ts.p.forceFit=false}if(ts.p.shrinkToFit===true&&vc>0){aw=grid.width-brd*vc-gw;if(!isNaN(ts.p.height)){aw-=scw;hs=true}initwidth=0;$.each(ts.p.colModel,function(i){if(this.hidden===false&&!this.fixed){cw=Math.round(aw*this.width/(ts.p.tblwidth-brd*vc-gw));this.width=cw;initwidth+=cw;lvc=i}});cr=0;if(hs){if(grid.width-gw-(initwidth+brd*vc)!==scw){cr=grid.width-gw-(initwidth+brd*vc)-scw}}else{if(!hs&&Math.abs(grid.width-gw-(initwidth+brd*vc))!==1){cr=grid.width-gw-(initwidth+brd*vc)}}ts.p.colModel[lvc].width+=cr;ts.p.tblwidth=initwidth+cr+brd*vc+gw;if(ts.p.tblwidth>ts.p.width){ts.p.colModel[lvc].width-=(ts.p.tblwidth-parseInt(ts.p.width,10));ts.p.tblwidth=ts.p.width}}},nextVisible=function(iCol){var ret=iCol,j=iCol,i;for(i=iCol+1;i<ts.p.colModel.length;i++){if(ts.p.colModel[i].hidden!==true){j=i;break}}return j-ret},getOffset=function(iCol){var i,ret=[0],brd1=$.jgrid.cell_width?0:ts.p.cellLayout;for(i=0;i<=iCol;i++){if(ts.p.colModel[i].hidden===false){ret[0]+=ts.p.colModel[i].width+brd1}}if(ts.p.direction=="rtl"){ret[0]=ts.p.width-ret[0]}ret[0]-=ts.grid.bDiv.scrollLeft;ret.push($(ts.grid.hDiv).position().top);ret.push($(ts.grid.bDiv).offset().top-$(ts.grid.hDiv).offset().top+$(ts.grid.bDiv).height());return ret},getColumnHeaderIndex=function(th){var i,headers=ts.grid.headers,ci=$.jgrid.getCellIndex(th);for(i=0;i<headers.length;i++){if(th===headers[i].el){ci=i;break}}return ci};this.p.id=this.id;if($.inArray(ts.p.multikey,sortkeys)==-1){ts.p.multikey=false}ts.p.keyIndex=false;for(i=0;i<ts.p.colModel.length;i++){ts.p.colModel[i]=$.extend(true,{},ts.p.cmTemplate,ts.p.colModel[i].template||{},ts.p.colModel[i]);if(ts.p.keyIndex===false&&ts.p.colModel[i].key===true){ts.p.keyIndex=i}}ts.p.sortorder=ts.p.sortorder.toLowerCase();$.jgrid.cell_width=$.jgrid.cellWidth();if(ts.p.grouping===true){ts.p.scroll=false;ts.p.rownumbers=false;ts.p.treeGrid=false;ts.p.gridview=true}if(this.p.treeGrid===true){try{$(this).jqGrid("setTreeGrid")}catch(_){}if(ts.p.datatype!="local"){ts.p.localReader={id:"_id_"}}}if(this.p.subGrid){try{$(ts).jqGrid("setSubGrid")}catch(s){}}if(this.p.multiselect){this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>");this.p.colModel.unshift({name:"cb",width:$.jgrid.cell_width?ts.p.multiselectWidth+ts.p.cellLayout:ts.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}if(this.p.rownumbers){this.p.colNames.unshift("");this.p.colModel.unshift({name:"rn",width:ts.p.rownumWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:"center",fixed:true})}ts.p.xmlReader=$.extend(true,{root:"rows",row:"row",page:"rows>page",total:"rows>total",records:"rows>records",repeatitems:true,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:true,cell:"cell"}},ts.p.xmlReader);ts.p.jsonReader=$.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:true,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true,cell:"cell"}},ts.p.jsonReader);ts.p.localReader=$.extend(true,{root:"rows",page:"page",total:"total",records:"records",repeatitems:false,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:true,cell:"cell"}},ts.p.localReader);if(ts.p.scroll){ts.p.pgbuttons=false;ts.p.pginput=false;ts.p.rowList=[]}if(ts.p.data.length){refreshIndex()}var thead="<thead><tr class='ui-jqgrid-labels' role='rowheader'>",tdc,idn,w,res,sort,td,ptr,tbody,imgs,iac="",idc="";if(ts.p.shrinkToFit===true&&ts.p.forceFit===true){for(i=ts.p.colModel.length-1;i>=0;i--){if(!ts.p.colModel[i].hidden){ts.p.colModel[i].resizable=false;break}}}if(ts.p.viewsortcols[1]=="horizontal"){iac=" ui-i-asc";idc=" ui-i-desc"}tdc=isMSIE?"class='ui-th-div-ie'":"";imgs="<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+iac+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+dir+"'></span>";imgs+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+idc+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+dir+"'></span></span>";for(i=0;i<this.p.colNames.length;i++){var tooltip=ts.p.headertitles?(' title="'+$.jgrid.stripHtml(ts.p.colNames[i])+'"'):"";thead+="<th id='"+ts.p.id+"_"+ts.p.colModel[i].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+dir+"'"+tooltip+">";idn=ts.p.colModel[i].index||ts.p.colModel[i].name;thead+="<div id='jqgh_"+ts.p.id+"_"+ts.p.colModel[i].name+"' "+tdc+">"+ts.p.colNames[i];if(!ts.p.colModel[i].width){ts.p.colModel[i].width=150}else{ts.p.colModel[i].width=parseInt(ts.p.colModel[i].width,10)}if(typeof ts.p.colModel[i].title!=="boolean"){ts.p.colModel[i].title=true}if(idn==ts.p.sortname){ts.p.lastsort=i}thead+=imgs+"</div></th>"}thead+="</tr></thead>";imgs=null;$(this).append(thead);$("thead tr:first th",this).hover(function(){$(this).addClass("ui-state-hover")},function(){$(this).removeClass("ui-state-hover")});if(this.p.multiselect){var emp=[],chk;$("#cb_"+$.jgrid.jqID(ts.p.id),this).bind("click",function(){ts.p.selarrrow=[];var froz=ts.p.frozenColumns===true?ts.p.id+"_frozen":"";if(this.checked){$(ts.rows).each(function(i){if(i>0){if(!$(this).hasClass("ui-subgrid")&&!$(this).hasClass("jqgroup")&&!$(this).hasClass("ui-state-disabled")){$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id))[ts.p.useProp?"prop":"attr"]("checked",true);$(this).addClass("ui-state-highlight").attr("aria-selected","true");ts.p.selarrrow.push(this.id);ts.p.selrow=this.id;if(froz){$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id),ts.grid.fbDiv)[ts.p.useProp?"prop":"attr"]("checked",true);$("#"+$.jgrid.jqID(this.id),ts.grid.fbDiv).addClass("ui-state-highlight")}}}});chk=true;emp=[]}else{$(ts.rows).each(function(i){if(i>0){if(!$(this).hasClass("ui-subgrid")&&!$(this).hasClass("ui-state-disabled")){$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id))[ts.p.useProp?"prop":"attr"]("checked",false);$(this).removeClass("ui-state-highlight").attr("aria-selected","false");emp.push(this.id);if(froz){$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id),ts.grid.fbDiv)[ts.p.useProp?"prop":"attr"]("checked",false);$("#"+$.jgrid.jqID(this.id),ts.grid.fbDiv).removeClass("ui-state-highlight")}}}});ts.p.selrow=null;chk=false}$(ts).triggerHandler("jqGridSelectAll",[chk?ts.p.selarrrow:emp,chk]);if($.isFunction(ts.p.onSelectAll)){ts.p.onSelectAll.call(ts,chk?ts.p.selarrrow:emp,chk)}})}if(ts.p.autowidth===true){var pw=$(eg).innerWidth();ts.p.width=pw>0?pw:"nw"}setColWidth();$(eg).css("width",grid.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+ts.p.id+"'>&#160;</div>");$(gv).css("width",grid.width+"px");thead=$("thead:first",ts).get(0);var tfoot="";if(ts.p.footerrow){tfoot+="<table role='grid' style='width:"+ts.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+dir+"'>"}var thr=$("tr:first",thead),firstr="<tr class='jqgfirstrow' role='row' style='height:auto'>";ts.p.disableClick=false;$("th",thr).each(function(j){w=ts.p.colModel[j].width;if(ts.p.colModel[j].resizable===undefined){ts.p.colModel[j].resizable=true}if(ts.p.colModel[j].resizable){res=document.createElement("span");$(res).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+dir).css("cursor","col-resize");$(this).addClass(ts.p.resizeclass)}else{res=""}$(this).css("width",w+"px").prepend(res);var hdcol="";if(ts.p.colModel[j].hidden){$(this).css("display","none");hdcol="display:none;"}firstr+="<td role='gridcell' style='height:0px;width:"+w+"px;"+hdcol+"'></td>";grid.headers[j]={width:w,el:this};sort=ts.p.colModel[j].sortable;if(typeof sort!=="boolean"){ts.p.colModel[j].sortable=true;sort=true}var nm=ts.p.colModel[j].name;if(!(nm=="cb"||nm=="subgrid"||nm=="rn")){if(ts.p.viewsortcols[2]){$(">div",this).addClass("ui-jqgrid-sortable")}}if(sort){if(ts.p.viewsortcols[0]){$("div span.s-ico",this).show();if(j==ts.p.lastsort){$("div span.ui-icon-"+ts.p.sortorder,this).removeClass("ui-state-disabled")}}else{if(j==ts.p.lastsort){$("div span.s-ico",this).show();$("div span.ui-icon-"+ts.p.sortorder,this).removeClass("ui-state-disabled")}}}if(ts.p.footerrow){tfoot+="<td role='gridcell' "+formatCol(j,0,"",null,"",false)+">&#160;</td>"}}).mousedown(function(e){if($(e.target).closest("th>span.ui-jqgrid-resize").length!=1){return}var ci=getColumnHeaderIndex(this);if(ts.p.forceFit===true){ts.p.nv=nextVisible(ci)}grid.dragStart(ci,e,getOffset(ci));return false}).click(function(e){if(ts.p.disableClick){ts.p.disableClick=false;return false}var s="th>div.ui-jqgrid-sortable",r,d;if(!ts.p.viewsortcols[2]){s="th>div>span>span.ui-grid-ico-sort"}var t=$(e.target).closest(s);if(t.length!=1){return}var ci=getColumnHeaderIndex(this);if(!ts.p.viewsortcols[2]){r=true;d=t.attr("sort")}sortData($("div",this)[0].id,ci,r,d);return false});if(ts.p.sortable&&$.fn.sortable){try{$(ts).jqGrid("sortableColumns",thr)}catch(e){}}if(ts.p.footerrow){tfoot+="</tr></tbody></table>"}firstr+="</tr>";tbody=document.createElement("tbody");this.appendChild(tbody);$(this).addClass("ui-jqgrid-btable").append(firstr);firstr=null;var hTable=$("<table class='ui-jqgrid-htable' style='width:"+ts.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(thead),hg=(ts.p.caption&&ts.p.hiddengrid===true)?true:false,hb=$("<div class='ui-jqgrid-hbox"+(dir=="rtl"?"-rtl":"")+"'></div>");thead=null;grid.hDiv=document.createElement("div");$(grid.hDiv).css({width:grid.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(hb);$(hb).append(hTable);hTable=null;if(hg){$(grid.hDiv).hide()}if(ts.p.pager){if(typeof ts.p.pager==="string"){if(ts.p.pager.substr(0,1)!="#"){ts.p.pager="#"+ts.p.pager}}else{ts.p.pager="#"+$(ts.p.pager).attr("id")}$(ts.p.pager).css({width:grid.width+"px"}).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom").appendTo(eg);if(hg){$(ts.p.pager).hide()}setPager(ts.p.pager,"")}if(ts.p.cellEdit===false&&ts.p.hoverrows===true){$(ts).bind("mouseover",function(e){ptr=$(e.target).closest("tr.jqgrow");if($(ptr).attr("class")!=="ui-subgrid"){$(ptr).addClass("ui-state-hover")}}).bind("mouseout",function(e){ptr=$(e.target).closest("tr.jqgrow");$(ptr).removeClass("ui-state-hover")})}var ri,ci,tdHtml;$(ts).before(grid.hDiv).click(function(e){td=e.target;ptr=$(td,ts.rows).closest("tr.jqgrow");if($(ptr).length===0||ptr[0].className.indexOf("ui-state-disabled")>-1||($(td,ts).closest("table.ui-jqgrid-btable").attr("id")||"").replace("_frozen","")!==ts.id){return this}var scb=$(td).hasClass("cbox"),cSel=$(ts).triggerHandler("jqGridBeforeSelectRow",[ptr[0].id,e]);cSel=(cSel===false||cSel==="stop")?false:true;if(cSel&&$.isFunction(ts.p.beforeSelectRow)){cSel=ts.p.beforeSelectRow.call(ts,ptr[0].id,e)}if(td.tagName=="A"||((td.tagName=="INPUT"||td.tagName=="TEXTAREA"||td.tagName=="OPTION"||td.tagName=="SELECT")&&!scb)){return}if(cSel===true){ri=ptr[0].id;ci=$.jgrid.getCellIndex(td);tdHtml=$(td).closest("td,th").html();$(ts).triggerHandler("jqGridCellSelect",[ri,ci,tdHtml,e]);if($.isFunction(ts.p.onCellSelect)){ts.p.onCellSelect.call(ts,ri,ci,tdHtml,e)}if(ts.p.cellEdit===true){if(ts.p.multiselect&&scb){$(ts).jqGrid("setSelection",ri,true,e)}else{ri=ptr[0].rowIndex;try{$(ts).jqGrid("editCell",ri,ci,true)}catch(_){}}}else{if(!ts.p.multikey){if(ts.p.multiselect&&ts.p.multiboxonly){if(scb){$(ts).jqGrid("setSelection",ri,true,e)}else{var frz=ts.p.frozenColumns?ts.p.id+"_frozen":"";$(ts.p.selarrrow).each(function(i,n){var ind=ts.rows.namedItem(n);$(ind).removeClass("ui-state-highlight");$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(n))[ts.p.useProp?"prop":"attr"]("checked",false);if(frz){$("#"+$.jgrid.jqID(n),"#"+$.jgrid.jqID(frz)).removeClass("ui-state-highlight");$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(n),"#"+$.jgrid.jqID(frz))[ts.p.useProp?"prop":"attr"]("checked",false)}});ts.p.selarrrow=[];$(ts).jqGrid("setSelection",ri,true,e)}}else{$(ts).jqGrid("setSelection",ri,true,e)}}else{if(e[ts.p.multikey]){$(ts).jqGrid("setSelection",ri,true,e)}else{if(ts.p.multiselect&&scb){scb=$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+ri).is(":checked");$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+ri)[ts.p.useProp?"prop":"attr"]("checked",scb)}}}}}}).bind("reloadGrid",function(e,opts){if(ts.p.treeGrid===true){ts.p.datatype=ts.p.treedatatype}if(opts&&opts.current){ts.grid.selectionPreserver(ts)}if(ts.p.datatype=="local"){$(ts).jqGrid("resetSelection");if(ts.p.data.length){refreshIndex()}}else{if(!ts.p.treeGrid){ts.p.selrow=null;if(ts.p.multiselect){ts.p.selarrrow=[];setHeadCheckBox(false)}ts.p.savedRow=[]}}if(ts.p.scroll){emptyRows.call(ts,true,false)}if(opts&&opts.page){var page=opts.page;if(page>ts.p.lastpage){page=ts.p.lastpage}if(page<1){page=1}ts.p.page=page;if(ts.grid.prevRowHeight){ts.grid.bDiv.scrollTop=(page-1)*ts.grid.prevRowHeight*ts.p.rowNum}else{ts.grid.bDiv.scrollTop=0}}if(ts.grid.prevRowHeight&&ts.p.scroll){delete ts.p.lastpage;ts.grid.populateVisible()}else{ts.grid.populate()}if(ts.p._inlinenav===true){$(ts).jqGrid("showAddEditButtons")}return false}).dblclick(function(e){td=e.target;ptr=$(td,ts.rows).closest("tr.jqgrow");if($(ptr).length===0){return}ri=ptr[0].rowIndex;ci=$.jgrid.getCellIndex(td);$(ts).triggerHandler("jqGridDblClickRow",[$(ptr).attr("id"),ri,ci,e]);if($.isFunction(this.p.ondblClickRow)){ts.p.ondblClickRow.call(ts,$(ptr).attr("id"),ri,ci,e)}}).bind("contextmenu",function(e){td=e.target;ptr=$(td,ts.rows).closest("tr.jqgrow");if($(ptr).length===0){return}if(!ts.p.multiselect){$(ts).jqGrid("setSelection",ptr[0].id,true,e)}ri=ptr[0].rowIndex;ci=$.jgrid.getCellIndex(td);$(ts).triggerHandler("jqGridRightClickRow",[$(ptr).attr("id"),ri,ci,e]);if($.isFunction(this.p.onRightClickRow)){ts.p.onRightClickRow.call(ts,$(ptr).attr("id"),ri,ci,e)}});grid.bDiv=document.createElement("div");if(isMSIE){if(String(ts.p.height).toLowerCase()==="auto"){ts.p.height="100%"}}$(grid.bDiv).append($('<div style="position:relative;'+(isMSIE&&$.jgrid.msiever()<8?"height:0.01%;":"")+'"></div>').append("<div></div>").append(this)).addClass("ui-jqgrid-bdiv").css({height:ts.p.height+(isNaN(ts.p.height)?"":"px"),width:(grid.width)+"px"}).scroll(grid.scrollGrid);$("table:first",grid.bDiv).css({width:ts.p.tblwidth+"px"});if(!$.support.tbody){if($("tbody",this).length==2){$("tbody:gt(0)",this).remove()}}if(ts.p.multikey){if($.jgrid.msie){$(grid.bDiv).bind("selectstart",function(){return false})}else{$(grid.bDiv).bind("mousedown",function(){return false})}}if(hg){$(grid.bDiv).hide()}grid.cDiv=document.createElement("div");var arf=ts.p.hidegrid===true?$("<a role='link' href='javascript:void(0)'/>").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){arf.addClass("ui-state-hover")},function(){arf.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css((dir=="rtl"?"left":"right"),"0px"):"";$(grid.cDiv).append(arf).append("<span class='ui-jqgrid-title"+(dir=="rtl"?"-rtl":"")+"'>"+ts.p.caption+"</span>").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");$(grid.cDiv).insertBefore(grid.hDiv);if(ts.p.toolbar[0]){grid.uDiv=document.createElement("div");if(ts.p.toolbar[1]=="top"){$(grid.uDiv).insertBefore(grid.hDiv)}else{if(ts.p.toolbar[1]=="bottom"){$(grid.uDiv).insertAfter(grid.hDiv)}}if(ts.p.toolbar[1]=="both"){grid.ubDiv=document.createElement("div");$(grid.uDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id).insertBefore(grid.hDiv);$(grid.ubDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id).insertAfter(grid.hDiv);if(hg){$(grid.ubDiv).hide()}}else{$(grid.uDiv).width(grid.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id)}if(hg){$(grid.uDiv).hide()}}if(ts.p.toppager){ts.p.toppager=$.jgrid.jqID(ts.p.id)+"_toppager";grid.topDiv=$("<div id='"+ts.p.toppager+"'></div>")[0];ts.p.toppager="#"+ts.p.toppager;$(grid.topDiv).addClass("ui-state-default ui-jqgrid-toppager").width(grid.width).insertBefore(grid.hDiv);setPager(ts.p.toppager,"_t")}if(ts.p.footerrow){grid.sDiv=$("<div class='ui-jqgrid-sdiv'></div>")[0];hb=$("<div class='ui-jqgrid-hbox"+(dir=="rtl"?"-rtl":"")+"'></div>");$(grid.sDiv).append(hb).width(grid.width).insertAfter(grid.hDiv);$(hb).append(tfoot);grid.footers=$(".ui-jqgrid-ftable",grid.sDiv)[0].rows[0].cells;if(ts.p.rownumbers){grid.footers[0].className="ui-state-default jqgrid-rownum"}if(hg){$(grid.sDiv).hide()}}hb=null;if(ts.p.caption){var tdt=ts.p.datatype;if(ts.p.hidegrid===true){$(".ui-jqgrid-titlebar-close",grid.cDiv).click(function(e){var onHdCl=$.isFunction(ts.p.onHeaderClick),elems=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",counter,self=this;if(ts.p.toolbar[0]===true){if(ts.p.toolbar[1]=="both"){elems+=", #"+$(grid.ubDiv).attr("id")}elems+=", #"+$(grid.uDiv).attr("id")}counter=$(elems,"#gview_"+$.jgrid.jqID(ts.p.id)).length;if(ts.p.gridstate=="visible"){$(elems,"#gbox_"+$.jgrid.jqID(ts.p.id)).slideUp("fast",function(){counter--;if(counter===0){$("span",self).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");ts.p.gridstate="hidden";if($("#gbox_"+$.jgrid.jqID(ts.p.id)).hasClass("ui-resizable")){$(".ui-resizable-handle","#gbox_"+$.jgrid.jqID(ts.p.id)).hide()}$(ts).triggerHandler("jqGridHeaderClick",[ts.p.gridstate,e]);if(onHdCl){if(!hg){ts.p.onHeaderClick.call(ts,ts.p.gridstate,e)}}}})}else{if(ts.p.gridstate=="hidden"){$(elems,"#gbox_"+$.jgrid.jqID(ts.p.id)).slideDown("fast",function(){counter--;if(counter===0){$("span",self).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");if(hg){ts.p.datatype=tdt;populate();hg=false}ts.p.gridstate="visible";if($("#gbox_"+$.jgrid.jqID(ts.p.id)).hasClass("ui-resizable")){$(".ui-resizable-handle","#gbox_"+$.jgrid.jqID(ts.p.id)).show()}$(ts).triggerHandler("jqGridHeaderClick",[ts.p.gridstate,e]);if(onHdCl){if(!hg){ts.p.onHeaderClick.call(ts,ts.p.gridstate,e)}}}})}}return false});if(hg){ts.p.datatype="local";$(".ui-jqgrid-titlebar-close",grid.cDiv).trigger("click")}}}else{$(grid.cDiv).hide()}$(grid.hDiv).after(grid.bDiv).mousemove(function(e){if(grid.resizing){grid.dragMove(e);return false}});$(".ui-jqgrid-labels",grid.hDiv).bind("selectstart",function(){return false});$(document).mouseup(function(){if(grid.resizing){grid.dragEnd();return false}return true});ts.formatCol=formatCol;ts.sortData=sortData;ts.updatepager=updatepager;ts.refreshIndex=refreshIndex;ts.setHeadCheckBox=setHeadCheckBox;ts.constructTr=constructTr;ts.formatter=function(rowId,cellval,colpos,rwdat,act){return formatter(rowId,cellval,colpos,rwdat,act)};$.extend(grid,{populate:populate,emptyRows:emptyRows});this.grid=grid;ts.addXmlData=function(d){addXmlData(d,ts.grid.bDiv)};ts.addJSONData=function(d){addJSONData(d,ts.grid.bDiv)};this.grid.cols=this.rows[0].cells;$(ts).triggerHandler("jqGridInitGrid");if($.isFunction(ts.p.onInitGrid)){ts.p.onInitGrid.call(ts)}populate();ts.p.hiddengrid=false})};$.jgrid.extend({getGridParam:function(pName){var $t=this[0];if(!$t||!$t.grid){return}if(!pName){return $t.p}return $t.p[pName]!==undefined?$t.p[pName]:null},setGridParam:function(newParams){return this.each(function(){if(this.grid&&typeof newParams==="object"){$.extend(true,this.p,newParams)}})},getDataIDs:function(){var ids=[],i=0,len,j=0;this.each(function(){len=this.rows.length;if(len&&len>0){while(i<len){if($(this.rows[i]).hasClass("jqgrow")){ids[j]=this.rows[i].id;j++}i++}}});return ids},setSelection:function(selection,onsr,e){return this.each(function(){var $t=this,stat,pt,ner,ia,tpsr,fid;if(selection===undefined){return}onsr=onsr===false?false:true;pt=$t.rows.namedItem(String(selection));if(!pt||!pt.className||pt.className.indexOf("ui-state-disabled")>-1){return}function scrGrid(iR){var ch=$($t.grid.bDiv)[0].clientHeight,st=$($t.grid.bDiv)[0].scrollTop,rpos=$($t.rows[iR]).position().top,rh=$t.rows[iR].clientHeight;if(rpos+rh>=ch+st){$($t.grid.bDiv)[0].scrollTop=rpos-(ch+st)+rh+st}else{if(rpos<ch+st){if(rpos<st){$($t.grid.bDiv)[0].scrollTop=rpos}}}}if($t.p.scrollrows===true){ner=$t.rows.namedItem(selection).rowIndex;if(ner>=0){scrGrid(ner)}}if($t.p.frozenColumns===true){fid=$t.p.id+"_frozen"}if(!$t.p.multiselect){if(pt.className!=="ui-subgrid"){if($t.p.selrow!=pt.id){$($t.rows.namedItem($t.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected":"false",tabindex:"-1"});$(pt).addClass("ui-state-highlight").attr({"aria-selected":"true",tabindex:"0"});if(fid){$("#"+$.jgrid.jqID($t.p.selrow),"#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight");$("#"+$.jgrid.jqID(selection),"#"+$.jgrid.jqID(fid)).addClass("ui-state-highlight")}stat=true}else{stat=false}$t.p.selrow=pt.id;$($t).triggerHandler("jqGridSelectRow",[pt.id,stat,e]);if($t.p.onSelectRow&&onsr){$t.p.onSelectRow.call($t,pt.id,stat,e)}}}else{$t.setHeadCheckBox(false);$t.p.selrow=pt.id;ia=$.inArray($t.p.selrow,$t.p.selarrrow);if(ia===-1){if(pt.className!=="ui-subgrid"){$(pt).addClass("ui-state-highlight").attr("aria-selected","true")}stat=true;$t.p.selarrrow.push($t.p.selrow)}else{if(pt.className!=="ui-subgrid"){$(pt).removeClass("ui-state-highlight").attr("aria-selected","false")}stat=false;$t.p.selarrrow.splice(ia,1);tpsr=$t.p.selarrrow[0];$t.p.selrow=(tpsr===undefined)?null:tpsr}$("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(pt.id))[$t.p.useProp?"prop":"attr"]("checked",stat);if(fid){if(ia===-1){$("#"+$.jgrid.jqID(selection),"#"+$.jgrid.jqID(fid)).addClass("ui-state-highlight")}else{$("#"+$.jgrid.jqID(selection),"#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight")}$("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(selection),"#"+$.jgrid.jqID(fid))[$t.p.useProp?"prop":"attr"]("checked",stat)}$($t).triggerHandler("jqGridSelectRow",[pt.id,stat,e]);if($t.p.onSelectRow&&onsr){$t.p.onSelectRow.call($t,pt.id,stat,e)}}})},resetSelection:function(rowid){return this.each(function(){var t=this,ind,sr,fid;if(t.p.frozenColumns===true){fid=t.p.id+"_frozen"}if(rowid!==undefined){sr=rowid===t.p.selrow?t.p.selrow:rowid;$("#"+$.jgrid.jqID(t.p.id)+" tbody:first tr#"+$.jgrid.jqID(sr)).removeClass("ui-state-highlight").attr("aria-selected","false");if(fid){$("#"+$.jgrid.jqID(sr),"#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight")}if(t.p.multiselect){$("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(sr),"#"+$.jgrid.jqID(t.p.id))[t.p.useProp?"prop":"attr"]("checked",false);if(fid){$("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(sr),"#"+$.jgrid.jqID(fid))[t.p.useProp?"prop":"attr"]("checked",false)}t.setHeadCheckBox(false)}sr=null}else{if(!t.p.multiselect){if(t.p.selrow){$("#"+$.jgrid.jqID(t.p.id)+" tbody:first tr#"+$.jgrid.jqID(t.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");if(fid){$("#"+$.jgrid.jqID(t.p.selrow),"#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight")}t.p.selrow=null}}else{$(t.p.selarrrow).each(function(i,n){ind=t.rows.namedItem(n);$(ind).removeClass("ui-state-highlight").attr("aria-selected","false");$("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(n))[t.p.useProp?"prop":"attr"]("checked",false);if(fid){$("#"+$.jgrid.jqID(n),"#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight");$("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(n),"#"+$.jgrid.jqID(fid))[t.p.useProp?"prop":"attr"]("checked",false)}});t.setHeadCheckBox(false);t.p.selarrrow=[]}}if(t.p.cellEdit===true){if(parseInt(t.p.iCol,10)>=0&&parseInt(t.p.iRow,10)>=0){$("td:eq("+t.p.iCol+")",t.rows[t.p.iRow]).removeClass("edit-cell ui-state-highlight");$(t.rows[t.p.iRow]).removeClass("selected-row ui-state-hover")}}t.p.savedRow=[]})},getRowData:function(rowid){var res={},resall,getall=false,len,j=0;this.each(function(){var $t=this,nm,ind;if(rowid===undefined){getall=true;resall=[];len=$t.rows.length}else{ind=$t.rows.namedItem(rowid);if(!ind){return res}len=2}while(j<len){if(getall){ind=$t.rows[j]}if($(ind).hasClass("jqgrow")){$('td[role="gridcell"]',ind).each(function(i){nm=$t.p.colModel[i].name;if(nm!=="cb"&&nm!=="subgrid"&&nm!=="rn"){if($t.p.treeGrid===true&&nm==$t.p.ExpandColumn){res[nm]=$.jgrid.htmlDecode($("span:first",this).html())}else{try{res[nm]=$.unformat.call($t,this,{rowId:ind.id,colModel:$t.p.colModel[i]},i)}catch(e){res[nm]=$.jgrid.htmlDecode($(this).html())}}}});if(getall){resall.push(res);res={}}}j++}});return resall||res},delRowData:function(rowid){var success=false,rowInd,ia,ri;this.each(function(){var $t=this;rowInd=$t.rows.namedItem(rowid);if(!rowInd){return false}ri=rowInd.rowIndex;$(rowInd).remove();$t.p.records--;$t.p.reccount--;$t.updatepager(true,false);success=true;if($t.p.multiselect){ia=$.inArray(rowid,$t.p.selarrrow);if(ia!=-1){$t.p.selarrrow.splice(ia,1)}}if($t.p.multiselect&&$t.p.selarrrow.length>0){$t.p.selrow=$t.p.selarrrow[$t.p.selarrrow.length-1]}else{$t.p.selrow=null}if($t.p.datatype=="local"){var id=$.jgrid.stripPref($t.p.idPrefix,rowid),pos=$t.p._index[id];if(pos!==undefined){$t.p.data.splice(pos,1);$t.refreshIndex()}}if($t.p.altRows===true&&success){var cn=$t.p.altclass;$($t.rows).each(function(i){if(i%2==1){$(this).addClass(cn)}else{$(this).removeClass(cn)}})}});return success},setRowData:function(rowid,data,cssp){var nm,success=true,title;this.each(function(){if(!this.grid){return false}var t=this,vl,ind,cp=typeof cssp,lcdata={};ind=t.rows.namedItem(rowid);if(!ind){return false}if(data){try{$(this.p.colModel).each(function(i){nm=this.name;if(data[nm]!==undefined){lcdata[nm]=this.formatter&&typeof this.formatter==="string"&&this.formatter=="date"?$.unformat.date.call(t,data[nm],this):data[nm];vl=t.formatter(rowid,data[nm],i,data,"edit");title=this.title?{title:$.jgrid.stripHtml(vl)}:{};if(t.p.treeGrid===true&&nm==t.p.ExpandColumn){$("td[role='gridcell']:eq("+i+") > span:first",ind).html(vl).attr(title)}else{$("td[role='gridcell']:eq("+i+")",ind).html(vl).attr(title)}}});if(t.p.datatype=="local"){var id=$.jgrid.stripPref(t.p.idPrefix,rowid),pos=t.p._index[id],key;if(t.p.treeGrid){for(key in t.p.treeReader){if(t.p.treeReader.hasOwnProperty(key)){delete lcdata[t.p.treeReader[key]]}}}if(pos!==undefined){t.p.data[pos]=$.extend(true,t.p.data[pos],lcdata)}lcdata=null}}catch(e){success=false}}if(success){if(cp==="string"){$(ind).addClass(cssp)}else{if(cp==="object"){$(ind).css(cssp)}}$(t).triggerHandler("jqGridAfterGridComplete")}});return success},addRowData:function(rowid,rdata,pos,src){if(!pos){pos="last"}var success=false,nm,row,gi,si,ni,sind,i,v,prp="",aradd,cnm,cn,data,cm,id;if(rdata){if($.isArray(rdata)){aradd=true;pos="last";cnm=rowid}else{rdata=[rdata];aradd=false}this.each(function(){var t=this,datalen=rdata.length;ni=t.p.rownumbers===true?1:0;gi=t.p.multiselect===true?1:0;si=t.p.subGrid===true?1:0;if(!aradd){if(rowid!==undefined){rowid=String(rowid)}else{rowid=$.jgrid.randId();if(t.p.keyIndex!==false){cnm=t.p.colModel[t.p.keyIndex+gi+si+ni].name;if(rdata[0][cnm]!==undefined){rowid=rdata[0][cnm]}}}}cn=t.p.altclass;var k=0,cna="",lcdata={},air=$.isFunction(t.p.afterInsertRow)?true:false;while(k<datalen){data=rdata[k];row=[];if(aradd){try{rowid=data[cnm];if(rowid===undefined){rowid=$.jgrid.randId()}}catch(e){rowid=$.jgrid.randId()}cna=t.p.altRows===true?(t.rows.length-1)%2===0?cn:"":""}id=rowid;rowid=t.p.idPrefix+rowid;if(ni){prp=t.formatCol(0,1,"",null,rowid,true);row[row.length]='<td role="gridcell" class="ui-state-default jqgrid-rownum" '+prp+">0</td>"}if(gi){v='<input role="checkbox" type="checkbox" id="jqg_'+t.p.id+"_"+rowid+'" class="cbox"/>';prp=t.formatCol(ni,1,"",null,rowid,true);row[row.length]='<td role="gridcell" '+prp+">"+v+"</td>"}if(si){row[row.length]=$(t).jqGrid("addSubGridCell",gi+ni,1)}for(i=gi+si+ni;i<t.p.colModel.length;i++){cm=t.p.colModel[i];nm=cm.name;lcdata[nm]=data[nm];v=t.formatter(rowid,$.jgrid.getAccessor(data,nm),i,data);prp=t.formatCol(i,1,v,data,rowid,lcdata);row[row.length]='<td role="gridcell" '+prp+">"+v+"</td>"}row.unshift(t.constructTr(rowid,false,cna,lcdata,data,false));row[row.length]="</tr>";if(t.rows.length===0){$("table:first",t.grid.bDiv).append(row.join(""))}else{switch(pos){case"last":$(t.rows[t.rows.length-1]).after(row.join(""));sind=t.rows.length-1;break;case"first":$(t.rows[0]).after(row.join(""));sind=1;break;case"after":sind=t.rows.namedItem(src);if(sind){if($(t.rows[sind.rowIndex+1]).hasClass("ui-subgrid")){$(t.rows[sind.rowIndex+1]).after(row)}else{$(sind).after(row.join(""))}}sind++;break;case"before":sind=t.rows.namedItem(src);if(sind){$(sind).before(row.join(""));sind=sind.rowIndex}sind--;break}}if(t.p.subGrid===true){$(t).jqGrid("addSubGrid",gi+ni,sind)}t.p.records++;t.p.reccount++;$(t).triggerHandler("jqGridAfterInsertRow",[rowid,data,data]);if(air){t.p.afterInsertRow.call(t,rowid,data,data)}k++;if(t.p.datatype=="local"){lcdata[t.p.localReader.id]=id;t.p._index[id]=t.p.data.length;t.p.data.push(lcdata);lcdata={}}}if(t.p.altRows===true&&!aradd){if(pos=="last"){if((t.rows.length-1)%2==1){$(t.rows[t.rows.length-1]).addClass(cn)}}else{$(t.rows).each(function(i){if(i%2==1){$(this).addClass(cn)}else{$(this).removeClass(cn)}})}}t.updatepager(true,true);success=true})}return success},footerData:function(action,data,format){var nm,success=false,res={},title;function isEmpty(obj){var i;for(i in obj){if(obj.hasOwnProperty(i)){return false}}return true}if(action===undefined){action="get"}if(typeof format!=="boolean"){format=true}action=action.toLowerCase();this.each(function(){var t=this,vl;if(!t.grid||!t.p.footerrow){return false}if(action=="set"){if(isEmpty(data)){return false}}success=true;$(this.p.colModel).each(function(i){nm=this.name;if(action=="set"){if(data[nm]!==undefined){vl=format?t.formatter("",data[nm],i,data,"edit"):data[nm];title=this.title?{title:$.jgrid.stripHtml(vl)}:{};$("tr.footrow td:eq("+i+")",t.grid.sDiv).html(vl).attr(title);success=true}}else{if(action=="get"){res[nm]=$("tr.footrow td:eq("+i+")",t.grid.sDiv).html()}}})});return action=="get"?res:success},showHideCol:function(colname,show){return this.each(function(){var $t=this,fndh=false,brd=$.jgrid.cell_width?0:$t.p.cellLayout,cw;if(!$t.grid){return}if(typeof colname==="string"){colname=[colname]}show=show!="none"?"":"none";var sw=show===""?true:false,gh=$t.p.groupHeader&&(typeof $t.p.groupHeader==="object"||$.isFunction($t.p.groupHeader));if(gh){$($t).jqGrid("destroyGroupHeader",false)}$(this.p.colModel).each(function(i){if($.inArray(this.name,colname)!==-1&&this.hidden===sw){if($t.p.frozenColumns===true&&this.frozen===true){return true}$("tr",$t.grid.hDiv).each(function(){$(this.cells[i]).css("display",show)});$($t.rows).each(function(){if(!$(this).hasClass("jqgroup")){$(this.cells[i]).css("display",show)}});if($t.p.footerrow){$("tr.footrow td:eq("+i+")",$t.grid.sDiv).css("display",show)}cw=parseInt(this.width,10);if(show==="none"){$t.p.tblwidth-=cw+brd}else{$t.p.tblwidth+=cw+brd}this.hidden=!sw;fndh=true;$($t).triggerHandler("jqGridShowHideCol",[sw,this.name,i])}});if(fndh===true){if($t.p.shrinkToFit===true&&!isNaN($t.p.height)){$t.p.tblwidth+=parseInt($t.p.scrollOffset,10)}$($t).jqGrid("setGridWidth",$t.p.shrinkToFit===true?$t.p.tblwidth:$t.p.width)}if(gh){$($t).jqGrid("setGroupHeaders",$t.p.groupHeader)}})},hideCol:function(colname){return this.each(function(){$(this).jqGrid("showHideCol",colname,"none")})},showCol:function(colname){return this.each(function(){$(this).jqGrid("showHideCol",colname,"")})},remapColumns:function(permutation,updateCells,keepHeader){function resortArray(a){var ac;if(a.length){ac=$.makeArray(a)}else{ac=$.extend({},a)}$.each(permutation,function(i){a[i]=ac[this]})}var ts=this.get(0);function resortRows(parent,clobj){$(">tr"+(clobj||""),parent).each(function(){var row=this;var elems=$.makeArray(row.cells);$.each(permutation,function(){var e=elems[this];if(e){row.appendChild(e)}})})}resortArray(ts.p.colModel);resortArray(ts.p.colNames);resortArray(ts.grid.headers);resortRows($("thead:first",ts.grid.hDiv),keepHeader&&":not(.ui-jqgrid-labels)");if(updateCells){resortRows($("#"+$.jgrid.jqID(ts.p.id)+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot")}if(ts.p.footerrow){resortRows($("tbody:first",ts.grid.sDiv))}if(ts.p.remapColumns){if(!ts.p.remapColumns.length){ts.p.remapColumns=$.makeArray(permutation)}else{resortArray(ts.p.remapColumns)}}ts.p.lastsort=$.inArray(ts.p.lastsort,permutation);if(ts.p.treeGrid){ts.p.expColInd=$.inArray(ts.p.expColInd,permutation)}$(ts).triggerHandler("jqGridRemapColumns",[permutation,updateCells,keepHeader])},setGridWidth:function(nwidth,shrink){return this.each(function(){if(!this.grid){return}var $t=this,cw,initwidth=0,brd=$.jgrid.cell_width?0:$t.p.cellLayout,lvc,vc=0,hs=false,scw=$t.p.scrollOffset,aw,gw=0,cl=0,cr;if(typeof shrink!=="boolean"){shrink=$t.p.shrinkToFit}if(isNaN(nwidth)){return}nwidth=parseInt(nwidth,10);$t.grid.width=$t.p.width=nwidth;$("#gbox_"+$.jgrid.jqID($t.p.id)).css("width",nwidth+"px");$("#gview_"+$.jgrid.jqID($t.p.id)).css("width",nwidth+"px");$($t.grid.bDiv).css("width",nwidth+"px");$($t.grid.hDiv).css("width",nwidth+"px");if($t.p.pager){$($t.p.pager).css("width",nwidth+"px")}if($t.p.toppager){$($t.p.toppager).css("width",nwidth+"px")}if($t.p.toolbar[0]===true){$($t.grid.uDiv).css("width",nwidth+"px");if($t.p.toolbar[1]=="both"){$($t.grid.ubDiv).css("width",nwidth+"px")}}if($t.p.footerrow){$($t.grid.sDiv).css("width",nwidth+"px")}if(shrink===false&&$t.p.forceFit===true){$t.p.forceFit=false}if(shrink===true){$.each($t.p.colModel,function(){if(this.hidden===false){cw=this.widthOrg;initwidth+=cw+brd;if(this.fixed){gw+=cw+brd}else{vc++}cl++}});if(vc===0){return}$t.p.tblwidth=initwidth;aw=nwidth-brd*vc-gw;if(!isNaN($t.p.height)){if($($t.grid.bDiv)[0].clientHeight<$($t.grid.bDiv)[0].scrollHeight||$t.rows.length===1){hs=true;aw-=scw}}initwidth=0;var cle=$t.grid.cols.length>0;$.each($t.p.colModel,function(i){if(this.hidden===false&&!this.fixed){cw=this.widthOrg;cw=Math.round(aw*cw/($t.p.tblwidth-brd*vc-gw));if(cw<0){return}this.width=cw;initwidth+=cw;$t.grid.headers[i].width=cw;$t.grid.headers[i].el.style.width=cw+"px";if($t.p.footerrow){$t.grid.footers[i].style.width=cw+"px"}if(cle){$t.grid.cols[i].style.width=cw+"px"}lvc=i}});if(!lvc){return}cr=0;if(hs){if(nwidth-gw-(initwidth+brd*vc)!==scw){cr=nwidth-gw-(initwidth+brd*vc)-scw}}else{if(Math.abs(nwidth-gw-(initwidth+brd*vc))!==1){cr=nwidth-gw-(initwidth+brd*vc)}}$t.p.colModel[lvc].width+=cr;$t.p.tblwidth=initwidth+cr+brd*vc+gw;if($t.p.tblwidth>nwidth){var delta=$t.p.tblwidth-parseInt(nwidth,10);$t.p.tblwidth=nwidth;cw=$t.p.colModel[lvc].width=$t.p.colModel[lvc].width-delta}else{cw=$t.p.colModel[lvc].width}$t.grid.headers[lvc].width=cw;$t.grid.headers[lvc].el.style.width=cw+"px";if(cle){$t.grid.cols[lvc].style.width=cw+"px"}if($t.p.footerrow){$t.grid.footers[lvc].style.width=cw+"px"}}if($t.p.tblwidth){$("table:first",$t.grid.bDiv).css("width",$t.p.tblwidth+"px");$("table:first",$t.grid.hDiv).css("width",$t.p.tblwidth+"px");$t.grid.hDiv.scrollLeft=$t.grid.bDiv.scrollLeft;if($t.p.footerrow){$("table:first",$t.grid.sDiv).css("width",$t.p.tblwidth+"px")}}})},setGridHeight:function(nh){return this.each(function(){var $t=this;if(!$t.grid){return}var bDiv=$($t.grid.bDiv);bDiv.css({height:nh+(isNaN(nh)?"":"px")});if($t.p.frozenColumns===true){$("#"+$.jgrid.jqID($t.p.id)+"_frozen").parent().height(bDiv.height()-16)}$t.p.height=nh;if($t.p.scroll){$t.grid.populateVisible()}})},setCaption:function(newcap){return this.each(function(){this.p.caption=newcap;$("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",this.grid.cDiv).html(newcap);$(this.grid.cDiv).show()})},setLabel:function(colname,nData,prop,attrp){return this.each(function(){var $t=this,pos=-1;if(!$t.grid){return}if(colname!==undefined){$($t.p.colModel).each(function(i){if(this.name==colname){pos=i;return false}})}else{return}if(pos>=0){var thecol=$("tr.ui-jqgrid-labels th:eq("+pos+")",$t.grid.hDiv);if(nData){var ico=$(".s-ico",thecol);$("[id^=jqgh_]",thecol).empty().html(nData).append(ico);$t.p.colNames[pos]=nData}if(prop){if(typeof prop==="string"){$(thecol).addClass(prop)}else{$(thecol).css(prop)}}if(typeof attrp==="object"){$(thecol).attr(attrp)}}})},setCell:function(rowid,colname,nData,cssp,attrp,forceupd){return this.each(function(){var $t=this,pos=-1,v,title;if(!$t.grid){return}if(isNaN(colname)){$($t.p.colModel).each(function(i){if(this.name==colname){pos=i;return false}})}else{pos=parseInt(colname,10)}if(pos>=0){var ind=$t.rows.namedItem(rowid);if(ind){var tcell=$("td:eq("+pos+")",ind);if(nData!==""||forceupd===true){v=$t.formatter(rowid,nData,pos,ind,"edit");title=$t.p.colModel[pos].title?{title:$.jgrid.stripHtml(v)}:{};if($t.p.treeGrid&&$(".tree-wrap",$(tcell)).length>0){$("span",$(tcell)).html(v).attr(title)}else{$(tcell).html(v).attr(title)}if($t.p.datatype=="local"){var cm=$t.p.colModel[pos],index;nData=cm.formatter&&typeof cm.formatter==="string"&&cm.formatter=="date"?$.unformat.date.call($t,nData,cm):nData;index=$t.p._index[rowid];if(index!==undefined){$t.p.data[index][cm.name]=nData}}}if(typeof cssp==="string"){$(tcell).addClass(cssp)}else{if(cssp){$(tcell).css(cssp)}}if(typeof attrp==="object"){$(tcell).attr(attrp)}}}})},getCell:function(rowid,col){var ret=false;this.each(function(){var $t=this,pos=-1;if(!$t.grid){return}if(isNaN(col)){$($t.p.colModel).each(function(i){if(this.name===col){pos=i;return false}})}else{pos=parseInt(col,10)}if(pos>=0){var ind=$t.rows.namedItem(rowid);if(ind){try{ret=$.unformat.call($t,$("td:eq("+pos+")",ind),{rowId:ind.id,colModel:$t.p.colModel[pos]},pos)}catch(e){ret=$.jgrid.htmlDecode($("td:eq("+pos+")",ind).html())}}}});return ret},getCol:function(col,obj,mathopr){var ret=[],val,sum=0,min,max,v;obj=typeof obj!=="boolean"?false:obj;if(mathopr===undefined){mathopr=false}this.each(function(){var $t=this,pos=-1;if(!$t.grid){return}if(isNaN(col)){$($t.p.colModel).each(function(i){if(this.name===col){pos=i;return false}})}else{pos=parseInt(col,10)}if(pos>=0){var ln=$t.rows.length,i=0;if(ln&&ln>0){while(i<ln){if($($t.rows[i]).hasClass("jqgrow")){try{val=$.unformat.call($t,$($t.rows[i].cells[pos]),{rowId:$t.rows[i].id,colModel:$t.p.colModel[pos]},pos)}catch(e){val=$.jgrid.htmlDecode($t.rows[i].cells[pos].innerHTML)}if(mathopr){v=parseFloat(val);sum+=v;if(max===undefined){max=min=v}min=Math.min(min,v);max=Math.max(max,v)}else{if(obj){ret.push({id:$t.rows[i].id,value:val})}else{ret.push(val)}}}i++}if(mathopr){switch(mathopr.toLowerCase()){case"sum":ret=sum;break;case"avg":ret=sum/ln;break;case"count":ret=ln;break;case"min":ret=min;break;case"max":ret=max;break}}}}});return ret},clearGridData:function(clearfooter){return this.each(function(){var $t=this;if(!$t.grid){return}if(typeof clearfooter!=="boolean"){clearfooter=false}if($t.p.deepempty){$("#"+$.jgrid.jqID($t.p.id)+" tbody:first tr:gt(0)").remove()}else{var trf=$("#"+$.jgrid.jqID($t.p.id)+" tbody:first tr:first")[0];$("#"+$.jgrid.jqID($t.p.id)+" tbody:first").empty().append(trf)}if($t.p.footerrow&&clearfooter){$(".ui-jqgrid-ftable td",$t.grid.sDiv).html("&#160;")}$t.p.selrow=null;$t.p.selarrrow=[];$t.p.savedRow=[];$t.p.records=0;$t.p.page=1;$t.p.lastpage=0;$t.p.reccount=0;$t.p.data=[];$t.p._index={};$t.updatepager(true,false)})},getInd:function(rowid,rc){var ret=false,rw;this.each(function(){rw=this.rows.namedItem(rowid);if(rw){ret=rc===true?rw:rw.rowIndex}});return ret},bindKeys:function(settings){var o=$.extend({onEnter:null,onSpace:null,onLeftKey:null,onRightKey:null,scrollingRows:true},settings||{});return this.each(function(){var $t=this;if(!$("body").is("[role]")){$("body").attr("role","application")}$t.p.scrollrows=o.scrollingRows;$($t).keydown(function(event){var target=$($t).find("tr[tabindex=0]")[0],id,r,mind,expanded=$t.p.treeReader.expanded_field;if(target){mind=$t.p._index[target.id];if(event.keyCode===37||event.keyCode===38||event.keyCode===39||event.keyCode===40){if(event.keyCode===38){r=target.previousSibling;id="";if(r){if($(r).is(":hidden")){while(r){r=r.previousSibling;if(!$(r).is(":hidden")&&$(r).hasClass("jqgrow")){id=r.id;break}}}else{id=r.id}}$($t).jqGrid("setSelection",id,true,event);event.preventDefault()}if(event.keyCode===40){r=target.nextSibling;id="";if(r){if($(r).is(":hidden")){while(r){r=r.nextSibling;if(!$(r).is(":hidden")&&$(r).hasClass("jqgrow")){id=r.id;break}}}else{id=r.id}}$($t).jqGrid("setSelection",id,true,event);event.preventDefault()}if(event.keyCode===37){if($t.p.treeGrid&&$t.p.data[mind][expanded]){$(target).find("div.treeclick").trigger("click")}$($t).triggerHandler("jqGridKeyLeft",[$t.p.selrow]);if($.isFunction(o.onLeftKey)){o.onLeftKey.call($t,$t.p.selrow)}}if(event.keyCode===39){if($t.p.treeGrid&&!$t.p.data[mind][expanded]){$(target).find("div.treeclick").trigger("click")}$($t).triggerHandler("jqGridKeyRight",[$t.p.selrow]);if($.isFunction(o.onRightKey)){o.onRightKey.call($t,$t.p.selrow)}}}else{if(event.keyCode===13){$($t).triggerHandler("jqGridKeyEnter",[$t.p.selrow]);if($.isFunction(o.onEnter)){o.onEnter.call($t,$t.p.selrow)}}else{if(event.keyCode===32){$($t).triggerHandler("jqGridKeySpace",[$t.p.selrow]);if($.isFunction(o.onSpace)){o.onSpace.call($t,$t.p.selrow)}}}}}})})},unbindKeys:function(){return this.each(function(){$(this).unbind("keydown")})},getLocalRow:function(rowid){var ret=false,ind;this.each(function(){if(rowid!==undefined){ind=this.p._index[rowid];if(ind>=0){ret=this.p.data[ind]}}});return ret}})})(jQuery);(function(a){a.jgrid.extend({getColProp:function(e){var b={},g=this[0];if(!g.grid){return false}var f=g.p.colModel,d;for(d=0;d<f.length;d++){if(f[d].name==e){b=f[d];break}}return b},setColProp:function(d,b){return this.each(function(){if(this.grid){if(b){var f=this.p.colModel,e;for(e=0;e<f.length;e++){if(f[e].name==d){a.extend(true,this.p.colModel[e],b);break}}}}})},sortGrid:function(d,b,e){return this.each(function(){var j=this,f=-1,h;if(!j.grid){return}if(!d){d=j.p.sortname}for(h=0;h<j.p.colModel.length;h++){if(j.p.colModel[h].index==d||j.p.colModel[h].name==d){f=h;break}}if(f!=-1){var g=j.p.colModel[f].sortable;if(typeof g!=="boolean"){g=true}if(typeof b!=="boolean"){b=false}if(g){j.sortData("jqgh_"+j.p.id+"_"+d,f,b,e)}}})},clearBeforeUnload:function(){return this.each(function(){var e=this.grid;e.emptyRows.call(this,true,true);a(e.hDiv).unbind("mousemove");a(this).unbind();e.dragEnd=null;e.dragMove=null;e.dragStart=null;e.emptyRows=null;e.populate=null;e.populateVisible=null;e.scrollGrid=null;e.selectionPreserver=null;e.bDiv=null;e.cDiv=null;e.hDiv=null;e.cols=null;var d,b=e.headers.length;for(d=0;d<b;d++){e.headers[d].el=null}this.formatCol=null;this.sortData=null;this.updatepager=null;this.refreshIndex=null;this.setHeadCheckBox=null;this.constructTr=null;this.formatter=null;this.addXmlData=null;this.addJSONData=null})},GridDestroy:function(){return this.each(function(){if(this.grid){if(this.p.pager){a(this.p.pager).remove()}try{a(this).jqGrid("clearBeforeUnload");a("#gbox_"+a.jgrid.jqID(this.id)).remove()}catch(b){}}})},GridUnload:function(){return this.each(function(){if(!this.grid){return}var e={id:a(this).attr("id"),cl:a(this).attr("class")};if(this.p.pager){a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom")}var b=document.createElement("table");a(b).attr({id:e.id});b.className=e.cl;var d=a.jgrid.jqID(this.id);a(b).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+d).length===1){a(b).insertBefore("#gbox_"+d).show();a(this.p.pager).insertBefore("#gbox_"+d)}else{a(b).insertBefore("#gbox_"+d).show()}a(this).jqGrid("clearBeforeUnload");a("#gbox_"+d).remove()})},setGridState:function(b){return this.each(function(){if(!this.grid){return}var d=this;if(b=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+a.jgrid.jqID(d.p.id)).slideUp("fast");if(d.p.pager){a(d.p.pager).slideUp("fast")}if(d.p.toppager){a(d.p.toppager).slideUp("fast")}if(d.p.toolbar[0]===true){if(d.p.toolbar[1]=="both"){a(d.grid.ubDiv).slideUp("fast")}a(d.grid.uDiv).slideUp("fast")}if(d.p.footerrow){a(".ui-jqgrid-sdiv","#gbox_"+a.jgrid.jqID(d.p.id)).slideUp("fast")}a(".ui-jqgrid-titlebar-close span",d.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");d.p.gridstate="hidden"}else{if(b=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+a.jgrid.jqID(d.p.id)).slideDown("fast");if(d.p.pager){a(d.p.pager).slideDown("fast")}if(d.p.toppager){a(d.p.toppager).slideDown("fast")}if(d.p.toolbar[0]===true){if(d.p.toolbar[1]=="both"){a(d.grid.ubDiv).slideDown("fast")}a(d.grid.uDiv).slideDown("fast")}if(d.p.footerrow){a(".ui-jqgrid-sdiv","#gbox_"+a.jgrid.jqID(d.p.id)).slideDown("fast")}a(".ui-jqgrid-titlebar-close span",d.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");d.p.gridstate="visible"}}})},filterToolbar:function(b){b=a.extend({autosearch:true,searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND",defaultSearch:"bw"},b||{});return this.each(function(){var j=this;if(this.ftoolbar){return}var d=function(){var o={},n=0,t,u,k={},l;a.each(j.p.colModel,function(){u=this.index||this.name;l=(this.searchoptions&&this.searchoptions.sopt)?this.searchoptions.sopt[0]:this.stype=="select"?"eq":b.defaultSearch;t=a("#gs_"+a.jgrid.jqID(this.name),(this.frozen===true&&j.p.frozenColumns===true)?j.grid.fhDiv:j.grid.hDiv).val();if(t){o[u]=t;k[u]=l;n++}else{try{delete j.p.postData[u]}catch(v){}}});var r=n>0?true:false;if(b.stringResult===true||j.p.datatype=="local"){var s='{"groupOp":"'+b.groupOp+'","rules":[';var q=0;a.each(o,function(v,w){if(q>0){s+=","}s+='{"field":"'+v+'",';s+='"op":"'+k[v]+'",';w+="";s+='"data":"'+w.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});s+="]}";a.extend(j.p.postData,{filters:s});a.each(["searchField","searchString","searchOper"],function(v,w){if(j.p.postData.hasOwnProperty(w)){delete j.p.postData[w]}})}else{a.extend(j.p.postData,o)}var p;if(j.p.searchurl){p=j.p.url;a(j).jqGrid("setGridParam",{url:j.p.searchurl})}var m=a(j).triggerHandler("jqGridToolbarBeforeSearch")==="stop"?true:false;if(!m&&a.isFunction(b.beforeSearch)){m=b.beforeSearch.call(j)}if(!m){a(j).jqGrid("setGridParam",{search:r}).trigger("reloadGrid",[{page:1}])}if(p){a(j).jqGrid("setGridParam",{url:p})}a(j).triggerHandler("jqGridToolbarAfterSearch");if(a.isFunction(b.afterSearch)){b.afterSearch.call(j)}};var h=function(k){var m={},l=0,s;k=(typeof k!=="boolean")?true:k;a.each(j.p.colModel,function(){var t;if(this.searchoptions&&this.searchoptions.defaultValue!==undefined){t=this.searchoptions.defaultValue}s=this.index||this.name;switch(this.stype){case"select":a("#gs_"+a.jgrid.jqID(this.name)+" option",(this.frozen===true&&j.p.frozenColumns===true)?j.grid.fhDiv:j.grid.hDiv).each(function(v){if(v===0){this.selected=true}if(a(this).val()==t){this.selected=true;return false}});if(t!==undefined){m[s]=t;l++}else{try{delete j.p.postData[s]}catch(u){}}break;case"text":a("#gs_"+a.jgrid.jqID(this.name),(this.frozen===true&&j.p.frozenColumns===true)?j.grid.fhDiv:j.grid.hDiv).val(t);if(t!==undefined){m[s]=t;l++}else{try{delete j.p.postData[s]}catch(w){}}break}});var p=l>0?true:false;if(b.stringResult===true||j.p.datatype=="local"){var q='{"groupOp":"'+b.groupOp+'","rules":[';var o=0;a.each(m,function(t,u){if(o>0){q+=","}q+='{"field":"'+t+'",';q+='"op":"eq",';u+="";q+='"data":"'+u.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';o++});q+="]}";a.extend(j.p.postData,{filters:q});a.each(["searchField","searchString","searchOper"],function(t,u){if(j.p.postData.hasOwnProperty(u)){delete j.p.postData[u]}})}else{a.extend(j.p.postData,m)}var n;if(j.p.searchurl){n=j.p.url;a(j).jqGrid("setGridParam",{url:j.p.searchurl})}var r=a(j).triggerHandler("jqGridToolbarBeforeClear")==="stop"?true:false;if(!r&&a.isFunction(b.beforeClear)){r=b.beforeClear.call(j)}if(!r){if(k){a(j).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}])}}if(n){a(j).jqGrid("setGridParam",{url:n})}a(j).triggerHandler("jqGridToolbarAfterClear");if(a.isFunction(b.afterClear)){b.afterClear()}};var f=function(){var k=a("tr.ui-search-toolbar",j.grid.hDiv),l=j.p.frozenColumns===true?a("tr.ui-search-toolbar",j.grid.fhDiv):false;if(k.css("display")=="none"){k.show();if(l){l.show()}}else{k.hide();if(l){l.hide()}}};var g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>");var e;a.each(j.p.colModel,function(){var w=this,u,n,s,l,z;n=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+j.p.direction+"'></th>");u=a("<div style='position:relative;height:100%;padding-right:0.3em;'></div>");if(this.hidden===true){a(n).css("display","none")}this.search=this.search===false?false:true;if(this.stype===undefined){this.stype="text"}s=a.extend({},this.searchoptions||{});if(this.search){switch(this.stype){case"select":l=this.surl||s.dataUrl;if(l){z=u;a.ajax(a.extend({url:l,dataType:"html",success:function(k){if(s.buildSelect!==undefined){var B=s.buildSelect(k);if(B){a(z).append(B)}}else{a(z).append(k)}if(s.defaultValue!==undefined){a("select",z).val(s.defaultValue)}a("select",z).attr({name:w.index||w.name,id:"gs_"+w.name});if(s.attr){a("select",z).attr(s.attr)}a("select",z).css({width:"100%"});a.jgrid.bindEv(a("select",z)[0],s,j);if(b.autosearch===true){a("select",z).change(function(){d();return false})}k=null}},a.jgrid.ajaxOptions,j.p.ajaxSelectOptions||{}))}else{var m,A,p;if(w.searchoptions){m=w.searchoptions.value===undefined?"":w.searchoptions.value;A=w.searchoptions.separator===undefined?":":w.searchoptions.separator;p=w.searchoptions.delimiter===undefined?";":w.searchoptions.delimiter}else{if(w.editoptions){m=w.editoptions.value===undefined?"":w.editoptions.value;A=w.editoptions.separator===undefined?":":w.editoptions.separator;p=w.editoptions.delimiter===undefined?";":w.editoptions.delimiter}}if(m){var r=document.createElement("select");r.style.width="100%";a(r).attr({name:w.index||w.name,id:"gs_"+w.name});var o,y,q,x,t;if(typeof m==="string"){o=m.split(p);for(t=0;t<o.length;t++){y=o[t].split(A);q=document.createElement("option");q.value=y[0];q.innerHTML=y[1];r.appendChild(q)}}else{if(typeof m==="object"){for(x in m){if(m.hasOwnProperty(x)){q=document.createElement("option");q.value=x;q.innerHTML=m[x];r.appendChild(q)}}}}if(s.defaultValue!==undefined){a(r).val(s.defaultValue)}if(s.attr){a(r).attr(s.attr)}a.jgrid.bindEv(r,s,j);a(u).append(r);if(b.autosearch===true){a(r).change(function(){d();return false})}}}break;case"text":var v=s.defaultValue!==undefined?s.defaultValue:"";a(u).append("<input type='text' style='width:95%;padding:0px;' name='"+(w.index||w.name)+"' id='gs_"+w.name+"' value='"+v+"'/>");if(s.attr){a("input",u).attr(s.attr)}a.jgrid.bindEv(a("input",u)[0],s,j);if(b.autosearch===true){if(b.searchOnEnter){a("input",u).keypress(function(B){var k=B.charCode||B.keyCode||0;if(k==13){d();return false}return this})}else{a("input",u).keydown(function(B){var k=B.which;switch(k){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:if(e){clearTimeout(e)}e=setTimeout(function(){d()},500)}})}}break}}a(n).append(u);a(g).append(n)});a("table thead",j.grid.hDiv).append(g);this.ftoolbar=true;this.triggerToolbar=d;this.clearToolbar=h;this.toggleToolbar=f})},destroyFilterToolbar:function(){return this.each(function(){if(!this.ftoolbar){return}this.triggerToolbar=null;this.clearToolbar=null;this.toggleToolbar=null;this.ftoolbar=false;a(this.grid.hDiv).find("table thead tr.ui-search-toolbar").remove()})},destroyGroupHeader:function(b){if(b===undefined){b=true}return this.each(function(){var j=this,n,k,g,e,q,f,d=j.grid,o=a("table.ui-jqgrid-htable thead",d.hDiv),p=j.p.colModel,m;if(!d){return}a(this).unbind(".setGroupHeaders");n=a("<tr>",{role:"rowheader"}).addClass("ui-jqgrid-labels");e=d.headers;for(k=0,g=e.length;k<g;k++){m=p[k].hidden?"none":"";q=a(e[k].el).width(e[k].width).css("display",m);try{q.removeAttr("rowSpan")}catch(h){q.attr("rowSpan",1)}n.append(q);f=q.children("span.ui-jqgrid-resize");if(f.length>0){f[0].style.height=""}q.children("div")[0].style.top=""}a(o).children("tr.ui-jqgrid-labels").remove();a(o).prepend(n);if(b===true){a(j).jqGrid("setGridParam",{groupHeader:null})}})},setGroupHeaders:function(b){b=a.extend({useColSpanStyle:false,groupHeaders:[]},b||{});return this.each(function(){this.p.groupHeader=b;var d=this,z,v,w=0,B,p,k,g,j,h,A,r,q,u,o=d.p.colModel,s=o.length,e=d.grid.headers,y=a("table.ui-jqgrid-htable",d.grid.hDiv),f=y.children("thead").children("tr.ui-jqgrid-labels:last").addClass("jqg-second-row-header"),n=y.children("thead"),t,m=y.find(".jqg-first-row-header");if(m[0]===undefined){m=a("<tr>",{role:"row","aria-hidden":"true"}).addClass("jqg-first-row-header").css("height","auto")}else{m.empty()}var l,x=function(F,D){var E=D.length,C;for(C=0;C<E;C++){if(D[C].startColumnName===F){return C}}return -1};a(d).prepend(n);B=a("<tr>",{role:"rowheader"}).addClass("ui-jqgrid-labels jqg-third-row-header");for(z=0;z<s;z++){k=e[z].el;g=a(k);v=o[z];j={height:"0px",width:e[z].width+"px",display:(v.hidden?"none":"")};a("<th>",{role:"gridcell"}).css(j).addClass("ui-first-th-"+d.p.direction).appendTo(m);k.style.width="";h=x(v.name,b.groupHeaders);if(h>=0){A=b.groupHeaders[h];r=A.numberOfColumns;q=A.titleText;for(u=0,h=0;h<r&&(z+h<s);h++){if(!o[z+h].hidden){u++}}p=a("<th>").attr({role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+d.p.direction).css({height:"22px","border-top":"0px none"}).html(q);if(u>0){p.attr("colspan",String(u))}if(d.p.headertitles){p.attr("title",p.text())}if(u===0){p.hide()}g.before(p);B.append(k);w=r-1}else{if(w===0){if(b.useColSpanStyle){g.attr("rowspan","2")}else{a("<th>",{role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+d.p.direction).css({display:v.hidden?"none":"","border-top":"0px none"}).insertBefore(g);B.append(k)}}else{B.append(k);w--}}}t=a(d).children("thead");t.prepend(m);B.insertAfter(f);y.append(t);if(b.useColSpanStyle){y.find("span.ui-jqgrid-resize").each(function(){var C=a(this).parent();if(C.is(":visible")){this.style.cssText="height: "+C.height()+"px !important; cursor: col-resize;"}});y.find("div.ui-jqgrid-sortable").each(function(){var C=a(this),D=C.parent();if(D.is(":visible")&&D.is(":has(span.ui-jqgrid-resize)")){C.css("top",(D.height()-C.outerHeight())/2+"px")}})}l=t.find("tr.jqg-first-row-header");a(d).bind("jqGridResizeStop.setGroupHeaders",function(E,D,C){l.find("th").eq(C).width(D)})})},setFrozenColumns:function(){return this.each(function(){if(!this.grid){return}var g=this,n=g.p.colModel,h=0,j=n.length,m=-1,b=false;if(g.p.subGrid===true||g.p.treeGrid===true||g.p.cellEdit===true||g.p.sortable||g.p.scroll||g.p.grouping){return}if(g.p.rownumbers){h++}if(g.p.multiselect){h++}while(h<j){if(n[h].frozen===true){b=true;m=h}else{break}h++}if(m>=0&&b){var k=g.p.caption?a(g.grid.cDiv).outerHeight():0,l=a(".ui-jqgrid-htable","#gview_"+a.jgrid.jqID(g.p.id)).height();if(g.p.toppager){k=k+a(g.grid.topDiv).outerHeight()}if(g.p.toolbar[0]===true){if(g.p.toolbar[1]!="bottom"){k=k+a(g.grid.uDiv).outerHeight()}}g.grid.fhDiv=a('<div style="position:absolute;left:0px;top:'+k+"px;height:"+l+'px;" class="frozen-div ui-state-default ui-jqgrid-hdiv"></div>');g.grid.fbDiv=a('<div style="position:absolute;left:0px;top:'+(parseInt(k,10)+parseInt(l,10)+1)+'px;overflow-y:hidden" class="frozen-bdiv ui-jqgrid-bdiv"></div>');a("#gview_"+a.jgrid.jqID(g.p.id)).append(g.grid.fhDiv);var f=a(".ui-jqgrid-htable","#gview_"+a.jgrid.jqID(g.p.id)).clone(true);if(g.p.groupHeader){a("tr.jqg-first-row-header, tr.jqg-third-row-header",f).each(function(){a("th:gt("+m+")",this).remove()});var d=-1,e=-1;a("tr.jqg-second-row-header th",f).each(function(){var o=parseInt(a(this).attr("colspan"),10);if(o){d=d+o;e++}if(d===m){return false}});if(d!==m){e=m}a("tr.jqg-second-row-header",f).each(function(){a("th:gt("+e+")",this).remove()})}else{a("tr",f).each(function(){a("th:gt("+m+")",this).remove()})}a(f).width(1);a(g.grid.fhDiv).append(f).mousemove(function(o){if(g.grid.resizing){g.grid.dragMove(o);return false}});a(g).bind("jqGridResizeStop.setFrozenColumns",function(s,o,q){var r=a(".ui-jqgrid-htable",g.grid.fhDiv);a("th:eq("+q+")",r).width(o);var p=a(".ui-jqgrid-btable",g.grid.fbDiv);a("tr:first td:eq("+q+")",p).width(o)});a(g).bind("jqGridOnSortCol.setFrozenColumns",function(p,r){var o=a("tr.ui-jqgrid-labels:last th:eq("+g.p.lastsort+")",g.grid.fhDiv),q=a("tr.ui-jqgrid-labels:last th:eq("+r+")",g.grid.fhDiv);a("span.ui-grid-ico-sort",o).addClass("ui-state-disabled");a(o).attr("aria-selected","false");a("span.ui-icon-"+g.p.sortorder,q).removeClass("ui-state-disabled");a(q).attr("aria-selected","true");if(!g.p.viewsortcols[0]){if(g.p.lastsort!=r){a("span.s-ico",o).hide();a("span.s-ico",q).show()}}});a("#gview_"+a.jgrid.jqID(g.p.id)).append(g.grid.fbDiv);a(g.grid.bDiv).scroll(function(){a(g.grid.fbDiv).scrollTop(a(this).scrollTop())});if(g.p.hoverrows===true){a("#"+a.jgrid.jqID(g.p.id)).unbind("mouseover").unbind("mouseout")}a(g).bind("jqGridAfterGridComplete.setFrozenColumns",function(){a("#"+a.jgrid.jqID(g.p.id)+"_frozen").remove();a(g.grid.fbDiv).height(a(g.grid.bDiv).height()-16);var o=a("#"+a.jgrid.jqID(g.p.id)).clone(true);a("tr",o).each(function(){a("td:gt("+m+")",this).remove()});a(o).width(1).attr("id",g.p.id+"_frozen");a(g.grid.fbDiv).append(o);if(g.p.hoverrows===true){a("tr.jqgrow",o).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(g.p.id)).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(g.p.id)).removeClass("ui-state-hover")});a("tr.jqgrow","#"+a.jgrid.jqID(g.p.id)).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(g.p.id)+"_frozen").addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(g.p.id)+"_frozen").removeClass("ui-state-hover")})}o=null});g.p.frozenColumns=true}})},destroyFrozenColumns:function(){return this.each(function(){if(!this.grid){return}if(this.p.frozenColumns===true){var d=this;a(d.grid.fhDiv).remove();a(d.grid.fbDiv).remove();d.grid.fhDiv=null;d.grid.fbDiv=null;a(this).unbind(".setFrozenColumns");if(d.p.hoverrows===true){var b;a("#"+a.jgrid.jqID(d.p.id)).bind("mouseover",function(f){b=a(f.target).closest("tr.jqgrow");if(a(b).attr("class")!=="ui-subgrid"){a(b).addClass("ui-state-hover")}}).bind("mouseout",function(f){b=a(f.target).closest("tr.jqgrow");a(b).removeClass("ui-state-hover")})}this.p.frozenColumns=false}})}})})(jQuery);(function(d){d.fn.jqm=function(f){var e={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:n,ajaxText:"",target:n,modal:n,toTop:n,onShow:n,onHide:n,onLoad:n};return this.each(function(){if(this._jqm){return l[this._jqm].c=d.extend({},l[this._jqm].c,f)}o++;this._jqm=o;l[o]={c:d.extend(e,d.jqm.params,f),a:n,w:d(this).addClass("jqmID"+o),s:o};if(e.trigger){d(this).jqmAddTrigger(e.trigger)}})};d.fn.jqmAddClose=function(f){return k(this,f,"jqmHide")};d.fn.jqmAddTrigger=function(f){return k(this,f,"jqmShow")};d.fn.jqmShow=function(e){return this.each(function(){d.jqm.open(this._jqm,e)})};d.fn.jqmHide=function(e){return this.each(function(){d.jqm.close(this._jqm,e)})};d.jqm={hash:{},open:function(y,x){var p=l[y],q=p.c,m="."+q.closeClass,v=(parseInt(p.w.css("z-index")));v=(v>0)?v:3000;var f=d("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":v-1,opacity:q.overlay/100});if(p.a){return n}p.t=x;p.a=true;p.w.css("z-index",v);if(q.modal){if(!a[0]){setTimeout(function(){j("bind")},1)}a.push(y)}else{if(q.overlay>0){if(q.closeoverlay){p.w.jqmAddClose(f)}}else{f=n}}p.o=(f)?f.addClass(q.overlayClass).prependTo("body"):n;if(q.ajax){var e=q.target||p.w,w=q.ajax;e=(typeof e=="string")?d(e,p.w):d(e);w=(w.substr(0,1)=="@")?d(x).attr(w.substring(1)):w;e.html(q.ajaxText).load(w,function(){if(q.onLoad){q.onLoad.call(this,p)}if(m){p.w.jqmAddClose(d(m,p.w))}h(p)})}else{if(m){p.w.jqmAddClose(d(m,p.w))}}if(q.toTop&&p.o){p.w.before('<span id="jqmP'+p.w[0]._jqm+'"></span>').insertAfter(p.o)}(q.onShow)?q.onShow(p):p.w.show();h(p);return n},close:function(f){var e=l[f];if(!e.a){return n}e.a=n;if(a[0]){a.pop();if(!a[0]){j("unbind")}}if(e.c.toTop&&e.o){d("#jqmP"+e.w[0]._jqm).after(e.w).remove()}if(e.c.onHide){e.c.onHide(e)}else{e.w.hide();if(e.o){e.o.remove()}}return n},params:{}};var o=0,l=d.jqm.hash,a=[],n=false,h=function(e){g(e)},g=function(f){try{d(":input:visible",f.w)[0].focus()}catch(e){}},j=function(e){d(document)[e]("keypress",b)[e]("keydown",b)[e]("mousedown",b)},b=function(p){var f=l[a[a.length-1]],m=(!d(p.target).parents(".jqmID"+f.s)[0]);if(m){g(f)}return !m},k=function(e,f,m){return e.each(function(){var p=this._jqm;d(f).each(function(){if(!this[m]){this[m]=[];d(this).click(function(){for(var q in {jqmShow:1,jqmHide:1}){for(var r in this[q]){if(l[this[q][r]]){l[this[q][r]].w[q](this)}}}return n})}this[m].push(p)})})}})(jQuery);(function(d){d.fn.jqDrag=function(f){return e(this,f,"d")};d.fn.jqResize=function(m,f){return e(this,m,"r",f)};d.jqDnR={dnr:{},e:0,drag:function(f){if(h.k=="d"){l.css({left:h.X+f.pageX-h.pX,top:h.Y+f.pageY-h.pY})}else{l.css({width:Math.max(f.pageX-h.pX+h.W,0),height:Math.max(f.pageY-h.pY+h.H,0)});if(a){k.css({width:Math.max(f.pageX-a.pX+a.W,0),height:Math.max(f.pageY-a.pY+a.H,0)})}}return false},stop:function(){d(document).unbind("mousemove",j.drag).unbind("mouseup",j.stop)}};var j=d.jqDnR,h=j.dnr,l=j.e,k,a,e=function(o,n,m,f){return o.each(function(){n=(n)?d(n,o):o;n.bind("mousedown",{e:o,k:m},function(q){var u=q.data,t={};l=u.e;k=f?d(f):false;if(l.css("position")!="relative"){try{l.position(t)}catch(s){}}h={X:t.left||g("left")||0,Y:t.top||g("top")||0,W:g("width")||l[0].scrollWidth||0,H:g("height")||l[0].scrollHeight||0,pX:q.pageX,pY:q.pageY,k:u.k};if(k&&u.k!="d"){a={X:t.left||b("left")||0,Y:t.top||b("top")||0,W:k[0].offsetWidth||b("width")||0,H:k[0].offsetHeight||b("height")||0,pX:q.pageX,pY:q.pageY,k:u.k}}else{a=false}if(d("input.hasDatepicker",l[0])[0]){try{d("input.hasDatepicker",l[0]).datepicker("hide")}catch(r){}}d(document).mousemove(d.jqDnR.drag).mouseup(d.jqDnR.stop);return false})})},g=function(f){return parseInt(l.css(f),10)||false},b=function(f){return parseInt(k.css(f),10)||false}})(jQuery);var xmlJsonClass={xml2json:function(b,e){if(b.nodeType===9){b=b.documentElement}var a=this.removeWhite(b);var f=this.toObj(a);var d=this.toJson(f,b.nodeName,"\t");return"{\n"+e+(e?d.replace(/\t/g,e):d.replace(/\t|\n/g,""))+"\n}"},json2xml:function(e,d){var f=function(r,g,j){var p="";var o,h;if(r instanceof Array){if(r.length===0){p+=j+"<"+g+">__EMPTY_ARRAY_</"+g+">\n"}else{for(o=0,h=r.length;o<h;o+=1){var q=j+f(r[o],g,j+"\t")+"\n";p+=q}}}else{if(typeof(r)==="object"){var l=false;p+=j+"<"+g;var k;for(k in r){if(r.hasOwnProperty(k)){if(k.charAt(0)==="@"){p+=" "+k.substr(1)+'="'+r[k].toString()+'"'}else{l=true}}}p+=l?">":"/>";if(l){for(k in r){if(r.hasOwnProperty(k)){if(k==="#text"){p+=r[k]}else{if(k==="#cdata"){p+="<![CDATA["+r[k]+"]]>"}else{if(k.charAt(0)!=="@"){p+=f(r[k],k,j+"\t")}}}}}p+=(p.charAt(p.length-1)==="\n"?j:"")+"</"+g+">"}}else{if(typeof(r)==="function"){p+=j+"<"+g+"><![CDATA["+r+"]]></"+g+">"}else{if(r===undefined){r=""}if(r.toString()==='""'||r.toString().length===0){p+=j+"<"+g+">__EMPTY_STRING_</"+g+">"}else{p+=j+"<"+g+">"+r.toString()+"</"+g+">"}}}}return p};var b="";var a;for(a in e){if(e.hasOwnProperty(a)){b+=f(e[a],a,"")}}return d?b.replace(/\t/g,d):b.replace(/\t|\n/g,"")},toObj:function(b){var h={};var g=/function/i;if(b.nodeType===1){if(b.attributes.length){var f;for(f=0;f<b.attributes.length;f+=1){h["@"+b.attributes[f].nodeName]=(b.attributes[f].nodeValue||"").toString()}}if(b.firstChild){var a=0,e=0,d=false;var j;for(j=b.firstChild;j;j=j.nextSibling){if(j.nodeType===1){d=true}else{if(j.nodeType===3&&j.nodeValue.match(/[^ \f\n\r\t\v]/)){a+=1}else{if(j.nodeType===4){e+=1}}}}if(d){if(a<2&&e<2){this.removeWhite(b);for(j=b.firstChild;j;j=j.nextSibling){if(j.nodeType===3){h["#text"]=this.escape(j.nodeValue)}else{if(j.nodeType===4){if(g.test(j.nodeValue)){h[j.nodeName]=[h[j.nodeName],j.nodeValue]}else{h["#cdata"]=this.escape(j.nodeValue)}}else{if(h[j.nodeName]){if(h[j.nodeName] instanceof Array){h[j.nodeName][h[j.nodeName].length]=this.toObj(j)}else{h[j.nodeName]=[h[j.nodeName],this.toObj(j)]}}else{h[j.nodeName]=this.toObj(j)}}}}}else{if(!b.attributes.length){h=this.escape(this.innerXml(b))}else{h["#text"]=this.escape(this.innerXml(b))}}}else{if(a){if(!b.attributes.length){h=this.escape(this.innerXml(b));if(h==="__EMPTY_ARRAY_"){h="[]"}else{if(h==="__EMPTY_STRING_"){h=""}}}else{h["#text"]=this.escape(this.innerXml(b))}}else{if(e){if(e>1){h=this.escape(this.innerXml(b))}else{for(j=b.firstChild;j;j=j.nextSibling){if(g.test(b.firstChild.nodeValue)){h=b.firstChild.nodeValue;break}else{h["#cdata"]=this.escape(j.nodeValue)}}}}}}}if(!b.attributes.length&&!b.firstChild){h=null}}else{if(b.nodeType===9){h=this.toObj(b.documentElement)}else{alert("unhandled node type: "+b.nodeType)}}return h},toJson:function(b,a,e,f){if(f===undefined){f=true}var q=a?('"'+a+'"'):"",g="\t",h="\n";if(!f){g="";h=""}if(b==="[]"){q+=(a?":[]":"[]")}else{if(b instanceof Array){var d,l,k=[];for(l=0,d=b.length;l<d;l+=1){k[l]=this.toJson(b[l],"",e+g,f)}q+=(a?":[":"[")+(k.length>1?(h+e+g+k.join(","+h+e+g)+h+e):k.join(""))+"]"}else{if(b===null){q+=(a&&":")+"null"}else{if(typeof(b)==="object"){var p=[],j;for(j in b){if(b.hasOwnProperty(j)){p[p.length]=this.toJson(b[j],j,e+g,f)}}q+=(a?":{":"{")+(p.length>1?(h+e+g+p.join(","+h+e+g)+h+e):p.join(""))+"}"}else{if(typeof(b)==="string"){q+=(a&&":")+'"'+b.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"'}else{q+=(a&&":")+b.toString()}}}}}return q},innerXml:function(d){var b="";if("innerHTML" in d){b=d.innerHTML}else{var a=function(j){var g="",f;if(j.nodeType===1){g+="<"+j.nodeName;for(f=0;f<j.attributes.length;f+=1){g+=" "+j.attributes[f].nodeName+'="'+(j.attributes[f].nodeValue||"").toString()+'"'}if(j.firstChild){g+=">";for(var h=j.firstChild;h;h=h.nextSibling){g+=a(h)}g+="</"+j.nodeName+">"}else{g+="/>"}}else{if(j.nodeType===3){g+=j.nodeValue}else{if(j.nodeType===4){g+="<![CDATA["+j.nodeValue+"]]>"}}}return g};for(var e=d.firstChild;e;e=e.nextSibling){b+=a(e)}}return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(b){b.normalize();var d;for(d=b.firstChild;d;){if(d.nodeType===3){if(!d.nodeValue.match(/[^ \f\n\r\t\v]/)){var a=d.nextSibling;b.removeChild(d);d=a}else{d=d.nextSibling}}else{if(d.nodeType===1){this.removeWhite(d);d=d.nextSibling}else{d=d.nextSibling}}}return b}};(function(a){a.fmatter={};a.extend(a.fmatter,{isBoolean:function(b){return typeof b==="boolean"},isObject:function(b){return(b&&(typeof b==="object"||a.isFunction(b)))||false},isString:function(b){return typeof b==="string"},isNumber:function(b){return typeof b==="number"&&isFinite(b)},isNull:function(b){return b===null},isUndefined:function(b){return b===undefined},isValue:function(b){return(this.isObject(b)||this.isString(b)||this.isNumber(b)||this.isBoolean(b))},isEmpty:function(b){if(!this.isString(b)&&this.isValue(b)){return false}if(!this.isValue(b)){return true}b=a.trim(b).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return b===""}});a.fn.fmatter=function(h,j,g,b,d){var e=j;g=a.extend({},a.jgrid.formatter,g);try{e=a.fn.fmatter[h].call(this,j,g,b,d)}catch(f){}return e};a.fmatter.util={NumberFormat:function(e,b){if(!a.fmatter.isNumber(e)){e*=1}if(a.fmatter.isNumber(e)){var g=(e<0);var m=String(e);var j=b.decimalSeparator||".";var k;if(a.fmatter.isNumber(b.decimalPlaces)){var l=b.decimalPlaces;var f=Math.pow(10,l);m=String(Math.round(e*f)/f);k=m.lastIndexOf(".");if(l>0){if(k<0){m+=j;k=m.length-1}else{if(j!=="."){m=m.replace(".",j)}}while((m.length-1-k)<l){m+="0"}}}if(b.thousandsSeparator){var o=b.thousandsSeparator;k=m.lastIndexOf(j);k=(k>-1)?k:m.length;var n=m.substring(k);var d=-1,h;for(h=k;h>0;h--){d++;if((d%3===0)&&(h!==k)&&(!g||(h>1))){n=o+n}n=m.charAt(h-1)+n}m=n}m=(b.prefix)?b.prefix+m:m;m=(b.suffix)?m+b.suffix:m;return m}return e},DateFormat:function(K,O,Q,A){var p=/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,E=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,M=/[^-+\dA-Z]/g,q=new RegExp("^/Date\\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\\)/$"),g=((typeof O==="string")?O.match(q):null),L=function(k,j){k=String(k);j=parseInt(j,10)||2;while(k.length<j){k="0"+k}return k},b={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},f=0,t,H,e,F=["i18n"];F.i18n={dayNames:A.dayNames,monthNames:A.monthNames};if(A.masks.hasOwnProperty(K)){K=A.masks[K]}if(!isNaN(O-0)&&String(K).toLowerCase()=="u"){f=new Date(parseFloat(O)*1000)}else{if(O.constructor===Date){f=O}else{if(g!==null){f=new Date(parseInt(g[1],10));if(g[3]){var h=Number(g[5])*60+Number(g[6]);h*=((g[4]=="-")?1:-1);h-=f.getTimezoneOffset();f.setTime(Number(Number(f)+(h*60*1000)))}}else{O=String(O).split(/[\\\/:_;.,\t\T\s-]/);K=K.split(/[\\\/:_;.,\t\T\s-]/);for(H=0,e=K.length;H<e;H++){if(K[H]=="M"){t=a.inArray(O[H],F.i18n.monthNames);if(t!==-1&&t<12){O[H]=t+1}}if(K[H]=="F"){t=a.inArray(O[H],F.i18n.monthNames);if(t!==-1&&t>11){O[H]=t+1-12}}if(O[H]){b[K[H].toLowerCase()]=parseInt(O[H],10)}}if(b.f){b.m=b.f}if(b.m===0&&b.y===0&&b.d===0){return"&#160;"}b.m=parseInt(b.m,10)-1;var P=b.y;if(P>=70&&P<=99){b.y=1900+b.y}else{if(P>=0&&P<=69){b.y=2000+b.y}}f=new Date(b.y,b.m,b.d,b.h,b.i,b.s,b.u)}}}if(A.masks.hasOwnProperty(Q)){Q=A.masks[Q]}else{if(!Q){Q="Y-m-d"}}var x=f.getHours(),J=f.getMinutes(),I=f.getDate(),D=f.getMonth()+1,C=f.getTimezoneOffset(),B=f.getSeconds(),y=f.getMilliseconds(),v=f.getDay(),d=f.getFullYear(),m=(v+6)%7+1,r=(new Date(d,D-1,I)-new Date(d,0,1))/86400000,l={d:L(I),D:F.i18n.dayNames[v],j:I,l:F.i18n.dayNames[v+7],N:m,S:A.S(I),w:v,z:r,W:m<5?Math.floor((r+m-1)/7)+1:Math.floor((r+m-1)/7)||((new Date(d-1,0,1).getDay()+6)%7<4?53:52),F:F.i18n.monthNames[D-1+12],m:L(D),M:F.i18n.monthNames[D-1],n:D,t:"?",L:"?",o:"?",Y:d,y:String(d).substring(2),a:x<12?A.AmPm[0]:A.AmPm[1],A:x<12?A.AmPm[2]:A.AmPm[3],B:"?",g:x%12||12,G:x,h:L(x%12||12),H:L(x),i:L(J),s:L(B),u:y,e:"?",I:"?",O:(C>0?"-":"+")+L(Math.floor(Math.abs(C)/60)*100+Math.abs(C)%60,4),P:"?",T:(String(f).match(E)||[""]).pop().replace(M,""),Z:"?",c:"?",r:"?",U:Math.floor(f/1000)};return Q.replace(p,function(j){return l.hasOwnProperty(j)?l[j]:j.substring(1)})}};a.fn.fmatter.defaultFormat=function(d,b){return(a.fmatter.isValue(d)&&d!=="")?d:b.defaultValue||"&#160;"};a.fn.fmatter.email=function(d,b){if(!a.fmatter.isEmpty(d)){return'<a href="mailto:'+d+'">'+d+"</a>"}return a.fn.fmatter.defaultFormat(d,b)};a.fn.fmatter.checkbox=function(f,d){var g=a.extend({},d.checkbox),e;if(d.colModel!==undefined&&!a.fmatter.isUndefined(d.colModel.formatoptions)){g=a.extend({},g,d.colModel.formatoptions)}if(g.disabled===true){e='disabled="disabled"'}else{e=""}if(a.fmatter.isEmpty(f)||a.fmatter.isUndefined(f)){f=a.fn.fmatter.defaultFormat(f,g)}f=String(f);f=f.toLowerCase();var b=f.search(/(false|0|no|n|off)/i)<0?" checked='checked' ":"";return'<input type="checkbox" '+b+' value="'+f+'" offval="no" '+e+"/>"};a.fn.fmatter.link=function(e,b){var f={target:b.target};var d="";if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){f=a.extend({},f,b.colModel.formatoptions)}if(f.target){d="target="+f.target}if(!a.fmatter.isEmpty(e)){return"<a "+d+' href="'+e+'">'+e+"</a>"}return a.fn.fmatter.defaultFormat(e,b)};a.fn.fmatter.showlink=function(e,b){var g={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName},d="",f;if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){g=a.extend({},g,b.colModel.formatoptions)}if(g.target){d="target="+g.target}f=g.baseLinkUrl+g.showAction+"?"+g.idName+"="+b.rowId+g.addParam;if(a.fmatter.isString(e)||a.fmatter.isNumber(e)){return"<a "+d+' href="'+f+'">'+e+"</a>"}return a.fn.fmatter.defaultFormat(e,b)};a.fn.fmatter.integer=function(d,b){var e=a.extend({},b.integer);if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){e=a.extend({},e,b.colModel.formatoptions)}if(a.fmatter.isEmpty(d)){return e.defaultValue}return a.fmatter.util.NumberFormat(d,e)};a.fn.fmatter.number=function(d,b){var e=a.extend({},b.number);if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){e=a.extend({},e,b.colModel.formatoptions)}if(a.fmatter.isEmpty(d)){return e.defaultValue}return a.fmatter.util.NumberFormat(d,e)};a.fn.fmatter.currency=function(d,b){var e=a.extend({},b.currency);if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){e=a.extend({},e,b.colModel.formatoptions)}if(a.fmatter.isEmpty(d)){return e.defaultValue}return a.fmatter.util.NumberFormat(d,e)};a.fn.fmatter.date=function(f,e,b,d){var g=a.extend({},e.date);if(e.colModel!==undefined&&!a.fmatter.isUndefined(e.colModel.formatoptions)){g=a.extend({},g,e.colModel.formatoptions)}if(!g.reformatAfterEdit&&d=="edit"){return a.fn.fmatter.defaultFormat(f,e)}if(!a.fmatter.isEmpty(f)){return a.fmatter.util.DateFormat(g.srcformat,f,g.newformat,g)}return a.fn.fmatter.defaultFormat(f,e)};a.fn.fmatter.select=function(h,b){h=String(h);var f=false,l=[],p,e;if(!a.fmatter.isUndefined(b.colModel.formatoptions)){f=b.colModel.formatoptions.value;p=b.colModel.formatoptions.separator===undefined?":":b.colModel.formatoptions.separator;e=b.colModel.formatoptions.delimiter===undefined?";":b.colModel.formatoptions.delimiter}else{if(!a.fmatter.isUndefined(b.colModel.editoptions)){f=b.colModel.editoptions.value;p=b.colModel.editoptions.separator===undefined?":":b.colModel.editoptions.separator;e=b.colModel.editoptions.delimiter===undefined?";":b.colModel.editoptions.delimiter}}if(f){var o=b.colModel.editoptions.multiple===true?true:false,n=[],m;if(o){n=h.split(",");n=a.map(n,function(j){return a.trim(j)})}if(a.fmatter.isString(f)){var d=f.split(e),g=0,k;for(k=0;k<d.length;k++){m=d[k].split(p);if(m.length>2){m[1]=a.map(m,function(q,j){if(j>0){return q}}).join(p)}if(o){if(a.inArray(m[0],n)>-1){l[g]=m[1];g++}}else{if(a.trim(m[0])==a.trim(h)){l[0]=m[1];break}}}}else{if(a.fmatter.isObject(f)){if(o){l=a.map(n,function(j){return f[j]})}else{l[0]=f[h]||""}}}}h=l.join(", ");return h===""?a.fn.fmatter.defaultFormat(h,b):h};a.fn.fmatter.rowactions=function(j){var h=a(this).closest("tr.jqgrow"),o=a(this).parent(),m=h.attr("id"),n=a(this).closest("table.ui-jqgrid-btable"),e=n[0],b=e.p,l=b.colModel[a.jgrid.getCellIndex(this)],g={keys:false,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{},url:null,restoreAfterError:true,mtype:"POST",delOptions:{},editOptions:{}},d=function(q,p){if(a.isFunction(g.afterSave)){g.afterSave.call(e,q,p)}o.find("div.ui-inline-edit,div.ui-inline-del").show();o.find("div.ui-inline-save,div.ui-inline-cancel").hide()},k=function(p){if(a.isFunction(g.afterRestore)){g.afterRestore.call(e,p)}o.find("div.ui-inline-edit,div.ui-inline-del").show();o.find("div.ui-inline-save,div.ui-inline-cancel").hide()};if(!a.fmatter.isUndefined(l.formatoptions)){g=a.extend(g,l.formatoptions)}if(!a.fmatter.isUndefined(b.editOptions)){g.editOptions=b.editOptions}if(!a.fmatter.isUndefined(b.delOptions)){g.delOptions=b.delOptions}if(h.hasClass("jqgrid-new-row")){g.extraparam[b.prmNames.oper]=b.prmNames.addoper}var f={keys:g.keys,oneditfunc:g.onEdit,successfunc:g.onSuccess,url:g.url,extraparam:g.extraparam,aftersavefunc:d,errorfunc:g.onError,afterrestorefunc:k,restoreAfterError:g.restoreAfterError,mtype:g.mtype};switch(j){case"edit":n.jqGrid("editRow",m,f);o.find("div.ui-inline-edit,div.ui-inline-del").hide();o.find("div.ui-inline-save,div.ui-inline-cancel").show();n.triggerHandler("jqGridAfterGridComplete");break;case"save":if(n.jqGrid("saveRow",m,f)){o.find("div.ui-inline-edit,div.ui-inline-del").show();o.find("div.ui-inline-save,div.ui-inline-cancel").hide();n.triggerHandler("jqGridAfterGridComplete")}break;case"cancel":n.jqGrid("restoreRow",m,k);o.find("div.ui-inline-edit,div.ui-inline-del").show();o.find("div.ui-inline-save,div.ui-inline-cancel").hide();n.triggerHandler("jqGridAfterGridComplete");break;case"del":n.jqGrid("delGridRow",m,g.delOptions);break;case"formedit":n.jqGrid("setSelection",m);n.jqGrid("editGridRow",m,g.editOptions);break}};a.fn.fmatter.actions=function(f,d){var h={keys:false,editbutton:true,delbutton:true,editformbutton:false},b=d.rowId,g="",e;if(!a.fmatter.isUndefined(d.colModel.formatoptions)){h=a.extend(h,d.colModel.formatoptions)}if(b===undefined||a.fmatter.isEmpty(b)){return""}if(h.editformbutton){e="onclick=jQuery.fn.fmatter.rowactions.call(this,'formedit'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";g+="<div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+e+"><span class='ui-icon ui-icon-pencil'></span></div>"}else{if(h.editbutton){e="onclick=jQuery.fn.fmatter.rowactions.call(this,'edit'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";g+="<div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+e+"><span class='ui-icon ui-icon-pencil'></span></div>"}}if(h.delbutton){e="onclick=jQuery.fn.fmatter.rowactions.call(this,'del'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";g+="<div title='"+a.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+e+"><span class='ui-icon ui-icon-trash'></span></div>"}e="onclick=jQuery.fn.fmatter.rowactions.call(this,'save'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";g+="<div title='"+a.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save' "+e+"><span class='ui-icon ui-icon-disk'></span></div>";e="onclick=jQuery.fn.fmatter.rowactions.call(this,'cancel'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";g+="<div title='"+a.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel' "+e+"><span class='ui-icon ui-icon-cancel'></span></div>";return"<div style='margin-left:8px;'>"+g+"</div>"};a.unformat=function(f,o,l,d){var j,g=o.colModel.formatter,h=o.colModel.formatoptions||{},p,n=/([\.\*\_\'\(\)\{\}\+\?\\])/g,k=o.colModel.unformat||(a.fn.fmatter[g]&&a.fn.fmatter[g].unformat);if(k!==undefined&&a.isFunction(k)){j=k.call(this,a(f).text(),o,f)}else{if(!a.fmatter.isUndefined(g)&&a.fmatter.isString(g)){var b=a.jgrid.formatter||{},m;switch(g){case"integer":h=a.extend({},b.integer,h);p=h.thousandsSeparator.replace(n,"\\$1");m=new RegExp(p,"g");j=a(f).text().replace(m,"");break;case"number":h=a.extend({},b.number,h);p=h.thousandsSeparator.replace(n,"\\$1");m=new RegExp(p,"g");j=a(f).text().replace(m,"").replace(h.decimalSeparator,".");break;case"currency":h=a.extend({},b.currency,h);p=h.thousandsSeparator.replace(n,"\\$1");m=new RegExp(p,"g");j=a(f).text();if(h.prefix&&h.prefix.length){j=j.substr(h.prefix.length)}if(h.suffix&&h.suffix.length){j=j.substr(0,j.length-h.suffix.length)}j=j.replace(m,"").replace(h.decimalSeparator,".");break;case"checkbox":var e=(o.colModel.editoptions)?o.colModel.editoptions.value.split(":"):["Yes","No"];j=a("input",f).is(":checked")?e[0]:e[1];break;case"select":j=a.unformat.select(f,o,l,d);break;case"actions":return"";default:j=a(f).text()}}}return j!==undefined?j:d===true?a(f).text():a.jgrid.htmlDecode(a(f).html())};a.unformat.select=function(h,s,n,e){var m=[];var q=a(h).text();if(e===true){return q}var l=a.extend({},!a.fmatter.isUndefined(s.colModel.formatoptions)?s.colModel.formatoptions:s.colModel.editoptions),t=l.separator===undefined?":":l.separator,d=l.delimiter===undefined?";":l.delimiter;if(l.value){var f=l.value,r=l.multiple===true?true:false,p=[],o;if(r){p=q.split(",");p=a.map(p,function(j){return a.trim(j)})}if(a.fmatter.isString(f)){var b=f.split(d),g=0,k;for(k=0;k<b.length;k++){o=b[k].split(t);if(o.length>2){o[1]=a.map(o,function(u,j){if(j>0){return u}}).join(t)}if(r){if(a.inArray(o[1],p)>-1){m[g]=o[0];g++}}else{if(a.trim(o[1])==a.trim(q)){m[0]=o[0];break}}}}else{if(a.fmatter.isObject(f)||a.isArray(f)){if(!r){p[0]=q}m=a.map(p,function(u){var j;a.each(f,function(v,w){if(w==u){j=v;return false}});if(j!==undefined){return j}})}}return m.join(", ")}return q||""};a.unformat.date=function(d,b){var e=a.jgrid.formatter.date||{};if(!a.fmatter.isUndefined(b.formatoptions)){e=a.extend({},e,b.formatoptions)}if(!a.fmatter.isEmpty(d)){return a.fmatter.util.DateFormat(e.newformat,d,e.srcformat,e)}return a.fn.fmatter.defaultFormat(d,b)}})(jQuery);(function(a){a.extend(a.jgrid,{showModal:function(b){b.w.show()},closeModal:function(b){b.w.hide().attr("aria-hidden","true");if(b.o){b.o.remove()}},hideModal:function(b,g){g=a.extend({jqm:true,gb:""},g||{});if(g.onClose){var d=g.gb&&typeof g.gb==="string"&&g.gb.substr(0,6)==="#gbox_"?g.onClose.call(a("#"+g.gb.substr(6))[0],b):g.onClose(b);if(typeof d==="boolean"&&!d){return}}if(a.fn.jqm&&g.jqm===true){a(b).attr("aria-hidden","true").jqmHide()}else{if(g.gb!==""){try{a(".jqgrid-overlay:first",g.gb).hide()}catch(f){}}a(b).hide().attr("aria-hidden","true")}},findPos:function(d){var e=0,b=0;if(d.offsetParent){do{e+=d.offsetLeft;b+=d.offsetTop}while(d=d.offsetParent)}return[e,b]},createModal:function(k,t,o,b,x,d,j){o=a.extend(true,{},a.jgrid.jqModal||{},o);var m=document.createElement("div"),u,n=this;j=a.extend({},j||{});u=a(o.gbox).attr("dir")=="rtl"?true:false;m.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";m.id=k.themodal;var w=document.createElement("div");w.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";w.id=k.modalhead;a(w).append("<span class='ui-jqdialog-title'>"+o.caption+"</span>");var q=a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){q.addClass("ui-state-hover")},function(){q.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(w).append(q);if(u){m.dir="rtl";a(".ui-jqdialog-title",w).css("float","right");a(".ui-jqdialog-titlebar-close",w).css("left",0.3+"em")}else{m.dir="ltr";a(".ui-jqdialog-title",w).css("float","left");a(".ui-jqdialog-titlebar-close",w).css("right",0.3+"em")}var y=document.createElement("div");a(y).addClass("ui-jqdialog-content ui-widget-content").attr("id",k.modalcontent);a(y).append(t);m.appendChild(y);a(m).prepend(w);if(d===true){a("body").append(m)}else{if(typeof d==="string"){a(d).append(m)}else{a(m).insertBefore(b)}}a(m).css(j);if(o.jqModal===undefined){o.jqModal=true}var s={};if(a.fn.jqm&&o.jqModal===true){if(o.left===0&&o.top===0&&o.overlay){var f=[];f=a.jgrid.findPos(x);o.left=f[0]+4;o.top=f[1]+4}s.top=o.top+"px";s.left=o.left}else{if(o.left!==0||o.top!==0){s.left=o.left;s.top=o.top+"px"}}a("a.ui-jqdialog-titlebar-close",w).click(function(){var e=a("#"+a.jgrid.jqID(k.themodal)).data("onClose")||o.onClose;var p=a("#"+a.jgrid.jqID(k.themodal)).data("gbox")||o.gbox;n.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:p,jqm:o.jqModal,onClose:e});return false});if(o.width===0||!o.width){o.width=300}if(o.height===0||!o.height){o.height=200}if(!o.zIndex){var g=a(b).parents("*[role=dialog]").filter(":first").css("z-index");if(g){o.zIndex=parseInt(g,10)+2}else{o.zIndex=950}}var h=0;if(u&&s.left&&!d){h=a(o.gbox).width()-(!isNaN(o.width)?parseInt(o.width,10):0)-8;s.left=parseInt(s.left,10)+parseInt(h,10)}if(s.left){s.left+="px"}a(m).css(a.extend({width:isNaN(o.width)?"auto":o.width+"px",height:isNaN(o.height)?"auto":o.height+"px",zIndex:o.zIndex,overflow:"hidden"},s)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":k.modalhead,"aria-hidden":"true"});if(o.drag===undefined){o.drag=true}if(o.resize===undefined){o.resize=true}if(o.drag){a(w).css("cursor","move");if(a.fn.jqDrag){a(m).jqDrag(w)}else{try{a(m).draggable({handle:a("#"+a.jgrid.jqID(w.id))})}catch(v){}}}if(o.resize){if(a.fn.jqResize){a(m).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se'></div>");a("#"+a.jgrid.jqID(k.themodal)).jqResize(".jqResize",k.scrollelm?"#"+a.jgrid.jqID(k.scrollelm):false)}else{try{a(m).resizable({handles:"se, sw",alsoResize:k.scrollelm?"#"+a.jgrid.jqID(k.scrollelm):false})}catch(l){}}}if(o.closeOnEscape===true){a(m).keydown(function(r){if(r.which==27){var p=a("#"+a.jgrid.jqID(k.themodal)).data("onClose")||o.onClose;n.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:o.gbox,jqm:o.jqModal,onClose:p})}})}},viewModal:function(b,e){e=a.extend({toTop:true,overlay:10,modal:false,overlayClass:"ui-widget-overlay",onShow:a.jgrid.showModal,onHide:a.jgrid.closeModal,gbox:"",jqm:true,jqM:true},e||{});if(a.fn.jqm&&e.jqm===true){if(e.jqM){a(b).attr("aria-hidden","false").jqm(e).jqmShow()}else{a(b).attr("aria-hidden","false").jqmShow()}}else{if(e.gbox!==""){a(".jqgrid-overlay:first",e.gbox).show();a(b).data("gbox",e.gbox)}a(b).show().attr("aria-hidden","false");try{a(":input:visible",b)[0].focus()}catch(d){}}},info_dialog:function(r,l,d,q){var o={width:290,height:"auto",dataheight:"auto",drag:true,resize:false,left:250,top:170,zIndex:1000,jqModal:true,modal:false,closeOnEscape:true,align:"center",buttonalign:"center",buttons:[]};a.extend(true,o,a.jgrid.jqModal||{},{caption:"<b>"+r+"</b>"},q||{});var g=o.jqModal,s=this;if(a.fn.jqm&&!g){g=false}var j="",h;if(o.buttons.length>0){for(h=0;h<o.buttons.length;h++){if(o.buttons[h].id===undefined){o.buttons[h].id="info_button_"+h}j+="<a href='javascript:void(0)' id='"+o.buttons[h].id+"' class='fm-button ui-state-default ui-corner-all'>"+o.buttons[h].text+"</a>"}}var n=isNaN(o.dataheight)?o.dataheight:o.dataheight+"px",p="text-align:"+o.align+";";var b="<div id='info_id'>";b+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+n+";"+p+"'>"+l+"</div>";b+=d?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+o.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+d+"</a>"+j+"</div>":j!==""?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+o.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+j+"</div>":"";b+="</div>";try{if(a("#info_dialog").attr("aria-hidden")=="false"){a.jgrid.hideModal("#info_dialog",{jqm:g})}a("#info_dialog").remove()}catch(k){}a.jgrid.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},b,o,"","",true);if(j){a.each(o.buttons,function(e){a("#"+a.jgrid.jqID(this.id),"#info_id").bind("click",function(){o.buttons[e].onClick.call(a("#info_dialog"));return false})})}a("#closedialog","#info_id").click(function(){s.hideModal("#info_dialog",{jqm:g});return false});a(".fm-button","#info_dialog").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});if(a.isFunction(o.beforeOpen)){o.beforeOpen()}a.jgrid.viewModal("#info_dialog",{onHide:function(e){e.w.hide().remove();if(e.o){e.o.remove()}},modal:o.modal,jqm:g});if(a.isFunction(o.afterOpen)){o.afterOpen()}try{a("#info_dialog").focus()}catch(f){}},bindEv:function(d,b,e){if(a.isFunction(b.dataInit)){b.dataInit.call(e,d)}if(b.dataEvents){a.each(b.dataEvents,function(){if(this.data!==undefined){a(d).bind(this.type,this.data,this.fn)}else{a(d).bind(this.type,this.fn)}})}},createEl:function(g,j,y,n,w){var x="",s=this;function u(F,E,D){var e=["dataInit","dataEvents","dataUrl","buildSelect","sopt","searchhidden","defaultValue","attr","custom_element","custom_value"];if(D!==undefined&&a.isArray(D)){a.merge(e,D)}a.each(E,function(G,H){if(a.inArray(G,e)===-1){a(F).attr(G,H)}});if(!E.hasOwnProperty("id")){a(F).attr("id",a.jgrid.randId())}}switch(g){case"textarea":x=document.createElement("textarea");if(n){if(!j.cols){a(x).css({width:"98%"})}}else{if(!j.cols){j.cols=20}}if(!j.rows){j.rows=2}if(y=="&nbsp;"||y=="&#160;"||(y.length==1&&y.charCodeAt(0)==160)){y=""}x.value=y;u(x,j);a(x).attr({role:"textbox",multiline:"true"});break;case"checkbox":x=document.createElement("input");x.type="checkbox";if(!j.value){var C=y.toLowerCase();if(C.search(/(false|0|no|off|undefined)/i)<0&&C!==""){x.checked=true;x.defaultChecked=true;x.value=y}else{x.value="on"}a(x).attr("offval","off")}else{var q=j.value.split(":");if(y===q[0]){x.checked=true;x.defaultChecked=true}x.value=q[0];a(x).attr("offval",q[1])}u(x,j,["value"]);a(x).attr("role","checkbox");break;case"select":x=document.createElement("select");x.setAttribute("role","select");var f,k=[];if(j.multiple===true){f=true;x.multiple="multiple";a(x).attr("aria-multiselectable","true")}else{f=false}if(j.dataUrl!==undefined){var m=j.name?String(j.id).substring(0,String(j.id).length-String(j.name).length-1):String(j.id),h=j.postData||w.postData;if(s.p&&s.p.idPrefix){m=a.jgrid.stripPref(s.p.idPrefix,m)}else{h=undefined}a.ajax(a.extend({url:j.dataUrl,type:"GET",dataType:"html",data:a.isFunction(h)?h.call(s,m,y,String(j.name)):h,context:{elem:x,options:j,vl:y},success:function(J){var E,D=[],I=this.elem,H=this.vl,F=a.extend({},this.options),G=F.multiple===true;if(a.isFunction(F.buildSelect)){var e=F.buildSelect.call(s,J);E=a(e).html()}else{E=a(J).html()}if(E){a(I).append(E);u(I,F);if(F.size===undefined){F.size=G?3:1}if(G){D=H.split(",");D=a.map(D,function(K){return a.trim(K)})}else{D[0]=a.trim(H)}setTimeout(function(){a("option",I).each(function(K){if(K===0&&I.multiple){this.selected=false}a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),D)>-1||a.inArray(a.trim(a(this).val()),D)>-1){this.selected="selected"}})},0)}}},w||{}))}else{if(j.value){var r;if(j.size===undefined){j.size=f?3:1}if(f){k=y.split(",");k=a.map(k,function(e){return a.trim(e)})}if(typeof j.value==="function"){j.value=j.value()}var t,p,l,o=j.separator===undefined?":":j.separator,z=j.delimiter===undefined?";":j.delimiter;if(typeof j.value==="string"){t=j.value.split(z);for(r=0;r<t.length;r++){p=t[r].split(o);if(p.length>2){p[1]=a.map(p,function(D,e){if(e>0){return D}}).join(o)}l=document.createElement("option");l.setAttribute("role","option");l.value=p[0];l.innerHTML=p[1];x.appendChild(l);if(!f&&(a.trim(p[0])==a.trim(y)||a.trim(p[1])==a.trim(y))){l.selected="selected"}if(f&&(a.inArray(a.trim(p[1]),k)>-1||a.inArray(a.trim(p[0]),k)>-1)){l.selected="selected"}}}else{if(typeof j.value==="object"){var d=j.value,B;for(B in d){if(d.hasOwnProperty(B)){l=document.createElement("option");l.setAttribute("role","option");l.value=B;l.innerHTML=d[B];x.appendChild(l);if(!f&&(a.trim(B)==a.trim(y)||a.trim(d[B])==a.trim(y))){l.selected="selected"}if(f&&(a.inArray(a.trim(d[B]),k)>-1||a.inArray(a.trim(B),k)>-1)){l.selected="selected"}}}}}u(x,j,["value"])}}break;case"text":case"password":case"button":var A;if(g=="button"){A="button"}else{A="textbox"}x=document.createElement("input");x.type=g;x.value=y;u(x,j);if(g!="button"){if(n){if(!j.size){a(x).css({width:"98%"})}}else{if(!j.size){j.size=20}}}a(x).attr("role",A);break;case"image":case"file":x=document.createElement("input");x.type=g;u(x,j);break;case"custom":x=document.createElement("span");try{if(a.isFunction(j.custom_element)){var b=j.custom_element.call(s,y,j);if(b){b=a(b).addClass("customelement").attr({id:j.id,name:j.name});a(x).empty().append(b)}else{throw"e2"}}else{throw"e1"}}catch(v){if(v=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}if(v=="e2"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,typeof v==="string"?v:v.message,a.jgrid.edit.bClose)}}break}return x},checkDate:function(p,f){var n=function(j){return(((j%4===0)&&(j%100!==0||(j%400===0)))?29:28)},e=function(s){var j;for(j=1;j<=s;j++){this[j]=31;if(j==4||j==6||j==9||j==11){this[j]=30}if(j==2){this[j]=29}}return this};var h={},r;p=p.toLowerCase();if(p.indexOf("/")!=-1){r="/"}else{if(p.indexOf("-")!=-1){r="-"}else{if(p.indexOf(".")!=-1){r="."}else{r="/"}}}p=p.split(r);f=f.split(r);if(f.length!=3){return false}var l=-1,q,k=-1,g=-1,m;for(m=0;m<p.length;m++){var d=isNaN(f[m])?0:parseInt(f[m],10);h[p[m]]=d;q=p[m];if(q.indexOf("y")!=-1){l=m}if(q.indexOf("m")!=-1){g=m}if(q.indexOf("d")!=-1){k=m}}if(p[l]=="y"||p[l]=="yyyy"){q=4}else{if(p[l]=="yy"){q=2}else{q=-1}}var b=e(12),o;if(l===-1){return false}o=h[p[l]].toString();if(q==2&&o.length==1){q=1}if(o.length!=q||(h[p[l]]===0&&f[l]!="00")){return false}if(g===-1){return false}o=h[p[g]].toString();if(o.length<1||h[p[g]]<1||h[p[g]]>12){return false}if(k===-1){return false}o=h[p[k]].toString();if(o.length<1||h[p[k]]<1||h[p[k]]>31||(h[p[g]]==2&&h[p[k]]>n(h[p[l]]))||h[p[k]]>b[h[p[g]]]){return false}return true},isEmpty:function(b){if(b.match(/^\s+$/)||b===""){return true}return false},checkTime:function(e){var d=/^(\d{1,2}):(\d{2})([ap]m)?$/,b;if(!a.jgrid.isEmpty(e)){b=e.match(d);if(b){if(b[3]){if(b[1]<1||b[1]>12){return false}}else{if(b[1]>23){return false}}if(b[2]>59){return false}}else{return false}}return true},checkValues:function(f,q,m,r,k){var j,l,s,d,n;if(r===undefined){if(typeof q==="string"){for(l=0,n=m.p.colModel.length;l<n;l++){if(m.p.colModel[l].name==q){j=m.p.colModel[l].editrules;q=l;try{s=m.p.colModel[l].formoptions.label}catch(p){}break}}}else{if(q>=0){j=m.p.colModel[q].editrules}}}else{j=r;s=k===undefined?"_":k}if(j){if(!s){s=m.p.colNames[q]}if(j.required===true){if(a.jgrid.isEmpty(f)){return[false,s+": "+a.jgrid.edit.msg.required,""]}}var h=j.required===false?false:true;if(j.number===true){if(!(h===false&&a.jgrid.isEmpty(f))){if(isNaN(f)){return[false,s+": "+a.jgrid.edit.msg.number,""]}}}if(j.minValue!==undefined&&!isNaN(j.minValue)){if(parseFloat(f)<parseFloat(j.minValue)){return[false,s+": "+a.jgrid.edit.msg.minValue+" "+j.minValue,""]}}if(j.maxValue!==undefined&&!isNaN(j.maxValue)){if(parseFloat(f)>parseFloat(j.maxValue)){return[false,s+": "+a.jgrid.edit.msg.maxValue+" "+j.maxValue,""]}}var b;if(j.email===true){if(!(h===false&&a.jgrid.isEmpty(f))){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;if(!b.test(f)){return[false,s+": "+a.jgrid.edit.msg.email,""]}}}if(j.integer===true){if(!(h===false&&a.jgrid.isEmpty(f))){if(isNaN(f)){return[false,s+": "+a.jgrid.edit.msg.integer,""]}if((f%1!==0)||(f.indexOf(".")!=-1)){return[false,s+": "+a.jgrid.edit.msg.integer,""]}}}if(j.date===true){if(!(h===false&&a.jgrid.isEmpty(f))){if(m.p.colModel[q].formatoptions&&m.p.colModel[q].formatoptions.newformat){d=m.p.colModel[q].formatoptions.newformat}else{d=m.p.colModel[q].datefmt||"Y-m-d"}if(!a.jgrid.checkDate(d,f)){return[false,s+": "+a.jgrid.edit.msg.date+" - "+d,""]}}}if(j.time===true){if(!(h===false&&a.jgrid.isEmpty(f))){if(!a.jgrid.checkTime(f)){return[false,s+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""]}}}if(j.url===true){if(!(h===false&&a.jgrid.isEmpty(f))){b=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!b.test(f)){return[false,s+": "+a.jgrid.edit.msg.url,""]}}}if(j.custom===true){if(!(h===false&&a.jgrid.isEmpty(f))){if(a.isFunction(j.custom_func)){var o=j.custom_func.call(m,f,s);return a.isArray(o)?o:[false,a.jgrid.edit.msg.customarray,""]}return[false,a.jgrid.edit.msg.customfcheck,""]}}}return[true,"",""]}})})(jQuery);(function(a){a.fn.jqFilter=function(b){if(typeof b==="string"){var e=a.fn.jqFilter[b];if(!e){throw ("jqFilter - No such method: "+b)}var d=a.makeArray(arguments).slice(1);return e.apply(this,d)}var f=a.extend(true,{filter:null,columns:[],onChange:null,afterRedraw:null,checkValues:null,error:false,errmsg:"",errorcheck:true,showQuery:true,sopt:null,ops:[{name:"eq",description:"equal",operator:"="},{name:"ne",description:"not equal",operator:"<>"},{name:"lt",description:"less",operator:"<"},{name:"le",description:"less or equal",operator:"<="},{name:"gt",description:"greater",operator:">"},{name:"ge",description:"greater or equal",operator:">="},{name:"bw",description:"begins with",operator:"LIKE"},{name:"bn",description:"does not begin with",operator:"NOT LIKE"},{name:"in",description:"in",operator:"IN"},{name:"ni",description:"not in",operator:"NOT IN"},{name:"ew",description:"ends with",operator:"LIKE"},{name:"en",description:"does not end with",operator:"NOT LIKE"},{name:"cn",description:"contains",operator:"LIKE"},{name:"nc",description:"does not contain",operator:"NOT LIKE"},{name:"nu",description:"is null",operator:"IS NULL"},{name:"nn",description:"is not null",operator:"IS NOT NULL"}],numopts:["eq","ne","lt","le","gt","ge","nu","nn","in","ni"],stropts:["eq","ne","bw","bn","ew","en","cn","nc","nu","nn","in","ni"],strarr:["text","string","blob"],_gridsopt:[],groupOps:[{op:"AND",text:"AND"},{op:"OR",text:"OR"}],groupButton:true,ruleButtons:true,direction:"ltr"},a.jgrid.filter,b||{});return this.each(function(){if(this.filter){return}this.p=f;if(this.p.filter===null||this.p.filter===undefined){this.p.filter={groupOp:this.p.groupOps[0].op,rules:[],groups:[]}}var k,g=this.p.columns.length,h,l=/msie/i.test(navigator.userAgent)&&!window.opera;if(this.p._gridsopt.length){for(k=0;k<this.p._gridsopt.length;k++){this.p.ops[k].description=this.p._gridsopt[k]}}this.p.initFilter=a.extend(true,{},this.p.filter);if(!g){return}for(k=0;k<g;k++){h=this.p.columns[k];if(h.stype){h.inputtype=h.stype}else{if(!h.inputtype){h.inputtype="text"}}if(h.sorttype){h.searchtype=h.sorttype}else{if(!h.searchtype){h.searchtype="string"}}if(h.hidden===undefined){h.hidden=false}if(!h.label){h.label=h.name}if(h.index){h.name=h.index}if(!h.hasOwnProperty("searchoptions")){h.searchoptions={}}if(!h.hasOwnProperty("searchrules")){h.searchrules={}}}if(this.p.showQuery){a(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;' dir='"+this.p.direction+"'><tbody><tr><td class='query'></td></tr></tbody></table>")}var j=function(p,m){var n=[true,""];if(a.isFunction(m.searchrules)){n=m.searchrules(p,m)}else{if(a.jgrid&&a.jgrid.checkValues){try{n=a.jgrid.checkValues(p,-1,null,m.searchrules,m.label)}catch(o){}}}if(n&&n.length&&n[0]===false){f.error=!n[0];f.errmsg=n[1]}};this.onchange=function(){this.p.error=false;this.p.errmsg="";return a.isFunction(this.p.onChange)?this.p.onChange.call(this,this.p):false};this.reDraw=function(){a("table.group:first",this).remove();var m=this.createTableForGroup(f.filter,null);a(this).append(m);if(a.isFunction(this.p.afterRedraw)){this.p.afterRedraw.call(this,this.p)}};this.createTableForGroup=function(p,A){var o=this,y;var z=a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>"),w="left";if(this.p.direction=="rtl"){w="right";z.attr("dir","rtl")}if(A===null){z.append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='"+w+"'></th></tr>")}var m=a("<tr></tr>");z.append(m);var n=a("<th colspan='5' align='"+w+"'></th>");m.append(n);if(this.p.ruleButtons===true){var t=a("<select class='opsel'></select>");n.append(t);var v="",u;for(y=0;y<f.groupOps.length;y++){u=p.groupOp===o.p.groupOps[y].op?" selected='selected'":"";v+="<option value='"+o.p.groupOps[y].op+"'"+u+">"+o.p.groupOps[y].text+"</option>"}t.append(v).bind("change",function(){p.groupOp=a(t).val();o.onchange()})}var D="<span></span>";if(this.p.groupButton){D=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>");D.bind("click",function(){if(p.groups===undefined){p.groups=[]}p.groups.push({groupOp:f.groupOps[0].op,rules:[],groups:[]});o.reDraw();o.onchange();return false})}n.append(D);if(this.p.ruleButtons===true){var r=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"),q;r.bind("click",function(){if(p.rules===undefined){p.rules=[]}for(y=0;y<o.p.columns.length;y++){var E=(o.p.columns[y].search===undefined)?true:o.p.columns[y].search,H=(o.p.columns[y].hidden===true),G=(o.p.columns[y].searchoptions.searchhidden===true);if((G&&E)||(E&&!H)){q=o.p.columns[y];break}}var F;if(q.searchoptions.sopt){F=q.searchoptions.sopt}else{if(o.p.sopt){F=o.p.sopt}else{if(a.inArray(q.searchtype,o.p.strarr)!==-1){F=o.p.stropts}else{F=o.p.numopts}}}p.rules.push({field:q.name,op:F[0],data:""});o.reDraw();return false});n.append(r)}if(A!==null){var s=a("<input type='button' value='-' title='Delete group' class='delete-group'/>");n.append(s);s.bind("click",function(){for(y=0;y<A.groups.length;y++){if(A.groups[y]===p){A.groups.splice(y,1);break}}o.reDraw();o.onchange();return false})}if(p.groups!==undefined){for(y=0;y<p.groups.length;y++){var x=a("<tr></tr>");z.append(x);var B=a("<td class='first'></td>");x.append(B);var C=a("<td colspan='4'></td>");C.append(this.createTableForGroup(p.groups[y],p));x.append(C)}}if(p.groupOp===undefined){p.groupOp=o.p.groupOps[0].op}if(p.rules!==undefined){for(y=0;y<p.rules.length;y++){z.append(this.createTableRowForRule(p.rules[y],p))}}return z};this.createTableRowForRule=function(v,x){var w=this,n=a("<tr></tr>"),H,z,p,y,C="",B;n.append("<td class='first'></td>");var q=a("<td class='columns'></td>");n.append(q);var I=a("<select></select>"),A,E=[];q.append(I);I.bind("change",function(){v.field=a(I).val();p=a(this).parents("tr:first");for(H=0;H<w.p.columns.length;H++){if(w.p.columns[H].name===v.field){y=w.p.columns[H];break}}if(!y){return}y.searchoptions.id=a.jgrid.randId();if(l&&y.inputtype==="text"){if(!y.searchoptions.size){y.searchoptions.size=10}}var N=a.jgrid.createEl(y.inputtype,y.searchoptions,"",true,w.p.ajaxSelectOptions,true);a(N).addClass("input-elm");if(y.searchoptions.sopt){z=y.searchoptions.sopt}else{if(w.p.sopt){z=w.p.sopt}else{if(a.inArray(y.searchtype,w.p.strarr)!==-1){z=w.p.stropts}else{z=w.p.numopts}}}var L="",M=0;E=[];a.each(w.p.ops,function(){E.push(this.name)});for(H=0;H<z.length;H++){A=a.inArray(z[H],E);if(A!==-1){if(M===0){v.op=w.p.ops[A].name}L+="<option value='"+w.p.ops[A].name+"'>"+w.p.ops[A].description+"</option>";M++}}a(".selectopts",p).empty().append(L);a(".selectopts",p)[0].selectedIndex=0;if(a.jgrid.msie&&a.jgrid.msiever()<9){var K=parseInt(a("select.selectopts",p)[0].offsetWidth,10)+1;a(".selectopts",p).width(K);a(".selectopts",p).css("width","auto")}a(".data",p).empty().append(N);a.jgrid.bindEv(N,y.searchoptions,w);a(".input-elm",p).bind("change",function(P){var O=a(this).hasClass("ui-autocomplete-input")?200:0;setTimeout(function(){var Q=P.target;v.data=Q.nodeName.toUpperCase()==="SPAN"&&y.searchoptions&&a.isFunction(y.searchoptions.custom_value)?y.searchoptions.custom_value(a(Q).children(".customelement:first"),"get"):Q.value;w.onchange()},O)});setTimeout(function(){v.data=a(N).val();w.onchange()},0)});var F=0;for(H=0;H<w.p.columns.length;H++){var t=(w.p.columns[H].search===undefined)?true:w.p.columns[H].search,G=(w.p.columns[H].hidden===true),J=(w.p.columns[H].searchoptions.searchhidden===true);if((J&&t)||(t&&!G)){B="";if(v.field===w.p.columns[H].name){B=" selected='selected'";F=H}C+="<option value='"+w.p.columns[H].name+"'"+B+">"+w.p.columns[H].label+"</option>"}}I.append(C);var D=a("<td class='operators'></td>");n.append(D);y=f.columns[F];y.searchoptions.id=a.jgrid.randId();if(l&&y.inputtype==="text"){if(!y.searchoptions.size){y.searchoptions.size=10}}var o=a.jgrid.createEl(y.inputtype,y.searchoptions,v.data,true,w.p.ajaxSelectOptions,true);if(v.op=="nu"||v.op=="nn"){a(o).attr("readonly","true");a(o).attr("disabled","true")}var m=a("<select class='selectopts'></select>");D.append(m);m.bind("change",function(){v.op=a(m).val();p=a(this).parents("tr:first");var K=a(".input-elm",p)[0];if(v.op==="nu"||v.op==="nn"){v.data="";K.value="";K.setAttribute("readonly","true");K.setAttribute("disabled","true")}else{K.removeAttribute("readonly");K.removeAttribute("disabled")}w.onchange()});if(y.searchoptions.sopt){z=y.searchoptions.sopt}else{if(w.p.sopt){z=w.p.sopt}else{if(a.inArray(y.searchtype,w.p.strarr)!==-1){z=w.p.stropts}else{z=w.p.numopts}}}C="";a.each(w.p.ops,function(){E.push(this.name)});for(H=0;H<z.length;H++){A=a.inArray(z[H],E);if(A!==-1){B=v.op===w.p.ops[A].name?" selected='selected'":"";C+="<option value='"+w.p.ops[A].name+"'"+B+">"+w.p.ops[A].description+"</option>"}}m.append(C);var s=a("<td class='data'></td>");n.append(s);s.append(o);a.jgrid.bindEv(o,y.searchoptions,w);a(o).addClass("input-elm").bind("change",function(){v.data=y.inputtype==="custom"?y.searchoptions.custom_value(a(this).children(".customelement:first"),"get"):a(this).val();w.onchange()});var u=a("<td></td>");n.append(u);if(this.p.ruleButtons===true){var r=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");u.append(r);r.bind("click",function(){for(H=0;H<x.rules.length;H++){if(x.rules[H]===v){x.rules.splice(H,1);break}}w.reDraw();w.onchange();return false})}return n};this.getStringForGroup=function(p){var n="(",m;if(p.groups!==undefined){for(m=0;m<p.groups.length;m++){if(n.length>1){n+=" "+p.groupOp+" "}try{n+=this.getStringForGroup(p.groups[m])}catch(q){alert(q)}}}if(p.rules!==undefined){try{for(m=0;m<p.rules.length;m++){if(n.length>1){n+=" "+p.groupOp+" "}n+=this.getStringForRule(p.rules[m])}}catch(o){alert(o)}}n+=")";if(n==="()"){return""}return n};this.getStringForRule=function(r){var o="",t="",q,n,p,s,m=["int","integer","float","number","currency"];for(q=0;q<this.p.ops.length;q++){if(this.p.ops[q].name===r.op){o=this.p.ops[q].operator;t=this.p.ops[q].name;break}}for(q=0;q<this.p.columns.length;q++){if(this.p.columns[q].name===r.field){n=this.p.columns[q];break}}if(n==null){return""}s=r.data;if(t==="bw"||t==="bn"){s=s+"%"}if(t==="ew"||t==="en"){s="%"+s}if(t==="cn"||t==="nc"){s="%"+s+"%"}if(t==="in"||t==="ni"){s=" ("+s+")"}if(f.errorcheck){j(r.data,n)}if(a.inArray(n.searchtype,m)!==-1||t==="nn"||t==="nu"){p=r.field+" "+o+" "+s}else{p=r.field+" "+o+' "'+s+'"'}return p};this.resetFilter=function(){this.p.filter=a.extend(true,{},this.p.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th.ui-state-error",this).html("");a("tr.error",this).hide()};this.showError=function(){a("th.ui-state-error",this).html(this.p.errmsg);a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(f.filter)};this.toString=function(){var n=this;function o(r){if(n.p.errorcheck){var q,p;for(q=0;q<n.p.columns.length;q++){if(n.p.columns[q].name===r.field){p=n.p.columns[q];break}}if(p){j(r.data,p)}}return r.op+"(item."+r.field+",'"+r.data+"')"}function m(r){var q="(",p;if(r.groups!==undefined){for(p=0;p<r.groups.length;p++){if(q.length>1){if(r.groupOp==="OR"){q+=" || "}else{q+=" && "}}q+=m(r.groups[p])}}if(r.rules!==undefined){for(p=0;p<r.rules.length;p++){if(q.length>1){if(r.groupOp==="OR"){q+=" || "}else{q+=" && "}}q+=o(r.rules[p])}}q+=")";if(q==="()"){return""}return q}return m(this.p.filter)};this.reDraw();if(this.p.showQuery){this.onchange()}this.filter=true})};a.extend(a.fn.jqFilter,{toSQLString:function(){var b="";this.each(function(){b=this.toUserFriendlyString()});return b},filterData:function(){var b;this.each(function(){b=this.p.filter});return b},getParameter:function(b){if(b!==undefined){if(this.p.hasOwnProperty(b)){return this.p[b]}}return this.p},resetFilter:function(){return this.each(function(){this.resetFilter()})},addFilter:function(b){if(typeof b==="string"){b=a.jgrid.parse(b)}this.each(function(){this.p.filter=b;this.reDraw();this.onchange()})}})})(jQuery);(function(b){var a={};b.jgrid.extend({searchGrid:function(d){d=b.extend(true,{recreateFilter:false,drag:true,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:true,beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,afterRedraw:null,afterChange:null,closeAfterSearch:false,closeAfterReset:false,closeOnEscape:false,searchOnEnter:false,multipleSearch:false,multipleGroup:false,top:0,left:0,jqModal:true,modal:false,resize:true,width:450,height:"auto",dataheight:"auto",showQuery:false,errorcheck:true,sopt:null,stringResult:undefined,onClose:null,onSearch:null,onReset:null,toTop:true,overlay:30,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:false,layer:null},b.jgrid.search,d||{});return this.each(function(){var u=this;if(!u.grid){return}var e="fbox_"+u.p.id,k=true,g={themodal:"searchmod"+e,modalhead:"searchhd"+e,modalcontent:"searchcnt"+e,scrollelm:e},h=u.p.postData[d.sFilter];if(typeof h==="string"){h=b.jgrid.parse(h)}if(d.recreateFilter===true){b("#"+b.jgrid.jqID(g.themodal)).remove()}function j(y){k=b(u).triggerHandler("jqGridFilterBeforeShow",[y]);if(k===undefined){k=true}if(k&&b.isFunction(d.beforeShowSearch)){k=d.beforeShowSearch.call(u,y)}if(k){b.jgrid.viewModal("#"+b.jgrid.jqID(g.themodal),{gbox:"#gbox_"+b.jgrid.jqID(e),jqm:d.jqModal,modal:d.modal,overlay:d.overlay,toTop:d.toTop});b(u).triggerHandler("jqGridFilterAfterShow",[y]);if(b.isFunction(d.afterShowSearch)){d.afterShowSearch.call(u,y)}}}if(b("#"+b.jgrid.jqID(g.themodal))[0]!==undefined){j(b("#fbox_"+b.jgrid.jqID(+u.p.id)))}else{var v=b("<div><div id='"+e+"' class='searchFilter' style='overflow:auto'></div></div>").insertBefore("#gview_"+b.jgrid.jqID(u.p.id)),t="left",l="";if(u.p.direction=="rtl"){t="right";l=" style='text-align:left'";v.attr("dir","rtl")}var f=b.extend([],u.p.colModel),q="<a href='javascript:void(0)' id='"+e+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+d.Find+"</a>",x="<a href='javascript:void(0)' id='"+e+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+d.Reset+"</a>",s="",m="",o,p=false,w,r=-1;if(d.showQuery){s="<a href='javascript:void(0)' id='"+e+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>"}if(!d.columns.length){b.each(f,function(z,C){if(!C.label){C.label=u.p.colNames[z]}if(!p){var y=(C.search===undefined)?true:C.search,B=(C.hidden===true),A=(C.searchoptions&&C.searchoptions.searchhidden===true);if((A&&y)||(y&&!B)){p=true;o=C.index||C.name;r=z}}})}else{f=d.columns}if((!h&&o)||d.multipleSearch===false){var n="eq";if(r>=0&&f[r].searchoptions&&f[r].searchoptions.sopt){n=f[r].searchoptions.sopt[0]}else{if(d.sopt&&d.sopt.length){n=d.sopt[0]}}h={groupOp:"AND",rules:[{field:o,op:n,data:""}]}}p=false;if(d.tmplNames&&d.tmplNames.length){p=true;m=d.tmplLabel;m+="<select class='ui-template'>";m+="<option value='default'>Default</option>";b.each(d.tmplNames,function(y,z){m+="<option value='"+y+"'>"+z+"</option>"});m+="</select>"}w="<table class='EditTable' style='border:0px none;margin-top:5px' id='"+e+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:"+t+"'>"+x+m+"</td><td class='EditButton' "+l+">"+s+q+"</td></tr></tbody></table>";e=b.jgrid.jqID(e);b("#"+e).jqFilter({columns:f,filter:d.loadDefaults?h:null,showQuery:d.showQuery,errorcheck:d.errorcheck,sopt:d.sopt,groupButton:d.multipleGroup,ruleButtons:d.multipleSearch,afterRedraw:d.afterRedraw,_gridsopt:b.jgrid.search.odata,ajaxSelectOptions:u.p.ajaxSelectOptions,groupOps:d.groupOps,onChange:function(){if(this.p.showQuery){b(".query",this).html(this.toUserFriendlyString())}if(b.isFunction(d.afterChange)){d.afterChange.call(u,b("#"+e),d)}},direction:u.p.direction});v.append(w);if(p&&d.tmplFilters&&d.tmplFilters.length){b(".ui-template",v).bind("change",function(){var y=b(this).val();if(y=="default"){b("#"+e).jqFilter("addFilter",h)}else{b("#"+e).jqFilter("addFilter",d.tmplFilters[parseInt(y,10)])}return false})}if(d.multipleGroup===true){d.multipleSearch=true}b(u).triggerHandler("jqGridFilterInitialize",[b("#"+e)]);if(b.isFunction(d.onInitializeSearch)){d.onInitializeSearch.call(u,b("#"+e))}d.gbox="#gbox_"+e;if(d.layer){b.jgrid.createModal(g,v,d,"#gview_"+b.jgrid.jqID(u.p.id),b("#gbox_"+b.jgrid.jqID(u.p.id))[0],"#"+b.jgrid.jqID(d.layer),{position:"relative"})}else{b.jgrid.createModal(g,v,d,"#gview_"+b.jgrid.jqID(u.p.id),b("#gbox_"+b.jgrid.jqID(u.p.id))[0])}if(d.searchOnEnter||d.closeOnEscape){b("#"+b.jgrid.jqID(g.themodal)).keydown(function(z){var y=b(z.target);if(d.searchOnEnter&&z.which===13&&!y.hasClass("add-group")&&!y.hasClass("add-rule")&&!y.hasClass("delete-group")&&!y.hasClass("delete-rule")&&(!y.hasClass("fm-button")||!y.is("[id$=_query]"))){b("#"+e+"_search").focus().click();return false}if(d.closeOnEscape&&z.which===27){b("#"+b.jgrid.jqID(g.modalhead)).find(".ui-jqdialog-titlebar-close").focus().click();return false}})}if(s){b("#"+e+"_query").bind("click",function(){b(".queryresult",v).toggle();return false})}if(d.stringResult===undefined){d.stringResult=d.multipleSearch}b("#"+e+"_search").bind("click",function(){var B=b("#"+e),z={},y,A=B.jqFilter("filterData");if(d.errorcheck){B[0].hideError();if(!d.showQuery){B.jqFilter("toSQLString")}if(B[0].p.error){B[0].showError();return false}}if(d.stringResult){try{y=xmlJsonClass.toJson(A,"","",false)}catch(D){try{y=JSON.stringify(A)}catch(C){}}if(typeof y==="string"){z[d.sFilter]=y;b.each([d.sField,d.sValue,d.sOper],function(){z[this]=""})}}else{if(d.multipleSearch){z[d.sFilter]=A;b.each([d.sField,d.sValue,d.sOper],function(){z[this]=""})}else{z[d.sField]=A.rules[0].field;z[d.sValue]=A.rules[0].data;z[d.sOper]=A.rules[0].op;z[d.sFilter]=""}}u.p.search=true;b.extend(u.p.postData,z);b(u).triggerHandler("jqGridFilterSearch");if(b.isFunction(d.onSearch)){d.onSearch.call(u)}b(u).trigger("reloadGrid",[{page:1}]);if(d.closeAfterSearch){b.jgrid.hideModal("#"+b.jgrid.jqID(g.themodal),{gb:"#gbox_"+b.jgrid.jqID(u.p.id),jqm:d.jqModal,onClose:d.onClose})}return false});b("#"+e+"_reset").bind("click",function(){var y={},z=b("#"+e);u.p.search=false;if(d.multipleSearch===false){y[d.sField]=y[d.sValue]=y[d.sOper]=""}else{y[d.sFilter]=""}z[0].resetFilter();if(p){b(".ui-template",v).val("default")}b.extend(u.p.postData,y);b(u).triggerHandler("jqGridFilterReset");if(b.isFunction(d.onReset)){d.onReset.call(u)}b(u).trigger("reloadGrid",[{page:1}]);return false});j(b("#"+e));b(".fm-button:not(.ui-state-disabled)",v).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")})}})},editGridRow:function(d,e){e=b.extend(true,{top:0,left:0,width:300,datawidth:"auto",height:"auto",dataheight:"auto",modal:false,overlay:30,drag:true,resize:true,url:null,mtype:"POST",clearAfterAdd:true,closeAfterEdit:false,reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:false,jqModal:true,closeOnEscape:false,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[false,13],navkeys:[false,38,40],checkOnSubmit:false,checkOnUpdate:false,_savedData:{},processing:false,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:true},b.jgrid.edit,e||{});a[b(this)[0].p.id]=e;return this.each(function(){var f=this;if(!f.grid||!d){return}var D=f.p.id,A="FrmGrid_"+D,W="TblGrid_"+D,x="#"+b.jgrid.jqID(W),l={themodal:"editmod"+D,modalhead:"edithd"+D,modalcontent:"editcnt"+D,scrollelm:A},E=b.isFunction(a[f.p.id].beforeShowForm)?a[f.p.id].beforeShowForm:false,N=b.isFunction(a[f.p.id].afterShowForm)?a[f.p.id].afterShowForm:false,M=b.isFunction(a[f.p.id].beforeInitData)?a[f.p.id].beforeInitData:false,r=b.isFunction(a[f.p.id].onInitializeForm)?a[f.p.id].onInitializeForm:false,Z=true,I=1,t=0,F,Q,G,C,H;A=b.jgrid.jqID(A);if(d==="new"){d="_empty";H="add";e.caption=a[f.p.id].addCaption}else{e.caption=a[f.p.id].editCaption;H="edit"}if(e.recreateForm===true&&b("#"+b.jgrid.jqID(l.themodal))[0]!==undefined){b("#"+b.jgrid.jqID(l.themodal)).remove()}var o=true;if(e.checkOnUpdate&&e.jqModal&&!e.modal){o=false}function Y(){b(x+" > tbody > tr > td > .FormElement").each(function(){var af=b(".customelement",this);if(af.length){var ad=af[0],ab=b(ad).attr("name");b.each(f.p.colModel,function(){if(this.name===ab&&this.editoptions&&b.isFunction(this.editoptions.custom_value)){try{F[ab]=this.editoptions.custom_value.call(f,b("#"+b.jgrid.jqID(ab),x),"get");if(F[ab]===undefined){throw"e1"}}catch(ag){if(ag==="e1"){b.jgrid.info_dialog(b.jgrid.errors.errcap,"function 'custom_value' "+b.jgrid.edit.msg.novalue,b.jgrid.edit.bClose)}else{b.jgrid.info_dialog(b.jgrid.errors.errcap,ag.message,b.jgrid.edit.bClose)}}return true}})}else{switch(b(this).get(0).type){case"checkbox":if(b(this).is(":checked")){F[this.name]=b(this).val()}else{var ac=b(this).attr("offval");F[this.name]=ac}break;case"select-one":F[this.name]=b("option:selected",this).val();Q[this.name]=b("option:selected",this).text();break;case"select-multiple":F[this.name]=b(this).val();if(F[this.name]){F[this.name]=F[this.name].join(",")}else{F[this.name]=""}var ae=[];b("option:selected",this).each(function(ag,ah){ae[ag]=b(ah).text()});Q[this.name]=ae.join(",");break;case"password":case"text":case"textarea":case"button":F[this.name]=b(this).val();break}if(f.p.autoencode){F[this.name]=b.jgrid.htmlEncode(F[this.name])}}});return true}function v(ad,ak,ah,af){var ar,al,ac,ag=0,aj,aq,ab,an=[],ae=false,am="<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>",ap="",ai;for(ai=1;ai<=af;ai++){ap+=am}if(ad!="_empty"){ae=b(ak).jqGrid("getInd",ad)}b(ak.p.colModel).each(function(av){ar=this.name;if(this.editrules&&this.editrules.edithidden===true){al=false}else{al=this.hidden===true?true:false}aq=al?"style='display:none'":"";if(ar!=="cb"&&ar!=="subgrid"&&this.editable===true&&ar!=="rn"){if(ae===false){aj=""}else{if(ar==ak.p.ExpandColumn&&ak.p.treeGrid===true){aj=b("td[role='gridcell']:eq("+av+")",ak.rows[ae]).text()}else{try{aj=b.unformat.call(ak,b("td[role='gridcell']:eq("+av+")",ak.rows[ae]),{rowId:ad,colModel:this},av)}catch(at){aj=(this.edittype&&this.edittype=="textarea")?b("td[role='gridcell']:eq("+av+")",ak.rows[ae]).text():b("td[role='gridcell']:eq("+av+")",ak.rows[ae]).html()}if(!aj||aj=="&nbsp;"||aj=="&#160;"||(aj.length==1&&aj.charCodeAt(0)==160)){aj=""}}}var au=b.extend({},this.editoptions||{},{id:ar,name:ar}),az=b.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),aw=parseInt(az.rowpos,10)||ag+1,ay=parseInt((parseInt(az.colpos,10)||1)*2,10);if(ad=="_empty"&&au.defaultValue){aj=b.isFunction(au.defaultValue)?au.defaultValue.call(f):au.defaultValue}if(!this.edittype){this.edittype="text"}if(f.p.autoencode){aj=b.jgrid.htmlDecode(aj)}ab=b.jgrid.createEl.call(f,this.edittype,au,aj,false,b.extend({},b.jgrid.ajaxOptions,ak.p.ajaxSelectOptions||{}));if(aj===""&&this.edittype=="checkbox"){aj=b(ab).attr("offval")}if(aj===""&&this.edittype=="select"){aj=b("option:eq(0)",ab).text()}if(a[f.p.id].checkOnSubmit||a[f.p.id].checkOnUpdate){a[f.p.id]._savedData[ar]=aj}b(ab).addClass("FormElement");if(b.inArray(this.edittype,["text","textarea","password","select"])>-1){b(ab).addClass("ui-widget-content ui-corner-all")}ac=b(ah).find("tr[rowpos="+aw+"]");if(az.rowabove){var ax=b("<tr><td class='contentinfo' colspan='"+(af*2)+"'>"+az.rowcontent+"</td></tr>");b(ah).append(ax);ax[0].rp=aw}if(ac.length===0){ac=b("<tr "+aq+" rowpos='"+aw+"'></tr>").addClass("FormData").attr("id","tr_"+ar);b(ac).append(ap);b(ah).append(ac);ac[0].rp=aw}b("td:eq("+(ay-2)+")",ac[0]).html(az.label===undefined?ak.p.colNames[av]:az.label);b("td:eq("+(ay-1)+")",ac[0]).append(az.elmprefix).append(ab).append(az.elmsuffix);if(b.isFunction(au.custom_value)&&ad!=="_empty"){au.custom_value.call(f,b("#"+ar,"#"+A),"set",aj)}b.jgrid.bindEv(ab,au,f);an[ag]=av;ag++}});if(ag>0){var ao=b("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(af*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+ak.p.id+"_id' value='"+ad+"'/></td></tr>");ao[0].rp=ag+999;b(ah).append(ao);if(a[f.p.id].checkOnSubmit||a[f.p.id].checkOnUpdate){a[f.p.id]._savedData[ak.p.id+"_id"]=ad}}return an}function s(ab,ai,ae){var am,af=0,aj,ah,ac,ag,ak;if(a[f.p.id].checkOnSubmit||a[f.p.id].checkOnUpdate){a[f.p.id]._savedData={};a[f.p.id]._savedData[ai.p.id+"_id"]=ab}var al=ai.p.colModel;if(ab=="_empty"){b(al).each(function(){am=this.name;ac=b.extend({},this.editoptions||{});ah=b("#"+b.jgrid.jqID(am),"#"+ae);if(ah&&ah.length&&ah[0]!==null){ag="";if(ac.defaultValue){ag=b.isFunction(ac.defaultValue)?ac.defaultValue.call(f):ac.defaultValue;if(ah[0].type=="checkbox"){ak=ag.toLowerCase();if(ak.search(/(false|0|no|off|undefined)/i)<0&&ak!==""){ah[0].checked=true;ah[0].defaultChecked=true;ah[0].value=ag}else{ah[0].checked=false;ah[0].defaultChecked=false}}else{ah.val(ag)}}else{if(ah[0].type=="checkbox"){ah[0].checked=false;ah[0].defaultChecked=false;ag=b(ah).attr("offval")}else{if(ah[0].type&&ah[0].type.substr(0,6)=="select"){ah[0].selectedIndex=0}else{ah.val(ag)}}}if(a[f.p.id].checkOnSubmit===true||a[f.p.id].checkOnUpdate){a[f.p.id]._savedData[am]=ag}}});b("#id_g","#"+ae).val(ab);return}var ad=b(ai).jqGrid("getInd",ab,true);if(!ad){return}b('td[role="gridcell"]',ad).each(function(aq){am=al[aq].name;if(am!=="cb"&&am!=="subgrid"&&am!=="rn"&&al[aq].editable===true){if(am==ai.p.ExpandColumn&&ai.p.treeGrid===true){aj=b(this).text()}else{try{aj=b.unformat.call(ai,b(this),{rowId:ab,colModel:al[aq]},aq)}catch(ap){aj=al[aq].edittype=="textarea"?b(this).text():b(this).html()}}if(f.p.autoencode){aj=b.jgrid.htmlDecode(aj)}if(a[f.p.id].checkOnSubmit===true||a[f.p.id].checkOnUpdate){a[f.p.id]._savedData[am]=aj}am=b.jgrid.jqID(am);switch(al[aq].edittype){case"password":case"text":case"button":case"image":case"textarea":if(aj=="&nbsp;"||aj=="&#160;"||(aj.length==1&&aj.charCodeAt(0)==160)){aj=""}b("#"+am,"#"+ae).val(aj);break;case"select":var ao=aj.split(",");ao=b.map(ao,function(at){return b.trim(at)});b("#"+am+" option","#"+ae).each(function(){if(!al[aq].editoptions.multiple&&(b.trim(aj)==b.trim(b(this).text())||ao[0]==b.trim(b(this).text())||ao[0]==b.trim(b(this).val()))){this.selected=true}else{if(al[aq].editoptions.multiple){if(b.inArray(b.trim(b(this).text()),ao)>-1||b.inArray(b.trim(b(this).val()),ao)>-1){this.selected=true}else{this.selected=false}}else{this.selected=false}}});break;case"checkbox":aj=String(aj);if(al[aq].editoptions&&al[aq].editoptions.value){var an=al[aq].editoptions.value.split(":");if(an[0]==aj){b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("checked",true);b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("defaultChecked",true)}else{b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("checked",false);b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("defaultChecked",false)}}else{aj=aj.toLowerCase();if(aj.search(/(false|0|no|off|undefined)/i)<0&&aj!==""){b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("checked",true);b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("defaultChecked",true)}else{b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("checked",false);b("#"+am,"#"+ae)[f.p.useProp?"prop":"attr"]("defaultChecked",false)}}break;case"custom":try{if(al[aq].editoptions&&b.isFunction(al[aq].editoptions.custom_value)){al[aq].editoptions.custom_value.call(f,b("#"+am,"#"+ae),"set",aj)}else{throw"e1"}}catch(ar){if(ar=="e1"){b.jgrid.info_dialog(b.jgrid.errors.errcap,"function 'custom_value' "+b.jgrid.edit.msg.nodefined,b.jgrid.edit.bClose)}else{b.jgrid.info_dialog(b.jgrid.errors.errcap,ar.message,b.jgrid.edit.bClose)}}break}af++}});if(af>0){b("#id_g",x).val(ab)}}function U(){b.each(f.p.colModel,function(ab,ac){if(ac.editoptions&&ac.editoptions.NullIfEmpty===true){if(F.hasOwnProperty(ac.name)&&F[ac.name]===""){F[ac.name]="null"}}})}function m(){var al,ak=[true,"",""],ab={},ag=f.p.prmNames,aj,ae,ao,ah,af;var ai=b(f).triggerHandler("jqGridAddEditBeforeCheckValues",[b("#"+A),H]);if(ai&&typeof ai==="object"){F=ai}if(b.isFunction(a[f.p.id].beforeCheckValues)){ai=a[f.p.id].beforeCheckValues.call(f,F,b("#"+A),F[f.p.id+"_id"]=="_empty"?ag.addoper:ag.editoper);if(ai&&typeof ai==="object"){F=ai}}for(ao in F){if(F.hasOwnProperty(ao)){ak=b.jgrid.checkValues.call(f,F[ao],ao,f);if(ak[0]===false){break}}}U();if(ak[0]){ab=b(f).triggerHandler("jqGridAddEditClickSubmit",[a[f.p.id],F,H]);if(ab===undefined&&b.isFunction(a[f.p.id].onclickSubmit)){ab=a[f.p.id].onclickSubmit.call(f,a[f.p.id],F)||{}}ak=b(f).triggerHandler("jqGridAddEditBeforeSubmit",[F,b("#"+A),H]);if(ak===undefined){ak=[true,"",""]}if(ak[0]&&b.isFunction(a[f.p.id].beforeSubmit)){ak=a[f.p.id].beforeSubmit.call(f,F,b("#"+A))}}if(ak[0]&&!a[f.p.id].processing){a[f.p.id].processing=true;b("#sData",x+"_2").addClass("ui-state-active");ae=ag.oper;aj=ag.id;F[ae]=(b.trim(F[f.p.id+"_id"])=="_empty")?ag.addoper:ag.editoper;if(F[ae]!=ag.addoper){F[aj]=F[f.p.id+"_id"]}else{if(F[aj]===undefined){F[aj]=F[f.p.id+"_id"]}}delete F[f.p.id+"_id"];F=b.extend(F,a[f.p.id].editData,ab);if(f.p.treeGrid===true){if(F[ae]==ag.addoper){ah=b(f).jqGrid("getGridParam","selrow");var ac=f.p.treeGridModel=="adjacency"?f.p.treeReader.parent_id_field:"parent_id";F[ac]=ah}for(af in f.p.treeReader){if(f.p.treeReader.hasOwnProperty(af)){var an=f.p.treeReader[af];if(F.hasOwnProperty(an)){if(F[ae]==ag.addoper&&af==="parent_id_field"){continue}delete F[an]}}}}F[aj]=b.jgrid.stripPref(f.p.idPrefix,F[aj]);var ad=b.extend({url:a[f.p.id].url||b(f).jqGrid("getGridParam","editurl"),type:a[f.p.id].mtype,data:b.isFunction(a[f.p.id].serializeEditData)?a[f.p.id].serializeEditData.call(f,F):F,complete:function(ar,ap){var aq;F[aj]=f.p.idPrefix+F[aj];if(ap!="success"){ak[0]=false;ak[1]=b(f).triggerHandler("jqGridAddEditErrorTextFormat",[ar,H]);if(b.isFunction(a[f.p.id].errorTextFormat)){ak[1]=a[f.p.id].errorTextFormat.call(f,ar)}else{ak[1]=ap+" Status: '"+ar.statusText+"'. Error code: "+ar.status}}else{ak=b(f).triggerHandler("jqGridAddEditAfterSubmit",[ar,F,H]);if(ak===undefined){ak=[true,"",""]}if(ak[0]&&b.isFunction(a[f.p.id].afterSubmit)){ak=a[f.p.id].afterSubmit.call(f,ar,F)}}if(ak[0]===false){b("#FormError>td",x).html(ak[1]);b("#FormError",x).show()}else{b.each(f.p.colModel,function(){if(Q[this.name]&&this.formatter&&this.formatter=="select"){try{delete Q[this.name]}catch(au){}}});F=b.extend(F,Q);if(f.p.autoencode){b.each(F,function(av,au){F[av]=b.jgrid.htmlDecode(au)})}if(F[ae]==ag.addoper){if(!ak[2]){ak[2]=b.jgrid.randId()}F[aj]=ak[2];if(a[f.p.id].closeAfterAdd){if(a[f.p.id].reloadAfterSubmit){b(f).trigger("reloadGrid")}else{if(f.p.treeGrid===true){b(f).jqGrid("addChildNode",ak[2],ah,F)}else{b(f).jqGrid("addRowData",ak[2],F,e.addedrow);b(f).jqGrid("setSelection",ak[2])}}b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose})}else{if(a[f.p.id].clearAfterAdd){if(a[f.p.id].reloadAfterSubmit){b(f).trigger("reloadGrid")}else{if(f.p.treeGrid===true){b(f).jqGrid("addChildNode",ak[2],ah,F)}else{b(f).jqGrid("addRowData",ak[2],F,e.addedrow)}}s("_empty",f,A)}else{if(a[f.p.id].reloadAfterSubmit){b(f).trigger("reloadGrid")}else{if(f.p.treeGrid===true){b(f).jqGrid("addChildNode",ak[2],ah,F)}else{b(f).jqGrid("addRowData",ak[2],F,e.addedrow)}}}}}else{if(a[f.p.id].reloadAfterSubmit){b(f).trigger("reloadGrid");if(!a[f.p.id].closeAfterEdit){setTimeout(function(){b(f).jqGrid("setSelection",F[aj])},1000)}}else{if(f.p.treeGrid===true){b(f).jqGrid("setTreeRow",F[aj],F)}else{b(f).jqGrid("setRowData",F[aj],F)}}if(a[f.p.id].closeAfterEdit){b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose})}}if(b.isFunction(a[f.p.id].afterComplete)){al=ar;setTimeout(function(){b(f).triggerHandler("jqGridAddEditAfterComplete",[al,F,b("#"+A),H]);a[f.p.id].afterComplete.call(f,al,F,b("#"+A));al=null},500)}if(a[f.p.id].checkOnSubmit||a[f.p.id].checkOnUpdate){b("#"+A).data("disabled",false);if(a[f.p.id]._savedData[f.p.id+"_id"]!="_empty"){for(aq in a[f.p.id]._savedData){if(a[f.p.id]._savedData.hasOwnProperty(aq)&&F[aq]){a[f.p.id]._savedData[aq]=F[aq]}}}}}a[f.p.id].processing=false;b("#sData",x+"_2").removeClass("ui-state-active");try{b(":input:visible","#"+A)[0].focus()}catch(at){}}},b.jgrid.ajaxOptions,a[f.p.id].ajaxEditOptions);if(!ad.url&&!a[f.p.id].useDataProxy){if(b.isFunction(f.p.dataProxy)){a[f.p.id].useDataProxy=true}else{ak[0]=false;ak[1]+=" "+b.jgrid.errors.nourl}}if(ak[0]){if(a[f.p.id].useDataProxy){var am=f.p.dataProxy.call(f,ad,"set_"+f.p.id);if(am===undefined){am=[true,""]}if(am[0]===false){ak[0]=false;ak[1]=am[1]||"Error deleting the selected row!"}else{if(ad.data.oper==ag.addoper&&a[f.p.id].closeAfterAdd){b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose})}if(ad.data.oper==ag.editoper&&a[f.p.id].closeAfterEdit){b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose})}}}else{b.ajax(ad)}}}if(ak[0]===false){b("#FormError>td",x).html(ak[1]);b("#FormError",x).show()}}function K(ae,ab){var ac=false,ad;for(ad in ae){if(ae.hasOwnProperty(ad)&&ae[ad]!=ab[ad]){ac=true;break}}return ac}function j(){var ab=true;b("#FormError",x).hide();if(a[f.p.id].checkOnUpdate){F={};Q={};Y();G=b.extend({},F,Q);C=K(G,a[f.p.id]._savedData);if(C){b("#"+A).data("disabled",true);b(".confirm","#"+l.themodal).show();ab=false}}return ab}function X(){var ab;if(d!=="_empty"&&f.p.savedRow!==undefined&&f.p.savedRow.length>0&&b.isFunction(b.fn.jqGrid.restoreRow)){for(ab=0;ab<f.p.savedRow.length;ab++){if(f.p.savedRow[ab].id==d){b(f).jqGrid("restoreRow",d);break}}}}function J(ac,ab){var ad=ab[1].length-1;if(ac===0){b("#pData",x+"_2").addClass("ui-state-disabled")}else{if(ab[1][ac-1]!==undefined&&b("#"+b.jgrid.jqID(ab[1][ac-1])).hasClass("ui-state-disabled")){b("#pData",x+"_2").addClass("ui-state-disabled")}else{b("#pData",x+"_2").removeClass("ui-state-disabled")}}if(ac==ad){b("#nData",x+"_2").addClass("ui-state-disabled")}else{if(ab[1][ac+1]!==undefined&&b("#"+b.jgrid.jqID(ab[1][ac+1])).hasClass("ui-state-disabled")){b("#nData",x+"_2").addClass("ui-state-disabled")}else{b("#nData",x+"_2").removeClass("ui-state-disabled")}}}function aa(){var ac=b(f).jqGrid("getDataIDs"),ab=b("#id_g",x).val(),ad=b.inArray(ab,ac);return[ad,ac]}if(b("#"+b.jgrid.jqID(l.themodal))[0]!==undefined){Z=b(f).triggerHandler("jqGridAddEditBeforeInitData",[b("#"+b.jgrid.jqID(A)),H]);if(Z===undefined){Z=true}if(Z&&M){Z=M.call(f,b("#"+A))}if(Z===false){return}X();b(".ui-jqdialog-title","#"+b.jgrid.jqID(l.modalhead)).html(e.caption);b("#FormError",x).hide();if(a[f.p.id].topinfo){b(".topinfo",x).html(a[f.p.id].topinfo);b(".tinfo",x).show()}else{b(".tinfo",x).hide()}if(a[f.p.id].bottominfo){b(".bottominfo",x+"_2").html(a[f.p.id].bottominfo);b(".binfo",x+"_2").show()}else{b(".binfo",x+"_2").hide()}s(d,f,A);if(d=="_empty"||!a[f.p.id].viewPagerButtons){b("#pData, #nData",x+"_2").hide()}else{b("#pData, #nData",x+"_2").show()}if(a[f.p.id].processing===true){a[f.p.id].processing=false;b("#sData",x+"_2").removeClass("ui-state-active")}if(b("#"+A).data("disabled")===true){b(".confirm","#"+b.jgrid.jqID(l.themodal)).hide();b("#"+A).data("disabled",false)}b(f).triggerHandler("jqGridAddEditBeforeShowForm",[b("#"+A),H]);if(E){E.call(f,b("#"+A))}b("#"+b.jgrid.jqID(l.themodal)).data("onClose",a[f.p.id].onClose);b.jgrid.viewModal("#"+b.jgrid.jqID(l.themodal),{gbox:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,jqM:false,overlay:e.overlay,modal:e.modal});if(!o){b(".jqmOverlay").click(function(){if(!j()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose});return false})}b(f).triggerHandler("jqGridAddEditAfterShowForm",[b("#"+A),H]);if(N){N.call(f,b("#"+A))}}else{var u=isNaN(e.dataheight)?e.dataheight:e.dataheight+"px",h=isNaN(e.datawidth)?e.datawidth:e.datawidth+"px",T=b("<form name='FormPost' id='"+A+"' class='FormGrid' onSubmit='return false;' style='width:"+h+";overflow:auto;position:relative;height:"+u+";'></form>").data("disabled",false),B=b("<table id='"+W+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");Z=b(f).triggerHandler("jqGridAddEditBeforeInitData",[b("#"+A),H]);if(Z===undefined){Z=true}if(Z&&M){Z=M.call(f,b("#"+A))}if(Z===false){return}X();b(f.p.colModel).each(function(){var ab=this.formoptions;I=Math.max(I,ab?ab.colpos||0:0);t=Math.max(t,ab?ab.rowpos||0:0)});b(T).append(B);var L=b("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+(I*2)+"'></td></tr>");L[0].rp=0;b(B).append(L);L=b("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+(I*2)+"'>"+a[f.p.id].topinfo+"</td></tr>");L[0].rp=0;b(B).append(L);var g=f.p.direction=="rtl"?true:false,S=g?"nData":"pData",V=g?"pData":"nData";v(d,f,B,I);var n="<a href='javascript:void(0)' id='"+S+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",p="<a href='javascript:void(0)' id='"+V+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",k="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+e.bSubmit+"</a>",w="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+e.bCancel+"</a>";var P="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+W+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(g?p+n:n+p)+"</td><td class='EditButton'>"+k+w+"</td></tr>";P+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+a[f.p.id].bottominfo+"</td></tr>";P+="</tbody></table>";if(t>0){var z=[];b.each(b(B)[0].rows,function(ab,ac){z[ab]=ac});z.sort(function(ac,ab){if(ac.rp>ab.rp){return 1}if(ac.rp<ab.rp){return -1}return 0});b.each(z,function(ab,ac){b("tbody",B).append(ac)})}e.gbox="#gbox_"+b.jgrid.jqID(D);var q=false;if(e.closeOnEscape===true){e.closeOnEscape=false;q=true}var O=b("<div></div>").append(T).append(P);b.jgrid.createModal(l,O,e,"#gview_"+b.jgrid.jqID(f.p.id),b("#gbox_"+b.jgrid.jqID(f.p.id))[0]);if(g){b("#pData, #nData",x+"_2").css("float","right");b(".EditButton",x+"_2").css("text-align","left")}if(a[f.p.id].topinfo){b(".tinfo",x).show()}if(a[f.p.id].bottominfo){b(".binfo",x+"_2").show()}O=null;P=null;b("#"+b.jgrid.jqID(l.themodal)).keydown(function(ab){var ac=ab.target;if(b("#"+A).data("disabled")===true){return false}if(a[f.p.id].savekey[0]===true&&ab.which==a[f.p.id].savekey[1]){if(ac.tagName!="TEXTAREA"){b("#sData",x+"_2").trigger("click");return false}}if(ab.which===27){if(!j()){return false}if(q){b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:e.gbox,jqm:e.jqModal,onClose:a[f.p.id].onClose})}return false}if(a[f.p.id].navkeys[0]===true){if(b("#id_g",x).val()=="_empty"){return true}if(ab.which==a[f.p.id].navkeys[1]){b("#pData",x+"_2").trigger("click");return false}if(ab.which==a[f.p.id].navkeys[2]){b("#nData",x+"_2").trigger("click");return false}}});if(e.checkOnUpdate){b("a.ui-jqdialog-titlebar-close span","#"+b.jgrid.jqID(l.themodal)).removeClass("jqmClose");b("a.ui-jqdialog-titlebar-close","#"+b.jgrid.jqID(l.themodal)).unbind("click").click(function(){if(!j()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose});return false})}e.saveicon=b.extend([true,"left","ui-icon-disk"],e.saveicon);e.closeicon=b.extend([true,"left","ui-icon-close"],e.closeicon);if(e.saveicon[0]===true){b("#sData",x+"_2").addClass(e.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+e.saveicon[2]+"'></span>")}if(e.closeicon[0]===true){b("#cData",x+"_2").addClass(e.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+e.closeicon[2]+"'></span>")}if(a[f.p.id].checkOnSubmit||a[f.p.id].checkOnUpdate){k="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+e.bYes+"</a>";p="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+e.bNo+"</a>";w="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+e.bExit+"</a>";var y=e.zIndex||999;y++;b("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+y+";display:none;'>&#160;</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(y+1)+"'>"+e.saveData+"<br/><br/>"+k+p+w+"</div>").insertAfter("#"+A);b("#sNew","#"+b.jgrid.jqID(l.themodal)).click(function(){m();b("#"+A).data("disabled",false);b(".confirm","#"+b.jgrid.jqID(l.themodal)).hide();return false});b("#nNew","#"+b.jgrid.jqID(l.themodal)).click(function(){b(".confirm","#"+b.jgrid.jqID(l.themodal)).hide();b("#"+A).data("disabled",false);setTimeout(function(){b(":input","#"+A)[0].focus()},0);return false});b("#cNew","#"+b.jgrid.jqID(l.themodal)).click(function(){b(".confirm","#"+b.jgrid.jqID(l.themodal)).hide();b("#"+A).data("disabled",false);b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose});return false})}b(f).triggerHandler("jqGridAddEditInitializeForm",[b("#"+A),H]);if(r){r.call(f,b("#"+A))}if(d=="_empty"||!a[f.p.id].viewPagerButtons){b("#pData,#nData",x+"_2").hide()}else{b("#pData,#nData",x+"_2").show()}b(f).triggerHandler("jqGridAddEditBeforeShowForm",[b("#"+A),H]);if(E){E.call(f,b("#"+A))}b("#"+b.jgrid.jqID(l.themodal)).data("onClose",a[f.p.id].onClose);b.jgrid.viewModal("#"+b.jgrid.jqID(l.themodal),{gbox:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,overlay:e.overlay,modal:e.modal});if(!o){b(".jqmOverlay").click(function(){if(!j()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose});return false})}b(f).triggerHandler("jqGridAddEditAfterShowForm",[b("#"+A),H]);if(N){N.call(f,b("#"+A))}b(".fm-button","#"+b.jgrid.jqID(l.themodal)).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});b("#sData",x+"_2").click(function(){F={};Q={};b("#FormError",x).hide();Y();if(F[f.p.id+"_id"]=="_empty"){m()}else{if(e.checkOnSubmit===true){G=b.extend({},F,Q);C=K(G,a[f.p.id]._savedData);if(C){b("#"+A).data("disabled",true);b(".confirm","#"+b.jgrid.jqID(l.themodal)).show()}else{m()}}else{m()}}return false});b("#cData",x+"_2").click(function(){if(!j()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(D),jqm:e.jqModal,onClose:a[f.p.id].onClose});return false});b("#nData",x+"_2").click(function(){if(!j()){return false}b("#FormError",x).hide();var ac=aa();ac[0]=parseInt(ac[0],10);if(ac[0]!=-1&&ac[1][ac[0]+1]){b(f).triggerHandler("jqGridAddEditClickPgButtons",["next",b("#"+A),ac[1][ac[0]]]);var ab;if(b.isFunction(e.onclickPgButtons)){ab=e.onclickPgButtons.call(f,"next",b("#"+A),ac[1][ac[0]]);if(ab!==undefined&&ab===false){return false}}if(b("#"+b.jgrid.jqID(ac[1][ac[0]+1])).hasClass("ui-state-disabled")){return false}s(ac[1][ac[0]+1],f,A);b(f).jqGrid("setSelection",ac[1][ac[0]+1]);b(f).triggerHandler("jqGridAddEditAfterClickPgButtons",["next",b("#"+A),ac[1][ac[0]]]);if(b.isFunction(e.afterclickPgButtons)){e.afterclickPgButtons.call(f,"next",b("#"+A),ac[1][ac[0]+1])}J(ac[0]+1,ac)}return false});b("#pData",x+"_2").click(function(){if(!j()){return false}b("#FormError",x).hide();var ac=aa();if(ac[0]!=-1&&ac[1][ac[0]-1]){b(f).triggerHandler("jqGridAddEditClickPgButtons",["prev",b("#"+A),ac[1][ac[0]]]);var ab;if(b.isFunction(e.onclickPgButtons)){ab=e.onclickPgButtons.call(f,"prev",b("#"+A),ac[1][ac[0]]);if(ab!==undefined&&ab===false){return false}}if(b("#"+b.jgrid.jqID(ac[1][ac[0]-1])).hasClass("ui-state-disabled")){return false}s(ac[1][ac[0]-1],f,A);b(f).jqGrid("setSelection",ac[1][ac[0]-1]);b(f).triggerHandler("jqGridAddEditAfterClickPgButtons",["prev",b("#"+A),ac[1][ac[0]]]);if(b.isFunction(e.afterclickPgButtons)){e.afterclickPgButtons.call(f,"prev",b("#"+A),ac[1][ac[0]-1])}J(ac[0]-1,ac)}return false})}var R=aa();J(R[0],R)})},viewGridRow:function(d,e){e=b.extend(true,{top:0,left:0,width:0,datawidth:"auto",height:"auto",dataheight:"auto",modal:false,overlay:30,drag:true,resize:true,jqModal:true,closeOnEscape:false,labelswidth:"30%",closeicon:[],navkeys:[false,38,40],onClose:null,beforeShowForm:null,beforeInitData:null,viewPagerButtons:true},b.jgrid.view,e||{});a[b(this)[0].p.id]=e;return this.each(function(){var A=this;if(!A.grid||!d){return}var u=A.p.id,E="ViewGrid_"+b.jgrid.jqID(u),w="ViewTbl_"+b.jgrid.jqID(u),x="ViewGrid_"+u,q="ViewTbl_"+u,l={themodal:"viewmod"+u,modalhead:"viewhd"+u,modalcontent:"viewcnt"+u,scrollelm:E},D=b.isFunction(a[A.p.id].beforeInitData)?a[A.p.id].beforeInitData:false,o=true,j=1,h=0;function m(){if(a[A.p.id].closeOnEscape===true||a[A.p.id].navkeys[0]===true){setTimeout(function(){b(".ui-jqdialog-titlebar-close","#"+b.jgrid.jqID(l.modalhead)).focus()},0)}}function r(O,U,S,aa){var K,N,V,Y=0,ad,ae,ac=[],T=false,Z,P="<td class='CaptionTD form-view-label ui-widget-content' width='"+e.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",R="",L="<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>",Q=["integer","number","currency"],X=0,W=0,M,J,ab;for(Z=1;Z<=aa;Z++){R+=Z==1?P:L}b(U.p.colModel).each(function(){if(this.editrules&&this.editrules.edithidden===true){N=false}else{N=this.hidden===true?true:false}if(!N&&this.align==="right"){if(this.formatter&&b.inArray(this.formatter,Q)!==-1){X=Math.max(X,parseInt(this.width,10))}else{W=Math.max(W,parseInt(this.width,10))}}});M=X!==0?X:W!==0?W:0;T=b(U).jqGrid("getInd",O);b(U.p.colModel).each(function(ag){K=this.name;J=false;if(this.editrules&&this.editrules.edithidden===true){N=false}else{N=this.hidden===true?true:false}ae=N?"style='display:none'":"";ab=(typeof this.viewable!=="boolean")?true:this.viewable;if(K!=="cb"&&K!=="subgrid"&&K!=="rn"&&ab){if(T===false){ad=""}else{if(K==U.p.ExpandColumn&&U.p.treeGrid===true){ad=b("td:eq("+ag+")",U.rows[T]).text()}else{ad=b("td:eq("+ag+")",U.rows[T]).html()}}J=this.align==="right"&&M!==0?true:false;var ak=b.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),ah=parseInt(ak.rowpos,10)||Y+1,aj=parseInt((parseInt(ak.colpos,10)||1)*2,10);if(ak.rowabove){var ai=b("<tr><td class='contentinfo' colspan='"+(aa*2)+"'>"+ak.rowcontent+"</td></tr>");b(S).append(ai);ai[0].rp=ah}V=b(S).find("tr[rowpos="+ah+"]");if(V.length===0){V=b("<tr "+ae+" rowpos='"+ah+"'></tr>").addClass("FormData").attr("id","trv_"+K);b(V).append(R);b(S).append(V);V[0].rp=ah}b("td:eq("+(aj-2)+")",V[0]).html("<b>"+(ak.label===undefined?U.p.colNames[ag]:ak.label)+"</b>");b("td:eq("+(aj-1)+")",V[0]).append("<span>"+ad+"</span>").attr("id","v_"+K);if(J){b("td:eq("+(aj-1)+") span",V[0]).css({"text-align":"right",width:M+"px"})}ac[Y]=ag;Y++}});if(Y>0){var af=b("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(aa*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+O+"'/></td></tr>");af[0].rp=Y+99;b(S).append(af)}return ac}function p(N,P){var J,Q,M=0,L,K,O;O=b(P).jqGrid("getInd",N,true);if(!O){return}b("td",O).each(function(R){J=P.p.colModel[R].name;if(P.p.colModel[R].editrules&&P.p.colModel[R].editrules.edithidden===true){Q=false}else{Q=P.p.colModel[R].hidden===true?true:false}if(J!=="cb"&&J!=="subgrid"&&J!=="rn"){if(J==P.p.ExpandColumn&&P.p.treeGrid===true){L=b(this).text()}else{L=b(this).html()}K=b.extend({},P.p.colModel[R].editoptions||{});J=b.jgrid.jqID("v_"+J);b("#"+J+" span","#"+w).html(L);if(Q){b("#"+J,"#"+w).parents("tr:first").hide()}M++}});if(M>0){b("#id_g","#"+w).val(N)}}function s(K,J){var L=J[1].length-1;if(K===0){b("#pData","#"+w+"_2").addClass("ui-state-disabled")}else{if(J[1][K-1]!==undefined&&b("#"+b.jgrid.jqID(J[1][K-1])).hasClass("ui-state-disabled")){b("#pData",w+"_2").addClass("ui-state-disabled")}else{b("#pData","#"+w+"_2").removeClass("ui-state-disabled")}}if(K==L){b("#nData","#"+w+"_2").addClass("ui-state-disabled")}else{if(J[1][K+1]!==undefined&&b("#"+b.jgrid.jqID(J[1][K+1])).hasClass("ui-state-disabled")){b("#nData",w+"_2").addClass("ui-state-disabled")}else{b("#nData","#"+w+"_2").removeClass("ui-state-disabled")}}}function k(){var K=b(A).jqGrid("getDataIDs"),J=b("#id_g","#"+w).val(),L=b.inArray(J,K);return[L,K]}if(b("#"+b.jgrid.jqID(l.themodal))[0]!==undefined){if(D){o=D.call(A,b("#"+E));if(o===undefined){o=true}}if(o===false){return}b(".ui-jqdialog-title","#"+b.jgrid.jqID(l.modalhead)).html(e.caption);b("#FormError","#"+w).hide();p(d,A);if(b.isFunction(a[A.p.id].beforeShowForm)){a[A.p.id].beforeShowForm.call(A,b("#"+E))}b.jgrid.viewModal("#"+b.jgrid.jqID(l.themodal),{gbox:"#gbox_"+b.jgrid.jqID(u),jqm:e.jqModal,jqM:false,overlay:e.overlay,modal:e.modal});m()}else{var C=isNaN(e.dataheight)?e.dataheight:e.dataheight+"px",v=isNaN(e.datawidth)?e.datawidth:e.datawidth+"px",G=b("<form name='FormPost' id='"+x+"' class='FormGrid' style='width:"+v+";overflow:auto;position:relative;height:"+C+";'></form>"),n=b("<table id='"+q+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");if(D){o=D.call(A,b("#"+E));if(o===undefined){o=true}}if(o===false){return}b(A.p.colModel).each(function(){var J=this.formoptions;j=Math.max(j,J?J.colpos||0:0);h=Math.max(h,J?J.rowpos||0:0)});b(G).append(n);r(d,A,n,j);var B=A.p.direction=="rtl"?true:false,I=B?"nData":"pData",g=B?"pData":"nData",y="<a href='javascript:void(0)' id='"+I+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",z="<a href='javascript:void(0)' id='"+g+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",H="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+e.bClose+"</a>";if(h>0){var f=[];b.each(b(n)[0].rows,function(J,K){f[J]=K});f.sort(function(K,J){if(K.rp>J.rp){return 1}if(K.rp<J.rp){return -1}return 0});b.each(f,function(J,K){b("tbody",n).append(K)})}e.gbox="#gbox_"+b.jgrid.jqID(u);var F=b("<div></div>").append(G).append("<table border='0' class='EditTable' id='"+w+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+e.labelswidth+"'>"+(B?z+y:y+z)+"</td><td class='EditButton'>"+H+"</td></tr></tbody></table>");b.jgrid.createModal(l,F,e,"#gview_"+b.jgrid.jqID(A.p.id),b("#gview_"+b.jgrid.jqID(A.p.id))[0]);if(B){b("#pData, #nData","#"+w+"_2").css("float","right");b(".EditButton","#"+w+"_2").css("text-align","left")}if(!e.viewPagerButtons){b("#pData, #nData","#"+w+"_2").hide()}F=null;b("#"+l.themodal).keydown(function(J){if(J.which===27){if(a[A.p.id].closeOnEscape){b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:e.gbox,jqm:e.jqModal,onClose:e.onClose})}return false}if(e.navkeys[0]===true){if(J.which===e.navkeys[1]){b("#pData","#"+w+"_2").trigger("click");return false}if(J.which===e.navkeys[2]){b("#nData","#"+w+"_2").trigger("click");return false}}});e.closeicon=b.extend([true,"left","ui-icon-close"],e.closeicon);if(e.closeicon[0]===true){b("#cData","#"+w+"_2").addClass(e.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+e.closeicon[2]+"'></span>")}if(b.isFunction(e.beforeShowForm)){e.beforeShowForm.call(A,b("#"+E))}b.jgrid.viewModal("#"+b.jgrid.jqID(l.themodal),{gbox:"#gbox_"+b.jgrid.jqID(u),jqm:e.jqModal,overlay:e.overlay,modal:e.modal});b(".fm-button:not(.ui-state-disabled)","#"+w+"_2").hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});m();b("#cData","#"+w+"_2").click(function(){b.jgrid.hideModal("#"+b.jgrid.jqID(l.themodal),{gb:"#gbox_"+b.jgrid.jqID(u),jqm:e.jqModal,onClose:e.onClose});return false});b("#nData","#"+w+"_2").click(function(){b("#FormError","#"+w).hide();var J=k();J[0]=parseInt(J[0],10);if(J[0]!=-1&&J[1][J[0]+1]){if(b.isFunction(e.onclickPgButtons)){e.onclickPgButtons.call(A,"next",b("#"+E),J[1][J[0]])}p(J[1][J[0]+1],A);b(A).jqGrid("setSelection",J[1][J[0]+1]);if(b.isFunction(e.afterclickPgButtons)){e.afterclickPgButtons.call(A,"next",b("#"+E),J[1][J[0]+1])}s(J[0]+1,J)}m();return false});b("#pData","#"+w+"_2").click(function(){b("#FormError","#"+w).hide();var J=k();if(J[0]!=-1&&J[1][J[0]-1]){if(b.isFunction(e.onclickPgButtons)){e.onclickPgButtons.call(A,"prev",b("#"+E),J[1][J[0]])}p(J[1][J[0]-1],A);b(A).jqGrid("setSelection",J[1][J[0]-1]);if(b.isFunction(e.afterclickPgButtons)){e.afterclickPgButtons.call(A,"prev",b("#"+E),J[1][J[0]-1])}s(J[0]-1,J)}m();return false})}var t=k();s(t[0],t)})},delGridRow:function(d,e){e=b.extend(true,{top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:false,overlay:30,drag:true,resize:true,url:"",mtype:"POST",reloadAfterSubmit:true,beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:true,closeOnEscape:false,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:false,serializeDelData:null,useDataProxy:false},b.jgrid.del,e||{});a[b(this)[0].p.id]=e;return this.each(function(){var u=this;if(!u.grid){return}if(!d){return}var y=b.isFunction(a[u.p.id].beforeShowForm),l=b.isFunction(a[u.p.id].afterShowForm),w=b.isFunction(a[u.p.id].beforeInitData)?a[u.p.id].beforeInitData:false,m=u.p.id,o={},k=true,h="DelTbl_"+b.jgrid.jqID(m),t,r,n,p,f="DelTbl_"+m,g={themodal:"delmod"+m,modalhead:"delhd"+m,modalcontent:"delcnt"+m,scrollelm:h};if(b.isArray(d)){d=d.join()}if(b("#"+b.jgrid.jqID(g.themodal))[0]!==undefined){if(w){k=w.call(u,b("#"+h));if(k===undefined){k=true}}if(k===false){return}b("#DelData>td","#"+h).text(d);b("#DelError","#"+h).hide();if(a[u.p.id].processing===true){a[u.p.id].processing=false;b("#dData","#"+h).removeClass("ui-state-active")}if(y){a[u.p.id].beforeShowForm.call(u,b("#"+h))}b.jgrid.viewModal("#"+b.jgrid.jqID(g.themodal),{gbox:"#gbox_"+b.jgrid.jqID(m),jqm:a[u.p.id].jqModal,jqM:false,overlay:a[u.p.id].overlay,modal:a[u.p.id].modal});if(l){a[u.p.id].afterShowForm.call(u,b("#"+h))}}else{var v=isNaN(a[u.p.id].dataheight)?a[u.p.id].dataheight:a[u.p.id].dataheight+"px",q=isNaN(e.datawidth)?e.datawidth:e.datawidth+"px",j="<div id='"+f+"' class='formdata' style='width:"+q+";overflow:auto;position:relative;height:"+v+";'>";j+="<table class='DelTable'><tbody>";j+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";j+="<tr id='DelData' style='display:none'><td >"+d+"</td></tr>";j+='<tr><td class="delmsg" style="white-space:pre;">'+a[u.p.id].msg+"</td></tr><tr><td >&#160;</td></tr>";j+="</tbody></table></div>";var s="<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+e.bSubmit+"</a>",x="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+e.bCancel+"</a>";j+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+h+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton'>"+s+"&#160;"+x+"</td></tr></tbody></table>";e.gbox="#gbox_"+b.jgrid.jqID(m);b.jgrid.createModal(g,j,e,"#gview_"+b.jgrid.jqID(u.p.id),b("#gview_"+b.jgrid.jqID(u.p.id))[0]);if(w){k=w.call(u,b("#"+h));if(k===undefined){k=true}}if(k===false){return}b(".fm-button","#"+h+"_2").hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});e.delicon=b.extend([true,"left","ui-icon-scissors"],a[u.p.id].delicon);e.cancelicon=b.extend([true,"left","ui-icon-cancel"],a[u.p.id].cancelicon);if(e.delicon[0]===true){b("#dData","#"+h+"_2").addClass(e.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+e.delicon[2]+"'></span>")}if(e.cancelicon[0]===true){b("#eData","#"+h+"_2").addClass(e.cancelicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+e.cancelicon[2]+"'></span>")}b("#dData","#"+h+"_2").click(function(){var B=[true,""],D,C=b("#DelData>td","#"+h).text();o={};if(b.isFunction(a[u.p.id].onclickSubmit)){o=a[u.p.id].onclickSubmit.call(u,a[u.p.id],C)||{}}if(b.isFunction(a[u.p.id].beforeSubmit)){B=a[u.p.id].beforeSubmit.call(u,C)}if(B[0]&&!a[u.p.id].processing){a[u.p.id].processing=true;n=u.p.prmNames;t=b.extend({},a[u.p.id].delData,o);p=n.oper;t[p]=n.deloper;r=n.id;C=String(C).split(",");if(!C.length){return false}for(D in C){if(C.hasOwnProperty(D)){C[D]=b.jgrid.stripPref(u.p.idPrefix,C[D])}}t[r]=C.join();b(this).addClass("ui-state-active");var z=b.extend({url:a[u.p.id].url||b(u).jqGrid("getGridParam","editurl"),type:a[u.p.id].mtype,data:b.isFunction(a[u.p.id].serializeDelData)?a[u.p.id].serializeDelData.call(u,t):t,complete:function(G,E){var F;if(E!="success"){B[0]=false;if(b.isFunction(a[u.p.id].errorTextFormat)){B[1]=a[u.p.id].errorTextFormat.call(u,G)}else{B[1]=E+" Status: '"+G.statusText+"'. Error code: "+G.status}}else{if(b.isFunction(a[u.p.id].afterSubmit)){B=a[u.p.id].afterSubmit.call(u,G,t)}}if(B[0]===false){b("#DelError>td","#"+h).html(B[1]);b("#DelError","#"+h).show()}else{if(a[u.p.id].reloadAfterSubmit&&u.p.datatype!="local"){b(u).trigger("reloadGrid")}else{if(u.p.treeGrid===true){try{b(u).jqGrid("delTreeNode",u.p.idPrefix+C[0])}catch(H){}}else{for(F=0;F<C.length;F++){b(u).jqGrid("delRowData",u.p.idPrefix+C[F])}}u.p.selrow=null;u.p.selarrrow=[]}if(b.isFunction(a[u.p.id].afterComplete)){setTimeout(function(){a[u.p.id].afterComplete.call(u,G,C)},500)}}a[u.p.id].processing=false;b("#dData","#"+h+"_2").removeClass("ui-state-active");if(B[0]){b.jgrid.hideModal("#"+b.jgrid.jqID(g.themodal),{gb:"#gbox_"+b.jgrid.jqID(m),jqm:e.jqModal,onClose:a[u.p.id].onClose})}}},b.jgrid.ajaxOptions,a[u.p.id].ajaxDelOptions);if(!z.url&&!a[u.p.id].useDataProxy){if(b.isFunction(u.p.dataProxy)){a[u.p.id].useDataProxy=true}else{B[0]=false;B[1]+=" "+b.jgrid.errors.nourl}}if(B[0]){if(a[u.p.id].useDataProxy){var A=u.p.dataProxy.call(u,z,"del_"+u.p.id);if(A===undefined){A=[true,""]}if(A[0]===false){B[0]=false;B[1]=A[1]||"Error deleting the selected row!"}else{b.jgrid.hideModal("#"+b.jgrid.jqID(g.themodal),{gb:"#gbox_"+b.jgrid.jqID(m),jqm:e.jqModal,onClose:a[u.p.id].onClose})}}else{b.ajax(z)}}}if(B[0]===false){b("#DelError>td","#"+h).html(B[1]);b("#DelError","#"+h).show()}return false});b("#eData","#"+h+"_2").click(function(){b.jgrid.hideModal("#"+b.jgrid.jqID(g.themodal),{gb:"#gbox_"+b.jgrid.jqID(m),jqm:a[u.p.id].jqModal,onClose:a[u.p.id].onClose});return false});if(y){a[u.p.id].beforeShowForm.call(u,b("#"+h))}b.jgrid.viewModal("#"+b.jgrid.jqID(g.themodal),{gbox:"#gbox_"+b.jgrid.jqID(m),jqm:a[u.p.id].jqModal,overlay:a[u.p.id].overlay,modal:a[u.p.id].modal});if(l){a[u.p.id].afterShowForm.call(u,b("#"+h))}}if(a[u.p.id].closeOnEscape===true){setTimeout(function(){b(".ui-jqdialog-titlebar-close","#"+b.jgrid.jqID(g.modalhead)).focus()},0)}})},navGrid:function(g,j,f,h,e,d,k){j=b.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",del:true,delicon:"ui-icon-trash",search:true,searchicon:"ui-icon-search",refresh:true,refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false,alertwidth:200,alertheight:"auto",alerttop:null,alertleft:null,alertzIndex:null},b.jgrid.nav,j||{});return this.each(function(){if(this.nav){return}var l={themodal:"alertmod_"+this.p.id,modalhead:"alerthd_"+this.p.id,modalcontent:"alertcnt_"+this.p.id},o=this,r,m;if(!o.grid||typeof g!=="string"){return}if(b("#"+l.themodal)[0]===undefined){if(!j.alerttop&&!j.alertleft){if(window.innerWidth!==undefined){j.alertleft=window.innerWidth;j.alerttop=window.innerHeight}else{if(document.documentElement!==undefined&&document.documentElement.clientWidth!==undefined&&document.documentElement.clientWidth!==0){j.alertleft=document.documentElement.clientWidth;j.alerttop=document.documentElement.clientHeight}else{j.alertleft=1024;j.alerttop=768}}j.alertleft=j.alertleft/2-parseInt(j.alertwidth,10)/2;j.alerttop=j.alerttop/2-25}b.jgrid.createModal(l,"<div>"+j.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+b.jgrid.jqID(o.p.id),jqModal:true,drag:true,resize:true,caption:j.alertcap,top:j.alerttop,left:j.alertleft,width:j.alertwidth,height:j.alertheight,closeOnEscape:j.closeOnEscape,zIndex:j.alertzIndex},"#gview_"+b.jgrid.jqID(o.p.id),b("#gbox_"+b.jgrid.jqID(o.p.id))[0],true)}var s=1,p,q=function(){if(!b(this).hasClass("ui-state-disabled")){b(this).addClass("ui-state-hover")}},t=function(){b(this).removeClass("ui-state-hover")};if(j.cloneToTop&&o.p.toppager){s=2}for(p=0;p<s;p++){var u,w=b("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),x="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",n,v;if(p===0){n=g;v=o.p.id;if(n==o.p.toppager){v+="_top";s=1}}else{n=o.p.toppager;v=o.p.id+"_top"}if(o.p.direction=="rtl"){b(w).attr("dir","rtl").css("float","right")}if(j.add){h=h||{};u=b("<td class='ui-pg-button ui-corner-all'></td>");b(u).append("<div class='ui-pg-div'><span class='ui-icon "+j.addicon+"'></span>"+j.addtext+"</div>");b("tr",w).append(u);b(u,w).attr({title:j.addtitle||"",id:h.id||"add_"+v}).click(function(){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(j.addfunc)){j.addfunc.call(o)}else{b(o).jqGrid("editGridRow","new",h)}}return false}).hover(q,t);u=null}if(j.edit){u=b("<td class='ui-pg-button ui-corner-all'></td>");f=f||{};b(u).append("<div class='ui-pg-div'><span class='ui-icon "+j.editicon+"'></span>"+j.edittext+"</div>");b("tr",w).append(u);b(u,w).attr({title:j.edittitle||"",id:f.id||"edit_"+v}).click(function(){if(!b(this).hasClass("ui-state-disabled")){var y=o.p.selrow;if(y){if(b.isFunction(j.editfunc)){j.editfunc.call(o,y)}else{b(o).jqGrid("editGridRow",y,f)}}else{b.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+b.jgrid.jqID(o.p.id),jqm:true});b("#jqg_alrt").focus()}}return false}).hover(q,t);u=null}if(j.view){u=b("<td class='ui-pg-button ui-corner-all'></td>");k=k||{};b(u).append("<div class='ui-pg-div'><span class='ui-icon "+j.viewicon+"'></span>"+j.viewtext+"</div>");b("tr",w).append(u);b(u,w).attr({title:j.viewtitle||"",id:k.id||"view_"+v}).click(function(){if(!b(this).hasClass("ui-state-disabled")){var y=o.p.selrow;if(y){if(b.isFunction(j.viewfunc)){j.viewfunc.call(o,y)}else{b(o).jqGrid("viewGridRow",y,k)}}else{b.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+b.jgrid.jqID(o.p.id),jqm:true});b("#jqg_alrt").focus()}}return false}).hover(q,t);u=null}if(j.del){u=b("<td class='ui-pg-button ui-corner-all'></td>");e=e||{};b(u).append("<div class='ui-pg-div'><span class='ui-icon "+j.delicon+"'></span>"+j.deltext+"</div>");b("tr",w).append(u);b(u,w).attr({title:j.deltitle||"",id:e.id||"del_"+v}).click(function(){if(!b(this).hasClass("ui-state-disabled")){var y;if(o.p.multiselect){y=o.p.selarrrow;if(y.length===0){y=null}}else{y=o.p.selrow}if(y){if(b.isFunction(j.delfunc)){j.delfunc.call(o,y)}else{b(o).jqGrid("delGridRow",y,e)}}else{b.jgrid.viewModal("#"+l.themodal,{gbox:"#gbox_"+b.jgrid.jqID(o.p.id),jqm:true});b("#jqg_alrt").focus()}}return false}).hover(q,t);u=null}if(j.add||j.edit||j.del||j.view){b("tr",w).append(x)}if(j.search){u=b("<td class='ui-pg-button ui-corner-all'></td>");d=d||{};b(u).append("<div class='ui-pg-div'><span class='ui-icon "+j.searchicon+"'></span>"+j.searchtext+"</div>");b("tr",w).append(u);b(u,w).attr({title:j.searchtitle||"",id:d.id||"search_"+v}).click(function(){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(j.searchfunc)){j.searchfunc.call(o,d)}else{b(o).jqGrid("searchGrid",d)}}return false}).hover(q,t);if(d.showOnLoad&&d.showOnLoad===true){b(u,w).click()}u=null}if(j.refresh){u=b("<td class='ui-pg-button ui-corner-all'></td>");b(u).append("<div class='ui-pg-div'><span class='ui-icon "+j.refreshicon+"'></span>"+j.refreshtext+"</div>");b("tr",w).append(u);b(u,w).attr({title:j.refreshtitle||"",id:"refresh_"+v}).click(function(){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(j.beforeRefresh)){j.beforeRefresh.call(o)}o.p.search=false;try{var y=o.p.id;o.p.postData.filters="";b("#fbox_"+b.jgrid.jqID(y)).jqFilter("resetFilter");if(b.isFunction(o.clearToolbar)){o.clearToolbar.call(o,false)}}catch(z){}switch(j.refreshstate){case"firstpage":b(o).trigger("reloadGrid",[{page:1}]);break;case"current":b(o).trigger("reloadGrid",[{current:true}]);break}if(b.isFunction(j.afterRefresh)){j.afterRefresh.call(o)}}return false}).hover(q,t);u=null}m=b(".ui-jqgrid").css("font-size")||"11px";b("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+m+";visibility:hidden;' ></div>");r=b(w).clone().appendTo("#testpg2").width();b("#testpg2").remove();b(n+"_"+j.position,n).append(w);if(o.p._nvtd){if(r>o.p._nvtd[0]){b(n+"_"+j.position,n).width(r);o.p._nvtd[0]=r}o.p._nvtd[1]=r}m=null;r=null;w=null;this.nav=true}})},navButtonAdd:function(d,e){e=b.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},e||{});return this.each(function(){if(!this.grid){return}if(typeof d==="string"&&d.indexOf("#")!==0){d="#"+b.jgrid.jqID(d)}var f=b(".navtable",d)[0],h=this;if(f){if(e.id&&b("#"+b.jgrid.jqID(e.id),f)[0]!==undefined){return}var g=b("<td></td>");if(e.buttonicon.toString().toUpperCase()=="NONE"){b(g).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+e.caption+"</div>")}else{b(g).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+e.buttonicon+"'></span>"+e.caption+"</div>")}if(e.id){b(g).attr("id",e.id)}if(e.position=="first"){if(f.rows[0].cells.length===0){b("tr",f).append(g)}else{b("tr td:eq(0)",f).before(g)}}else{b("tr",f).append(g)}b(g,f).attr("title",e.title||"").click(function(j){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(e.onClickButton)){e.onClickButton.call(h,j)}}return false}).hover(function(){if(!b(this).hasClass("ui-state-disabled")){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")})}})},navSeparatorAdd:function(d,e){e=b.extend({sepclass:"ui-separator",sepcontent:"",position:"last"},e||{});return this.each(function(){if(!this.grid){return}if(typeof d==="string"&&d.indexOf("#")!==0){d="#"+b.jgrid.jqID(d)}var g=b(".navtable",d)[0];if(g){var f="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+e.sepclass+"'></span>"+e.sepcontent+"</td>";if(e.position==="first"){if(g.rows[0].cells.length===0){b("tr",g).append(f)}else{b("tr td:eq(0)",g).before(f)}}else{b("tr",g).append(f)}}})},GridToForm:function(d,e){return this.each(function(){var h=this,f;if(!h.grid){return}var g=b(h).jqGrid("getRowData",d);if(g){for(f in g){if(g.hasOwnProperty(f)){if(b("[name="+b.jgrid.jqID(f)+"]",e).is("input:radio")||b("[name="+b.jgrid.jqID(f)+"]",e).is("input:checkbox")){b("[name="+b.jgrid.jqID(f)+"]",e).each(function(){if(b(this).val()==g[f]){b(this)[h.p.useProp?"prop":"attr"]("checked",true)}else{b(this)[h.p.useProp?"prop":"attr"]("checked",false)}})}else{b("[name="+b.jgrid.jqID(f)+"]",e).val(g[f])}}}}})},FormToGrid:function(e,f,g,d){return this.each(function(){var k=this;if(!k.grid){return}if(!g){g="set"}if(!d){d="first"}var h=b(f).serializeArray();var j={};b.each(h,function(l,m){j[m.name]=m.value});if(g=="add"){b(k).jqGrid("addRowData",e,j,d)}else{if(g=="set"){b(k).jqGrid("setRowData",e,j)}}})}})})(jQuery);(function(a){a.jgrid.inlineEdit=a.jgrid.inlineEdit||{};a.jgrid.extend({editRow:function(d,n,m,g,b,h,f,j,k){var e={},l=a.makeArray(arguments).slice(1);if(a.type(l[0])==="object"){e=l[0]}else{if(n!==undefined){e.keys=n}if(a.isFunction(m)){e.oneditfunc=m}if(a.isFunction(g)){e.successfunc=g}if(b!==undefined){e.url=b}if(h!==undefined){e.extraparam=h}if(a.isFunction(f)){e.aftersavefunc=f}if(a.isFunction(j)){e.errorfunc=j}if(a.isFunction(k)){e.afterrestorefunc=k}}e=a.extend(true,{keys:false,oneditfunc:null,successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:true,mtype:"POST"},a.jgrid.inlineEdit,e);return this.each(function(){var r=this,w,s,p,q=0,v=null,u={},o,t;if(!r.grid){return}o=a(r).jqGrid("getInd",d,true);if(o===false){return}p=a(o).attr("editable")||"0";if(p=="0"&&!a(o).hasClass("not-editable-row")){t=r.p.colModel;a('td[role="gridcell"]',o).each(function(A){w=t[A].name;var z=r.p.treeGrid===true&&w==r.p.ExpandColumn;if(z){s=a("span:first",this).html()}else{try{s=a.unformat.call(r,this,{rowId:d,colModel:t[A]},A)}catch(x){s=(t[A].edittype&&t[A].edittype=="textarea")?a(this).text():a(this).html()}}if(w!="cb"&&w!="subgrid"&&w!="rn"){if(r.p.autoencode){s=a.jgrid.htmlDecode(s)}u[w]=s;if(t[A].editable===true){if(v===null){v=A}if(z){a("span:first",this).html("")}else{a(this).html("")}var y=a.extend({},t[A].editoptions||{},{id:d+"_"+w,name:w});if(!t[A].edittype){t[A].edittype="text"}if(s=="&nbsp;"||s=="&#160;"||(s.length==1&&s.charCodeAt(0)==160)){s=""}var B=a.jgrid.createEl.call(r,t[A].edittype,y,s,true,a.extend({},a.jgrid.ajaxOptions,r.p.ajaxSelectOptions||{}));a(B).addClass("editable");if(z){a("span:first",this).append(B)}else{a(this).append(B)}a.jgrid.bindEv(B,y,r);if(t[A].edittype=="select"&&t[A].editoptions!==undefined&&t[A].editoptions.multiple===true&&t[A].editoptions.dataUrl===undefined&&a.jgrid.msie){a(B).width(a(B).width())}q++}}});if(q>0){u.id=d;r.p.savedRow.push(u);a(o).attr("editable","1");a("td:eq("+v+") input",o).focus();if(e.keys===true){a(o).bind("keydown",function(y){if(y.keyCode===27){a(r).jqGrid("restoreRow",d,e.afterrestorefunc);if(r.p._inlinenav){try{a(r).jqGrid("showAddEditButtons")}catch(A){}}return false}if(y.keyCode===13){var x=y.target;if(x.tagName=="TEXTAREA"){return true}if(a(r).jqGrid("saveRow",d,e)){if(r.p._inlinenav){try{a(r).jqGrid("showAddEditButtons")}catch(z){}}}return false}})}a(r).triggerHandler("jqGridInlineEditRow",[d,e]);if(a.isFunction(e.oneditfunc)){e.oneditfunc.call(r,d)}}}})},saveRow:function(p,l,h,j,u,s,b){var f=a.makeArray(arguments).slice(1),D={};if(a.type(f[0])==="object"){D=f[0]}else{if(a.isFunction(l)){D.successfunc=l}if(h!==undefined){D.url=h}if(j!==undefined){D.extraparam=j}if(a.isFunction(u)){D.aftersavefunc=u}if(a.isFunction(s)){D.errorfunc=s}if(a.isFunction(b)){D.afterrestorefunc=b}}D=a.extend(true,{successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:true,mtype:"POST"},a.jgrid.inlineEdit,D);var r=false;var H=this[0],d,J={},C={},B={},E,n,g,x;if(!H.grid){return r}x=a(H).jqGrid("getInd",p,true);if(x===false){return r}E=a(x).attr("editable");D.url=D.url||H.p.editurl;if(E==="1"){var v;a('td[role="gridcell"]',x).each(function(o){v=H.p.colModel[o];d=v.name;if(d!="cb"&&d!="subgrid"&&v.editable===true&&d!="rn"&&!a(this).hasClass("not-editable-cell")){switch(v.edittype){case"checkbox":var k=["Yes","No"];if(v.editoptions){k=v.editoptions.value.split(":")}J[d]=a("input",this).is(":checked")?k[0]:k[1];break;case"text":case"password":case"textarea":case"button":J[d]=a("input, textarea",this).val();break;case"select":if(!v.editoptions.multiple){J[d]=a("select option:selected",this).val();C[d]=a("select option:selected",this).text()}else{var K=a("select",this),M=[];J[d]=a(K).val();if(J[d]){J[d]=J[d].join(",")}else{J[d]=""}a("select option:selected",this).each(function(e,N){M[e]=a(N).text()});C[d]=M.join(",")}if(v.formatter&&v.formatter=="select"){C={}}break;case"custom":try{if(v.editoptions&&a.isFunction(v.editoptions.custom_value)){J[d]=v.editoptions.custom_value.call(H,a(".customelement",this),"get");if(J[d]===undefined){throw"e2"}}else{throw"e1"}}catch(L){if(L=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}if(L=="e2"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,L.message,a.jgrid.edit.bClose)}}break}g=a.jgrid.checkValues(J[d],o,H);if(g[0]===false){g[1]=J[d]+" "+g[1];return false}if(H.p.autoencode){J[d]=a.jgrid.htmlEncode(J[d])}if(D.url!=="clientArray"&&v.editoptions&&v.editoptions.NullIfEmpty===true){if(J[d]===""){B[d]="null"}}}});if(g[0]===false){try{var t=a.jgrid.findPos(a("#"+a.jgrid.jqID(p),H.grid.bDiv)[0]);a.jgrid.info_dialog(a.jgrid.errors.errcap,g[1],a.jgrid.edit.bClose,{left:t[0],top:t[1]})}catch(I){alert(g[1])}return r}var z,w=H.p.prmNames,q=p;if(H.p.keyIndex===false){z=w.id}else{z=H.p.colModel[H.p.keyIndex+(H.p.rownumbers===true?1:0)+(H.p.multiselect===true?1:0)+(H.p.subGrid===true?1:0)].name}if(J){J[w.oper]=w.editoper;if(J[z]===undefined){J[z]=p}else{if(x.id!==H.p.idPrefix+J[z]){var y=a.jgrid.stripPref(H.p.idPrefix,p);if(H.p._index[y]!==undefined){H.p._index[J[z]]=H.p._index[y];delete H.p._index[y]}p=H.p.idPrefix+J[z];a(x).attr("id",p);if(H.p.selrow===q){H.p.selrow=p}if(a.isArray(H.p.selarrrow)){var G=a.inArray(q,H.p.selarrrow);if(G>=0){H.p.selarrrow[G]=p}}if(H.p.multiselect){var m="jqg_"+H.p.id+"_"+p;a("input.cbox",x).attr("id",m).attr("name",m)}}}if(H.p.inlineData===undefined){H.p.inlineData={}}J=a.extend({},J,H.p.inlineData,D.extraparam)}if(D.url=="clientArray"){J=a.extend({},J,C);if(H.p.autoencode){a.each(J,function(k,e){J[k]=a.jgrid.htmlDecode(e)})}var F,A=a(H).jqGrid("setRowData",p,J);a(x).attr("editable","0");for(F=0;F<H.p.savedRow.length;F++){if(H.p.savedRow[F].id==q){n=F;break}}if(n>=0){H.p.savedRow.splice(n,1)}a(H).triggerHandler("jqGridInlineAfterSaveRow",[p,A,J,D]);if(a.isFunction(D.aftersavefunc)){D.aftersavefunc.call(H,p,A,D)}r=true;a(x).unbind("keydown")}else{a("#lui_"+a.jgrid.jqID(H.p.id)).show();B=a.extend({},J,B);B[z]=a.jgrid.stripPref(H.p.idPrefix,B[z]);a.ajax(a.extend({url:D.url,data:a.isFunction(H.p.serializeRowData)?H.p.serializeRowData.call(H,B):B,type:D.mtype,async:false,complete:function(K,L){a("#lui_"+a.jgrid.jqID(H.p.id)).hide();if(L==="success"){var o=true,M,e;M=a(H).triggerHandler("jqGridInlineSuccessSaveRow",[K,p,D]);if(!a.isArray(M)){M=[true,J]}if(M[0]&&a.isFunction(D.successfunc)){M=D.successfunc.call(H,K)}if(a.isArray(M)){o=M[0];J=M[1]||J}else{o=M}if(o===true){if(H.p.autoencode){a.each(J,function(N,k){J[N]=a.jgrid.htmlDecode(k)})}J=a.extend({},J,C);a(H).jqGrid("setRowData",p,J);a(x).attr("editable","0");for(e=0;e<H.p.savedRow.length;e++){if(H.p.savedRow[e].id==p){n=e;break}}if(n>=0){H.p.savedRow.splice(n,1)}a(H).triggerHandler("jqGridInlineAfterSaveRow",[p,K,J,D]);if(a.isFunction(D.aftersavefunc)){D.aftersavefunc.call(H,p,K)}r=true;a(x).unbind("keydown")}else{a(H).triggerHandler("jqGridInlineErrorSaveRow",[p,K,L,null,D]);if(a.isFunction(D.errorfunc)){D.errorfunc.call(H,p,K,L,null)}if(D.restoreAfterError===true){a(H).jqGrid("restoreRow",p,D.afterrestorefunc)}}}},error:function(o,K,L){a("#lui_"+a.jgrid.jqID(H.p.id)).hide();a(H).triggerHandler("jqGridInlineErrorSaveRow",[p,o,K,L,D]);if(a.isFunction(D.errorfunc)){D.errorfunc.call(H,p,o,K,L)}else{var k=o.responseText||o.statusText;try{a.jgrid.info_dialog(a.jgrid.errors.errcap,'<div class="ui-state-error">'+k+"</div>",a.jgrid.edit.bClose,{buttonalign:"right"})}catch(M){alert(k)}}if(D.restoreAfterError===true){a(H).jqGrid("restoreRow",p,D.afterrestorefunc)}}},a.jgrid.ajaxOptions,H.p.ajaxRowOptions||{}))}}return r},restoreRow:function(e,b){var d=a.makeArray(arguments).slice(1),f={};if(a.type(d[0])==="object"){f=d[0]}else{if(a.isFunction(b)){f.afterrestorefunc=b}}f=a.extend(true,a.jgrid.inlineEdit,f);return this.each(function(){var n=this,g,j,m={},h;if(!n.grid){return}j=a(n).jqGrid("getInd",e,true);if(j===false){return}for(h=0;h<n.p.savedRow.length;h++){if(n.p.savedRow[h].id==e){g=h;break}}if(g>=0){if(a.isFunction(a.fn.datepicker)){try{a("input.hasDatepicker","#"+a.jgrid.jqID(j.id)).datepicker("hide")}catch(l){}}a.each(n.p.colModel,function(){if(this.editable===true&&n.p.savedRow[g].hasOwnProperty(this.name)){m[this.name]=n.p.savedRow[g][this.name]}});a(n).jqGrid("setRowData",e,m);a(j).attr("editable","0").unbind("keydown");n.p.savedRow.splice(g,1);if(a("#"+a.jgrid.jqID(e),"#"+a.jgrid.jqID(n.p.id)).hasClass("jqgrid-new-row")){setTimeout(function(){a(n).jqGrid("delRowData",e)},0)}}a(n).triggerHandler("jqGridInlineAfterRestoreRow",[e]);if(a.isFunction(f.afterrestorefunc)){f.afterrestorefunc.call(n,e)}})},addRow:function(b){b=a.extend(true,{rowID:null,initdata:{},position:"first",useDefValues:true,useFormatter:false,addRowParams:{extraparam:{}}},b||{});return this.each(function(){if(!this.grid){return}var f=this;b.rowID=a.isFunction(b.rowID)?b.rowID.call(f,b):((b.rowID!=null)?b.rowID:a.jgrid.randId());if(b.useDefValues===true){a(f.p.colModel).each(function(){if(this.editoptions&&this.editoptions.defaultValue){var h=this.editoptions.defaultValue,g=a.isFunction(h)?h.call(f):h;b.initdata[this.name]=g}})}a(f).jqGrid("addRowData",b.rowID,b.initdata,b.position);b.rowID=f.p.idPrefix+b.rowID;a("#"+a.jgrid.jqID(b.rowID),"#"+a.jgrid.jqID(f.p.id)).addClass("jqgrid-new-row");if(b.useFormatter){a("#"+a.jgrid.jqID(b.rowID)+" .ui-inline-edit","#"+a.jgrid.jqID(f.p.id)).click()}else{var d=f.p.prmNames,e=d.oper;b.addRowParams.extraparam[e]=d.addoper;a(f).jqGrid("editRow",b.rowID,b.addRowParams);a(f).jqGrid("setSelection",b.rowID)}})},inlineNav:function(b,d){d=a.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",save:true,saveicon:"ui-icon-disk",cancel:true,cancelicon:"ui-icon-cancel",addParams:{},editParams:{},restoreAfterSelect:true},a.jgrid.nav,d||{});return this.each(function(){if(!this.grid){return}var l=this,f,j=a.jgrid.jqID(l.p.id);l.p._inlinenav=true;if(d.addParams.useFormatter===true){var e=l.p.colModel,h;for(h=0;h<e.length;h++){if(e[h].formatter&&e[h].formatter==="actions"){if(e[h].formatoptions){var k={keys:false,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{},url:null},g=a.extend(k,e[h].formatoptions);d.addParams.addRowParams={keys:g.keys,oneditfunc:g.onEdit,successfunc:g.onSuccess,url:g.url,extraparam:g.extraparam,aftersavefunc:g.afterSavef,errorfunc:g.onError,afterrestorefunc:g.afterRestore}}break}}}if(d.add){a(l).jqGrid("navButtonAdd",b,{caption:d.addtext,title:d.addtitle,buttonicon:d.addicon,id:l.p.id+"_iladd",onClickButton:function(){a(l).jqGrid("addRow",d.addParams);if(!d.addParams.useFormatter){a("#"+j+"_ilsave").removeClass("ui-state-disabled");a("#"+j+"_ilcancel").removeClass("ui-state-disabled");a("#"+j+"_iladd").addClass("ui-state-disabled");a("#"+j+"_iledit").addClass("ui-state-disabled")}}})}if(d.edit){a(l).jqGrid("navButtonAdd",b,{caption:d.edittext,title:d.edittitle,buttonicon:d.editicon,id:l.p.id+"_iledit",onClickButton:function(){var m=a(l).jqGrid("getGridParam","selrow");if(m){a(l).jqGrid("editRow",m,d.editParams);a("#"+j+"_ilsave").removeClass("ui-state-disabled");a("#"+j+"_ilcancel").removeClass("ui-state-disabled");a("#"+j+"_iladd").addClass("ui-state-disabled");a("#"+j+"_iledit").addClass("ui-state-disabled")}else{a.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+j,jqm:true});a("#jqg_alrt").focus()}}})}if(d.save){a(l).jqGrid("navButtonAdd",b,{caption:d.savetext||"",title:d.savetitle||"Save row",buttonicon:d.saveicon,id:l.p.id+"_ilsave",onClickButton:function(){var n=l.p.savedRow[0].id;if(n){var m=l.p.prmNames,o=m.oper;if(!d.editParams.extraparam){d.editParams.extraparam={}}if(a("#"+a.jgrid.jqID(n),"#"+j).hasClass("jqgrid-new-row")){d.editParams.extraparam[o]=m.addoper}else{d.editParams.extraparam[o]=m.editoper}if(a(l).jqGrid("saveRow",n,d.editParams)){a(l).jqGrid("showAddEditButtons")}}else{a.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+j,jqm:true});a("#jqg_alrt").focus()}}});a("#"+j+"_ilsave").addClass("ui-state-disabled")}if(d.cancel){a(l).jqGrid("navButtonAdd",b,{caption:d.canceltext||"",title:d.canceltitle||"Cancel row editing",buttonicon:d.cancelicon,id:l.p.id+"_ilcancel",onClickButton:function(){var m=l.p.savedRow[0].id;if(m){a(l).jqGrid("restoreRow",m,d.editParams);a(l).jqGrid("showAddEditButtons")}else{a.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+j,jqm:true});a("#jqg_alrt").focus()}}});a("#"+j+"_ilcancel").addClass("ui-state-disabled")}if(d.restoreAfterSelect===true){if(a.isFunction(l.p.beforeSelectRow)){f=l.p.beforeSelectRow}else{f=false}l.p.beforeSelectRow=function(o,n){var m=true;if(l.p.savedRow.length>0&&l.p._inlinenav===true&&(o!==l.p.selrow&&l.p.selrow!==null)){if(l.p.selrow==d.addParams.rowID){a(l).jqGrid("delRowData",l.p.selrow)}else{a(l).jqGrid("restoreRow",l.p.selrow,d.editParams)}a(l).jqGrid("showAddEditButtons")}if(f){m=f.call(l,o,n)}return m}}})},showAddEditButtons:function(){return this.each(function(){if(!this.grid){return}var b=a.jgrid.jqID(this.p.id);a("#"+b+"_ilsave").addClass("ui-state-disabled");a("#"+b+"_ilcancel").addClass("ui-state-disabled");a("#"+b+"_iladd").removeClass("ui-state-disabled");a("#"+b+"_iledit").removeClass("ui-state-disabled")})}})})(jQuery);(function(a){a.jgrid.extend({editCell:function(e,d,b){return this.each(function(){var k=this,o,l,h,m;if(!k.grid||k.p.cellEdit!==true){return}d=parseInt(d,10);k.p.selrow=k.rows[e].id;if(!k.p.knv){a(k).jqGrid("GridNav")}if(k.p.savedRow.length>0){if(b===true){if(e==k.p.iRow&&d==k.p.iCol){return}}a(k).jqGrid("saveCell",k.p.savedRow[0].id,k.p.savedRow[0].ic)}else{window.setTimeout(function(){a("#"+a.jgrid.jqID(k.p.knv)).attr("tabindex","-1").focus()},0)}m=k.p.colModel[d];o=m.name;if(o=="subgrid"||o=="cb"||o=="rn"){return}h=a("td:eq("+d+")",k.rows[e]);if(m.editable===true&&b===true&&!h.hasClass("not-editable-cell")){if(parseInt(k.p.iCol,10)>=0&&parseInt(k.p.iRow,10)>=0){a("td:eq("+k.p.iCol+")",k.rows[k.p.iRow]).removeClass("edit-cell ui-state-highlight");a(k.rows[k.p.iRow]).removeClass("selected-row ui-state-hover")}a(h).addClass("edit-cell ui-state-highlight");a(k.rows[e]).addClass("selected-row ui-state-hover");try{l=a.unformat.call(k,h,{rowId:k.rows[e].id,colModel:m},d)}catch(n){l=(m.edittype&&m.edittype=="textarea")?a(h).text():a(h).html()}if(k.p.autoencode){l=a.jgrid.htmlDecode(l)}if(!m.edittype){m.edittype="text"}k.p.savedRow.push({id:e,ic:d,name:o,v:l});if(l==="&nbsp;"||l==="&#160;"||(l.length===1&&l.charCodeAt(0)===160)){l=""}if(a.isFunction(k.p.formatCell)){var j=k.p.formatCell.call(k,k.rows[e].id,o,l,e,d);if(j!==undefined){l=j}}var g=a.extend({},m.editoptions||{},{id:e+"_"+o,name:o});var f=a.jgrid.createEl.call(k,m.edittype,g,l,true,a.extend({},a.jgrid.ajaxOptions,k.p.ajaxSelectOptions||{}));a(k).triggerHandler("jqGridBeforeEditCell",[k.rows[e].id,o,l,e,d]);if(a.isFunction(k.p.beforeEditCell)){k.p.beforeEditCell.call(k,k.rows[e].id,o,l,e,d)}a(h).html("").append(f).attr("tabindex","0");a.jgrid.bindEv(f,g,k);window.setTimeout(function(){a(f).focus()},0);a("input, select, textarea",h).bind("keydown",function(p){if(p.keyCode===27){if(a("input.hasDatepicker",h).length>0){if(a(".ui-datepicker").is(":hidden")){a(k).jqGrid("restoreCell",e,d)}else{a("input.hasDatepicker",h).datepicker("hide")}}else{a(k).jqGrid("restoreCell",e,d)}}if(p.keyCode===13){a(k).jqGrid("saveCell",e,d);return false}if(p.keyCode===9){if(!k.grid.hDiv.loading){if(p.shiftKey){a(k).jqGrid("prevCell",e,d)}else{a(k).jqGrid("nextCell",e,d)}}else{return false}}p.stopPropagation()});a(k).triggerHandler("jqGridAfterEditCell",[k.rows[e].id,o,l,e,d]);if(a.isFunction(k.p.afterEditCell)){k.p.afterEditCell.call(k,k.rows[e].id,o,l,e,d)}}else{if(parseInt(k.p.iCol,10)>=0&&parseInt(k.p.iRow,10)>=0){a("td:eq("+k.p.iCol+")",k.rows[k.p.iRow]).removeClass("edit-cell ui-state-highlight");a(k.rows[k.p.iRow]).removeClass("selected-row ui-state-hover")}h.addClass("edit-cell ui-state-highlight");a(k.rows[e]).addClass("selected-row ui-state-hover");l=h.html().replace(/\&#160\;/ig,"");a(k).triggerHandler("jqGridSelectCell",[k.rows[e].id,o,l,e,d]);if(a.isFunction(k.p.onSelectCell)){k.p.onSelectCell.call(k,k.rows[e].id,o,l,e,d)}}k.p.iCol=d;k.p.iRow=e})},saveCell:function(d,b){return this.each(function(){var x=this,j;if(!x.grid||x.p.cellEdit!==true){return}if(x.p.savedRow.length>=1){j=0}else{j=null}if(j!==null){var r=a("td:eq("+b+")",x.rows[d]),p,f,l=x.p.colModel[b],g=l.name,k=a.jgrid.jqID(g);switch(l.edittype){case"select":if(!l.editoptions.multiple){p=a("#"+d+"_"+k+" option:selected",x.rows[d]).val();f=a("#"+d+"_"+k+" option:selected",x.rows[d]).text()}else{var w=a("#"+d+"_"+k,x.rows[d]),u=[];p=a(w).val();if(p){p.join(",")}else{p=""}a("option:selected",w).each(function(e,v){u[e]=a(v).text()});f=u.join(",")}if(l.formatter){f=p}break;case"checkbox":var s=["Yes","No"];if(l.editoptions){s=l.editoptions.value.split(":")}p=a("#"+d+"_"+k,x.rows[d]).is(":checked")?s[0]:s[1];f=p;break;case"password":case"text":case"textarea":case"button":p=a("#"+d+"_"+k,x.rows[d]).val();f=p;break;case"custom":try{if(l.editoptions&&a.isFunction(l.editoptions.custom_value)){p=l.editoptions.custom_value.call(x,a(".customelement",r),"get");if(p===undefined){throw"e2"}else{f=p}}else{throw"e1"}}catch(y){if(y=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}if(y=="e2"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,y.message,a.jgrid.edit.bClose)}}break}if(f!==x.p.savedRow[j].v){var A=a(x).triggerHandler("jqGridBeforeSaveCell",[x.rows[d].id,g,p,d,b]);if(A){p=A;f=A}if(a.isFunction(x.p.beforeSaveCell)){var t=x.p.beforeSaveCell.call(x,x.rows[d].id,g,p,d,b);if(t){p=t;f=t}}var h=a.jgrid.checkValues(p,b,x);if(h[0]===true){var n=a(x).triggerHandler("jqGridBeforeSubmitCell",[x.rows[d].id,g,p,d,b])||{};if(a.isFunction(x.p.beforeSubmitCell)){n=x.p.beforeSubmitCell.call(x,x.rows[d].id,g,p,d,b);if(!n){n={}}}if(a("input.hasDatepicker",r).length>0){a("input.hasDatepicker",r).datepicker("hide")}if(x.p.cellsubmit=="remote"){if(x.p.cellurl){var z={};if(x.p.autoencode){p=a.jgrid.htmlEncode(p)}z[g]=p;var q,o,m;m=x.p.prmNames;q=m.id;o=m.oper;z[q]=a.jgrid.stripPref(x.p.idPrefix,x.rows[d].id);z[o]=m.editoper;z=a.extend(n,z);a("#lui_"+a.jgrid.jqID(x.p.id)).show();x.grid.hDiv.loading=true;a.ajax(a.extend({url:x.p.cellurl,data:a.isFunction(x.p.serializeCellData)?x.p.serializeCellData.call(x,z):z,type:"POST",complete:function(e,B){a("#lui_"+x.p.id).hide();x.grid.hDiv.loading=false;if(B=="success"){var v=a(x).triggerHandler("jqGridAfterSubmitCell",[x,e,z.id,g,p,d,b])||[true,""];if(v[0]===true&&a.isFunction(x.p.afterSubmitCell)){v=x.p.afterSubmitCell.call(x,e,z.id,g,p,d,b)}if(v[0]===true){a(r).empty();a(x).jqGrid("setCell",x.rows[d].id,b,f,false,false,true);a(r).addClass("dirty-cell");a(x.rows[d]).addClass("edited");a(x).triggerHandler("jqGridAfterSaveCell",[x.rows[d].id,g,p,d,b]);if(a.isFunction(x.p.afterSaveCell)){x.p.afterSaveCell.call(x,x.rows[d].id,g,p,d,b)}x.p.savedRow.splice(0,1)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,v[1],a.jgrid.edit.bClose);a(x).jqGrid("restoreCell",d,b)}}},error:function(e,v,B){a("#lui_"+a.jgrid.jqID(x.p.id)).hide();x.grid.hDiv.loading=false;a(x).triggerHandler("jqGridErrorCell",[e,v,B]);if(a.isFunction(x.p.errorCell)){x.p.errorCell.call(x,e,v,B);a(x).jqGrid("restoreCell",d,b)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,e.status+" : "+e.statusText+"<br/>"+v,a.jgrid.edit.bClose);a(x).jqGrid("restoreCell",d,b)}}},a.jgrid.ajaxOptions,x.p.ajaxCellOptions||{}))}else{try{a.jgrid.info_dialog(a.jgrid.errors.errcap,a.jgrid.errors.nourl,a.jgrid.edit.bClose);a(x).jqGrid("restoreCell",d,b)}catch(y){}}}if(x.p.cellsubmit=="clientArray"){a(r).empty();a(x).jqGrid("setCell",x.rows[d].id,b,f,false,false,true);a(r).addClass("dirty-cell");a(x.rows[d]).addClass("edited");a(x).triggerHandler("jqGridAfterSaveCell",[x.rows[d].id,g,p,d,b]);if(a.isFunction(x.p.afterSaveCell)){x.p.afterSaveCell.call(x,x.rows[d].id,g,p,d,b)}x.p.savedRow.splice(0,1)}}else{try{window.setTimeout(function(){a.jgrid.info_dialog(a.jgrid.errors.errcap,p+" "+h[1],a.jgrid.edit.bClose)},100);a(x).jqGrid("restoreCell",d,b)}catch(y){}}}else{a(x).jqGrid("restoreCell",d,b)}}window.setTimeout(function(){a("#"+a.jgrid.jqID(x.p.knv)).attr("tabindex","-1").focus()},0)})},restoreCell:function(d,b){return this.each(function(){var j=this,f;if(!j.grid||j.p.cellEdit!==true){return}if(j.p.savedRow.length>=1){f=0}else{f=null}if(f!==null){var h=a("td:eq("+b+")",j.rows[d]);if(a.isFunction(a.fn.datepicker)){try{a("input.hasDatepicker",h).datepicker("hide")}catch(g){}}a(h).empty().attr("tabindex","-1");a(j).jqGrid("setCell",j.rows[d].id,b,j.p.savedRow[f].v,false,false,true);a(j).triggerHandler("jqGridAfterRestoreCell",[j.rows[d].id,j.p.savedRow[f].v,d,b]);if(a.isFunction(j.p.afterRestoreCell)){j.p.afterRestoreCell.call(j,j.rows[d].id,j.p.savedRow[f].v,d,b)}j.p.savedRow.splice(0,1)}window.setTimeout(function(){a("#"+j.p.knv).attr("tabindex","-1").focus()},0)})},nextCell:function(d,b){return this.each(function(){var g=this,f=false,e;if(!g.grid||g.p.cellEdit!==true){return}for(e=b+1;e<g.p.colModel.length;e++){if(g.p.colModel[e].editable===true){f=e;break}}if(f!==false){a(g).jqGrid("editCell",d,f,true)}else{if(g.p.savedRow.length>0){a(g).jqGrid("saveCell",d,b)}}})},prevCell:function(d,b){return this.each(function(){var g=this,f=false,e;if(!g.grid||g.p.cellEdit!==true){return}for(e=b-1;e>=0;e--){if(g.p.colModel[e].editable===true){f=e;break}}if(f!==false){a(g).jqGrid("editCell",d,f,true)}else{if(g.p.savedRow.length>0){a(g).jqGrid("saveCell",d,b)}}})},GridNav:function(){return this.each(function(){var h=this;if(!h.grid||h.p.cellEdit!==true){return}h.p.knv=h.p.id+"_kn";var g=a("<div style='position:fixed;top:-1000000px;width:1px;height:1px;' tabindex='0'><div tabindex='-1' style='width:1px;height:1px;' id='"+h.p.knv+"'></div></div>"),e,d;function f(r,p,q){if(q.substr(0,1)=="v"){var j=a(h.grid.bDiv)[0].clientHeight,s=a(h.grid.bDiv)[0].scrollTop,t=h.rows[r].offsetTop+h.rows[r].clientHeight,n=h.rows[r].offsetTop;if(q=="vd"){if(t>=j){a(h.grid.bDiv)[0].scrollTop=a(h.grid.bDiv)[0].scrollTop+h.rows[r].clientHeight}}if(q=="vu"){if(n<s){a(h.grid.bDiv)[0].scrollTop=a(h.grid.bDiv)[0].scrollTop-h.rows[r].clientHeight}}}if(q=="h"){var m=a(h.grid.bDiv)[0].clientWidth,l=a(h.grid.bDiv)[0].scrollLeft,k=h.rows[r].cells[p].offsetLeft+h.rows[r].cells[p].clientWidth,o=h.rows[r].cells[p].offsetLeft;if(k>=m+parseInt(l,10)){a(h.grid.bDiv)[0].scrollLeft=a(h.grid.bDiv)[0].scrollLeft+h.rows[r].cells[p].clientWidth}else{if(o<l){a(h.grid.bDiv)[0].scrollLeft=a(h.grid.bDiv)[0].scrollLeft-h.rows[r].cells[p].clientWidth}}}}function b(m,j){var l,k;if(j=="lft"){l=m+1;for(k=m;k>=0;k--){if(h.p.colModel[k].hidden!==true){l=k;break}}}if(j=="rgt"){l=m-1;for(k=m;k<h.p.colModel.length;k++){if(h.p.colModel[k].hidden!==true){l=k;break}}}return l}a(g).insertBefore(h.grid.cDiv);a("#"+h.p.knv).focus().keydown(function(j){d=j.keyCode;if(h.p.direction=="rtl"){if(d===37){d=39}else{if(d===39){d=37}}}switch(d){case 38:if(h.p.iRow-1>0){f(h.p.iRow-1,h.p.iCol,"vu");a(h).jqGrid("editCell",h.p.iRow-1,h.p.iCol,false)}break;case 40:if(h.p.iRow+1<=h.rows.length-1){f(h.p.iRow+1,h.p.iCol,"vd");a(h).jqGrid("editCell",h.p.iRow+1,h.p.iCol,false)}break;case 37:if(h.p.iCol-1>=0){e=b(h.p.iCol-1,"lft");f(h.p.iRow,e,"h");a(h).jqGrid("editCell",h.p.iRow,e,false)}break;case 39:if(h.p.iCol+1<=h.p.colModel.length-1){e=b(h.p.iCol+1,"rgt");f(h.p.iRow,e,"h");a(h).jqGrid("editCell",h.p.iRow,e,false)}break;case 13:if(parseInt(h.p.iCol,10)>=0&&parseInt(h.p.iRow,10)>=0){a(h).jqGrid("editCell",h.p.iRow,h.p.iCol,true)}break;default:return true}return false})})},getChangedCells:function(d){var b=[];if(!d){d="all"}this.each(function(){var f=this,e;if(!f.grid||f.p.cellEdit!==true){return}a(f.rows).each(function(g){var h={};if(a(this).hasClass("edited")){a("td",this).each(function(j){e=f.p.colModel[j].name;if(e!=="cb"&&e!=="subgrid"){if(d=="dirty"){if(a(this).hasClass("dirty-cell")){try{h[e]=a.unformat.call(f,this,{rowId:f.rows[g].id,colModel:f.p.colModel[j]},j)}catch(k){h[e]=a.jgrid.htmlDecode(a(this).html())}}}else{try{h[e]=a.unformat.call(f,this,{rowId:f.rows[g].id,colModel:f.p.colModel[j]},j)}catch(k){h[e]=a.jgrid.htmlDecode(a(this).html())}}}});h.id=this.id;b.push(h)}})});return b}})})(jQuery);(function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var f=this,b,e,d={plusicon:"ui-icon-plus",minusicon:"ui-icon-minus",openicon:"ui-icon-carat-1-sw",expandOnLoad:false,delayOnLoad:50,selectOnExpand:false,reloadOnExpand:true};f.p.subGridOptions=a.extend(d,f.p.subGridOptions||{});f.p.colNames.unshift("");f.p.colModel.unshift({name:"subgrid",width:a.jgrid.cell_width?f.p.subGridWidth+f.p.cellLayout:f.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,fixed:true});b=f.p.subGridModel;if(b[0]){b[0].align=a.extend([],b[0].align||[]);for(e=0;e<b[0].name.length;e++){b[0].align[e]=b[0].align[e]||"left"}}})},addSubGridCell:function(g,f){var e="",b,d;this.each(function(){e=this.formatCol(g,f);d=this.p.id;b=this.p.subGridOptions.plusicon});return'<td role="gridcell" aria-describedby="'+d+'_subgrid" class="ui-sgcollapsed sgcollapsed" '+e+"><a href='javascript:void(0);'><span class='ui-icon "+b+"'></span></a></td>"},addSubGrid:function(d,b){return this.each(function(){var o=this;if(!o.grid){return}var g=function(t,r,v){var u=a("<td align='"+o.p.subGridModel[0].align[v]+"'></td>").html(r);a(t).append(u)};var f=function(t,z){var y,w,v,x=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),r=a("<tr></tr>");for(w=0;w<o.p.subGridModel[0].name.length;w++){y=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+o.p.direction+"'></th>");a(y).html(o.p.subGridModel[0].name[w]);a(y).width(o.p.subGridModel[0].width[w]);a(r).append(y)}a(x).append(r);if(t){v=o.p.xmlReader.subgrid;a(v.root+" "+v.row,t).each(function(){r=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(v.repeatitems===true){a(v.cell,this).each(function(B){g(r,a(this).text()||"&#160;",B)})}else{var A=o.p.subGridModel[0].mapping||o.p.subGridModel[0].name;if(A){for(w=0;w<A.length;w++){g(r,a(A[w],this).text()||"&#160;",w)}}}a(x).append(r)})}var u=a("table:first",o.grid.bDiv).attr("id")+"_";a("#"+a.jgrid.jqID(u+z)).append(x);o.grid.hDiv.loading=false;a("#load_"+a.jgrid.jqID(o.p.id)).hide();return false};var h=function(z,w){var B,D,x,A,r,v,u=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),t=a("<tr></tr>");for(x=0;x<o.p.subGridModel[0].name.length;x++){B=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+o.p.direction+"'></th>");a(B).html(o.p.subGridModel[0].name[x]);a(B).width(o.p.subGridModel[0].width[x]);a(t).append(B)}a(u).append(t);if(z){r=o.p.jsonReader.subgrid;D=a.jgrid.getAccessor(z,r.root);if(D!==undefined){for(x=0;x<D.length;x++){A=D[x];t=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(r.repeatitems===true){if(r.cell){A=A[r.cell]}for(v=0;v<A.length;v++){g(t,A[v]||"&#160;",v)}}else{var y=o.p.subGridModel[0].mapping||o.p.subGridModel[0].name;if(y.length){for(v=0;v<y.length;v++){g(t,A[y[v]]||"&#160;",v)}}}a(u).append(t)}}}var C=a("table:first",o.grid.bDiv).attr("id")+"_";a("#"+a.jgrid.jqID(C+w)).append(u);o.grid.hDiv.loading=false;a("#load_"+a.jgrid.jqID(o.p.id)).hide();return false};var p=function(v){var r,w,u,t;r=a(v).attr("id");w={nd_:(new Date().getTime())};w[o.p.prmNames.subgridid]=r;if(!o.p.subGridModel[0]){return false}if(o.p.subGridModel[0].params){for(t=0;t<o.p.subGridModel[0].params.length;t++){for(u=0;u<o.p.colModel.length;u++){if(o.p.colModel[u].name===o.p.subGridModel[0].params[t]){w[o.p.colModel[u].name]=a("td:eq("+u+")",v).text().replace(/\&#160\;/ig,"")}}}}if(!o.grid.hDiv.loading){o.grid.hDiv.loading=true;a("#load_"+a.jgrid.jqID(o.p.id)).show();if(!o.p.subgridtype){o.p.subgridtype=o.p.datatype}if(a.isFunction(o.p.subgridtype)){o.p.subgridtype.call(o,w)}else{o.p.subgridtype=o.p.subgridtype.toLowerCase()}switch(o.p.subgridtype){case"xml":case"json":a.ajax(a.extend({type:o.p.mtype,url:o.p.subGridUrl,dataType:o.p.subgridtype,data:a.isFunction(o.p.serializeSubGridData)?o.p.serializeSubGridData.call(o,w):w,complete:function(x){if(o.p.subgridtype==="xml"){f(x.responseXML,r)}else{h(a.jgrid.parse(x.responseText),r)}x=null}},a.jgrid.ajaxOptions,o.p.ajaxSubgridOptions||{}));break}}return false};var q,s,k,m=0,j,e;a.each(o.p.colModel,function(){if(this.hidden===true||this.name==="rn"||this.name==="cb"){m++}});var n=o.rows.length,l=1;if(b!==undefined&&b>0){l=b;n=b+1}while(l<n){if(a(o.rows[l]).hasClass("jqgrow")){a(o.rows[l].cells[d]).bind("click",function(){var r=a(this).parent("tr")[0];e=r.nextSibling;if(a(this).hasClass("sgcollapsed")){s=o.p.id;q=r.id;if(o.p.subGridOptions.reloadOnExpand===true||(o.p.subGridOptions.reloadOnExpand===false&&!a(e).hasClass("ui-subgrid"))){k=d>=1?"<td colspan='"+d+"'>&#160;</td>":"";j=a(o).triggerHandler("jqGridSubGridBeforeExpand",[s+"_"+q,q]);j=(j===false||j==="stop")?false:true;if(j&&a.isFunction(o.p.subGridBeforeExpand)){j=o.p.subGridBeforeExpand.call(o,s+"_"+q,q)}if(j===false){return false}a(r).after("<tr role='row' class='ui-subgrid'>"+k+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+o.p.subGridOptions.openicon+"'></span></td><td colspan='"+parseInt(o.p.colNames.length-1-m,10)+"' class='ui-widget-content subgrid-data'><div id="+s+"_"+q+" class='tablediv'></div></td></tr>");a(o).triggerHandler("jqGridSubGridRowExpanded",[s+"_"+q,q]);if(a.isFunction(o.p.subGridRowExpanded)){o.p.subGridRowExpanded.call(o,s+"_"+q,q)}else{p(r)}}else{a(e).show()}a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+o.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");if(o.p.subGridOptions.selectOnExpand){a(o).jqGrid("setSelection",q)}}else{if(a(this).hasClass("sgexpanded")){j=a(o).triggerHandler("jqGridSubGridRowColapsed",[s+"_"+q,q]);j=(j===false||j==="stop")?false:true;if(j&&a.isFunction(o.p.subGridRowColapsed)){q=r.id;j=o.p.subGridRowColapsed.call(o,s+"_"+q,q)}if(j===false){return false}if(o.p.subGridOptions.reloadOnExpand===true){a(e).remove(".ui-subgrid")}else{if(a(e).hasClass("ui-subgrid")){a(e).hide()}}a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+o.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}}return false})}l++}if(o.p.subGridOptions.expandOnLoad===true){a(o.rows).filter(".jqgrow").each(function(r,t){a(t.cells[0]).click()})}o.subGridXml=function(t,r){f(t,r)};o.subGridJson=function(t,r){h(t,r)}})},expandSubGridRow:function(b){return this.each(function(){var f=this;if(!f.grid&&!b){return}if(f.p.subGrid===true){var d=a(this).jqGrid("getInd",b,true);if(d){var e=a("td.sgcollapsed",d)[0];if(e){a(e).trigger("click")}}}})},collapseSubGridRow:function(b){return this.each(function(){var f=this;if(!f.grid&&!b){return}if(f.p.subGrid===true){var d=a(this).jqGrid("getInd",b,true);if(d){var e=a("td.sgexpanded",d)[0];if(e){a(e).trigger("click")}}}})},toggleSubGridRow:function(b){return this.each(function(){var f=this;if(!f.grid&&!b){return}if(f.p.subGrid===true){var d=a(this).jqGrid("getInd",b,true);if(d){var e=a("td.sgcollapsed",d)[0];if(e){a(e).trigger("click")}else{e=a("td.sgexpanded",d)[0];if(e){a(e).trigger("click")}}}}})}})})(jQuery);(function(a){a.jgrid.extend({setTreeNode:function(d,b){return this.each(function(){var r=this;if(!r.grid||!r.p.treeGrid){return}var l=r.p.expColInd,n=r.p.treeReader.expanded_field,u=r.p.treeReader.leaf_field,e=r.p.treeReader.level_field,t=r.p.treeReader.icon_field,p=r.p.treeReader.loaded,w,m,f,j,o,x,v,k;while(d<b){var h=r.rows[d].id,g=r.p._index[h],s;v=r.p.data[g];if(r.p.treeGridModel=="nested"){if(!v[u]){w=parseInt(v[r.p.treeReader.left_field],10);m=parseInt(v[r.p.treeReader.right_field],10);v[u]=(m===w+1)?"true":"false";r.rows[d].cells[r.p._treeleafpos].innerHTML=v[u]}}f=parseInt(v[e],10);if(r.p.tree_root_level===0){j=f+1;o=f}else{j=f;o=f-1}x="<div class='tree-wrap tree-wrap-"+r.p.direction+"' style='width:"+(j*18)+"px;'>";x+="<div style='"+(r.p.direction=="rtl"?"right:":"left:")+(o*18)+"px;' class='ui-icon ";if(v[p]!==undefined){if(v[p]=="true"||v[p]===true){v[p]=true}else{v[p]=false}}if(v[u]=="true"||v[u]===true){x+=((v[t]!==undefined&&v[t]!=="")?v[t]:r.p.treeIcons.leaf)+" tree-leaf treeclick";v[u]=true;k="leaf"}else{v[u]=false;k=""}v[n]=((v[n]=="true"||v[n]===true)?true:false)&&(v[p]||v[p]===undefined);if(v[n]===false){x+=((v[u]===true)?"'":r.p.treeIcons.plus+" tree-plus treeclick'")}else{x+=((v[u]===true)?"'":r.p.treeIcons.minus+" tree-minus treeclick'")}x+="></div></div>";a(r.rows[d].cells[l]).wrapInner("<span class='cell-wrapper"+k+"'></span>").prepend(x);if(f!==parseInt(r.p.tree_root_level,10)){var q=a(r).jqGrid("getNodeParent",v);s=q&&q.hasOwnProperty(n)?q[n]:true;if(!s){a(r.rows[d]).css("display","none")}}a(r.rows[d].cells[l]).find("div.treeclick").bind("click",function(z){var y=z.target||z.srcElement,B=a(y,r.rows).closest("tr.jqgrow")[0].id,A=r.p._index[B];if(!r.p.data[A][u]){if(r.p.data[A][n]){a(r).jqGrid("collapseRow",r.p.data[A]);a(r).jqGrid("collapseNode",r.p.data[A])}else{a(r).jqGrid("expandRow",r.p.data[A]);a(r).jqGrid("expandNode",r.p.data[A])}}return false});if(r.p.ExpandColClick===true){a(r.rows[d].cells[l]).find("span.cell-wrapper").css("cursor","pointer").bind("click",function(z){var y=z.target||z.srcElement,B=a(y,r.rows).closest("tr.jqgrow")[0].id,A=r.p._index[B];if(!r.p.data[A][u]){if(r.p.data[A][n]){a(r).jqGrid("collapseRow",r.p.data[A]);a(r).jqGrid("collapseNode",r.p.data[A])}else{a(r).jqGrid("expandRow",r.p.data[A]);a(r).jqGrid("expandNode",r.p.data[A])}}a(r).jqGrid("setSelection",B);return false})}d++}})},setTreeGrid:function(){return this.each(function(){var k=this,g=0,e,j=false,d,f,h,b=[];if(!k.p.treeGrid){return}if(!k.p.treedatatype){a.extend(k.p,{treedatatype:k.p.datatype})}k.p.subGrid=false;k.p.altRows=false;k.p.pgbuttons=false;k.p.pginput=false;k.p.gridview=true;if(k.p.rowTotal===null){k.p.rowNum=10000}k.p.multiselect=false;k.p.rowList=[];k.p.expColInd=0;e="ui-icon-triangle-1-"+(k.p.direction=="rtl"?"w":"e");k.p.treeIcons=a.extend({plus:e,minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},k.p.treeIcons||{});if(k.p.treeGridModel=="nested"){k.p.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},k.p.treeReader)}else{if(k.p.treeGridModel=="adjacency"){k.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},k.p.treeReader)}}for(f in k.p.colModel){if(k.p.colModel.hasOwnProperty(f)){d=k.p.colModel[f].name;if(d==k.p.ExpandColumn&&!j){j=true;k.p.expColInd=g}g++;for(h in k.p.treeReader){if(k.p.treeReader.hasOwnProperty(h)&&k.p.treeReader[h]==d){b.push(d)}}}}a.each(k.p.treeReader,function(l,m){if(m&&a.inArray(m,b)===-1){if(l==="leaf_field"){k.p._treeleafpos=g}g++;k.p.colNames.push(m);k.p.colModel.push({name:m,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})})},expandRow:function(b){this.each(function(){var g=this;if(!g.grid||!g.p.treeGrid){return}var e=a(g).jqGrid("getNodeChildren",b),d=g.p.treeReader.expanded_field,f=g.rows;a(e).each(function(){var h=a.jgrid.getAccessor(this,g.p.localReader.id);a(f.namedItem(h)).css("display","");if(this[d]){a(g).jqGrid("expandRow",this)}})})},collapseRow:function(b){this.each(function(){var g=this;if(!g.grid||!g.p.treeGrid){return}var e=a(g).jqGrid("getNodeChildren",b),d=g.p.treeReader.expanded_field,f=g.rows;a(e).each(function(){var h=a.jgrid.getAccessor(this,g.p.localReader.id);a(f.namedItem(h)).css("display","none");if(this[d]){a(g).jqGrid("collapseRow",this)}})})},getRootNodes:function(){var b=[];this.each(function(){var f=this;if(!f.grid||!f.p.treeGrid){return}switch(f.p.treeGridModel){case"nested":var e=f.p.treeReader.level_field;a(f.p.data).each(function(){if(parseInt(this[e],10)===parseInt(f.p.tree_root_level,10)){b.push(this)}});break;case"adjacency":var d=f.p.treeReader.parent_id_field;a(f.p.data).each(function(){if(this[d]===null||String(this[d]).toLowerCase()=="null"){b.push(this)}});break}});return b},getNodeDepth:function(d){var b=null;this.each(function(){if(!this.grid||!this.p.treeGrid){return}var f=this;switch(f.p.treeGridModel){case"nested":var e=f.p.treeReader.level_field;b=parseInt(d[e],10)-parseInt(f.p.tree_root_level,10);break;case"adjacency":b=a(f).jqGrid("getNodeAncestors",d).length;break}});return b},getNodeParent:function(d){var b=null;this.each(function(){var h=this;if(!h.grid||!h.p.treeGrid){return}switch(h.p.treeGridModel){case"nested":var g=h.p.treeReader.left_field,n=h.p.treeReader.right_field,j=h.p.treeReader.level_field,m=parseInt(d[g],10),l=parseInt(d[n],10),e=parseInt(d[j],10);a(this.p.data).each(function(){if(parseInt(this[j],10)===e-1&&parseInt(this[g],10)<m&&parseInt(this[n],10)>l){b=this;return false}});break;case"adjacency":var k=h.p.treeReader.parent_id_field,f=h.p.localReader.id;a(this.p.data).each(function(){if(this[f]==d[k]){b=this;return false}});break}});return b},getNodeChildren:function(d){var b=[];this.each(function(){var h=this;if(!h.grid||!h.p.treeGrid){return}switch(h.p.treeGridModel){case"nested":var g=h.p.treeReader.left_field,n=h.p.treeReader.right_field,j=h.p.treeReader.level_field,m=parseInt(d[g],10),l=parseInt(d[n],10),e=parseInt(d[j],10);a(this.p.data).each(function(){if(parseInt(this[j],10)===e+1&&parseInt(this[g],10)>m&&parseInt(this[n],10)<l){b.push(this)}});break;case"adjacency":var k=h.p.treeReader.parent_id_field,f=h.p.localReader.id;a(this.p.data).each(function(){if(this[k]==d[f]){b.push(this)}});break}});return b},getFullTreeNode:function(d){var b=[];this.each(function(){var h=this,j;if(!h.grid||!h.p.treeGrid){return}switch(h.p.treeGridModel){case"nested":var g=h.p.treeReader.left_field,o=h.p.treeReader.right_field,k=h.p.treeReader.level_field,n=parseInt(d[g],10),m=parseInt(d[o],10),e=parseInt(d[k],10);a(this.p.data).each(function(){if(parseInt(this[k],10)>=e&&parseInt(this[g],10)>=n&&parseInt(this[g],10)<=m){b.push(this)}});break;case"adjacency":if(d){b.push(d);var l=h.p.treeReader.parent_id_field,f=h.p.localReader.id;a(this.p.data).each(function(p){j=b.length;for(p=0;p<j;p++){if(b[p][f]==this[l]){b.push(this);break}}})}break}});return b},getNodeAncestors:function(d){var b=[];this.each(function(){if(!this.grid||!this.p.treeGrid){return}var e=a(this).jqGrid("getNodeParent",d);while(e){b.push(e);e=a(this).jqGrid("getNodeParent",e)}});return b},isVisibleNode:function(d){var b=true;this.each(function(){var g=this;if(!g.grid||!g.p.treeGrid){return}var f=a(g).jqGrid("getNodeAncestors",d),e=g.p.treeReader.expanded_field;a(f).each(function(){b=b&&this[e];if(!b){return false}})});return b},isNodeLoaded:function(d){var b;this.each(function(){var f=this;if(!f.grid||!f.p.treeGrid){return}var e=f.p.treeReader.leaf_field;if(d!==undefined){if(d.loaded!==undefined){b=d.loaded}else{if(d[e]||a(f).jqGrid("getNodeChildren",d).length>0){b=true}else{b=false}}}else{b=false}});return b},expandNode:function(b){return this.each(function(){if(!this.grid||!this.p.treeGrid){return}var j=this.p.treeReader.expanded_field,k=this.p.treeReader.parent_id_field,g=this.p.treeReader.loaded,d=this.p.treeReader.level_field,m=this.p.treeReader.left_field,l=this.p.treeReader.right_field;if(!b[j]){var e=a.jgrid.getAccessor(b,this.p.localReader.id);var f=a("#"+a.jgrid.jqID(e),this.grid.bDiv)[0];var h=this.p._index[e];if(a(this).jqGrid("isNodeLoaded",this.p.data[h])){b[j]=true;a("div.treeclick",f).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{if(!this.grid.hDiv.loading){b[j]=true;a("div.treeclick",f).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=f.rowIndex;this.p.datatype=this.p.treedatatype;if(this.p.treeGridModel=="nested"){a(this).jqGrid("setGridParam",{postData:{nodeid:e,n_left:b[m],n_right:b[l],n_level:b[d]}})}else{a(this).jqGrid("setGridParam",{postData:{nodeid:e,parentid:b[k],n_level:b[d]}})}a(this).trigger("reloadGrid");b[g]=true;if(this.p.treeGridModel=="nested"){a(this).jqGrid("setGridParam",{postData:{nodeid:"",n_left:"",n_right:"",n_level:""}})}else{a(this).jqGrid("setGridParam",{postData:{nodeid:"",parentid:"",n_level:""}})}}}}})},collapseNode:function(b){return this.each(function(){if(!this.grid||!this.p.treeGrid){return}var e=this.p.treeReader.expanded_field;if(b[e]){b[e]=false;var f=a.jgrid.getAccessor(b,this.p.localReader.id);var d=a("#"+a.jgrid.jqID(f),this.grid.bDiv)[0];a("div.treeclick",d).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(f,d,b,e){return this.each(function(){if(!this.grid||!this.p.treeGrid){return}var l,g,n,k=[],o=this,m,j,h=a(this).jqGrid("getRootNodes");m=a.jgrid.from(h);m.orderBy(f,d,b,e);j=m.select();for(l=0,g=j.length;l<g;l++){n=j[l];k.push(n);a(this).jqGrid("collectChildrenSortTree",k,n,f,d,b,e)}a.each(k,function(p){var q=a.jgrid.getAccessor(this,o.p.localReader.id);a("#"+a.jgrid.jqID(o.p.id)+" tbody tr:eq("+p+")").after(a("tr#"+a.jgrid.jqID(q),o.grid.bDiv))});m=null;j=null;k=null})},collectChildrenSortTree:function(b,g,h,e,d,f){return this.each(function(){if(!this.grid||!this.p.treeGrid){return}var l,j,o,m,n,k;m=a(this).jqGrid("getNodeChildren",g);n=a.jgrid.from(m);n.orderBy(h,e,d,f);k=n.select();for(l=0,j=k.length;l<j;l++){o=k[l];b.push(o);a(this).jqGrid("collectChildrenSortTree",b,o,h,e,d,f)}})},setTreeRow:function(b,d){var e=false;this.each(function(){var f=this;if(!f.grid||!f.p.treeGrid){return}e=a(f).jqGrid("setRowData",b,d)});return e},delTreeNode:function(b){return this.each(function(){var j=this,o=j.p.localReader.id,k,h=j.p.treeReader.left_field,n=j.p.treeReader.right_field,e,f,l,m;if(!j.grid||!j.p.treeGrid){return}var d=j.p._index[b];if(d!==undefined){e=parseInt(j.p.data[d][n],10);f=e-parseInt(j.p.data[d][h],10)+1;var g=a(j).jqGrid("getFullTreeNode",j.p.data[d]);if(g.length>0){for(k=0;k<g.length;k++){a(j).jqGrid("delRowData",g[k][o])}}if(j.p.treeGridModel==="nested"){l=a.jgrid.from(j.p.data).greater(h,e,{stype:"integer"}).select();if(l.length){for(m in l){if(l.hasOwnProperty(m)){l[m][h]=parseInt(l[m][h],10)-f}}}l=a.jgrid.from(j.p.data).greater(n,e,{stype:"integer"}).select();if(l.length){for(m in l){if(l.hasOwnProperty(m)){l[m][n]=parseInt(l[m][n],10)-f}}}}}})},addChildNode:function(h,o,A,l){var u=this[0];if(A){var p=u.p.treeReader.expanded_field,x=u.p.treeReader.leaf_field,b=u.p.treeReader.level_field,j=u.p.treeReader.parent_id_field,e=u.p.treeReader.left_field,y=u.p.treeReader.right_field,q=u.p.treeReader.loaded,d,z,k,n,s,t,r=0,m=o,w,v;if(l===undefined){l=false}if(h===undefined||h===null){s=u.p.data.length-1;if(s>=0){while(s>=0){r=Math.max(r,parseInt(u.p.data[s][u.p.localReader.id],10));s--}}h=r+1}var D=a(u).jqGrid("getInd",o);w=false;if(o===undefined||o===null||o===""){o=null;m=null;d="last";n=u.p.tree_root_level;s=u.p.data.length+1}else{d="after";z=u.p._index[o];k=u.p.data[z];o=k[u.p.localReader.id];n=parseInt(k[b],10)+1;var f=a(u).jqGrid("getFullTreeNode",k);if(f.length){s=f[f.length-1][u.p.localReader.id];m=s;s=a(u).jqGrid("getInd",m)+1}else{s=a(u).jqGrid("getInd",o)+1}if(k[x]){w=true;k[p]=true;a(u.rows[D]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(u.p.treeIcons.leaf+" tree-leaf").addClass(u.p.treeIcons.minus+" tree-minus");u.p.data[z][x]=false;k[q]=true}}t=s+1;if(A[p]===undefined){A[p]=false}if(A[q]===undefined){A[q]=false}A[b]=n;if(A[x]===undefined){A[x]=true}if(u.p.treeGridModel==="adjacency"){A[j]=o}if(u.p.treeGridModel==="nested"){var g,C,B;if(o!==null){v=parseInt(k[y],10);g=a.jgrid.from(u.p.data);g=g.greaterOrEquals(y,v,{stype:"integer"});C=g.select();if(C.length){for(B in C){if(C.hasOwnProperty(B)){C[B][e]=C[B][e]>v?parseInt(C[B][e],10)+2:C[B][e];C[B][y]=C[B][y]>=v?parseInt(C[B][y],10)+2:C[B][y]}}}A[e]=v;A[y]=v+1}else{v=parseInt(a(u).jqGrid("getCol",y,false,"max"),10);C=a.jgrid.from(u.p.data).greater(e,v,{stype:"integer"}).select();if(C.length){for(B in C){if(C.hasOwnProperty(B)){C[B][e]=parseInt(C[B][e],10)+2}}}C=a.jgrid.from(u.p.data).greater(y,v,{stype:"integer"}).select();if(C.length){for(B in C){if(C.hasOwnProperty(B)){C[B][y]=parseInt(C[B][y],10)+2}}}A[e]=v+1;A[y]=v+2}}if(o===null||a(u).jqGrid("isNodeLoaded",k)||w){a(u).jqGrid("addRowData",h,A,d,m);a(u).jqGrid("setTreeNode",s,t)}if(k&&!k[p]&&l){a(u.rows[D]).find("div.treeclick").click()}}}})})(jQuery);(function(a){a.extend(a.jgrid,{template:function(f){var d=a.makeArray(arguments).slice(1),b,e=d.length;if(f==null){f=""}return f.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,function(g,l){if(!isNaN(parseInt(l,10))){return d[parseInt(l,10)]}for(b=0;b<e;b++){if(a.isArray(d[b])){var j=d[b],h=j.length;while(h--){if(l===j[h].nm){return j[h].v}}}}})}});a.jgrid.extend({groupingSetup:function(){return this.each(function(){var h=this,f,e,g,d=h.p.colModel,b=h.p.groupingView;if(b!==null&&((typeof b==="object")||a.isFunction(b))){if(!b.groupField.length){h.p.grouping=false}else{if(b.visibiltyOnNextGrouping===undefined){b.visibiltyOnNextGrouping=[]}b.lastvalues=[];b.groups=[];b.counters=[];for(f=0;f<b.groupField.length;f++){if(!b.groupOrder[f]){b.groupOrder[f]="asc"}if(!b.groupText[f]){b.groupText[f]="{0}"}if(typeof b.groupColumnShow[f]!=="boolean"){b.groupColumnShow[f]=true}if(typeof b.groupSummary[f]!=="boolean"){b.groupSummary[f]=false}if(b.groupColumnShow[f]===true){b.visibiltyOnNextGrouping[f]=true;a(h).jqGrid("showCol",b.groupField[f])}else{b.visibiltyOnNextGrouping[f]=a("#"+a.jgrid.jqID(h.p.id+"_"+b.groupField[f])).is(":visible");a(h).jqGrid("hideCol",b.groupField[f])}}b.summary=[];for(e=0,g=d.length;e<g;e++){if(d[e].summaryType){b.summary.push({nm:d[e].name,st:d[e].summaryType,v:"",sr:d[e].summaryRound,srt:d[e].summaryRoundType||"round"})}}}}else{h.p.grouping=false}})},groupingPrepare:function(e,f,b,d){this.each(function(){var o=this.p.groupingView,h=this,j,n=o.groupField.length,p,m,l,k,g=0;for(j=0;j<n;j++){p=o.groupField[j];l=o.displayField[j];m=b[p];k=l==null?null:b[l];if(k==null){k=m}if(m!==undefined){if(d===0){o.groups.push({idx:j,dataIndex:p,value:m,displayValue:k,startRow:d,cnt:1,summary:[]});o.lastvalues[j]=m;o.counters[j]={cnt:1,pos:o.groups.length-1,summary:a.extend(true,[],o.summary)};a.each(o.counters[j].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(h,this.v,this.nm,b)}else{this.v=a(h).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});o.groups[o.counters[j].pos].summary=o.counters[j].summary}else{if(typeof m!=="object"&&o.lastvalues[j]!==m){o.groups.push({idx:j,dataIndex:p,value:m,displayValue:k,startRow:d,cnt:1,summary:[]});o.lastvalues[j]=m;g=1;o.counters[j]={cnt:1,pos:o.groups.length-1,summary:a.extend(true,[],o.summary)};a.each(o.counters[j].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(h,this.v,this.nm,b)}else{this.v=a(h).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});o.groups[o.counters[j].pos].summary=o.counters[j].summary}else{if(g===1){o.groups.push({idx:j,dataIndex:p,value:m,displayValue:k,startRow:d,cnt:1,summary:[]});o.lastvalues[j]=m;o.counters[j]={cnt:1,pos:o.groups.length-1,summary:a.extend(true,[],o.summary)};a.each(o.counters[j].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(h,this.v,this.nm,b)}else{this.v=a(h).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});o.groups[o.counters[j].pos].summary=o.counters[j].summary}else{o.counters[j].cnt+=1;o.groups[o.counters[j].pos].cnt=o.counters[j].cnt;a.each(o.counters[j].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(h,this.v,this.nm,b)}else{this.v=a(h).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});o.groups[o.counters[j].pos].summary=o.counters[j].summary}}}}}f.push(e)});return f},groupingToggle:function(b){this.each(function(){var j=this,q=j.p.groupingView,e=b.split("_"),k=parseInt(e[e.length-2],10);e.splice(e.length-2,2);var n=e.join("_"),g=q.minusicon,m=q.plusicon,l=a("#"+a.jgrid.jqID(b)),d=l.length?l[0].nextSibling:null,o=a("#"+a.jgrid.jqID(b)+" span.tree-wrap-"+j.p.direction),h=false,p;if(o.hasClass(g)){if(q.showSummaryOnHide){if(d){while(d){if(a(d).hasClass("jqfoot")){var f=parseInt(a(d).attr("jqfootlevel"),10);if(f<=k){break}}a(d).hide();d=d.nextSibling}}}else{if(d){while(d){if(a(d).hasClass(n+"_"+String(k))||a(d).hasClass(n+"_"+String(k-1))){break}a(d).hide();d=d.nextSibling}}}o.removeClass(g).addClass(m);h=true}else{if(d){while(d){if(a(d).hasClass(n+"_"+String(k))||a(d).hasClass(n+"_"+String(k-1))){break}a(d).show();p=a(d).find("span.tree-wrap-"+j.p.direction);if(p&&a(p).hasClass(m)){a(p).removeClass(m).addClass(g)}d=d.nextSibling}}o.removeClass(m).addClass(g)}a(j).triggerHandler("jqGridGroupingClickGroup",[b,h]);if(a.isFunction(j.p.onClickGroup)){j.p.onClickGroup.call(j,b,h)}});return false},groupingRender:function(b,d){return this.each(function(){var g=this,q=g.p.groupingView,l="",m="",n,p,j=q.groupCollapse?q.plusicon:q.minusicon,e,k=[],h=q.groupField.length;j+=" tree-wrap-"+g.p.direction;a.each(g.p.colModel,function(s,u){var t;for(t=0;t<h;t++){if(q.groupField[t]===u.name){k[t]=s;break}}});var f=0;function r(v,w,s){var t=false,u;if(w===0){t=s[v]}else{var x=s[v].idx;if(x===0){t=s[v]}else{for(u=v;u>=0;u--){if(s[u].idx===x-w){t=s[u];break}}}}return t}var o=a.makeArray(q.groupSummary);o.reverse();a.each(q.groups,function(x,u){f++;p=g.p.id+"ghead_"+u.idx;n=p+"_"+x;m="<span style='cursor:pointer;' class='ui-icon "+j+"' onclick=\"jQuery('#"+a.jgrid.jqID(g.p.id)+"').jqGrid('groupingToggle','"+n+"');return false;\"></span>";try{e=g.formatter(n,u.displayValue,k[u.idx],u.value)}catch(I){e=u.displayValue}l+='<tr id="'+n+'" role="row" class= "ui-widget-content jqgroup ui-row-'+g.p.direction+" "+p+'"><td style="padding-left:'+(u.idx*12)+'px;" colspan="'+d+'">'+m+a.jgrid.template(q.groupText[u.idx],e,u.cnt,u.summary)+"</td></tr>";var A=h-1===u.idx;if(A){var B=q.groups[x+1],w,t,F;var v=B!==undefined?q.groups[x+1].startRow:b.length;for(t=u.startRow;t<v;t++){l+=b[t].join("")}var y;if(B!==undefined){for(y=0;y<q.groupField.length;y++){if(B.dataIndex===q.groupField[y]){break}}f=q.groupField.length-y}for(F=0;F<f;F++){if(!o[F]){continue}var C="";if(q.groupCollapse&&!q.showSummaryOnHide){C=' style="display:none;"'}l+="<tr"+C+' jqfootlevel="'+(u.idx-F)+'" role="row" class="ui-widget-content jqfoot ui-row-'+g.p.direction+'">';var z=r(x,F,q.groups),E=g.p.colModel,D,G=z.cnt;for(w=0;w<d;w++){var s="<td "+g.formatCol(w,1,"")+">&#160;</td>",H="{0}";a.each(z.summary,function(){if(this.nm===E[w].name){if(E[w].summaryTpl){H=E[w].summaryTpl}if(typeof this.st==="string"&&this.st.toLowerCase()==="avg"){if(this.v&&G>0){this.v=(this.v/G)}}try{D=g.formatter("",this.v,w,this)}catch(J){D=this.v}s="<td "+g.formatCol(w,1,"")+">"+a.jgrid.format(H,D)+"</td>";return false}});l+=s}l+="</tr>"}f=y}});a("#"+a.jgrid.jqID(g.p.id)+" tbody:first").append(l);l=null})},groupingGroupBy:function(d,b){return this.each(function(){var g=this;if(typeof d==="string"){d=[d]}var e=g.p.groupingView;g.p.grouping=true;if(e.visibiltyOnNextGrouping===undefined){e.visibiltyOnNextGrouping=[]}var f;for(f=0;f<e.groupField.length;f++){if(!e.groupColumnShow[f]&&e.visibiltyOnNextGrouping[f]){a(g).jqGrid("showCol",e.groupField[f])}}for(f=0;f<d.length;f++){e.visibiltyOnNextGrouping[f]=a("#"+a.jgrid.jqID(g.p.id)+"_"+a.jgrid.jqID(d[f])).is(":visible")}g.p.groupingView=a.extend(g.p.groupingView,b||{});e.groupField=d;a(g).trigger("reloadGrid")})},groupingRemove:function(b){return this.each(function(){var f=this;if(b===undefined){b=true}f.p.grouping=false;if(b===true){var d=f.p.groupingView,e;for(e=0;e<d.groupField.length;e++){if(!d.groupColumnShow[e]&&d.visibiltyOnNextGrouping[e]){a(f).jqGrid("showCol",d.groupField)}}a("tr.jqgroup, tr.jqfoot","#"+a.jgrid.jqID(f.p.id)+" tbody:first").remove();a("tr.jqgrow:hidden","#"+a.jgrid.jqID(f.p.id)+" tbody:first").show()}else{a(f).trigger("reloadGrid")}})},groupingCalculations:{handler:function(g,k,h,l,j,b){var d={sum:function(){return parseFloat(k||0)+parseFloat((b[h]||0))},min:function(){if(k===""){return parseFloat(b[h]||0)}return Math.min(parseFloat(k),parseFloat(b[h]||0))},max:function(){if(k===""){return parseFloat(b[h]||0)}return Math.max(parseFloat(k),parseFloat(b[h]||0))},count:function(){if(k===""){k=0}if(b.hasOwnProperty(h)){return k+1}return 0},avg:function(){return d.sum()}};if(!d[g]){throw ("jqGrid Grouping No such method: "+g)}var f=d[g]();if(l!=null){if(j=="fixed"){f=f.toFixed(l)}else{var e=Math.pow(10,l);f=Math.round(f*e)/e}}return f}}})})(jQuery);(function(a){a.jgrid.extend({jqGridImport:function(b){b=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},b||{});return this.each(function(){var g=this;var d=function(j,p){var h=a(p.xmlGrid.config,j)[0];var n=a(p.xmlGrid.data,j)[0],q,l,k;if(xmlJsonClass.xml2json&&a.jgrid.parse){q=xmlJsonClass.xml2json(h," ");q=a.jgrid.parse(q);for(k in q){if(q.hasOwnProperty(k)){l=q[k]}}if(n){var m=q.grid.datatype;q.grid.datatype="xmlstring";q.grid.datastr=j;a(g).jqGrid(l).jqGrid("setGridParam",{datatype:m})}else{a(g).jqGrid(l)}q=null;l=null}else{alert("xml2json or parse are not present")}};var f=function(k,n){if(k&&typeof k=="string"){var h=false;if(a.jgrid.useJSON){a.jgrid.useJSON=false;h=true}var j=a.jgrid.parse(k);if(h){a.jgrid.useJSON=true}var p=j[n.jsonGrid.config];var l=j[n.jsonGrid.data];if(l){var m=p.datatype;p.datatype="jsonstring";p.datastr=l;a(g).jqGrid(p).jqGrid("setGridParam",{datatype:m})}else{a(g).jqGrid(p)}}};switch(b.imptype){case"xml":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"xml",complete:function(h,j){if(j=="success"){d(h.responseXML,b);a(g).triggerHandler("jqGridImportComplete",[h,b]);if(a.isFunction(b.importComplete)){b.importComplete(h)}}h=null}},b.ajaxOptions));break;case"xmlstring":if(b.impstring&&typeof b.impstring=="string"){var e=a.jgrid.stringToDoc(b.impstring);if(e){d(e,b);a(g).triggerHandler("jqGridImportComplete",[e,b]);if(a.isFunction(b.importComplete)){b.importComplete(e)}b.impstring=null}e=null}break;case"json":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"json",complete:function(j){try{f(j.responseText,b);a(g).triggerHandler("jqGridImportComplete",[j,b]);if(a.isFunction(b.importComplete)){b.importComplete(j)}}catch(h){}j=null}},b.ajaxOptions));break;case"jsonstring":if(b.impstring&&typeof b.impstring=="string"){f(b.impstring,b);a(g).triggerHandler("jqGridImportComplete",[b.impstring,b]);if(a.isFunction(b.importComplete)){b.importComplete(b.impstring)}b.impstring=null}break}})},jqGridExport:function(d){d=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},d||{});var b=null;this.each(function(){if(!this.grid){return}var e,f=a.extend(true,{},a(this).jqGrid("getGridParam"));if(f.rownumbers){f.colNames.splice(0,1);f.colModel.splice(0,1)}if(f.multiselect){f.colNames.splice(0,1);f.colModel.splice(0,1)}if(f.subGrid){f.colNames.splice(0,1);f.colModel.splice(0,1)}f.knv=null;if(f.treeGrid){for(e in f.treeReader){if(f.treeReader.hasOwnProperty(e)){f.colNames.splice(f.colNames.length-1);f.colModel.splice(f.colModel.length-1)}}}switch(d.exptype){case"xmlstring":b="<"+d.root+">"+xmlJsonClass.json2xml(f,d.ident)+"</"+d.root+">";break;case"jsonstring":b="{"+xmlJsonClass.toJson(f,d.root,d.ident,false)+"}";if(f.postData.filters!==undefined){b=b.replace(/filters":"/,'filters":');b=b.replace(/}]}"/,"}]}")}break}});return b},excelExport:function(b){b=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},b||{});return this.each(function(){if(!this.grid){return}var d;if(b.exptype=="remote"){var e=a.extend({},this.p.postData);e[b.oper]=b.tag;var f=jQuery.param(e);if(b.url.indexOf("?")!=-1){d=b.url+"&"+f}else{d=b.url+"?"+f}window.location=d}})}})})(jQuery);(function($){if($.jgrid.msie&&$.jgrid.msiever()==8){$.expr[":"].hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0||elem.style.display=="none"}}$.jgrid._multiselect=false;if($.ui){if($.ui.multiselect){if($.ui.multiselect.prototype._setSelected){var setSelected=$.ui.multiselect.prototype._setSelected;$.ui.multiselect.prototype._setSelected=function(item,selected){var ret=setSelected.call(this,item,selected);if(selected&&this.selectedList){var elt=this.element;this.selectedList.find("li").each(function(){if($(this).data("optionLink")){$(this).data("optionLink").remove().appendTo(elt)}})}return ret}}if($.ui.multiselect.prototype.destroy){$.ui.multiselect.prototype.destroy=function(){this.element.show();this.container.remove();if($.Widget===undefined){$.widget.prototype.destroy.apply(this,arguments)}else{$.Widget.prototype.destroy.apply(this,arguments)}}}$.jgrid._multiselect=true}}$.jgrid.extend({sortableColumns:function(tblrow){return this.each(function(){var ts=this,tid=$.jgrid.jqID(ts.p.id);function start(){ts.p.disableClick=true}var sortable_opts={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_"+tid+"_cb,#jqgh_"+tid+"_rn,#jqgh_"+tid+"_subgrid),:hidden)",placeholder:{element:function(item){var el=$(document.createElement(item[0].nodeName)).addClass(item[0].className+" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0];return el},update:function(self,p){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css("paddingTop")||0,10)-parseInt(self.currentItem.css("paddingBottom")||0,10));p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css("paddingLeft")||0,10)-parseInt(self.currentItem.css("paddingRight")||0,10))}},update:function(event,ui){var p=$(ui.item).parent(),th=$(">th",p),colModel=ts.p.colModel,cmMap={},tid=ts.p.id+"_";$.each(colModel,function(i){cmMap[this.name]=i});var permutation=[];th.each(function(){var id=$(">div",this).get(0).id.replace(/^jqgh_/,"").replace(tid,"");if(cmMap.hasOwnProperty(id)){permutation.push(cmMap[id])}});$(ts).jqGrid("remapColumns",permutation,true,true);if($.isFunction(ts.p.sortable.update)){ts.p.sortable.update(permutation)}setTimeout(function(){ts.p.disableClick=false},50)}};if(ts.p.sortable.options){$.extend(sortable_opts,ts.p.sortable.options)}else{if($.isFunction(ts.p.sortable)){ts.p.sortable={update:ts.p.sortable}}}if(sortable_opts.start){var s=sortable_opts.start;sortable_opts.start=function(e,ui){start();s.call(this,e,ui)}}else{sortable_opts.start=start}if(ts.p.sortable.exclude){sortable_opts.items+=":not("+ts.p.sortable.exclude+")"}tblrow.sortable(sortable_opts).data("sortable").floating=true})},columnChooser:function(opts){var self=this;if($("#colchooser_"+$.jgrid.jqID(self[0].p.id)).length){return}var selector=$('<div id="colchooser_'+self[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');var select=$("select",selector);function insert(perm,i,v){if(i>=0){var a=perm.slice();var b=a.splice(i,Math.max(perm.length-i,i));if(i>perm.length){i=perm.length}a[i]=v;return a.concat(b)}}opts=$.extend({width:420,height:240,classname:null,done:function(perm){if(perm){self.jqGrid("remapColumns",perm,true)}},msel:"multiselect",dlog:"dialog",dialog_opts:{minWidth:470},dlog_opts:function(opts){var buttons={};buttons[opts.bSubmit]=function(){opts.apply_perm();opts.cleanup(false)};buttons[opts.bCancel]=function(){opts.cleanup(true)};return $.extend(true,{buttons:buttons,close:function(){opts.cleanup(true)},modal:opts.modal||false,resizable:opts.resizable||true,width:opts.width+20},opts.dialog_opts||{})},apply_perm:function(){$("option",select).each(function(){if(this.selected){self.jqGrid("showCol",colModel[this.value].name)}else{self.jqGrid("hideCol",colModel[this.value].name)}});var perm=[];$("option:selected",select).each(function(){perm.push(parseInt(this.value,10))});$.each(perm,function(){delete colMap[colModel[parseInt(this,10)].name]});$.each(colMap,function(){var ti=parseInt(this,10);perm=insert(perm,ti,ti)});if(opts.done){opts.done.call(self,perm)}},cleanup:function(calldone){call(opts.dlog,selector,"destroy");call(opts.msel,select,"destroy");selector.remove();if(calldone&&opts.done){opts.done.call(self)}},msel_opts:{}},$.jgrid.col,opts||{});if($.ui){if($.ui.multiselect){if(opts.msel=="multiselect"){if(!$.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}opts.msel_opts=$.extend($.ui.multiselect.defaults,opts.msel_opts)}}}if(opts.caption){selector.attr("title",opts.caption)}if(opts.classname){selector.addClass(opts.classname);select.addClass(opts.classname)}if(opts.width){$(">div",selector).css({width:opts.width,margin:"0 auto"});select.css("width",opts.width)}if(opts.height){$(">div",selector).css("height",opts.height);select.css("height",opts.height-10)}var colModel=self.jqGrid("getGridParam","colModel");var colNames=self.jqGrid("getGridParam","colNames");var colMap={},fixedCols=[];select.empty();$.each(colModel,function(i){colMap[this.name]=i;if(this.hidedlg){if(!this.hidden){fixedCols.push(i)}return}select.append("<option value='"+i+"' "+(this.hidden?"":"selected='selected'")+">"+$.jgrid.stripHtml(colNames[i])+"</option>")});function call(fn,obj){if(!fn){return}if(typeof fn=="string"){if($.fn[fn]){$.fn[fn].apply(obj,$.makeArray(arguments).slice(2))}}else{if($.isFunction(fn)){fn.apply(obj,$.makeArray(arguments).slice(2))}}}var dopts=$.isFunction(opts.dlog_opts)?opts.dlog_opts.call(self,opts):opts.dlog_opts;call(opts.dlog,selector,dopts);var mopts=$.isFunction(opts.msel_opts)?opts.msel_opts.call(self,opts):opts.msel_opts;call(opts.msel,select,mopts)},sortableRows:function(opts){return this.each(function(){var $t=this;if(!$t.grid){return}if($t.p.treeGrid){return}if($.fn.sortable){opts=$.extend({cursor:"move",axis:"y",items:".jqgrow"},opts||{});if(opts.start&&$.isFunction(opts.start)){opts._start_=opts.start;delete opts.start}else{opts._start_=false}if(opts.update&&$.isFunction(opts.update)){opts._update_=opts.update;delete opts.update}else{opts._update_=false}opts.start=function(ev,ui){$(ui.item).css("border-width","0px");$("td",ui.item).each(function(i){this.style.width=$t.grid.cols[i].style.width});if($t.p.subGrid){var subgid=$(ui.item).attr("id");try{$($t).jqGrid("collapseSubGridRow",subgid)}catch(e){}}if(opts._start_){opts._start_.apply(this,[ev,ui])}};opts.update=function(ev,ui){$(ui.item).css("border-width","");if($t.p.rownumbers===true){$("td.jqgrid-rownum",$t.rows).each(function(i){$(this).html(i+1+(parseInt($t.p.page,10)-1)*parseInt($t.p.rowNum,10))})}if(opts._update_){opts._update_.apply(this,[ev,ui])}};$("tbody:first",$t).sortable(opts);$("tbody:first",$t).disableSelection()}})},gridDnD:function(opts){return this.each(function(){var $t=this,i,cn;if(!$t.grid){return}if($t.p.treeGrid){return}if(!$.fn.draggable||!$.fn.droppable){return}function updateDnD(){var datadnd=$.data($t,"dnd");$("tr.jqgrow:not(.ui-draggable)",$t).draggable($.isFunction(datadnd.drag)?datadnd.drag.call($($t),datadnd):datadnd.drag)}var appender="<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>";if($("#jqgrid_dnd")[0]===undefined){$("body").append(appender)}if(typeof opts=="string"&&opts=="updateDnD"&&$t.p.jqgdnd===true){updateDnD();return}opts=$.extend({drag:function(opts){return $.extend({start:function(ev,ui){var i,subgid;if($t.p.subGrid){subgid=$(ui.helper).attr("id");try{$($t).jqGrid("collapseSubGridRow",subgid)}catch(e){}}for(i=0;i<$.data($t,"dnd").connectWith.length;i++){if($($.data($t,"dnd").connectWith[i]).jqGrid("getGridParam","reccount")=="0"){$($.data($t,"dnd").connectWith[i]).jqGrid("addRowData","jqg_empty_row",{})}}ui.helper.addClass("ui-state-highlight");$("td",ui.helper).each(function(i){this.style.width=$t.grid.headers[i].width+"px"});if(opts.onstart&&$.isFunction(opts.onstart)){opts.onstart.call($($t),ev,ui)}},stop:function(ev,ui){var i,ids;if(ui.helper.dropped&&!opts.dragcopy){ids=$(ui.helper).attr("id");if(ids===undefined){ids=$(this).attr("id")}$($t).jqGrid("delRowData",ids)}for(i=0;i<$.data($t,"dnd").connectWith.length;i++){$($.data($t,"dnd").connectWith[i]).jqGrid("delRowData","jqg_empty_row")}if(opts.onstop&&$.isFunction(opts.onstop)){opts.onstop.call($($t),ev,ui)}}},opts.drag_opts||{})},drop:function(opts){return $.extend({accept:function(d){if(!$(d).hasClass("jqgrow")){return d}var tid=$(d).closest("table.ui-jqgrid-btable");if(tid.length>0&&$.data(tid[0],"dnd")!==undefined){var cn=$.data(tid[0],"dnd").connectWith;return $.inArray("#"+$.jgrid.jqID(this.id),cn)!=-1?true:false}return false},drop:function(ev,ui){if(!$(ui.draggable).hasClass("jqgrow")){return}var accept=$(ui.draggable).attr("id");var getdata=ui.draggable.parent().parent().jqGrid("getRowData",accept);if(!opts.dropbyname){var j=0,tmpdata={},nm,key;var dropmodel=$("#"+$.jgrid.jqID(this.id)).jqGrid("getGridParam","colModel");try{for(key in getdata){if(getdata.hasOwnProperty(key)){nm=dropmodel[j].name;if(!(nm=="cb"||nm=="rn"||nm=="subgrid")){if(getdata.hasOwnProperty(key)&&dropmodel[j]){tmpdata[nm]=getdata[key]}}j++}}getdata=tmpdata}catch(e){}}ui.helper.dropped=true;if(opts.beforedrop&&$.isFunction(opts.beforedrop)){var datatoinsert=opts.beforedrop.call(this,ev,ui,getdata,$("#"+$.jgrid.jqID($t.p.id)),$(this));if(datatoinsert!==undefined&&datatoinsert!==null&&typeof datatoinsert=="object"){getdata=datatoinsert}}if(ui.helper.dropped){var grid;if(opts.autoid){if($.isFunction(opts.autoid)){grid=opts.autoid.call(this,getdata)}else{grid=Math.ceil(Math.random()*1000);grid=opts.autoidprefix+grid}}$("#"+$.jgrid.jqID(this.id)).jqGrid("addRowData",grid,getdata,opts.droppos)}if(opts.ondrop&&$.isFunction(opts.ondrop)){opts.ondrop.call(this,ev,ui,getdata)}}},opts.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5000},dragcopy:false,dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},opts||{});if(!opts.connectWith){return}opts.connectWith=opts.connectWith.split(",");opts.connectWith=$.map(opts.connectWith,function(n){return $.trim(n)});$.data($t,"dnd",opts);if($t.p.reccount!="0"&&!$t.p.jqgdnd){updateDnD()}$t.p.jqgdnd=true;for(i=0;i<opts.connectWith.length;i++){cn=opts.connectWith[i];$(cn).droppable($.isFunction(opts.drop)?opts.drop.call($($t),opts):opts.drop)}})},gridResize:function(opts){return this.each(function(){var $t=this,gID=$.jgrid.jqID($t.p.id);if(!$t.grid||!$.fn.resizable){return}opts=$.extend({},opts||{});if(opts.alsoResize){opts._alsoResize_=opts.alsoResize;delete opts.alsoResize}else{opts._alsoResize_=false}if(opts.stop&&$.isFunction(opts.stop)){opts._stop_=opts.stop;delete opts.stop}else{opts._stop_=false}opts.stop=function(ev,ui){$($t).jqGrid("setGridParam",{height:$("#gview_"+gID+" .ui-jqgrid-bdiv").height()});$($t).jqGrid("setGridWidth",ui.size.width,opts.shrinkToFit);if(opts._stop_){opts._stop_.call($t,ev,ui)}};if(opts._alsoResize_){var optstest="{'#gview_"+gID+" .ui-jqgrid-bdiv':true,'"+opts._alsoResize_+"':true}";opts.alsoResize=eval("("+optstest+")")}else{opts.alsoResize=$(".ui-jqgrid-bdiv","#gview_"+gID)}delete opts._alsoResize_;$("#gbox_"+gID).resizable(opts)})}})})(jQuery);function tableToGrid(a,b){jQuery(a).each(function(){if(this.grid){return}jQuery(this).width("99%");var o=jQuery(this).width();var q=jQuery("tr td:first-child input[type=checkbox]:first",jQuery(this));var j=jQuery("tr td:first-child input[type=radio]:first",jQuery(this));var e=q.length>0;var h=!e&&j.length>0;var k=e||h;var m=[];var p=[];jQuery("th",jQuery(this)).each(function(){if(m.length===0&&k){m.push({name:"__selection__",index:"__selection__",width:0,hidden:true});p.push("__selection__")}else{m.push({name:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),index:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),width:jQuery(this).width()||150});p.push(jQuery(this).html())}});var g=[];var f=[];var n=[];jQuery("tbody > tr",jQuery(this)).each(function(){var s={};var r=0;jQuery("td",jQuery(this)).each(function(){if(r===0&&k){var t=jQuery("input",jQuery(this));var u=t.attr("value");f.push(u||g.length);if(t.is(":checked")){n.push(u)}s[m[r].name]=t.attr("value")}else{s[m[r].name]=jQuery(this).html()}r++});if(r>0){g.push(s)}});jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid(jQuery.extend({datatype:"local",width:o,colNames:p,colModel:m,multiselect:e},b||{}));var l;for(l=0;l<g.length;l++){var d=null;if(f.length>0){d=f[l];if(d&&d.replace){d=encodeURIComponent(d).replace(/[.\-%]/g,"_")}}if(d===null){d=l+1}jQuery(this).jqGrid("addRowData",d,g[l])}for(l=0;l<n.length;l++){jQuery(this).jqGrid("setSelection",n[l])}})}
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
var rp_ge={};(function(a){a.extend(a.jgrid,{})})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.jgrid.fluid={fluidWidth:function(b){var d=a(this);var f=a.extend({fluidBaseLayer:"#gbox_"+d.attr("id"),fluidOffset:0,minWidth:null,maxWidth:null},b||{});var e=function(k,j){var g=k.width(),l=a(k).data("previousWidth"),h=g;if(j===true||(g!=l)){a(k).data("previousWidth",g);h=(f.minWidth!==null&&g<f.minWidth?f.minWidth:h);h=(f.maxWidth!==null&&g>f.maxWidth?f.maxWidth:h);d.trigger("fluidWidth.resize",[l,h-f.fluidOffset])}};if(a(f.fluidBaseLayer).data("fluidWidth")!==true){a(f.fluidBaseLayer).data("fluidWidth",true);setInterval(function(){e(a(f.fluidBaseLayer),false)},100)}e(a(f.fluidBaseLayer),true)}}})(jQuery);jQuery.fn.extend({fluidWidth:jQuery.jgrid.fluid.fluidWidth});(function(){window.form2object=function(l,h,e){if(typeof e=="undefined"||e==null){e=true}if(typeof h=="undefined"||h==null){h="."}l=typeof l=="string"?document.getElementById(l):l;var p=b(l);var u={};var k={};for(var o=0;o<p.length;o++){var q=p[o].value;if(e&&q===""){continue}var g=p[o].name;if(g){var n=g.split(h);var r=u;for(var m=0;m<n.length;m++){var s=n[m];var f;if(s.indexOf("[]")>-1&&m==n.length-1){f=s.substr(0,s.indexOf("["));if(!r[f]){r[f]=[]}r[f].push(q)}else{if(s.indexOf("[")>-1){f=s.substr(0,s.indexOf("["));var t=s.replace(/^[a-z]+\[|\]$/gi,"");if(!k[f]){k[f]={}}if(!r[f]){r[f]=[]}if(m==n.length-1){r[f].push(q)}else{if(!k[f][t]){r[f].push({});k[f][t]=r[f][r[f].length-1]}}r=k[f][t]}else{if(m<n.length-1){if(!r[s]){r[s]={}}r=r[s]}else{r[s]=q}}}}}}return u};function b(h){var e=[],j;var k=h.firstChild;while(k){if(k.nodeName.match(/INPUT|SELECT|TEXTAREA|HIDDEN/i)){var l=a(k);if(jQuery(k).is("select")&&k.multiple){var g=jQuery(k).attr("name").split(".");j=g.length>1?g[g.length-2]:g[0]}else{j=jQuery(k).attr("name")}if(l!==null){e.push({name:j,value:l})}}else{var f=b(k);e=e.concat(f)}k=k.nextSibling}return e}function a(e){var f=jQuery(e).attr("ruptype");if(f){return jQuery(e)["rup_"+f]("getRupValue")}else{switch(e.nodeName){case"HIDDEN":case"INPUT":case"TEXTAREA":switch(e.type.toLowerCase()){case"radio":case"checkbox":if(e.checked){return e.value}break;case"button":case"reset":case"submit":case"image":return"";break;default:return e.value;break}break;case"SELECT":return d(e);break;default:break}}return null}function d(k){var f=k.multiple;if(!f){return k.value}var e=[];for(var j=k.getElementsByTagName("option"),m=0,h=j.length;m<h;m++){var g=k.name.split(".");g[g.length-1];if(j[m].selected){var n={};n[g[g.length-1]]=j[m].value;e.push(n)}}return e}window.form2json=window.form2object})();(function(k){if(/1\.(0|1|2)\.(0|1|2)/.test(k.fn.jquery)||/^1.1/.test(k.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+k.fn.jquery);return}k.fn._fadeIn=k.fn.fadeIn;var d=function(){};var l=document.documentMode||0;var f=k.browser.msie&&((k.browser.version<8&&!l)||l<8);var g=k.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!l;k.blockUI=function(r){e(window,r)};k.unblockUI=function(r){j(window,r)};k.growlUI=function(v,t,u,r){var s=k('<div class="growlUI"></div>');if(v){s.append("<h1>"+v+"</h1>")}if(t){s.append("<h2>"+t+"</h2>")}if(u==undefined){u=3000}k.blockUI({message:s,fadeIn:700,fadeOut:1000,centerY:false,timeout:u,showOverlay:false,onUnblock:r,css:k.blockUI.defaults.growlCSS})};k.fn.block=function(r){return this.unblock({fadeOut:0}).each(function(){if(k.css(this,"position")=="static"){this.style.position="relative"}if(k.browser.msie){this.style.zoom=1}e(this,r)})};k.fn.unblock=function(r){return this.each(function(){j(this,r)})};k.blockUI.version=2.35;k.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var b=null;var h=[];function e(v,H){var C=(v==window);var y=H&&H.message!==undefined?H.message:undefined;H=k.extend({},k.blockUI.defaults,H||{});H.overlayCSS=k.extend({},k.blockUI.defaults.overlayCSS,H.overlayCSS||{});var E=k.extend({},k.blockUI.defaults.css,H.css||{});var P=k.extend({},k.blockUI.defaults.themedCSS,H.themedCSS||{});y=y===undefined?H.message:y;if(C&&b){j(window,{fadeOut:0})}if(y&&typeof y!="string"&&(y.parentNode||y.jquery)){var K=y.jquery?y[0]:y;var R={};k(v).data("blockUI.history",R);R.el=K;R.parent=K.parentNode;R.display=K.style.display;R.position=K.style.position;if(R.parent){R.parent.removeChild(K)}}var D=H.baseZ;var O=(k.browser.msie||H.forceIframe)?k('<iframe class="blockUI" style="z-index:'+(D++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+H.iframeSrc+'"></iframe>'):k('<div class="blockUI" style="display:none"></div>');var N=k('<div class="blockUI blockOverlay" style="z-index:'+(D++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var M,I;if(H.theme&&C){I='<div class="blockUI '+H.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+D+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(H.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(H.theme){I='<div class="blockUI '+H.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+D+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(H.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(C){I='<div class="blockUI '+H.blockMsgClass+' blockPage" style="z-index:'+D+';display:none;position:fixed"></div>'}else{I='<div class="blockUI '+H.blockMsgClass+' blockElement" style="z-index:'+D+';display:none;position:absolute"></div>'}}}M=k(I);if(y){if(H.theme){M.css(P);M.addClass("ui-widget-content")}else{M.css(E)}}if(!H.applyPlatformOpacityRules||!(k.browser.mozilla&&/Linux/.test(navigator.platform))){N.css(H.overlayCSS)}N.css("position",C?"fixed":"absolute");if(k.browser.msie||H.forceIframe){O.css("opacity",0)}var B=[O,N,M],Q=C?k("body"):k(v);k.each(B,function(){this.appendTo(Q)});if(H.theme&&H.draggable&&k.fn.draggable){M.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var x=f&&(!k.boxModel||k("object,embed",C?null:v).length>0);if(g||x){if(C&&H.allowBodyStretch&&k.boxModel){k("html,body").css("height","100%")}if((g||!k.boxModel)&&!C){var G=o(v,"borderTopWidth"),L=o(v,"borderLeftWidth");var A=G?"(0 - "+G+")":0;var F=L?"(0 - "+L+")":0}k.each([O,N,M],function(t,U){var z=U[0].style;z.position="absolute";if(t<2){C?z.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+H.quirksmodeOffsetHack+') + "px"'):z.setExpression("height",'this.parentNode.offsetHeight + "px"');C?z.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):z.setExpression("width",'this.parentNode.offsetWidth + "px"');if(F){z.setExpression("left",F)}if(A){z.setExpression("top",A)}}else{if(H.centerY){if(C){z.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}z.marginTop=0}else{if(!H.centerY&&C){var S=(H.css&&H.css.top)?parseInt(H.css.top):0;var T="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+S+') + "px"';z.setExpression("top",T)}}}})}if(y){if(H.theme){M.find(".ui-widget-content").append(y)}else{M.append(y)}if(y.jquery||y.nodeType){k(y).show()}}if((k.browser.msie||H.forceIframe)&&H.showOverlay){O.show()}if(H.fadeIn){var J=H.onBlock?H.onBlock:d;var u=(H.showOverlay&&!y)?J:d;var r=y?J:d;if(H.showOverlay){N._fadeIn(H.fadeIn,u)}if(y){M._fadeIn(H.fadeIn,r)}}else{if(H.showOverlay){N.show()}if(y){M.show()}if(H.onBlock){H.onBlock()}}n(1,v,H);if(C){b=M[0];h=k(":input:enabled:visible",b);if(H.focusInput){setTimeout(q,20)}}else{a(M[0],H.centerX,H.centerY)}if(H.timeout){var w=setTimeout(function(){C?k.unblockUI(H):k(v).unblock(H)},H.timeout);k(v).data("blockUI.timeout",w)}}function j(u,v){var t=(u==window);var s=k(u);var w=s.data("blockUI.history");var x=s.data("blockUI.timeout");if(x){clearTimeout(x);s.removeData("blockUI.timeout")}v=k.extend({},k.blockUI.defaults,v||{});n(0,u,v);var r;if(t){r=k("body").children().filter(".blockUI").add("body > .blockUI")}else{r=k(".blockUI",u)}if(t){b=h=null}if(v.fadeOut){r.fadeOut(v.fadeOut);setTimeout(function(){m(r,w,v,u)},v.fadeOut)}else{m(r,w,v,u)}}function m(r,u,t,s){r.each(function(v,w){if(this.parentNode){this.parentNode.removeChild(this)}});if(u&&u.el){u.el.style.display=u.display;u.el.style.position=u.position;if(u.parent){u.parent.appendChild(u.el)}k(s).removeData("blockUI.history")}if(typeof t.onUnblock=="function"){t.onUnblock(s,t)}}function n(r,v,w){var u=v==window,t=k(v);if(!r&&(u&&!b||!u&&!t.data("blockUI.isBlocked"))){return}if(!u){t.data("blockUI.isBlocked",r)}if(!w.bindEvents||(r&&!w.showOverlay)){return}var s="mousedown mouseup keydown keypress";r?k(document).bind(s,w,p):k(document).unbind(s,p)}function p(v){if(v.keyCode&&v.keyCode==9){if(b&&v.data.constrainTabKey){var t=h;var s=!v.shiftKey&&v.target===t[t.length-1];var r=v.shiftKey&&v.target===t[0];if(s||r){setTimeout(function(){q(r)},10);return false}}}var u=v.data;if(k(v.target).parents("div."+u.blockMsgClass).length>0){return true}return k(v.target).parents().children().filter("div.blockUI").length==0}function q(r){if(!h){return}var s=h[r===true?h.length-1:0];if(s){s.focus()}}function a(z,r,B){var A=z.parentNode,w=z.style;var u=((A.offsetWidth-z.offsetWidth)/2)-o(A,"borderLeftWidth");var v=((A.offsetHeight-z.offsetHeight)/2)-o(A,"borderTopWidth");if(r){w.left=u>0?(u+"px"):"0"}if(B){w.top=v>0?(v+"px"):"0"}}function o(r,s){return parseInt(k.css(r,s))||0}})(jQuery);var $=jQuery.noConflict();$.extend({fileDownload:function(l,d){var o=function(x,y){alert("A file download error has occurred, please try again.")};var s=$.extend({preparingMessageHtml:null,failMessageHtml:null,androidPostUnsupportedMessageHtml:"Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.",dialogOptions:{modal:true},successCallback:function(x){},failCallback:o,httpMethod:"GET",data:null,checkInterval:100,cookieName:"fileDownload",cookieValue:"true",cookiePath:"/",popupWindowTitle:"Initiating file download...",encodeHTMLEntities:true},d);var v=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase();var p=false;var u=false;var b=false;if(/ip(ad|hone|od)/.test(v)){p=true}else{if(v.indexOf("android")!=-1){u=true}else{b=/avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(v)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(v.substr(0,4))}}var r=s.httpMethod.toUpperCase();if(u&&r!="GET"){if($().dialog){$("<div>").html(s.androidPostUnsupportedMessageHtml).dialog(s.dialogOptions)}else{alert(s.androidPostUnsupportedMessageHtml)}return}var w=null;if(s.preparingMessageHtml){w=$("<div>").html(s.preparingMessageHtml).dialog(s.dialogOptions)}var j={onSuccess:function(x){if(w){w.dialog("close")}s.successCallback(x)},onFail:function(x,y){if(w){w.dialog("close")}if(s.failMessageHtml){$("<div>").html(s.failMessageHtml).dialog(s.dialogOptions);if(s.failCallback!=o){s.failCallback(x,y)}}else{s.failCallback(x,y)}}};if(s.data!==null&&typeof s.data!=="string"){s.data=$.param(s.data)}var n,e,t,f;if(r==="GET"){if(s.data!==null){var q=l.indexOf("?");if(q!=-1){if(l.substring(l.length-1)!=="&"){l=l+"&"}}else{l=l+"?"}l=l+s.data}if(p||u){e=window.open(l);e.document.title=s.popupWindowTitle;window.focus()}else{if(b){window.location(l)}else{n=$("<iframe>").hide().attr("src",l).appendTo("body")}}}else{var h="";if(s.data!==null){$.each(s.data.replace(/\+/g," ").split("&"),function(){var x=this.split("=");var y=s.encodeHTMLEntities?g(decodeURIComponent(x[0])):decodeURIComponent(x[0]);if(!y){return}var z=x[1]||"";z=s.encodeHTMLEntities?g(decodeURIComponent(x[1])):decodeURIComponent(x[1]);h+='<input type="hidden" name="'+y+'" value="'+z+'" />'})}if(b){f=$("<form>").appendTo("body");f.hide().attr("method",s.httpMethod).attr("action",l).html(h)}else{if(p){e=window.open("about:blank");e.document.title=s.popupWindowTitle;t=e.document;window.focus()}else{n=$("<iframe style='display: none' src='about:blank'></iframe>").appendTo("body");t=a(n)}t.write("<html><head></head><body><form method='"+s.httpMethod+"' action='"+l+"'>"+h+"</form>"+s.popupWindowTitle+"</body></html>");f=$(t).find("form")}f.submit()}setTimeout(k,s.checkInterval);function k(){if(document.cookie.indexOf(s.cookieName+"="+s.cookieValue)!=-1){j.onSuccess(l);var y=new Date(1000);document.cookie=s.cookieName+"=; expires="+y.toUTCString()+"; path="+s.cookiePath;m(false);return}if(e||n){try{var x;if(e){x=e.document}else{x=a(n)}if(x&&x.body!=null&&x.body.innerHTML.length>0){var B=true;if(f&&f.length>0){var z=$(x.body).contents().first();if(z.length>0&&z[0]===f[0]){B=false}}if(B){j.onFail(x.body.innerHTML,l);m(true);return}}}catch(A){j.onFail("",l);m(true);return}}setTimeout(k,s.checkInterval)}function a(x){var y=x[0].contentWindow||x[0].contentDocument;if(y.document){y=y.document}return y}function m(x){setTimeout(function(){if(e){if(u){e.close()}if(p){if(x){e.focus();e.close()}else{e.focus()}}}},0)}function g(x){return x.replace(/&/gm,"&amp;").replace(/\n/gm,"&#10;").replace(/\r/gm,"&#13;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;").replace(/'/gm,"&apos;")}}});(function(a){a.widget("blueimp.fileupload",{options:{namespace:undefined,dropZone:a(document),fileInput:undefined,replaceFileInput:true,paramName:undefined,singleFileUploads:true,limitMultiFileUploads:undefined,sequentialUploads:false,limitConcurrentUploads:undefined,forceIframeTransport:false,postMessage:undefined,multipart:true,maxChunkSize:undefined,uploadedBytes:undefined,recalculateProgress:true,formData:function(b){return b.serializeArray()},add:function(d,b){b.submit()},processData:false,contentType:false,cache:false},_refreshOptionsList:["namespace","dropZone","fileInput"],_isXHRUpload:function(b){var d="undefined";return !b.forceIframeTransport&&typeof XMLHttpRequestUpload!==d&&typeof File!==d&&(!b.multipart||typeof FormData!==d)},_getFormData:function(b){var d;if(typeof b.formData==="function"){return b.formData(b.form)}else{if(a.isArray(b.formData)){return b.formData}else{if(b.formData){d=[];a.each(b.formData,function(e,f){d.push({name:e,value:f})});return d}}}return[]},_getTotal:function(d){var b=0;a.each(d,function(e,f){b+=f.size||1});return b},_onProgress:function(g,f){if(g.originalEvent.lengthComputable){var d=f.total||this._getTotal(f.files),b=parseInt(g.originalEvent.loaded/g.originalEvent.total*(f.chunkSize||d),10)+(f.uploadedBytes||0);this._loaded+=b-(f.loaded||f.uploadedBytes||0);f.lengthComputable=true;f.loaded=b;f.total=d;this._trigger("progress",g,f);this._trigger("progressall",g,{lengthComputable:true,loaded:this._loaded,total:this._total})}},_initProgressListener:function(b){var d=this,e=b.xhr?b.xhr():a.ajaxSettings.xhr();if(e.upload){a(e.upload).bind("progress",function(f){d._onProgress(f,b)});b.xhr=function(){return e}}},_initXHRData:function(b){var e,d=b.files[0];if(!b.multipart||b.blob){b.headers=a.extend(b.headers,{"X-File-Name":d.name,"X-File-Type":d.type,"X-File-Size":d.size});if(!b.blob){b.contentType=d.type;b.data=d}else{if(!b.multipart){b.contentType="application/octet-stream";b.data=b.blob}}}if(b.multipart&&typeof FormData!=="undefined"){if(b.postMessage){e=this._getFormData(b);if(b.blob){e.push({name:b.paramName,value:b.blob})}else{a.each(b.files,function(f,g){e.push({name:b.paramName,value:g})})}}else{if(b.formData instanceof FormData){e=b.formData}else{e=new FormData();a.each(this._getFormData(b),function(f,g){e.append(g.name,g.value)})}if(b.blob){e.append(b.paramName,b.blob)}else{a.each(b.files,function(f,g){if(g instanceof Blob){e.append(b.paramName,g)}})}}b.data=e}b.blob=null},_initIframeSettings:function(b){b.dataType="iframe "+(b.dataType||"");b.formData=this._getFormData(b)},_initDataSettings:function(b){if(this._isXHRUpload(b)){if(!this._chunkedUpload(b,true)){if(!b.data){this._initXHRData(b)}this._initProgressListener(b)}if(b.postMessage){b.dataType="postmessage "+(b.dataType||"")}}else{this._initIframeSettings(b,"iframe")}},_initFormSettings:function(b){if(!b.form||!b.form.length){b.form=a(b.fileInput.prop("form"))}if(!b.paramName){b.paramName=b.fileInput.prop("name")||"files[]"}if(!b.url){b.url=b.form.prop("action")||location.href}b.type=(b.type||b.form.prop("method")||"").toUpperCase();if(b.type!=="POST"&&b.type!=="PUT"){b.type="POST"}},_getAJAXSettings:function(d){var b=a.extend({},this.options,d);this._initFormSettings(b);this._initDataSettings(b);return b},_enhancePromise:function(b){b.success=b.done;b.error=b.fail;b.complete=b.always;return b},_getXHRPromise:function(f,e,d){var b=a.Deferred(),g=b.promise();e=e||this.options.context||g;if(f===true){b.resolveWith(e,d)}else{if(f===false){b.rejectWith(e,d)}}g.abort=b.promise;return this._enhancePromise(g)},_chunkedUpload:function(p,k){var j=this,g=p.files[0],h=g.size,b=p.uploadedBytes=p.uploadedBytes||0,f=p.maxChunkSize||h,m=g.webkitSlice||g.mozSlice||g.slice,o,d,l,e;if(!(this._isXHRUpload(p)&&m&&(b||f<h))||p.data){return false}if(k){return true}if(b>=h){g.error="uploadedBytes";return this._getXHRPromise(false)}d=Math.ceil((h-b)/f);o=function(n){if(!n){return j._getXHRPromise(true)}return o(n-=1).pipe(function(){var q=a.extend({},p);q.blob=m.call(g,b+n*f,b+(n+1)*f);q.chunkSize=q.blob.size;j._initXHRData(q);j._initProgressListener(q);l=(a.ajax(q)||j._getXHRPromise(false,q.context)).done(function(){if(!q.loaded){j._onProgress(a.Event("progress",{lengthComputable:true,loaded:q.chunkSize,total:q.chunkSize}),q)}p.uploadedBytes=q.uploadedBytes+=q.chunkSize});return l})};e=o(d);e.abort=function(){return l.abort()};return this._enhancePromise(e)},_beforeSend:function(d,b){if(this._active===0){this._trigger("start")}this._active+=1;this._loaded+=b.uploadedBytes||0;this._total+=this._getTotal(b.files)},_onDone:function(b,f,e,d){if(!this._isXHRUpload(d)){this._onProgress(a.Event("progress",{lengthComputable:true,loaded:1,total:1}),d)}d.result=b;d.textStatus=f;d.jqXHR=e;this._trigger("done",null,d)},_onFail:function(d,f,e,b){b.jqXHR=d;b.textStatus=f;b.errorThrown=e;this._trigger("fail",null,b);if(b.recalculateProgress){this._loaded-=b.loaded||b.uploadedBytes||0;this._total-=b.total||this._getTotal(b.files)}},_onAlways:function(e,f,d,b){this._active-=1;b.textStatus=f;if(d&&d.always){b.jqXHR=d;b.result=e}else{b.jqXHR=e;b.errorThrown=d}this._trigger("always",null,b);if(this._active===0){this._trigger("stop");this._loaded=this._total=0}},_onSend:function(k,h){var g=this,f,l,d,b=g._getAJAXSettings(h),j=function(m,e){g._sending+=1;f=f||((m!==false&&g._trigger("send",k,b)!==false&&(g._chunkedUpload(b)||a.ajax(b)))||g._getXHRPromise(false,b.context,e)).done(function(n,p,o){g._onDone(n,p,o,b)}).fail(function(n,p,o){g._onFail(n,p,o,b)}).always(function(p,q,o){g._sending-=1;g._onAlways(p,q,o,b);if(b.limitConcurrentUploads&&b.limitConcurrentUploads>g._sending){var n=g._slots.shift();while(n){if(!n.isRejected()){n.resolve();break}n=g._slots.shift()}}});return f};this._beforeSend(k,b);if(this.options.sequentialUploads||(this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending)){if(this.options.limitConcurrentUploads>1){l=a.Deferred();this._slots.push(l);d=l.pipe(j)}else{d=(this._sequence=this._sequence.pipe(j,j))}d.abort=function(){var e=[undefined,"abort","abort"];if(!f){if(l){l.rejectWith(e)}return j(false,e)}return f.abort()};return this._enhancePromise(d)}return j()},_onAdd:function(l,j){var h=this,b=true,f=a.extend({},this.options,j),d=f.limitMultiFileUploads,k,g;if(!(f.singleFileUploads||d)||!this._isXHRUpload(f)){k=[j.files]}else{if(!f.singleFileUploads&&d){k=[];for(g=0;g<j.files.length;g+=d){k.push(j.files.slice(g,g+d))}}}j.originalFiles=j.files;a.each(k||j.files,function(e,m){var o=k?m:[m],n=a.extend({},j,{files:o});n.submit=function(){return(h._trigger("submit",l,n)!==false)&&h._onSend(l,n)};return(b=h._trigger("add",l,n))});return b},_normalizeFile:function(b,d){if(d.name===undefined&&d.size===undefined){d.name=d.fileName;d.size=d.fileSize}},_replaceFileInput:function(b){var d=b.clone(true);a("<form></form>").append(d)[0].reset();b.after(d).detach();a.cleanData(b.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(e,f){if(f===b[0]){return d[0]}return f});if(b[0]===this.element[0]){this.element=d}},_onChange:function(f){var b=f.data.fileupload,d={files:a.each(a.makeArray(f.target.files),b._normalizeFile),fileInput:a(f.target),form:a(f.target.form)};if(!d.files.length){d.files=[{name:f.target.value.replace(/^.*\\/,"")}]}if(b.options.replaceFileInput){b._replaceFileInput(d.fileInput)}if(b._trigger("change",f,d)===false||b._onAdd(f,d)===false){return false}},_onPaste:function(h){var d=h.data.fileupload,g=h.originalEvent.clipboardData,b=(g&&g.items)||[],f={files:[]};a.each(b,function(e,k){var j=k.getAsFile&&k.getAsFile();if(j){f.files.push(j)}});if(d._trigger("paste",h,f)===false||d._onAdd(h,f)===false){return false}},_onDrop:function(g){var b=g.data.fileupload,f=g.dataTransfer=g.originalEvent.dataTransfer,d={files:a.each(a.makeArray(f&&f.files),b._normalizeFile)};if(b._trigger("drop",g,d)===false||b._onAdd(g,d)===false){return false}g.preventDefault()},_onDragOver:function(f){var b=f.data.fileupload,d=f.dataTransfer=f.originalEvent.dataTransfer;if(b._trigger("dragover",f)===false){return false}if(d){d.dropEffect=d.effectAllowed="copy"}f.preventDefault()},_initEventHandlers:function(){var b=this.options.namespace||this.widgetName;this.options.dropZone.bind("dragover."+b,{fileupload:this},this._onDragOver).bind("drop."+b,{fileupload:this},this._onDrop).bind("paste."+b,{fileupload:this},this._onPaste);this.options.fileInput.bind("change."+b,{fileupload:this},this._onChange)},_destroyEventHandlers:function(){var b=this.options.namespace||this.widgetName;this.options.dropZone.unbind("dragover."+b,this._onDragOver).unbind("drop."+b,this._onDrop).unbind("paste."+b,this._onPaste);this.options.fileInput.unbind("change."+b,this._onChange)},_beforeSetOption:function(b,d){this._destroyEventHandlers()},_afterSetOption:function(d,e){var b=this.options;if(!b.fileInput){b.fileInput=a()}if(!b.dropZone){b.dropZone=a()}this._initEventHandlers()},_setOption:function(b,e){var d=a.inArray(b,this._refreshOptionsList)!==-1;if(d){this._beforeSetOption(b,e)}a.Widget.prototype._setOption.call(this,b,e);if(d){this._afterSetOption(b,e)}},_create:function(){var b=this.options;if(b.fileInput===undefined){b.fileInput=this.element.is("input:file")?this.element:this.element.find("input:file")}else{if(!b.fileInput){b.fileInput=a()}}if(!b.dropZone){b.dropZone=a()}this._slots=[];this._sequence=this._getXHRPromise(true);this._sending=this._active=this._loaded=this._total=0;this._initEventHandlers()},destroy:function(){this._destroyEventHandlers();a.Widget.prototype.destroy.call(this)},enable:function(){a.Widget.prototype.enable.call(this);this._initEventHandlers()},disable:function(){this._destroyEventHandlers();a.Widget.prototype.disable.call(this)},add:function(b){if(!b||this.options.disabled){return}b.files=a.each(a.makeArray(b.files),this._normalizeFile);this._onAdd(null,b)},send:function(b){if(b&&!this.options.disabled){b.files=a.each(a.makeArray(b.files),this._normalizeFile);if(b.files.length){return this._onSend(null,b)}}return this._getXHRPromise(false,b&&b.context)}})}(jQuery));(function(a){a.widget("blueimpUI.fileupload",a.blueimp.fileupload,{options:{autoUpload:false,maxNumberOfFiles:undefined,maxFileSize:undefined,minFileSize:1,acceptFileTypes:/.+$/i,previewFileTypes:/^image\/(gif|jpeg|png)$/,previewMaxWidth:80,previewMaxHeight:80,previewAsCanvas:true,uploadTemplate:a("#template-upload"),downloadTemplate:a("#template-download"),dataType:"json",add:function(f,d){var b=a(this).data("fileupload");b._adjustMaxNumberOfFiles(-d.files.length);d.isAdjusted=true;d.isValidated=b._validate(d.files);d.context=b._renderUpload(d.files).appendTo(a(this).find(".files")).fadeIn(function(){a(this).show()}).data("data",d);if((b.options.autoUpload||d.autoUpload)&&d.isValidated){d.jqXHR=d.submit()}},send:function(f,d){if(!d.isValidated){var b=a(this).data("fileupload");if(!d.isAdjusted){b._adjustMaxNumberOfFiles(-d.files.length)}if(!b._validate(d.files)){return false}}if(d.context&&d.dataType&&d.dataType.substr(0,6)==="iframe"){d.context.find(".ui-progressbar").progressbar("value",parseInt(100,10))}},done:function(f,d){var b=a(this).data("fileupload");if(d.context){d.context.each(function(e){var g=(a.isArray(d.result)&&d.result[e])||{error:"emptyResult"};if(g.error){b._adjustMaxNumberOfFiles(1)}a(this).fadeOut(function(){b._renderDownload([g]).css("display","none").replaceAll(this).fadeIn(function(){a(this).show()})})})}else{b._renderDownload(d.result).css("display","none").appendTo(a(this).find(".files")).fadeIn(function(){a(this).show()})}},fail:function(f,d){var b=a(this).data("fileupload");b._adjustMaxNumberOfFiles(d.files.length);if(d.context){d.context.each(function(e){a(this).fadeOut(function(){if(d.errorThrown!=="abort"){var g=d.files[e];g.error=g.error||d.errorThrown||true;b._renderDownload([g]).css("display","none").replaceAll(this).fadeIn(function(){a(this).show()})}else{d.context.remove()}})})}else{if(d.errorThrown!=="abort"){b._adjustMaxNumberOfFiles(-d.files.length);d.context=b._renderUpload(d.files).css("display","none").appendTo(a(this).find(".files")).fadeIn(function(){a(this).show()}).data("data",d)}}},progress:function(d,b){if(b.context){b.context.find(".ui-progressbar").progressbar("value",parseInt(b.loaded/b.total*100,10))}},progressall:function(d,b){a(this).find(".fileupload-progressbar").progressbar("value",parseInt(b.loaded/b.total*100,10))},start:function(){a(this).find(".fileupload-progressbar").progressbar("value",0).fadeIn()},stop:function(){a(this).find(".fileupload-progressbar").fadeOut()},destroy:function(f,d){var b=a(this).data("fileupload");if(d.url){a.ajax(d).success(function(){b._adjustMaxNumberOfFiles(1);a(this).fadeOut(function(){a(this).remove()})})}else{b._adjustMaxNumberOfFiles(1);d.context.fadeOut(function(){a(this).remove()})}}},_scaleImage:function(b,e){e=e||{};var d=document.createElement("canvas"),f=Math.min((e.maxWidth||b.width)/b.width,(e.maxHeight||b.height)/b.height);if(f>=1){f=Math.max((e.minWidth||b.width)/b.width,(e.minHeight||b.height)/b.height)}b.width=parseInt(b.width*f,10);b.height=parseInt(b.height*f,10);if(!e.canvas||!d.getContext){return b}d.width=b.width;d.height=b.height;d.getContext("2d").drawImage(b,0,0,b.width,b.height);return d},_createObjectURL:function(b){var e="undefined",d=(typeof window.createObjectURL!==e&&window)||(typeof URL!==e&&URL)||(typeof webkitURL!==e&&webkitURL);return d?d.createObjectURL(b):false},_revokeObjectURL:function(b){var e="undefined",d=(typeof window.revokeObjectURL!==e&&window)||(typeof URL!==e&&URL)||(typeof webkitURL!==e&&webkitURL);return d?d.revokeObjectURL(b):false},_loadFile:function(d,e){if(typeof FileReader!=="undefined"&&FileReader.prototype.readAsDataURL){var b=new FileReader();b.onload=function(f){e(f.target.result)};b.readAsDataURL(d);return true}return false},_loadImage:function(f,h,e){var g=this,d,b;if(!e||!e.fileTypes||e.fileTypes.test(f.type)){d=this._createObjectURL(f);b=a("<img>").bind("load",function(){a(this).unbind("load");g._revokeObjectURL(d);h(g._scaleImage(b[0],e))});if(d){b.prop("src",d);return true}else{return this._loadFile(f,function(j){b.prop("src",j)})}}return false},_enableDragToDesktop:function(){var f=a(this),d=f.prop("href"),b=decodeURIComponent(d.split("/").pop()).replace(/:/g,"-"),e="application/octet-stream";f.bind("dragstart",function(h){try{h.originalEvent.dataTransfer.setData("DownloadURL",[e,b,d].join(":"))}catch(g){}})},_adjustMaxNumberOfFiles:function(b){if(typeof this.options.maxNumberOfFiles==="number"){this.options.maxNumberOfFiles+=b;if(this.options.maxNumberOfFiles<1){this._disableFileInputButton()}else{this._enableFileInputButton()}}},_formatFileSize:function(b){if(typeof b.size!=="number"){return""}if(b.size>=1000000000){return(b.size/1000000000).toFixed(2)+" GB"}if(b.size>=1000000){return(b.size/1000000).toFixed(2)+" MB"}return(b.size/1000).toFixed(2)+" KB"},_hasError:function(b){if(b.error){return b.error}if(this.options.maxNumberOfFiles<0){return"maxNumberOfFiles"}if(!(this.options.acceptFileTypes.test(b.type)||this.options.acceptFileTypes.test(b.name))){return"acceptFileTypes"}if(this.options.maxFileSize&&b.size>this.options.maxFileSize){return"maxFileSize"}if(typeof b.size==="number"&&b.size<this.options.minFileSize){return"minFileSize"}return null},_validate:function(e){var d=this,b=!!e.length;a.each(e,function(f,g){g.error=d._hasError(g);if(g.error){b=false}});return b},_uploadTemplateHelper:function(b){b.sizef=this._formatFileSize(b);return b},_renderUploadTemplate:function(d){var b=this;return a.tmpl(this.options.uploadTemplate,a.map(d,function(e){return b._uploadTemplateHelper(e)}))},_renderUpload:function(g){var f=this,e=this.options,d=this._renderUploadTemplate(g),b=this._validate(g);if(!(d instanceof a)){return a()}d.css("display","none");d.find(".progress div").slice(b?1:0).remove().end().first().progressbar();d.find(".start button").slice(this.options.autoUpload||!b?0:1).remove().end().first().button({text:false,icons:{primary:"ui-icon-circle-arrow-e"}});d.find(".cancel button").slice(1).remove().end().first().button({text:false,icons:{primary:"ui-icon-cancel"}});d.find(".preview").each(function(h,j){f._loadImage(g[h],function(k){a(k).hide().appendTo(j).fadeIn()},{maxWidth:e.previewMaxWidth,maxHeight:e.previewMaxHeight,fileTypes:e.previewFileTypes,canvas:e.previewAsCanvas})});return d},_downloadTemplateHelper:function(b){b.sizef=this._formatFileSize(b);return b},_renderDownloadTemplate:function(d){var b=this;return a.tmpl(this.options.downloadTemplate,a.map(d,function(e){return b._downloadTemplateHelper(e)}))},_renderDownload:function(d){var b=this._renderDownloadTemplate(d);if(!(b instanceof a)){return a()}b.css("display","none");b.find(".delete button").button({text:false,icons:{primary:"ui-icon-trash"}});b.find("a").each(this._enableDragToDesktop);return b},_startHandler:function(f){f.preventDefault();var b=a(this).closest(".template-upload"),d=b.data("data");if(d&&d.submit&&!d.jqXHR){d.jqXHR=d.submit();if(d.jqXHR){a(this).fadeOut()}}},_cancelHandler:function(f){f.preventDefault();var b=a(this).closest(".template-upload"),d=b.data("data")||{};if(!d.jqXHR){d.errorThrown="abort";f.data.fileupload._trigger("fail",f,d)}else{d.jqXHR.abort()}},_deleteHandler:function(d){d.preventDefault();var b=a(this);d.data.fileupload._trigger("destroy",d,{context:b.closest(".template-download"),url:b.attr("data-url"),type:b.attr("data-type"),dataType:d.data.fileupload.options.dataType})},_initEventHandlers:function(){a.blueimp.fileupload.prototype._initEventHandlers.call(this);var b={fileupload:this};this.element.find(".files").delegate(".start button","click."+this.options.namespace,b,this._startHandler).delegate(".cancel button","click."+this.options.namespace,b,this._cancelHandler).delegate(".delete button","click."+this.options.namespace,b,this._deleteHandler)},_destroyEventHandlers:function(){this.element.find(".files").undelegate(".start button","click."+this.options.namespace).undelegate(".cancel button","click."+this.options.namespace).undelegate(".delete button","click."+this.options.namespace);a.blueimp.fileupload.prototype._destroyEventHandlers.call(this)},_initFileUploadButtonBar:function(){var d=this.element.find(".fileupload-buttonbar"),e=this.element.find(".files"),b=this.options.namespace;d.addClass("ui-widget-header ui-corner-top");this.element.find(".fileinput-button").each(function(){var f=a(this).find("input:file").detach();a(this).button({icons:{primary:"ui-icon-plusthick"}}).append(f)});d.find(".start").button({icons:{primary:"ui-icon-circle-arrow-e"}}).bind("click."+b,function(f){f.preventDefault();e.find(".start button").click()});d.find(".cancel").button({icons:{primary:"ui-icon-cancel"}}).bind("click."+b,function(f){f.preventDefault();e.find(".cancel button").click()});d.find(".delete").button({icons:{primary:"ui-icon-trash"}}).bind("click."+b,function(f){f.preventDefault();e.find(".delete input:checked").siblings("button").click()});d.find(".toggle").bind("change."+b,function(f){e.find(".delete input").prop("checked",a(this).is(":checked"))})},_destroyFileUploadButtonBar:function(){this.element.find(".fileupload-buttonbar").removeClass("ui-widget-header ui-corner-top");this.element.find(".fileinput-button").each(function(){var b=a(this).find("input:file").detach();a(this).button("destroy").append(b)});this.element.find(".fileupload-buttonbar button").unbind("click."+this.options.namespace).button("destroy");this.element.find(".fileupload-buttonbar .toggle").unbind("change."+this.options.namespace)},_enableFileInputButton:function(){this.element.find(".fileinput-button input:file:disabled").each(function(){var d=a(this),b=d.parent();d.detach().prop("disabled",false);b.button("enable").append(d)})},_disableFileInputButton:function(){this.element.find(".fileinput-button input:file:enabled").each(function(){var d=a(this),b=d.parent();d.detach().prop("disabled",true);b.button("disable").append(d)})},_initTemplates:function(){if(this.options.uploadTemplate instanceof a&&!this.options.uploadTemplate.length){this.options.uploadTemplate=a(this.options.uploadTemplate.selector)}if(this.options.downloadTemplate instanceof a&&!this.options.downloadTemplate.length){this.options.downloadTemplate=a(this.options.downloadTemplate.selector)}},_create:function(){a.blueimp.fileupload.prototype._create.call(this);this._initTemplates();this.element.addClass("ui-widget");this._initFileUploadButtonBar();this.element.find(".fileupload-content").addClass("ui-widget-content ui-corner-bottom");this.element.find(".fileupload-progressbar").hide().progressbar()},destroy:function(){this.element.find(".fileupload-progressbar").progressbar("destroy");this.element.find(".fileupload-content").removeClass("ui-widget-content ui-corner-bottom");this._destroyFileUploadButtonBar();this.element.removeClass("ui-widget");a.blueimp.fileupload.prototype.destroy.call(this)},enable:function(){a.blueimp.fileupload.prototype.enable.call(this);this.element.find(":ui-button").not(".fileinput-button").button("enable");this._enableFileInputButton()},disable:function(){this.element.find(":ui-button").not(".fileinput-button").button("disable");this._disableFileInputButton();a.blueimp.fileupload.prototype.disable.call(this)}})}(jQuery));
/*
 * jQuery Form Plugin
 * version: 2.93 (30-NOV-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *	http://www.opensource.org/licenses/mit-license.php
 *	http://www.gnu.org/licenses/gpl.html
 */
(function(b){b.fn.ajaxSubmit=function(e){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}var d,w,g,j=this;if(typeof e=="function"){e={success:e}}d=this.attr("method");w=this.attr("action");g=(typeof w==="string")?b.trim(w):"";g=g||window.location.href||"";if(g){g=(g.match(/^([^#]+)/)||[])[1]}e=b.extend(true,{url:g,success:b.ajaxSettings.success,type:d||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},e);var p={};this.trigger("form-pre-serialize",[this,e,p]);if(p.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(e.beforeSerialize&&e.beforeSerialize(this,e)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var h=e.traditional;if(h===undefined){h=b.ajaxSettings.traditional}var z,u,l,A=this.formToArray(e.semantic);if(e.data){e.extraData=e.data;z=b.param(e.data,h)}if(e.beforeSubmit&&e.beforeSubmit(A,this,e)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[A,this,e,p]);if(p.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var t=b.param(A,h);if(z){t=(t?(t+"&"+z):z)}if(e.type.toUpperCase()=="GET"){e.url+=(e.url.indexOf("?")>=0?"&":"?")+t;e.data=null}else{e.data=t}var C=[];if(e.resetForm){C.push(function(){j.resetForm()})}if(e.clearForm){C.push(function(){j.clearForm(e.includeHidden)})}if(!e.dataType&&e.target){var f=e.success||function(){};C.push(function(q){var n=e.replaceTarget?"replaceWith":"html";b(e.target)[n](q).each(f,arguments)})}else{if(e.success){C.push(e.success)}}e.success=function(E,q,F){var D=e.context||e;for(var v=0,n=C.length;v<n;v++){C[v].apply(D,[E,q,F||j,j])}};var y=b("input:file:enabled[value]",this);var k=y.length>0;var x="multipart/form-data";var s=(j.attr("enctype")==x||j.attr("encoding")==x);var r=!!(k&&y.get(0).files&&window.FormData);a("fileAPI :"+r);var m=(k||s)&&!r;if(e.iframe!==false&&(e.iframe||m)){if(e.closeKeepAlive){b.get(e.closeKeepAlive,function(){B(A)})}else{B(A)}}else{if((k||s)&&r){e.progress=e.progress||b.noop;o(A)}else{b.ajax(e)}}this.trigger("form-submit-notify",[this,e]);return this;function o(v){var n=new FormData();for(var E=0;E<v.length;E++){if(v[E].type=="file"){continue}n.append(v[E].name,v[E].value)}j.find("input:file:enabled").each(function(){var F=b(this).attr("name"),H=this.files;if(F){for(var G=0;G<H.length;G++){n.append(F,H[G])}}});if(e.extraData){for(var D in e.extraData){n.append(D,e.extraData[D])}}e.data=null;var q=e.beforeSend;e.beforeSend=function(G,F){F.data=n;if(G.upload){G.upload.onprogress=function(H){F.progress(H.position,H.total)}}if(q){q.call(F,G,F)}};b.ajax(e)}function B(ab){var G=j[0],F,X,R,Z,U,I,M,K,L,V,Y,P;var J=!!b.fn.prop;if(ab){if(J){for(X=0;X<ab.length;X++){F=b(G[ab[X].name]);F.prop("disabled",false)}}else{for(X=0;X<ab.length;X++){F=b(G[ab[X].name]);F.removeAttr("disabled")}}}if(b(":input[name=submit],:input[id=submit]",G).length){alert('Error: Form elements must not have name or id of "submit".');return}R=b.extend(true,{},b.ajaxSettings,e);R.context=R.context||R;U="jqFormIO"+(new Date().getTime());if(R.iframeTarget){I=b(R.iframeTarget);V=I.attr("name");if(V==null){I.attr("name",U)}else{U=V}}else{I=b('<iframe name="'+U+'" src="'+R.iframeSrc+'" />');I.css({position:"absolute",top:"-1000px",left:"-1000px"})}M=I[0];K={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(n){var ae=(n==="timeout"?"timeout":"aborted");a("aborting upload... "+ae);this.aborted=1;I.attr("src",R.iframeSrc);K.error=ae;R.error&&R.error.call(R.context,K,ae,n);Z&&b.event.trigger("ajaxError",[K,R,ae]);R.complete&&R.complete.call(R.context,K,ae)}};Z=R.global;if(Z&&!b.active++){b.event.trigger("ajaxStart")}if(Z){b.event.trigger("ajaxSend",[K,R])}if(R.beforeSend&&R.beforeSend.call(R.context,K,R)===false){if(R.global){b.active--}return}if(K.aborted){return}L=G.clk;if(L){V=L.name;if(V&&!L.disabled){R.extraData=R.extraData||{};R.extraData[V]=L.value;if(L.type=="image"){R.extraData[V+".x"]=G.clk_x;R.extraData[V+".y"]=G.clk_y}}}var Q=1;var N=2;function O(ae){var n=ae.contentWindow?ae.contentWindow.document:ae.contentDocument?ae.contentDocument:ae.document;return n}var E=b("meta[name=csrf-token]").attr("content");var D=b("meta[name=csrf-param]").attr("content");if(D&&E){R.extraData=R.extraData||{};R.extraData[D]=E}function W(){var ag=j.attr("target"),ae=j.attr("action");G.setAttribute("target",U);if(!d){G.setAttribute("method","POST")}if(ae!=R.url){G.setAttribute("action",R.url)}if(!R.skipEncodingOverride&&(!d||/post/i.test(d))){j.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(R.timeout){P=setTimeout(function(){Y=true;T(Q)},R.timeout)}function ah(){try{var n=O(M).readyState;a("state = "+n);if(n.toLowerCase()=="uninitialized"){setTimeout(ah,50)}}catch(aj){a("Server abort: ",aj," (",aj.name,")");T(N);P&&clearTimeout(P);P=undefined}}var af=[];try{if(R.extraData){for(var ai in R.extraData){af.push(b('<input type="hidden" name="'+ai+'">').attr("value",R.extraData[ai]).appendTo(G)[0])}}if(!R.iframeTarget){I.appendTo("body");M.attachEvent?M.attachEvent("onload",T):M.addEventListener("load",T,false)}setTimeout(ah,15);G.submit()}finally{G.setAttribute("action",ae);if(ag){G.setAttribute("target",ag)}else{j.removeAttr("target")}b(af).remove()}}if(R.forceSync){W()}else{setTimeout(W,10)}var ac,ad,aa=50,H;function T(ah){if(K.aborted||H){return}try{ad=O(M)}catch(ak){a("cannot access response document: ",ak);ah=N}if(ah===Q&&K){K.abort("timeout");return}else{if(ah==N&&K){K.abort("server abort");return}}if(!ad||ad.location.href==R.iframeSrc){if(!Y){return}}M.detachEvent?M.detachEvent("onload",T):M.removeEventListener("load",T,false);var ag="success",aj;try{if(Y){throw"timeout"}var af=R.dataType=="xml"||ad.XMLDocument||b.isXMLDoc(ad);a("isXml="+af);if(!af&&window.opera&&(ad.body==null||ad.body.innerHTML=="")){if(--aa){a("requeing onLoad callback, DOM not available");setTimeout(T,250);return}}var al=ad.body?ad.body:ad.documentElement;K.responseText=al?al.innerHTML:null;K.responseXML=ad.XMLDocument?ad.XMLDocument:ad;if(af){R.dataType="xml"}K.getResponseHeader=function(aq){var ap={"content-type":R.dataType};return ap[aq]};if(al){K.status=Number(al.getAttribute("status"))||K.status;K.statusText=al.getAttribute("statusText")||K.statusText}var n=(R.dataType||"").toLowerCase();var ai=/(json|script|text)/.test(n);if(ai||R.textarea){var ao,an;try{ao=b(b(ad).text());an=ao.is("textarea")}catch(ah){an=false}if(an){K.responseText=ao.text();K.status=Number(ao.attr("status"))||K.status;K.statusText=ao.attr("statusText")||K.statusText}else{if(ai){var ae=ad.getElementsByTagName("pre")[0];var am=ad.getElementsByTagName("body")[0];if(ae){K.responseText=ae.textContent?ae.textContent:ae.innerText}else{if(am){K.responseText=am.textContent?am.textContent:am.innerText}}}}}else{if(n=="xml"&&!K.responseXML&&K.responseText!=null){K.responseXML=S(K.responseText)}}try{ac=q(K,n,R)}catch(ah){ag="parsererror";K.error=aj=(ah||ag)}}catch(ah){a("error caught: ",ah);ag="error";K.error=aj=(ah||ag)}if(K.aborted){a("upload aborted");ag=null}if(K.status){ag=(K.status>=200&&K.status<300||K.status===304)?"success":"error"}if(ag==="success"){R.success&&R.success.call(R.context,ac,"success",K);Z&&b.event.trigger("ajaxSuccess",[K,R])}else{if(ag){if(aj==undefined){aj=K.statusText}R.error&&R.error.call(R.context,K,ag,aj);Z&&b.event.trigger("ajaxError",[K,R,aj])}}Z&&b.event.trigger("ajaxComplete",[K,R]);if(Z&&!--b.active){b.event.trigger("ajaxStop")}R.complete&&R.complete.call(R.context,K,ag);H=true;if(R.timeout){clearTimeout(P)}setTimeout(function(){if(!R.iframeTarget){I.remove()}K.responseXML=null},100)}var S=b.parseXML||function(n,ae){if(window.ActiveXObject){ae=new ActiveXObject("Microsoft.XMLDOM");ae.async="false";ae.loadXML(n)}else{ae=(new DOMParser()).parseFromString(n,"text/xml")}return(ae&&ae.documentElement&&ae.documentElement.nodeName!="parsererror")?ae:null};var v=b.parseJSON||function(n){return window["eval"]("("+n+")")};var q=function(ai,ag,af){var ae=ai.getResponseHeader("content-type")||"",n=ag==="xml"||!ag&&ae.indexOf("xml")>=0,ah=n?ai.responseXML:ai.responseText;if(n&&ah.documentElement.nodeName==="parsererror"){b.error&&b.error("parsererror")}if(af&&af.dataFilter){ah=af.dataFilter(ah,ag)}if(typeof ah==="string"){if(ag==="json"||!ag&&ae.indexOf("json")>=0){ah=v(ah)}else{if(ag==="script"||!ag&&ae.indexOf("javascript")>=0){b.globalEval(ah)}}}return ah}}};b.fn.ajaxForm=function(d){if(this.length===0){var e={s:this.selector,c:this.context};if(!b.isReady&&e.s){a("DOM not ready, queuing ajaxForm");b(function(){b(e.s,e.c).ajaxForm(d)});return this}a("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();b(this).ajaxSubmit(d)}}).bind("click.form-plugin",function(k){var j=k.target;var g=b(j);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length==0){return}j=f[0]}var h=this;h.clk=j;if(j.type=="image"){if(k.offsetX!=undefined){h.clk_x=k.offsetX;h.clk_y=k.offsetY}else{if(typeof b.fn.offset=="function"){var l=g.offset();h.clk_x=k.pageX-l.left;h.clk_y=k.pageY-l.top}else{h.clk_x=k.pageX-j.offsetLeft;h.clk_y=k.pageY-j.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(r){var q=[];if(this.length===0){return q}var e=this[0];var h=r?e.getElementsByTagName("*"):e.elements;if(!h){return q}var l,k,g,s,f,o,d;for(l=0,o=h.length;l<o;l++){f=h[l];g=f.name;if(!g){continue}if(r&&e.clk&&f.type=="image"){if(!f.disabled&&e.clk==f){q.push({name:g,value:b(f).val(),type:f.type});q.push({name:g+".x",value:e.clk_x},{name:g+".y",value:e.clk_y})}continue}s=b.fieldValue(f,true);if(s&&s.constructor==Array){for(k=0,d=s.length;k<d;k++){q.push({name:g,value:s[k]})}}else{if(s!==null&&typeof s!="undefined"){q.push({name:g,value:s,type:f.type})}}}if(!r&&e.clk){var m=b(e.clk),p=m[0];g=p.name;if(g&&!p.disabled&&p.type=="image"){q.push({name:g,value:m.val()});q.push({name:g+".x",value:e.clk_x},{name:g+".y",value:e.clk_y})}}return q};b.fn.formSerialize=function(d){return b.param(this.formToArray(d))};b.fn.fieldSerialize=function(e){var d=[];this.each(function(){var j=this.name;if(!j){return}var g=b.fieldValue(this,e);if(g&&g.constructor==Array){for(var h=0,f=g.length;h<f;h++){d.push({name:j,value:g[h]})}}else{if(g!==null&&typeof g!="undefined"){d.push({name:this.name,value:g})}}});return b.param(d)};b.fn.fieldValue=function(j){for(var h=[],f=0,d=this.length;f<d;f++){var g=this[f];var e=b.fieldValue(g,j);if(e===null||typeof e=="undefined"||(e.constructor==Array&&!e.length)){continue}e.constructor==Array?b.merge(h,e):h.push(e)}return h};b.fieldValue=function(d,k){var f=d.name,q=d.type,r=d.tagName.toLowerCase();if(k===undefined){k=true}if(k&&(!f||d.disabled||q=="reset"||q=="button"||(q=="checkbox"||q=="radio")&&!d.checked||(q=="submit"||q=="image")&&d.form&&d.form.clk!=d||r=="select"&&d.selectedIndex==-1)){return null}if(r=="select"){var l=d.selectedIndex;if(l<0){return null}var o=[],e=d.options;var h=(q=="select-one");var m=(h?l+1:e.length);for(var g=(h?l:0);g<m;g++){var j=e[g];if(j.selected){var p=j.value;if(!p){p=(j.attributes&&j.attributes.value&&!(j.attributes.value.specified))?j.text:j.value}if(h){return p}o.push(p)}}return o}return b(d).val()};b.fn.clearForm=function(d){return this.each(function(){b("input,select,textarea",this).clearFields(d)})};b.fn.clearFields=b.fn.clearInputs=function(d){var e=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var g=this.type,f=this.tagName.toLowerCase();if(e.test(g)||f=="textarea"||(d&&/hidden/.test(g))){this.value=""}else{if(g=="checkbox"||g=="radio"){this.checked=false}else{if(f=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(d){if(d===undefined){d=true}return this.each(function(){this.disabled=!d})};b.fn.selected=function(d){if(d===undefined){d=true}return this.each(function(){var e=this.type;if(e=="checkbox"||e=="radio"){this.checked=d}else{if(this.tagName.toLowerCase()=="option"){var f=b(this).parent("select");if(d&&f[0]&&f[0].type=="select-one"){f.find("option").selected(false)}this.selected=d}}})};b.fn.ajaxSubmit.debug=false;function a(){if(!b.fn.ajaxSubmit.debug){return}var d="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(d)}else{if(window.opera&&window.opera.postError){window.opera.postError(d)}}}})(jQuery);(function(b){var a=0;b.ajaxTransport("iframe",function(d){if(d.async&&(d.type==="POST"||d.type==="GET")){var f,e;return{send:function(g,h){f=b('<form style="display:none;"></form>');e=b('<iframe src="javascript:false;" name="iframe-transport-'+(a+=1)+'"></iframe>').bind("load",function(){var j;e.unbind("load").bind("load",function(){var k;try{k=e.contents();if(!k.length||!k[0].firstChild){throw new Error()}}catch(l){k=undefined}h(200,"success",{iframe:k});b('<iframe src="javascript:false;"></iframe>').appendTo(f);f.remove()});f.prop("target",e.prop("name")).prop("action",d.url).prop("method",d.type);if(d.formData){b.each(d.formData,function(k,l){b('<input type="hidden"/>').prop("name",l.name).val(l.value).appendTo(f)})}if(d.fileInput&&d.fileInput.length&&d.type==="POST"){j=d.fileInput.clone();d.fileInput.after(function(k){return j[k]});if(d.paramName){d.fileInput.each(function(){b(this).prop("name",d.paramName)})}f.append(d.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")}f.submit();if(j&&j.length){d.fileInput.each(function(l,k){var m=b(j[l]);b(k).prop("name",m.prop("name"));m.replaceWith(k)})}});f.append(e).appendTo(document.body)},abort:function(){if(e){e.unbind("load").prop("src","javascript".concat(":false;"))}if(f){f.remove()}}}}});b.ajaxSetup({converters:{"iframe text":function(d){return d.find("body").text()},"iframe json":function(d){return b.parseJSON(d.find("body").text())},"iframe html":function(d){return d.find("body").html()},"iframe script":function(d){return b.globalEval(d.find("body").text())}}})}(jQuery));(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<o.length;i++){ret.push($.toJSON(o[i])||"null")}return"["+ret.join(",")+"]"}var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number"){name='"'+k+'"'}else{if(type=="string"){name=$.quoteString(k)}else{continue}}if(typeof o[k]=="function"){continue}var val=$.toJSON(o[k]);pairs.push(name+":"+val)}return"{"+pairs.join(", ")+"}"}};$.evalJSON=function(src){if(typeof(JSON)=="object"&&JSON.parse){return JSON.parse(src)}return eval("("+src+")")};$.secureEvalJSON=function(src){if(typeof(JSON)=="object"&&JSON.parse){return JSON.parse(src)}var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,"@");filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered)){return eval("("+src+")")}else{throw new SyntaxError("Error parsing JSON, source is not valid.")}};$.quoteString=function(string){if(string.match(_escapeable)){return'"'+string.replace(_escapeable,function(a){var c=_meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+string+'"'};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}})(jQuery);(function(a){a.fn.numeric=function(d,e){d=(d===false)?"":d||".";e=typeof e=="function"?e:function(){};var b=a(this);this.bind("paste",function(f){setTimeout(function(){var g=b.val();if(d===""){var h=/[^\d]/}else{var h=new RegExp("[^\\d"+d+"]")}if(h.test(g)){b.val("")}},0)});return this.data("numeric.decimal",d).data("numeric.callback",e).keypress(a.fn.numeric.keypress).blur(a.fn.numeric.blur)};a.fn.numeric.keypress=function(g){var b=a.data(this,"numeric.decimal");var d=g.charCode?g.charCode:g.keyCode?g.keyCode:0;if(d==13&&this.nodeName.toLowerCase()=="input"){return true}else{if(d==13){return false}}var f=false;if((g.ctrlKey&&d==97)||(g.ctrlKey&&d==65)){return true}if((g.ctrlKey&&d==120)||(g.ctrlKey&&d==88)){return true}if((g.ctrlKey&&d==99)||(g.ctrlKey&&d==67)){return true}if((g.ctrlKey&&d==122)||(g.ctrlKey&&d==90)){return true}if((g.ctrlKey&&d==118)||(g.ctrlKey&&d==86)||(g.shiftKey&&d==45)){return true}if(d<48||d>57){if(d==45&&this.value.length==0){return true}if(b&&d==b.charCodeAt(0)&&this.value.indexOf(b)!=-1){f=false}if(d!=8&&d!=9&&d!=13&&d!=35&&d!=36&&d!=37&&d!=39&&d!=46){f=false}else{if(typeof g.charCode!="undefined"){if(g.keyCode==g.which&&g.which!=0){f=true;if(g.which==46){f=false}}else{if(g.keyCode!=0&&g.charCode==0&&g.which==0){f=true}}}}if(b&&d==b.charCodeAt(0)){if(this.value.indexOf(b)==-1){f=true}else{f=false}}}else{f=true}return f};a.fn.numeric.blur=function(){var b=a.data(this,"numeric.decimal");var f=a.data(this,"numeric.callback");var e=a(this).val();if(e!=""){var d=new RegExp("^\\d+$|\\d*"+b+"\\d+");if(!d.exec(e)){f.apply(this)}}};a.fn.removeNumeric=function(){return this.data("numeric.decimal",null).data("numeric.callback",null).unbind("keypress",a.fn.numeric.keypress).unbind("blur",a.fn.numeric.blur)}})(jQuery);(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(h){var l=true,t=false,D=null,j,s,r,d,C={},m="ui-tooltip",f="ui-widget",g="ui-state-disabled",u="div.qtip."+m,n=m+"-default",E=m+"-focus",e=m+"-hover",z=m+"-fluid",q="-31000px",B="_replacedByqTip",p="oldtitle",o;function k(){k.history=k.history||[];k.history.push(arguments);if("object"===typeof console){var I=console[console.warn?"warn":"log"],H=Array.prototype.slice.call(arguments),G;if(typeof arguments[0]==="string"){H[0]="qTip2: "+H[0]}G=I.apply?I.apply(console,H):I(H)}}function a(H){var G;if(!H||"object"!==typeof H){return t}if(H.metadata===D||"object"!==typeof H.metadata){H.metadata={type:H.metadata}}if("content" in H){if(H.content===D||"object"!==typeof H.content||H.content.jquery){H.content={text:H.content}}G=H.content.text||t;if(!h.isFunction(G)&&((!G&&!G.attr)||G.length<1||("object"===typeof G&&!G.jquery))){H.content.text=t}if("title" in H.content){if(H.content.title===D||"object"!==typeof H.content.title){H.content.title={text:H.content.title}}G=H.content.title.text||t;if(!h.isFunction(G)&&((!G&&!G.attr)||G.length<1||("object"===typeof G&&!G.jquery))){H.content.title.text=t}}}if("position" in H){if(H.position===D||"object"!==typeof H.position){H.position={my:H.position,at:H.position}}}if("show" in H){if(H.show===D||"object"!==typeof H.show){if(H.show.jquery){H.show={target:H.show}}else{H.show={event:H.show}}}}if("hide" in H){if(H.hide===D||"object"!==typeof H.hide){if(H.hide.jquery){H.hide={target:H.hide}}else{H.hide={event:H.hide}}}}if("style" in H){if(H.style===D||"object"!==typeof H.style){H.style={classes:H.style}}}h.each(r,function(){if(this.sanitize){this.sanitize(H)}});return H}function A(ac,I,W,X){var V=this,R=document.body,O=m+"-"+W,J=0,ab=0,K=h(),S=".qtip-"+W,T,U;V.id=W;V.rendered=t;V.elements=T={target:ac};V.timers={img:{}};V.options=I;V.checks={};V.plugins={};V.cache=U={event:{},target:h(),disabled:t,attr:X,onTarget:t};function L(af){var ad=0,ah,ae=I,ag=af.split(".");while(ae=ae[ag[ad++]]){if(ad<ag.length){ah=ae}}return[ah||I,ag.pop()]}function aa(){var ad=I.style.widget;K.toggleClass(f,ad).toggleClass(n,I.style.def&&!ad);T.content.toggleClass(f+"-content",ad);if(T.titlebar){T.titlebar.toggleClass(f+"-header",ad)}if(T.button){T.button.toggleClass(m+"-icon",!ad)}}function G(ad){if(T.title){T.titlebar.remove();T.titlebar=T.title=T.button=D;if(ad!==t){V.reposition()}}}function Y(){var ae=I.content.title.button,ad=typeof ae==="string",af=ad?ae:"Close tooltip";if(T.button){T.button.remove()}if(ae.jquery){T.button=ae}else{T.button=h("<a />",{"class":"ui-state-default ui-tooltip-close "+(I.style.widget?"":m+"-icon"),title:af,"aria-label":af}).prepend(h("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"}))}T.button.appendTo(T.titlebar).attr("role","button").click(function(ag){if(!K.hasClass(g)){V.hide(ag)}return t});V.redraw()}function N(){var ad=O+"-title";if(T.titlebar){G()}T.titlebar=h("<div />",{"class":m+"-titlebar "+(I.style.widget?"ui-widget-header":"")}).append(T.title=h("<div />",{id:ad,"class":m+"-title","aria-atomic":l})).insertBefore(T.content).delegate(".ui-tooltip-close","mousedown keydown mouseup keyup mouseout",function(ae){h(this).toggleClass("ui-state-active ui-state-focus",ae.type.substr(-4)==="down")}).delegate(".ui-tooltip-close","mouseover mouseout",function(ae){h(this).toggleClass("ui-state-hover",ae.type==="mouseover")});if(I.content.title.button){Y()}else{if(V.rendered){V.redraw()}}}function Q(ad){var ae=T.button,af=T.title;if(!V.rendered){return t}if(!ad){ae.remove()}else{if(!af){N()}Y()}}function Z(af,ad){var ae=T.title;if(!V.rendered||!af){return t}if(h.isFunction(af)){af=af.call(ac,U.event,V)}if(af===t||(!af&&af!=="")){return G(t)}else{if(af.jquery&&af.length>0){ae.empty().append(af.css({display:"block"}))}else{ae.html(af)}}V.redraw();if(ad!==t&&V.rendered&&K.is(":visible")){V.reposition(U.event)}}function P(af,ad){var ae=T.content;if(!V.rendered||!af){return t}if(h.isFunction(af)){af=af.call(ac,U.event,V)||""}if(af.jquery&&af.length>0){ae.empty().append(af.css({display:"block"}))}else{ae.html(af)}function ag(ai){var ah,aj={};function ak(al){if(al){delete aj[al.src];clearTimeout(V.timers.img[al.src]);h(al).unbind(S)}if(h.isEmptyObject(aj)){V.redraw();if(ad!==t){V.reposition(U.event)}ai()}}if((ah=ae.find("img[src]:not([height]):not([width])")).length===0){return ak()}ah.each(function(am,ao){if(aj[ao.src]!==j){return}var an=0,al=3;(function ap(){if(ao.height||ao.width||(an>al)){return ak(ao)}an+=1;V.timers.img[ao.src]=setTimeout(ap,700)}());h(ao).bind("error"+S+" load"+S,function(){ak(this)});aj[ao.src]=ao})}if(V.rendered<0){K.queue("fx",ag)}else{ab=0;ag(h.noop)}return V}function H(){var ag=I.position,ae={show:I.show.target,hide:I.hide.target,viewport:h(ag.viewport),document:h(document),body:h(document.body),window:h(window)},af={show:h.trim(""+I.show.event).split(" "),hide:h.trim(""+I.hide.event).split(" ")},ad=h.browser.msie&&parseInt(h.browser.version,10)===6;function ai(al){if(K.hasClass(g)){return t}clearTimeout(V.timers.show);clearTimeout(V.timers.hide);var am=function(){V.toggle(l,al)};if(I.show.delay>0){V.timers.show=setTimeout(am,I.show.delay)}else{am()}}function ah(ao){if(K.hasClass(g)||J||ab){return t}var am=h(ao.relatedTarget||ao.target),al=am.closest(u)[0]===K[0],an=am[0]===ae.show[0];clearTimeout(V.timers.show);clearTimeout(V.timers.hide);if((ag.target==="mouse"&&al)||(I.hide.fixed&&((/mouse(out|leave|move)/).test(ao.type)&&(al||an)))){try{ao.preventDefault();ao.stopImmediatePropagation()}catch(ap){}return}if(I.hide.delay>0){V.timers.hide=setTimeout(function(){V.hide(ao)},I.hide.delay)}else{V.hide(ao)}}function aj(al){if(K.hasClass(g)){return t}clearTimeout(V.timers.inactive);V.timers.inactive=setTimeout(function(){V.hide(al)},I.hide.inactive)}function ak(al){if(K.is(":visible")){V.reposition(al)}}K.bind("mouseenter"+S+" mouseleave"+S,function(al){var am=al.type==="mouseenter";if(am){V.focus(al)}K.toggleClass(e,am)});if(I.hide.fixed){ae.hide=ae.hide.add(K);K.bind("mouseover"+S,function(){if(!K.hasClass(g)){clearTimeout(V.timers.hide)}})}if(/mouse(out|leave)/i.test(I.hide.event)){if(I.hide.leave==="window"){ae.window.bind("mouseout"+S+" blur"+S,function(al){if(/select|option/.test(al.target)&&!al.relatedTarget){V.hide(al)}})}}else{if(/mouse(over|enter)/i.test(I.show.event)){ae.hide.bind("mouseleave"+S,function(al){clearTimeout(V.timers.show)})}}if((""+I.hide.event).indexOf("unfocus")>-1){ag.container.closest("html").bind("mousedown"+S,function(ao){var an=h(ao.target),am=!K.hasClass(g)&&K.is(":visible"),al=an.parents(u).filter(K[0]).length>0;if(an[0]!==ac[0]&&an[0]!==K[0]&&!al&&!ac.has(an[0]).length&&!an.attr("disabled")){V.hide(ao)}})}if("number"===typeof I.hide.inactive){ae.show.bind("qtip-"+W+"-inactive",aj);h.each(s.inactiveEvents,function(al,am){ae.hide.add(T.tooltip).bind(am+S+"-inactive",aj)})}h.each(af.hide,function(am,an){var al=h.inArray(an,af.show),ao=h(ae.hide);if((al>-1&&ao.add(ae.show).length===ao.length)||an==="unfocus"){ae.show.bind(an+S,function(ap){if(K.is(":visible")){ah(ap)}else{ai(ap)}});delete af.show[al]}else{ae.hide.bind(an+S,ah)}});h.each(af.show,function(al,am){ae.show.bind(am+S,ai)});if("number"===typeof I.hide.distance){ae.show.add(K).bind("mousemove"+S,function(ao){var an=U.origin||{},am=I.hide.distance,al=Math.abs;if(al(ao.pageX-an.pageX)>=am||al(ao.pageY-an.pageY)>=am){V.hide(ao)}})}if(ag.target==="mouse"){ae.show.bind("mousemove"+S,function(al){d={pageX:al.pageX,pageY:al.pageY,type:"mousemove"}});if(ag.adjust.mouse){if(I.hide.event){K.bind("mouseleave"+S,function(al){if((al.relatedTarget||al.target)!==ae.show[0]){V.hide(al)}});T.target.bind("mouseenter"+S+" mouseleave"+S,function(al){U.onTarget=al.type==="mouseenter"})}ae.document.bind("mousemove"+S,function(al){if(U.onTarget&&!K.hasClass(g)&&K.is(":visible")){V.reposition(al||d)}})}}if(ag.adjust.resize||ae.viewport.length){(h.event.special.resize?ae.viewport:ae.window).bind("resize"+S,ak)}if(ae.viewport.length||(ad&&K.css("position")==="fixed")){ae.viewport.bind("scroll"+S,ak)}}function M(){var ad=[I.show.target[0],I.hide.target[0],V.rendered&&T.tooltip[0],I.position.container[0],I.position.viewport[0],window,document];if(V.rendered){h([]).pushStack(h.grep(ad,function(ae){return typeof ae==="object"})).unbind(S)}else{I.show.target.unbind(S+"-create")}}V.checks.builtin={"^id$":function(af,ag,ad){var ah=ad===l?s.nextid:ad,ae=m+"-"+ah;if(ah!==t&&ah.length>0&&!h("#"+ae).length){K[0].id=ae;T.content[0].id=ae+"-content";T.title[0].id=ae+"-title"}},"^content.text$":function(ae,af,ad){P(ad)},"^content.title.text$":function(ae,af,ad){if(!ad){return G()}if(!T.title&&ad){N()}Z(ad)},"^content.title.button$":function(ae,af,ad){Q(ad)},"^position.(my|at)$":function(ae,af,ad){if("string"===typeof ad){ae[af]=new r.Corner(ad)}},"^position.container$":function(ae,af,ad){if(V.rendered){K.appendTo(ad)}},"^show.ready$":function(){if(!V.rendered){V.render(1)}else{V.toggle(l)}},"^style.classes$":function(ae,af,ad){K.attr("class",m+" qtip ui-helper-reset "+ad)},"^style.widget|content.title":aa,"^events.(render|show|move|hide|focus|blur)$":function(ae,af,ad){K[(h.isFunction(ad)?"":"un")+"bind"]("tooltip"+af,ad)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var ad=I.position;K.attr("tracking",ad.target==="mouse"&&ad.adjust.mouse);M();H()}};h.extend(V,{render:function(ad){if(V.rendered){return V}var ag=I.content.text,af=I.content.title.text,ae=I.position,ah=h.Event("tooltiprender");h.attr(ac[0],"aria-describedby",O);K=T.tooltip=h("<div/>",{id:O,"class":m+" qtip ui-helper-reset "+n+" "+I.style.classes+" "+m+"-pos-"+I.position.my.abbrev(),width:I.style.width||"",height:I.style.height||"",tracking:ae.target==="mouse"&&ae.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":t,"aria-describedby":O+"-content","aria-hidden":l}).toggleClass(g,U.disabled).data("qtip",V).appendTo(I.position.container).append(T.content=h("<div />",{"class":m+"-content",id:O+"-content","aria-atomic":l}));V.rendered=-1;ab=1;J=1;if(af){N();if(!h.isFunction(af)){Z(af,t)}}if(!h.isFunction(ag)){P(ag,t)}V.rendered=l;aa();h.each(I.events,function(ai,aj){if(h.isFunction(aj)){K.bind(ai==="toggle"?"tooltipshow tooltiphide":"tooltip"+ai,aj)}});h.each(r,function(){if(this.initialize==="render"){this(V)}});H();K.queue("fx",function(ai){ah.originalEvent=U.event;K.trigger(ah,[V]);ab=0;J=0;V.redraw();if(I.show.ready||ad){V.toggle(l,U.event,t)}ai()});return V},get:function(ae){var ad,af;switch(ae.toLowerCase()){case"dimensions":ad={height:K.outerHeight(),width:K.outerWidth()};break;case"offset":ad=r.offset(K,I.position.container);break}return ad},set:function(ag,ah){var af=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,ai=/^content\.(title|attr)|style/i,aj=t,al=t,ae=V.checks,ad;function ak(ap,an){var ao,aq,am;for(ao in ae){for(aq in ae[ao]){if(am=(new RegExp(aq,"i")).exec(ap)){an.push(am);ae[ao][aq].apply(V,an)}}}}if("string"===typeof ag){ad=ag;ag={};ag[ad]=ah}else{ag=h.extend(l,{},ag)}h.each(ag,function(an,ao){var ap=L(an.toLowerCase()),am;am=ap[0][ap[1]];ap[0][ap[1]]="object"===typeof ao&&ao.nodeType?h(ao):ao;ag[an]=[ap[0],ap[1],ao,am];aj=af.test(an)||aj;al=ai.test(an)||al});a(I);J=ab=1;h.each(ag,ak);J=ab=0;if(K.is(":visible")&&V.rendered){if(aj){V.reposition(I.position.target==="mouse"?D:U.event)}if(al){V.redraw()}}return V},toggle:function(af,ag){if(!V.rendered){return af?V.render(1):V}var al=af?"show":"hide",ad=I[al],ah=K.is(":visible"),ai=!ag||I[al].target.length<2||U.target[0]===ag.target,an=I.position,aj=I.content,ak,am;if((typeof af).search("boolean|number")){af=!ah}if(!K.is(":animated")&&ah===af&&ai){return V}if(ag){if((/over|enter/).test(ag.type)&&(/out|leave/).test(U.event.type)&&ag.target===I.show.target[0]&&K.has(ag.relatedTarget).length){return V}U.event=h.extend({},ag)}am=h.Event("tooltip"+al);am.originalEvent=ag?U.event:D;K.trigger(am,[V,90]);if(am.isDefaultPrevented()){return V}h.attr(K[0],"aria-hidden",!!!af);if(af){U.origin=h.extend({},d);V.focus(ag);if(h.isFunction(aj.text)){P(aj.text,t)}if(h.isFunction(aj.title.text)){Z(aj.title.text,t)}if(!o&&an.target==="mouse"&&an.adjust.mouse){h(document).bind("mousemove.qtip",function(ao){d={pageX:ao.pageX,pageY:ao.pageY,type:"mousemove"}});o=l}V.reposition(ag,arguments[2]);if((am.solo=!!ad.solo)){h(u,ad.solo).not(K).qtip("hide",am)}}else{clearTimeout(V.timers.show);delete U.origin;if(o&&!h(u+'[tracking="true"]:visible',ad.solo).not(K).length){h(document).unbind("mousemove.qtip");o=t}V.blur(ag)}function ae(){if(af){if(h.browser.msie){K[0].style.removeAttribute("filter")}K.css("overflow","");if("string"===typeof ad.autofocus){h(ad.autofocus,K).focus()}am=h.Event("tooltipvisible");am.originalEvent=ag?U.event:D;K.trigger(am,[V]);ad.target.trigger("qtip-"+W+"-inactive")}else{K.css({display:"",visibility:"",opacity:"",left:"",top:""})}}if(ai){K.stop(0,1)}if(ad.effect===t){K[al]();ae.call(K)}else{if(h.isFunction(ad.effect)){ad.effect.call(K,V);K.queue("fx",function(ao){ae();ao()})}else{K.fadeTo(90,af?1:0,ae)}}if(af){ad.target.trigger("qtip-"+W+"-inactive")}return V},show:function(ad){return V.toggle(l,ad)},hide:function(ad){return V.toggle(t,ad)},focus:function(ah){if(!V.rendered){return V}var ai=h(u),af=parseInt(K[0].style.zIndex,10),ae=s.zindex+ai.length,ag=h.extend({},ah),ad,aj;if(!K.hasClass(E)){aj=h.Event("tooltipfocus");aj.originalEvent=ag;K.trigger(aj,[V,ae]);if(!aj.isDefaultPrevented()){if(af!==ae){ai.each(function(){if(this.style.zIndex>af){this.style.zIndex=this.style.zIndex-1}});ai.filter("."+E).qtip("blur",ag)}K.addClass(E)[0].style.zIndex=ae}}return V},blur:function(ae){var ad=h.extend({},ae),af;K.removeClass(E);af=h.Event("tooltipblur");af.originalEvent=ad;K.trigger(af,[V]);return V},reposition:function(au,ap){if(!V.rendered||J){return V}J=1;var ay=I.position.target,ax=I.position,an=ax.my,ao=ax.at,aq=ax.adjust,ae=aq.method.split(" "),av=K.outerWidth(),ar=K.outerHeight(),aj=0,ak=0,ai=h.Event("tooltipmove"),ag=K.css("position")==="fixed",aw=ax.viewport,az={left:0,top:0},al=ax.container,af=t,am=V.plugins.tip,ad={horizontal:ae[0],vertical:(ae[1]=ae[1]||ae[0]),enabled:aw.jquery&&ay[0]!==window&&ay[0]!==R&&aq.method!=="none",left:function(aE){var aA=ad.horizontal==="shift",aD=-al.offset.left+aw.offset.left+aw.scrollLeft,aB=an.x==="left"?av:an.x==="right"?-av:-av/2,at=ao.x==="left"?aj:ao.x==="right"?-aj:-aj/2,aG=am&&am.size?am.size.width||0:0,aJ=am&&am.corner&&am.corner.precedance==="x"&&!aA?aG:0,aI=aD-aE+aJ,aC=aE+av-aw.width-aD+aJ,aF=aB-(an.precedance==="x"||an.x===an.y?at:0)-(ao.x==="center"?aj/2:0),aH=an.x==="center";if(aA){aJ=am&&am.corner&&am.corner.precedance==="y"?aG:0;aF=(an.x==="left"?1:-1)*aB-aJ;az.left+=aI>0?aI:aC>0?-aC:0;az.left=Math.max(-al.offset.left+aw.offset.left+(aJ&&am.corner.x==="center"?am.offset:0),aE-aF,Math.min(Math.max(-al.offset.left+aw.offset.left+aw.width,aE+aF),az.left))}else{if(aI>0&&(an.x!=="left"||aC>0)){az.left-=aF}else{if(aC>0&&(an.x!=="right"||aI>0)){az.left-=aH?-aF:aF}}if(az.left!==aE&&aH){az.left-=aq.x}if(az.left<aD&&-az.left>aC){az.left=aE}}return az.left-aE},top:function(aG){var aA=ad.vertical==="shift",aE=-al.offset.top+aw.offset.top+aw.scrollTop,aB=an.y==="top"?ar:an.y==="bottom"?-ar:-ar/2,aH=ao.y==="top"?ak:ao.y==="bottom"?-ak:-ak/2,at=am&&am.size?am.size.height||0:0,aJ=am&&am.corner&&am.corner.precedance==="y"&&!aA?at:0,aC=aE-aG+aJ,aD=aG+ar-aw.height-aE+aJ,aF=aB-(an.precedance==="y"||an.x===an.y?aH:0)-(ao.y==="center"?ak/2:0),aI=an.y==="center";if(aA){aJ=am&&am.corner&&am.corner.precedance==="x"?at:0;aF=(an.y==="top"?1:-1)*aB-aJ;az.top+=aC>0?aC:aD>0?-aD:0;az.top=Math.max(-al.offset.top+aw.offset.top+(aJ&&am.corner.x==="center"?am.offset:0),aG-aF,Math.min(Math.max(-al.offset.top+aw.offset.top+aw.height,aG+aF),az.top))}else{if(aC>0&&(an.y!=="top"||aD>0)){az.top-=aF}else{if(aD>0&&(an.y!=="bottom"||aC>0)){az.top-=aI?-aF:aF}}if(az.top!==aG&&aI){az.top-=aq.y}if(az.top<0&&-az.top>aD){az.top=aG}}return az.top-aG}},ah;if(h.isArray(ay)&&ay.length===2){ao={x:"left",y:"top"};az={left:ay[0],top:ay[1]}}else{if(ay==="mouse"&&((au&&au.pageX)||U.event.pageX)){ao={x:"left",y:"top"};au=(au&&(au.type==="resize"||au.type==="scroll")?U.event:au&&au.pageX&&au.type==="mousemove"?au:d&&d.pageX&&(aq.mouse||!au||!au.pageX)?{pageX:d.pageX,pageY:d.pageY}:!aq.mouse&&U.origin&&U.origin.pageX&&I.show.distance?U.origin:au)||au||U.event||d||{};az={top:au.pageY,left:au.pageX}}else{if(ay==="event"){if(au&&au.target&&au.type!=="scroll"&&au.type!=="resize"){ay=U.target=h(au.target)}else{ay=U.target}}else{ay=U.target=h(ay.jquery?ay:T.target)}ay=h(ay).eq(0);if(ay.length===0){return V}else{if(ay[0]===document||ay[0]===window){aj=r.iOS?window.innerWidth:ay.width();ak=r.iOS?window.innerHeight:ay.height();if(ay[0]===window){az={top:(aw||ay).scrollTop(),left:(aw||ay).scrollLeft()}}}else{if(ay.is("area")&&r.imagemap){az=r.imagemap(ay,ao,ad.enabled?ae:t)}else{if(ay[0].namespaceURI==="http://www.w3.org/2000/svg"&&r.svg){az=r.svg(ay,ao)}else{aj=ay.outerWidth();ak=ay.outerHeight();az=r.offset(ay,al)}}}}if(az.offset){aj=az.width;ak=az.height;af=az.flipoffset;az=az.offset}if((r.iOS<4.1&&r.iOS>3.1)||r.iOS==4.3||(!r.iOS&&ag)){ah=h(window);az.left-=ah.scrollLeft();az.top-=ah.scrollTop()}az.left+=ao.x==="right"?aj:ao.x==="center"?aj/2:0;az.top+=ao.y==="bottom"?ak:ao.y==="center"?ak/2:0}}az.left+=aq.x+(an.x==="right"?-av:an.x==="center"?-av/2:0);az.top+=aq.y+(an.y==="bottom"?-ar:an.y==="center"?-ar/2:0);if(ad.enabled){aw={elem:aw,height:aw[(aw[0]===window?"h":"outerH")+"eight"](),width:aw[(aw[0]===window?"w":"outerW")+"idth"](),scrollLeft:ag?0:aw.scrollLeft(),scrollTop:ag?0:aw.scrollTop(),offset:aw.offset()||{left:0,top:0}};al={elem:al,scrollLeft:al.scrollLeft(),scrollTop:al.scrollTop(),offset:al.offset()||{left:0,top:0}};az.adjusted={left:ad.horizontal!=="none"?ad.left(az.left):0,top:ad.vertical!=="none"?ad.top(az.top):0};if(az.adjusted.left+az.adjusted.top){K.attr("class",K[0].className.replace(/ui-tooltip-pos-\w+/i,m+"-pos-"+an.abbrev()))}if(af&&az.adjusted.left){az.left+=af.left}if(af&&az.adjusted.top){az.top+=af.top}}else{az.adjusted={left:0,top:0}}ai.originalEvent=h.extend({},au);K.trigger(ai,[V,az,aw.elem||aw]);if(ai.isDefaultPrevented()){return V}delete az.adjusted;if(ap===t||isNaN(az.left)||isNaN(az.top)||ay==="mouse"||!h.isFunction(ax.effect)){K.css(az)}else{if(h.isFunction(ax.effect)){ax.effect.call(K,V,h.extend({},az));K.queue(function(at){h(this).css({opacity:"",height:""});if(h.browser.msie){this.style.removeAttribute("filter")}at()})}}J=0;return V},redraw:function(){if(V.rendered<1||ab){return V}var ae=I.position.container,ag,ah,ad,af;ab=1;if(I.style.height){K.css("height",I.style.height)}if(I.style.width){K.css("width",I.style.width)}else{K.css("width","").addClass(z);ah=K.width()+1;ad=K.css("max-width")||"";af=K.css("min-width")||"";ag=(ad+af).indexOf("%")>-1?ae.width()/100:0;ad=((ad.indexOf("%")>-1?ag:1)*parseInt(ad,10))||ah;af=((af.indexOf("%")>-1?ag:1)*parseInt(af,10))||0;ah=ad+af?Math.min(Math.max(ah,af),ad):ah;K.css("width",Math.round(ah)).removeClass(z)}ab=0;return V},disable:function(ad){if("boolean"!==typeof ad){ad=!(K.hasClass(g)||U.disabled)}if(V.rendered){K.toggleClass(g,ad);h.attr(K[0],"aria-disabled",ad)}else{U.disabled=!!ad}return V},enable:function(){return V.disable(t)},destroy:function(){var ad=ac[0],ae=h.attr(ad,p),af=ac.data("qtip");if(V.rendered){K.stop(1,0).remove();h.each(V.plugins,function(){if(this.destroy){this.destroy()}})}clearTimeout(V.timers.show);clearTimeout(V.timers.hide);M();if(!af||V===af){h.removeData(ad,"qtip");if(I.suppress&&ae){h.attr(ad,"title",ae);ac.removeAttr(p)}ac.removeAttr("aria-describedby")}ac.unbind(".qtip-"+W);delete C[V.id];return ac}})}function v(H,G){var K,T,O,I,R,J=h(this),L=h(document.body),Q=this===document?L:J,P=(J.metadata)?J.metadata(G.metadata):D,S=G.metadata.type==="html5"&&P?P[G.metadata.name]:D,M=J.data(G.metadata.name||"qtipopts");try{M=typeof M==="string"?(new Function("return "+M))():M}catch(N){k("Unable to parse HTML5 attribute data: "+M)}I=h.extend(l,{},s.defaults,G,typeof M==="object"?a(M):D,a(S||P));T=I.position;I.id=H;if("boolean"===typeof I.content.text){O=J.attr(I.content.attr);if(I.content.attr!==t&&O){I.content.text=O}else{k("Unable to locate content for tooltip! Aborting render of tooltip on element: ",J);return t}}if(!T.container.length){T.container=L}if(T.target===t){T.target=Q}if(I.show.target===t){I.show.target=Q}if(I.show.solo===l){I.show.solo=T.container.closest("body")}if(I.hide.target===t){I.hide.target=Q}if(I.position.viewport===l){I.position.viewport=T.container}T.at=new r.Corner(T.at);T.my=new r.Corner(T.my);if(h.data(this,"qtip")){if(I.overwrite){J.qtip("destroy")}else{if(I.overwrite===t){return t}}}if(I.suppress&&(R=h.attr(this,"title"))){h(this).removeAttr("title").attr(p,R)}K=new A(J,I,H,!!O);h.data(this,"qtip",K);J.bind("remove.qtip-"+H+" removeqtip.qtip-"+H,function(){K.destroy()});return K}s=h.fn.qtip=function(H,L,M){var N=(""+H).toLowerCase(),K=D,G=h.makeArray(arguments).slice(1),J=G[G.length-1],I=this[0]?h.data(this[0],"qtip"):D;if((!arguments.length&&I)||N==="api"){return I}else{if("string"===typeof H){this.each(function(){var O=h.data(this,"qtip");if(!O){return l}if(J&&J.timeStamp){O.cache.event=J}if((N==="option"||N==="options")&&L){if(h.isPlainObject(L)||M!==j){O.set(L,M)}else{K=O.get(L);return t}}else{if(O[N]){O[N].apply(O[N],G)}}});return K!==D?K:this}else{if("object"===typeof H||!arguments.length){I=a(h.extend(l,{},H));return s.bind.call(this,I,J)}}}};s.bind=function(H,G){return this.each(function(L){var J,I,K,N,M,P;P=h.isArray(H.id)?H.id[L]:H.id;P=!P||P===t||P.length<1||C[P]?s.nextid++:(C[P]=P);N=".qtip-"+P+"-create";M=v.call(this,P,H);if(M===t){return l}J=M.options;h.each(r,function(){if(this.initialize==="initialize"){this(M)}});I={show:J.show.target,hide:J.hide.target};K={show:h.trim(""+J.show.event).replace(/ /g,N+" ")+N,hide:h.trim(""+J.hide.event).replace(/ /g,N+" ")+N};if(/mouse(over|enter)/i.test(K.show)&&!/mouse(out|leave)/i.test(K.hide)){K.hide+=" mouseleave"+N}I.show.bind("mousemove"+N,function(Q){d={pageX:Q.pageX,pageY:Q.pageY,type:"mousemove"};M.cache.onTarget=l});function O(R){function Q(){M.render(typeof R==="object"||J.show.ready);I.show.add(I.hide).unbind(N)}if(M.cache.disabled){return t}M.cache.event=h.extend({},R);M.cache.target=R?h(R.target):[j];if(J.show.delay>0){clearTimeout(M.timers.show);M.timers.show=setTimeout(Q,J.show.delay);if(K.show!==K.hide){I.hide.bind(K.hide,function(){clearTimeout(M.timers.show)})}}else{Q()}}I.show.bind(K.show,O);if(J.show.ready||J.prerender){O(G)}})};r=s.plugins={Corner:function(G){G=(""+G).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(G.match(/left|right/i)||G.match(/center/)||["inherit"])[0].toLowerCase();this.y=(G.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();var H=G.charAt(0);this.precedance=(H==="t"||H==="b"?"y":"x");this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbrev=function(){var I=this.x.substr(0,1),J=this.y.substr(0,1);return I===J?I:(I==="c"||(I!=="c"&&J!=="c"))?J+I:I+J};this.clone=function(){return{x:this.x,y:this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:this.clone}}},offset:function(J,G){var M=J.offset(),L=J.closest("body")[0],O=G,H,I,K;function N(Q,P){M.left+=P*Q.scrollLeft();M.top+=P*Q.scrollTop()}if(O){do{if(O.css("position")!=="static"){I=O.position();M.left-=I.left+(parseInt(O.css("borderLeftWidth"),10)||0)+(parseInt(O.css("marginLeft"),10)||0);M.top-=I.top+(parseInt(O.css("borderTopWidth"),10)||0)+(parseInt(O.css("marginTop"),10)||0);if(!H&&(K=O.css("overflow"))!=="hidden"&&K!=="visible"){H=O}}}while((O=h(O[0].offsetParent)).length);if(H&&H[0]!==L){N(H,1)}}return M},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_","."))||t,fn:{attr:function(G,K){if(this.length){var H=this[0],J="title",I=h.data(H,"qtip");if(G===J&&I&&"object"===typeof I&&I.options.suppress){if(arguments.length<2){return h.attr(H,p)}else{if(I&&I.options.content.attr===J&&I.cache.attr){I.set("content.text",K)}return this.attr(p,K)}}}return h.fn["attr"+B].apply(this,arguments)},clone:function(H){var J=h([]),I="title",G=h.fn["clone"+B].apply(this,arguments);if(!H){G.filter("["+p+"]").attr("title",function(){return h.attr(this,p)}).removeAttr(p)}return G}}};h.each(r.fn,function(H,I){if(!I||h.fn[H+B]){return l}var G=h.fn[H+B]=h.fn[H];h.fn[H]=function(){return I.apply(this,arguments)||G.apply(this,arguments)}});if(!h.ui){h["cleanData"+B]=h.cleanData;h.cleanData=function(G){for(var H=0,I;(I=G[H])!==j;H++){try{h(I).triggerHandler("removeqtip")}catch(J){}}h["cleanData"+B](G)}}s.version="2.0.0pre";s.nextid=0;s.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");s.zindex=15000;s.defaults={prerender:t,id:t,overwrite:l,suppress:l,content:{text:l,attr:"title",title:{text:t,button:t}},position:{my:"top left",at:"bottom right",target:t,container:t,viewport:t,adjust:{x:0,y:0,mouse:l,resize:l,method:"flip flip"},effect:function(H,I,G){h(this).animate(I,{duration:200,queue:t})}},show:{target:t,event:"mouseenter",effect:l,delay:90,solo:t,ready:t,autofocus:t},hide:{target:t,event:"mouseleave",effect:l,delay:0,fixed:t,inactive:t,leave:"window",distance:t},style:{classes:"",widget:t,width:t,height:t,def:l},events:{render:D,move:D,show:D,hide:D,toggle:D,visible:D,focus:D,blur:D}};function w(J){var N=this,O=J.elements.tooltip,G=J.options.content.ajax,H=".qtip-ajax",K=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,I=l,M=t,L;J.checks.ajax={"^content.ajax":function(R,Q,P){if(Q==="ajax"){G=P}if(Q==="once"){N.init()}else{if(G&&G.url){N.load()}else{O.unbind(H)}}}};h.extend(N,{init:function(){if(G&&G.url){O.unbind(H)[G.once?"one":"bind"]("tooltipshow"+H,N.load)}return N},load:function(Q,U){var T=G.url.indexOf(" "),R=G.url,S,Y=G.once&&!G.loading&&U;if(Y){try{Q.preventDefault()}catch(X){}}else{if(Q&&Q.isDefaultPrevented()){return N}}if(L&&L.abort){L.abort()}if(T>-1){S=R.substr(T);R=R.substr(0,T)}function P(){if(M){return}if(Y){J.show(Q.originalEvent);U=t}if(h.isFunction(G.complete)){G.complete.apply(this,arguments)}}function W(Z){if(M){return}if(S){Z=h("<div/>").append(Z.replace(K,"")).find(S)}J.set("content.text",Z)}function V(ab,Z,aa){if(M||ab.status===0){return}J.set("content.text",Z+": "+aa)}L=h.ajax(h.extend({success:W,error:V,context:J},G,{url:R,complete:P}))},destroy:function(){if(L&&L.abort){L.abort()}M=l}});N.init()}r.ajax=function(H){var G=H.plugins.ajax;return"object"===typeof G?G:(H.plugins.ajax=new w(H))};r.ajax.initialize="render";r.ajax.sanitize=function(G){var I=G.content,H;if(I&&"ajax" in I){H=I.ajax;if(typeof H!=="object"){H=G.content.ajax={url:H}}if("boolean"!==typeof H.once&&H.once){H.once=!!H.once}}};h.extend(l,s.defaults,{content:{ajax:{loading:l,once:l}}});function F(J){var H=this,G=J.elements,K=G.tooltip,I=".bgiframe-"+J.id;h.extend(H,{init:function(){G.bgiframe=h('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>');G.bgiframe.appendTo(K);K.bind("tooltipmove"+I,H.adjust)},adjust:function(){var N=J.get("dimensions"),M=J.plugins.tip,O=G.tip,L,P;P=parseInt(K.css("border-left-width"),10)||0;P={left:-P,top:-P};if(M&&O){L=(M.corner.precedance==="x")?["width","left"]:["height","top"];P[L[1]]-=O[L[0]]()}G.bgiframe.css(P).css(N)},destroy:function(){G.bgiframe.remove();K.unbind(I)}});H.init()}r.bgiframe=function(I){var H=h.browser,G=I.plugins.bgiframe;if(h("select, object").length<1||!(H.msie&&(""+H.version).charAt(0)==="6")){return t}return"object"===typeof G?G:(I.plugins.bgiframe=new F(I))};r.bgiframe.initialize="render";r.imagemap=function(H,Q,N){if(!H.jquery){H=h(H)}var O=(H[0].shape||H.attr("shape")).toLowerCase(),J=(H[0].coords||H.attr("coords")).split(","),P=[],K=h('img[usemap="#'+H.parent("map").attr("name")+'"]'),S=K.offset(),R={width:0,height:0,offset:{top:10000000000,right:0,bottom:0,left:10000000000}},L=0,M=0,G;function I(ac,aa,ab){var X=0,Z=1,Y=1,W=0,U=0,V=ac.width,T=ac.height;while(V>0&&T>0&&Z>0&&Y>0){V=Math.floor(V/2);T=Math.floor(T/2);if(ab.x==="left"){Z=V}else{if(ab.x==="right"){Z=ac.width-V}else{Z+=Math.floor(V/2)}}if(ab.y==="top"){Y=T}else{if(ab.y==="bottom"){Y=ac.height-T}else{Y+=Math.floor(T/2)}}X=aa.length;while(X--){if(aa.length<2){break}W=aa[X][0]-ac.offset.left;U=aa[X][1]-ac.offset.top;if((ab.x==="left"&&W>=Z)||(ab.x==="right"&&W<=Z)||(ab.x==="center"&&(W<Z||W>(ac.width-Z)))||(ab.y==="top"&&U>=Y)||(ab.y==="bottom"&&U<=Y)||(ab.y==="center"&&(U<Y||U>(ac.height-Y)))){aa.splice(X,1)}}}return{left:aa[0][0],top:aa[0][1]}}S.left+=Math.ceil((K.outerWidth()-K.width())/2);S.top+=Math.ceil((K.outerHeight()-K.height())/2);if(O==="poly"){L=J.length;while(L--){M=[parseInt(J[--L],10),parseInt(J[L+1],10)];if(M[0]>R.offset.right){R.offset.right=M[0]}if(M[0]<R.offset.left){R.offset.left=M[0]}if(M[1]>R.offset.bottom){R.offset.bottom=M[1]}if(M[1]<R.offset.top){R.offset.top=M[1]}P.push(M)}}else{P=h.map(J,function(T){return parseInt(T,10)})}switch(O){case"rect":R={width:Math.abs(P[2]-P[0]),height:Math.abs(P[3]-P[1]),offset:{left:Math.min(P[0],P[2]),top:Math.min(P[1],P[3])}};break;case"circle":R={width:P[2]+2,height:P[2]+2,offset:{left:P[0],top:P[1]}};break;case"poly":h.extend(R,{width:Math.abs(R.offset.right-R.offset.left),height:Math.abs(R.offset.bottom-R.offset.top)});if(Q.string()==="centercenter"){R.offset={left:R.offset.left+(R.width/2),top:R.offset.top+(R.height/2)}}else{R.offset=I(R,P.slice(),Q);if(N&&(N[0]==="flip"||N[1]==="flip")){R.flipoffset=I(R,P.slice(),{x:Q.x==="left"?"right":Q.x==="right"?"left":"center",y:Q.y==="top"?"bottom":Q.y==="bottom"?"top":"center"});R.flipoffset.left-=R.offset.left;R.flipoffset.top-=R.offset.top}}R.width=R.height=0;break}R.offset.left+=S.left;R.offset.top+=S.top;return R};function b(M){var O=this,Q=M.options.show.modal,G=M.elements,P=G.tooltip,I="#qtip-overlay",H=".qtipmodal",J=H+M.id,N="is-modal-qtip",L=h(document.body),K;M.checks.modal={"^show.modal.(on|blur)$":function(){O.init();G.overlay.toggle(P.is(":visible"))}};h.extend(O,{init:function(){if(!Q.on){return O}K=O.create();P.attr(N,l).css("z-index",r.modal.zindex+h(u+"["+N+"]").length).unbind(H).unbind(J).bind("tooltipshow"+H+" tooltiphide"+H,function(T,S,V){var R=T.originalEvent;if(T.target===P[0]){if(R&&T.type==="tooltiphide"&&/mouse(leave|enter)/.test(R.type)&&h(R.relatedTarget).closest(K[0]).length){try{T.preventDefault()}catch(U){}}else{if(!R||(R&&!R.solo)){O[T.type.replace("tooltip","")](T,V)}}}}).bind("tooltipfocus"+H,function(T){if(T.isDefaultPrevented()||T.target!==P[0]){return}var U=h(u).filter("["+N+"]"),S=r.modal.zindex+U.length,R=parseInt(P[0].style.zIndex,10);K[0].style.zIndex=S-1;U.each(function(){if(this.style.zIndex>R){this.style.zIndex-=1}});U.end().filter("."+E).qtip("blur",T.originalEvent);P.addClass(E)[0].style.zIndex=S;try{T.preventDefault()}catch(V){}}).bind("tooltiphide"+H,function(R){if(R.target===P[0]){h("["+N+"]").filter(":visible").not(P).last().qtip("focus",R)}});if(Q.escape){h(window).unbind(J).bind("keydown"+J,function(R){if(R.keyCode===27&&P.hasClass(E)){M.hide(R)}})}if(Q.blur){G.overlay.unbind(J).bind("click"+J,function(R){if(P.hasClass(E)){M.hide(R)}})}return O},create:function(){var S=h(I);if(S.length){return(G.overlay=S.insertAfter(h(u).last()))}K=G.overlay=h("<div />",{id:I.substr(1),html:"<div></div>",mousedown:function(){return t}}).insertAfter(h(u).last());function R(){K.css({height:h(window).height(),width:h(window).width()})}h(window).unbind(H).bind("resize"+H,R);R();return K},toggle:function(V,W,X){if(V&&V.isDefaultPrevented()){return O}var U=Q.effect,T=W?"show":"hide",Y=K.is(":visible"),S=h("["+N+"]").filter(":visible").not(P),R;if(!K){K=O.create()}if((K.is(":animated")&&Y===W)||(!W&&S.length)){return O}if(W){K.css({left:0,top:0});K.toggleClass("blurs",Q.blur);L.bind("focusin"+J,function(aa){var ab=h(aa.target),Z=ab.closest(".qtip"),ac=Z.length<1?t:(parseInt(Z[0].style.zIndex,10)>parseInt(P[0].style.zIndex,10));if(!ac&&(h(aa.target).closest(u)[0]!==P[0])){P.find("input:visible").filter(":first").focus()}})}else{L.undelegate("*","focusin"+J)}K.stop(l,t);if(h.isFunction(U)){U.call(K,W)}else{if(U===t){K[T]()}else{K.fadeTo(parseInt(X,10)||90,W?1:0,function(){if(!W){h(this).hide()}})}}if(!W){K.queue(function(Z){K.css({left:"",top:""});Z()})}return O},show:function(R,S){return O.toggle(R,l,S)},hide:function(R,S){return O.toggle(R,t,S)},destroy:function(){var R=K;if(R){R=h("["+N+"]").not(P).length<1;if(R){G.overlay.remove();h(window).unbind(H)}else{G.overlay.unbind(H+M.id)}L.undelegate("*","focusin"+J)}return P.removeAttr(N).unbind(H)}});O.init()}r.modal=function(H){var G=H.plugins.modal;return"object"===typeof G?G:(H.plugins.modal=new b(H))};r.modal.initialize="render";r.modal.sanitize=function(G){if(G.show){if(typeof G.show.modal!=="object"){G.show.modal={on:!!G.show.modal}}else{if(typeof G.show.modal.on==="undefined"){G.show.modal.on=l}}}};r.modal.zindex=s.zindex+1000;h.extend(l,s.defaults,{show:{modal:{on:t,effect:l,blur:l,escape:l}}});r.svg=function(K,O){var N=h(document),I=K[0],P={width:0,height:0,offset:{top:10000000000,left:10000000000}},J,G,L,M,H;if(I.getBBox&&I.parentNode){J=I.getBBox();G=I.getScreenCTM();L=I.farthestViewportElement||I;if(!L.createSVGPoint){return P}M=L.createSVGPoint();M.x=J.x;M.y=J.y;H=M.matrixTransform(G);P.offset.left=H.x;P.offset.top=H.y;M.x+=J.width;M.y+=J.height;H=M.matrixTransform(G);P.width=H.x-P.offset.left;P.height=H.y-P.offset.top;P.offset.left+=N.scrollLeft();P.offset.top+=N.scrollTop()}return P};function x(L,J,H){var I=Math.ceil(J/2),K=Math.ceil(H/2),G={bottomright:[[0,0],[J,H],[J,0]],bottomleft:[[0,0],[J,0],[0,H]],topright:[[0,H],[J,0],[J,H]],topleft:[[0,0],[0,H],[J,H]],topcenter:[[0,H],[I,0],[J,H]],bottomcenter:[[0,0],[J,0],[I,H]],rightcenter:[[0,0],[J,K],[0,H]],leftcenter:[[J,0],[J,H],[0,K]]};G.lefttop=G.bottomright;G.righttop=G.bottomleft;G.leftbottom=G.topright;G.rightbottom=G.topleft;return G[L.string()]}function y(R,Q){var T=this,I=R.options.style.tip,K=R.elements,U=K.tooltip,J={top:0,left:0},V={width:I.width,height:I.height},P={},O=I.border||0,N=".qtip-tip",M=!!(h("<canvas />")[0]||{}).getContext;T.corner=D;T.mimic=D;T.border=O;T.offset=I.offset;T.size=V;R.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){if(!T.init()){T.destroy()}R.reposition()},"^style.tip.(height|width)$":function(){V={width:I.width,height:I.height};T.create();T.update();R.reposition()},"^content.title.text|style.(classes|widget)$":function(){if(K.tip){T.update()}}};function S(X,ad,ag,ae){if(!K.tip){return}var ai=T.corner.clone(),ah=ag.adjusted,W=R.options.position.adjust.method.split(" "),Y=W[0],aa=W[1]||W[0],Z={left:t,top:t,x:0,y:0},ab,ac={},af;if(T.corner.fixed!==l){if(Y==="shift"&&ai.precedance==="x"&&ah.left&&ai.y!=="center"){ai.precedance=ai.precedance==="x"?"y":"x"}else{if(Y==="flip"&&ah.left){ai.x=ai.x==="center"?(ah.left>0?"left":"right"):(ai.x==="left"?"right":"left")}}if(aa==="shift"&&ai.precedance==="y"&&ah.top&&ai.x!=="center"){ai.precedance=ai.precedance==="y"?"x":"y"}else{if(aa==="flip"&&ah.top){ai.y=ai.y==="center"?(ah.top>0?"top":"bottom"):(ai.y==="top"?"bottom":"top")}}if(ai.string()!==J.corner.string()&&(J.top!==ah.top||J.left!==ah.left)){T.update(ai,t)}}ab=T.position(ai,ah);if(ab.right!==j){ab.left=-ab.right}if(ab.bottom!==j){ab.top=-ab.bottom}ab.user=Math.max(0,I.offset);if(Z.left=(Y==="shift"&&!!ah.left)){if(ai.x==="center"){ac["margin-left"]=Z.x=ab["margin-left"]-ah.left}else{af=ab.right!==j?[ah.left,-ab.left]:[-ah.left,ab.left];if((Z.x=Math.max(af[0],af[1]))>af[0]){ag.left-=ah.left;Z.left=t}ac[ab.right!==j?"right":"left"]=Z.x}}if(Z.top=(aa==="shift"&&!!ah.top)){if(ai.y==="center"){ac["margin-top"]=Z.y=ab["margin-top"]-ah.top}else{af=ab.bottom!==j?[ah.top,-ab.top]:[-ah.top,ab.top];if((Z.y=Math.max(af[0],af[1]))>af[0]){ag.top-=ah.top;Z.top=t}ac[ab.bottom!==j?"bottom":"top"]=Z.y}}K.tip.css(ac).toggle(!((Z.x&&Z.y)||(ai.x==="center"&&Z.y)||(ai.y==="center"&&Z.x)));ag.left-=ab.left.charAt?ab.user:Y!=="shift"||Z.top||!Z.left&&!Z.top?ab.left:0;ag.top-=ab.top.charAt?ab.user:aa!=="shift"||Z.left||!Z.left&&!Z.top?ab.top:0;J.left=ah.left;J.top=ah.top;J.corner=ai.clone()}function H(ab,Z,X){Z=!Z?ab[ab.precedance]:Z;var ac=U.hasClass(z),W=K.titlebar&&ab.y==="top",aa=W?K.titlebar:K.content,Y="border-"+Z+"-width",ad;U.addClass(z);ad=parseInt(aa.css(Y),10);ad=(X?ad||parseInt(U.css(Y),10):ad)||0;U.toggleClass(z,ac);return ad}function L(ab){var W=K.titlebar&&ab.y==="top",aa=W?K.titlebar:K.content,Z=h.browser.mozilla,ac=Z?"-moz-":h.browser.webkit?"-webkit-":"",Y=ab.y+(Z?"":"-")+ab.x,X=ac+(Z?"border-radius-"+Y:"border-"+Y+"-radius");return parseInt(aa.css(X),10)||parseInt(U.css(X),10)||0}function G(af){var ad=af.precedance==="y",X=V[ad?"width":"height"],ag=V[ad?"height":"width"],ac=af.string().indexOf("center")>-1,W=X*(ac?0.5:1),Z=Math.pow,ah=Math.round,ae,ab,ai,Y=Math.sqrt(Z(W,2)+Z(ag,2)),aa=[(O/W)*Y,(O/ag)*Y];aa[2]=Math.sqrt(Z(aa[0],2)-Z(O,2));aa[3]=Math.sqrt(Z(aa[1],2)-Z(O,2));ae=Y+aa[2]+aa[3]+(ac?0:aa[0]);ab=ae/Y;ai=[ah(ab*ag),ah(ab*X)];return{height:ai[ad?0:1],width:ai[ad?1:0]}}h.extend(T,{init:function(){var W=T.detectCorner()&&(M||h.browser.msie);if(W){T.create();T.update();U.unbind(N).bind("tooltipmove"+N,S)}return W},detectCorner:function(){var Y=I.corner,X=R.options.position,W=X.at,Z=X.my.string?X.my.string():X.my;if(Y===t||(Z===t&&W===t)){return t}else{if(Y===l){T.corner=new r.Corner(Z)}else{if(!Y.string){T.corner=new r.Corner(Y);T.corner.fixed=l}}}J.corner=new r.Corner(T.corner.string());return T.corner.string()!=="centercenter"},detectColours:function(aj){var ac,al,aa,ah=K.tip.css("cssText",""),ai=aj||T.corner,X=ai[ai.precedance],W="border-"+X+"-color",ad="border"+X.charAt(0)+X.substr(1)+"Color",ae=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ag="background-color",am="transparent",Z=" !important",ab=h(document.body).css("color"),ak=R.elements.content.css("color"),af=K.titlebar&&(ai.y==="top"||(ai.y==="center"&&ah.position().top+(V.height/2)+I.offset<K.titlebar.outerHeight(1))),Y=af?K.titlebar:K.content;U.addClass(z);P.fill=al=ah.css(ag);P.border=aa=ah[0].style[ad]||ah.css(W)||U.css(W);if(!al||ae.test(al)){P.fill=Y.css(ag)||am;if(ae.test(P.fill)){P.fill=U.css(ag)||al}}if(!aa||ae.test(aa)||aa===ab){P.border=Y.css(W)||am;if(ae.test(P.border)){P.border=aa}}h("*",ah).add(ah).css("cssText",ag+":"+am+Z+";border:0"+Z+";");U.removeClass(z)},create:function(){var Y=V.width,X=V.height,W;if(K.tip){K.tip.remove()}K.tip=h("<div />",{"class":"ui-tooltip-tip"}).css({width:Y,height:X}).prependTo(U);if(M){h("<canvas />").appendTo(K.tip)[0].getContext("2d").save()}else{W='<vml:shape coordorigin="0,0" style="display:inline-block; position:absolute; behavior:url(#default#VML);"></vml:shape>';K.tip.html(W+W);h("*",K.tip).bind("click mousedown",function(Z){Z.stopPropagation()})}},update:function(af,ab){var ae=K.tip,ak=ae.children(),Y=V.width,ag=V.height,Z="px solid ",aj="px dashed transparent",ai=I.mimic,ah=Math.round,W,X,ad,aa,ac;if(!af){af=J.corner||T.corner}if(ai===t){ai=af}else{ai=new r.Corner(ai);ai.precedance=af.precedance;if(ai.x==="inherit"){ai.x=af.x}else{if(ai.y==="inherit"){ai.y=af.y}else{if(ai.x===ai.y){ai[af.precedance]=af[af.precedance]}}}}W=ai.precedance;T.detectColours(af);if(P.border!=="transparent"&&P.border!=="#123456"){O=H(af,D,l);if(I.border===0&&O>0){P.fill=P.border}T.border=O=I.border!==l?I.border:O}else{T.border=O=0}ad=x(ai,Y,ag);T.size=ac=G(af);ae.css(ac);if(af.precedance==="y"){aa=[ah(ai.x==="left"?O:ai.x==="right"?ac.width-Y-O:(ac.width-Y)/2),ah(ai.y==="top"?ac.height-ag:0)]}else{aa=[ah(ai.x==="left"?ac.width-Y:0),ah(ai.y==="top"?O:ai.y==="bottom"?ac.height-ag-O:(ac.height-ag)/2)]}if(M){ak.attr(ac);X=ak[0].getContext("2d");X.restore();X.save();X.clearRect(0,0,3000,3000);X.translate(aa[0],aa[1]);X.beginPath();X.moveTo(ad[0][0],ad[0][1]);X.lineTo(ad[1][0],ad[1][1]);X.lineTo(ad[2][0],ad[2][1]);X.closePath();X.fillStyle=P.fill;X.strokeStyle=P.border;X.lineWidth=O*2;X.lineJoin="miter";X.miterLimit=100;if(O){X.stroke()}X.fill()}else{ad="m"+ad[0][0]+","+ad[0][1]+" l"+ad[1][0]+","+ad[1][1]+" "+ad[2][0]+","+ad[2][1]+" xe";aa[2]=O&&/^(r|b)/i.test(af.string())?parseFloat(h.browser.version,10)===8?2:1:0;ak.css({antialias:""+(ai.string().indexOf("center")>-1),left:aa[0]-(aa[2]*Number(W==="x")),top:aa[1]-(aa[2]*Number(W==="y")),width:Y+O,height:ag+O}).each(function(al){var am=h(this);am[am.prop?"prop":"attr"]({coordsize:(Y+O)+" "+(ag+O),path:ad,fillcolor:P.fill,filled:!!al,stroked:!!!al}).css({display:O||al?"block":"none"});if(!al&&am.html()===""){am.html('<vml:stroke weight="'+(O*2)+'px" color="'+P.border+'" miterlimit="1000" joinstyle="miter"  style="behavior:url(#default#VML); display:inline-block;" />')}})}if(ab!==t){T.position(af)}},position:function(ab){var ac=K.tip,X={},W=Math.max(0,I.offset),Y,aa,Z;if(I.corner===t||!ac){return t}ab=ab||T.corner;Y=ab.precedance;aa=G(ab);Z=[ab.x,ab.y];if(Y==="x"){Z.reverse()}h.each(Z,function(ag,af){var ad,ae;if(af==="center"){ad=Y==="y"?"left":"top";X[ad]="50%";X["margin-"+ad]=-Math.round(aa[Y==="y"?"width":"height"]/2)+W}else{ad=H(ab,af,l);ae=L(ab);X[af]=ag?O?H(ab,af):0:W+(ae>ad?ae:0)}});X[ab[Y]]-=aa[Y==="x"?"width":"height"];ac.css({top:"",bottom:"",left:"",right:"",margin:""}).css(X);return X},destroy:function(){if(K.tip){K.tip.remove()}U.unbind(N)}});T.init()}r.tip=function(H){var G=H.plugins.tip;return"object"===typeof G?G:(H.plugins.tip=new y(H))};r.tip.initialize="render";r.tip.sanitize=function(G){var H=G.style,I;if(H&&"tip" in H){I=G.style.tip;if(typeof I!=="object"){G.style.tip={corner:I}}if(!(/string|boolean/i).test(typeof I.corner)){I.corner=l}if(typeof I.width!=="number"){delete I.width}if(typeof I.height!=="number"){delete I.height}if(typeof I.border!=="number"&&I.border!==l){delete I.border}if(typeof I.offset!=="number"){delete I.offset}}};h.extend(l,s.defaults,{style:{tip:{corner:l,mimic:t,width:6,height:6,border:l,offset:0}}})}));(function(j,g){var k={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href"},l=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"],f={anchor:"fragment"},a={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},d=/(?:^|&|;)([^&=;]*)=?([^&;]*)/g,b=/(?:^|&|;)([^&=;]*)=?([^&;]*)/g;function h(m,p){var r=decodeURI(m),o=a[p||false?"strict":"loose"].exec(r),q={attr:{},param:{},seg:{}},n=14;while(n--){q.attr[l[n]]=o[n]||""}q.param.query={};q.param.fragment={};q.attr.query.replace(d,function(t,s,u){if(s){q.param.query[s]=u}});q.attr.fragment.replace(b,function(t,s,u){if(s){q.param.fragment[s]=u}});q.seg.path=q.attr.path.replace(/^\/+|\/+$/g,"").split("/");q.seg.fragment=q.attr.fragment.replace(/^\/+|\/+$/g,"").split("/");q.attr.base=q.attr.host?q.attr.protocol+"://"+q.attr.host+(q.attr.port?":"+q.attr.port:""):"";return q}function e(n){var m=n.tagName;if(m!==g){return k[m.toLowerCase()]}return m}j.fn.url=function(n){var m="";if(this.length){m=j(this).attr(e(this[0]))||""}return j.url(m,n)};j.url=function(m,n){if(arguments.length===1&&m===true){n=true;m=g}n=n||false;m=m||window.location.toString();return{data:h(m,n),attr:function(o){o=f[o]||o;return o!==g?this.data.attr[o]:this.data.attr},param:function(o){return o!==g?this.data.param.query[o]:this.data.param.query},fparam:function(o){return o!==g?this.data.param.fragment[o]:this.data.param.fragment},segment:function(o){if(o===g){return this.data.seg.path}else{o=o<0?this.data.seg.path.length+o:o-1;return this.data.seg.path[o]}},fsegment:function(o){if(o===g){return this.data.seg.fragment}else{o=o<0?this.data.seg.fragment.length+o:o-1;return this.data.seg.fragment[o]}}}}})(jQuery);(function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var d=a.data(this[0],"validator");if(d){return d}this.attr("novalidate","novalidate");d=new a.validator(b,this[0]);a.data(this[0],"validator",d);if(d.settings.onsubmit){var e=this.find("input, button");e.filter(".cancel").click(function(){d.cancelSubmit=true});if(d.settings.submitHandler){e.filter(":submit").click(function(){d.submitButton=this})}this.submit(function(f){if(d.settings.debug){f.preventDefault()}function g(){if(d.settings.submitHandler){if(d.submitButton){var h=a("<input type='hidden'/>").attr("name",d.submitButton.name).val(d.submitButton.value).appendTo(d.currentForm)}d.settings.submitHandler.call(d,d.currentForm);if(d.submitButton){h.remove()}return false}return true}if(d.cancelSubmit){d.cancelSubmit=false;return g()}if(d.form()){if(d.pendingRequest){d.formSubmitted=true;return false}return g()}else{d.focusInvalid();return false}})}return d},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var d=true;var b=a(this[0].form).validate();this.each(function(){d&=b.element(this)});return d}},removeAttrs:function(e){var b={},d=this;a.each(e.split(/\s/),function(f,g){b[g]=d.attr(g);d.removeAttr(g)});return b},rules:function(f,b){var h=this[0];if(f){var e=a.data(h.form,"validator").settings;var k=e.rules;var l=a.validator.staticRules(h);switch(f){case"add":a.extend(l,a.validator.normalizeRule(b));k[h.name]=l;if(b.messages){e.messages[h.name]=a.extend(e.messages[h.name],b.messages)}break;case"remove":if(!b){delete k[h.name];return l}var j={};a.each(b.split(/\s/),function(m,n){j[n]=l[n];delete l[n]});return j}}var g=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(h),a.validator.classRules(h),a.validator.attributeRules(h),a.validator.staticRules(h)),h);if(g.required){var d=g.required;delete g.required;g=a.extend({required:d},g)}return g}});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(b,d){this.settings=a.extend(true,{},a.validator.defaults,b);this.currentForm=d;this.init()};a.validator.format=function(b,d){if(arguments.length==1){return function(){var e=a.makeArray(arguments);e.unshift(b);return a.validator.format.apply(this,e)}}if(arguments.length>2&&d.constructor!=Array){d=a.makeArray(arguments).slice(1)}if(d.constructor!=Array){d=[d]}a.each(d,function(e,f){b=b.replace(new RegExp("\\{"+e+"\\}","g"),f)});return b};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(b,d){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.addWrapper(this.errorsFor(b)).hide()}},onfocusout:function(b,d){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b,d){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b,d){if(b.name in this.submitted){this.element(b)}else{if(b.parentNode.name in this.submitted){this.element(b.parentNode)}}},highlight:function(e,b,d){if(e.type==="radio"){this.findByName(e.name).addClass(b).removeClass(d)}else{a(e).addClass(b).removeClass(d)}},unhighlight:function(e,b,d){if(e.type==="radio"){this.findByName(e.name).removeClass(b).addClass(d)}else{a(e).removeClass(b).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 b=(this.groups={});a.each(this.settings.groups,function(f,g){a.each(g.split(/\s/),function(j,h){b[h]=f})});var e=this.settings.rules;a.each(e,function(f,g){e[f]=a.validator.normalizeRule(g)});function d(h){var g=a.data(this[0].form,"validator"),f="on"+h.type.replace(/^validate/,"");g.settings[f]&&g.settings[f].call(g,this[0],h)}a(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",d).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",d);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 b=0,d=(this.currentElements=this.elements());d[b];b++){this.check(d[b])}return this.valid()},element:function(d){d=this.validationTargetFor(this.clean(d));this.lastElement=d;this.prepareElement(d);this.currentElements=a(d);var b=this.check(d);if(b){delete this.invalid[d.name]}else{this.invalid[d.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return b},showErrors:function(d){if(d){a.extend(this.errorMap,d);this.errorList=[];for(var b in d){this.errorList.push({message:d[b],element:this.findByName(b)[0]})}this.successList=a.grep(this.successList,function(e){return !(e.name in d)})}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.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var d=0;for(var b in e){d++}return d},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(d){return d.element.name==b.name}).length==1&&b},elements:function(){var d=this,b={};var f=a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&d.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!d.objectLength(a(this).rules())){return false}b[this.name]=true;return true});return f},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.validationTargetFor(this.clean(d));var j=a(d).rules();var f=false;for(var k in j){var h={method:k,parameters:j[k]};try{var b=a.validator.methods[k].call(this,d.value.replace(/\r/g,""),d,h.parameters);if(b=="dependency-mismatch"){f=true;continue}f=false;if(b=="pending"){this.toHide=this.toHide.not(this.errorsFor(d));return}if(!b){this.formatAndAdd(d,h);return false}}catch(g){this.settings.debug&&window.console&&console.log("exception occured when checking element "+d.id+", check the '"+h.method+"' method",g);throw g}}if(f){return}if(this.objectLength(j)){this.successList.push(d)}return true},customMetaMessage:function(b,e){if(!a.metadata){return}var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[e]},customMessage:function(d,e){var b=this.settings.messages[d];return b&&(b.constructor==String?b:b[e])},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b]}}return undefined},defaultMessage:function(b,d){return this.findDefined(this.customMessage(b.name,d),this.customMetaMessage(b,d),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[d],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(d,f){var e=this.defaultMessage(d,f.method),b=/\$?\{(\d+)\}/g;if(typeof e=="function"){e=e.call(this,f.parameters,d)}else{if(b.test(e)){e=jQuery.format(e.replace(b,"{$1}"),f.parameters)}}this.errorList.push({message:e,element:d});this.errorMap[d.name]=e;this.submitted[d.name]=e},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 b=this.errorList[d];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.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,e=this.validElements();e[d];d++){this.settings.unhighlight.call(this,e[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(d,e){var b=this.errorsFor(d);if(b.length){b.removeClass(this.settings.validClass).addClass(this.settings.errorClass);b.attr("generated")&&b.html(e)}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(d),generated:true}).addClass(this.settings.errorClass).html(e||"");if(this.settings.wrapper){b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(b).length){this.settings.errorPlacement?this.settings.errorPlacement(b,a(d)):b.insertAfter(d)}}if(!e&&this.settings.success){b.text("");typeof this.settings.success=="string"?b.addClass(this.settings.success):this.settings.success(b)}this.toShow=this.toShow.add(b)},errorsFor:function(d){var b=this.idOrName(d);return this.errors().filter(function(){return a(this).attr("for")==b})},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},validationTargetFor:function(b){if(this.checkable(b)){b=this.findByName(b.name).not(this.settings.ignore)[0]}return b},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(b){var d=this.currentForm;return a(document.getElementsByName(b)).map(function(e,f){return f.form==d&&f.name==b&&f||null})},getLength:function(d,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 d.length},depend:function(d,b){return this.dependTypes[typeof d]?this.dependTypes[typeof d](d,b):true},dependTypes:{"boolean":function(d,b){return d},string:function(d,b){return !!a(d,b.form).length},"function":function(d,b){return d(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,d){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(d&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();this.formSubmitted=false}else{if(!d&&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,d){b.constructor==String?this.classRuleSettings[b]=d:a.extend(this.classRuleSettings,b)},classRules:function(d){var e={};var b=a(d).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(e,a.validator.classRuleSettings[this])}});return e},attributeRules:function(d){var f={};var b=a(d);for(var g in a.validator.methods){var e;if(g==="required"&&typeof a.fn.prop==="function"){e=b.prop(g)}else{e=b.attr(g)}if(e){f[g]=e}else{if(b[0].getAttribute("type")===g){f[g]=true}}}if(f.maxlength&&/-1|2147483647|524288/.test(f.maxlength)){delete f.maxlength}return f},metadataRules:function(b){if(!a.metadata){return{}}var d=a.data(b.form,"validator").settings.meta;return d?a(b).metadata()[d]:a(b).metadata()},staticRules:function(d){var e={};var b=a.data(d.form,"validator");if(b.settings.rules){e=a.validator.normalizeRule(b.settings.rules[d.name])||{}}return e},normalizeRules:function(d,b){a.each(d,function(g,f){if(f===false){delete d[g];return}if(f.param||f.depends){var e=true;switch(typeof f.depends){case"string":e=!!a(f.depends,b.form).length;break;case"function":e=f.depends.call(b,b);break}if(e){d[g]=f.param!==undefined?f.param:true}else{delete d[g]}}});a.each(d,function(e,f){d[e]=a.isFunction(f)?f(b):f});a.each(["minlength","maxlength","min","max"],function(){if(d[this]){d[this]=Number(d[this])}});a.each(["rangelength","range"],function(){if(d[this]){d[this]=[Number(d[this][0]),Number(d[this][1])]}});if(a.validator.autoCreateRanges){if(d.min&&d.max){d.range=[d.min,d.max];delete d.min;delete d.max}if(d.minlength&&d.maxlength){d.rangelength=[d.minlength,d.maxlength];delete d.minlength;delete d.maxlength}}if(d.messages){delete d.messages}return d},normalizeRule:function(d){if(typeof d=="string"){var b={};a.each(d.split(/\s/),function(){b[this]=true});d=b}return d},addMethod:function(b,e,d){a.validator.methods[b]=e;a.validator.messages[b]=d!=undefined?d:a.validator.messages[b];if(e.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b))}},methods:{required:function(d,b,f){if(!this.depend(f,b)){return"dependency-mismatch"}switch(b.nodeName.toLowerCase()){case"select":var e=a(b).val();return e&&e.length>0;case"input":if(this.checkable(b)){return this.getLength(d,b)>0}default:return a.trim(d).length>0}},remote:function(g,d,h){if(this.optional(d)){return"dependency-mismatch"}var e=this.previousValue(d);if(!this.settings.messages[d.name]){this.settings.messages[d.name]={}}e.originalMessage=this.settings.messages[d.name].remote;this.settings.messages[d.name].remote=e.message;h=typeof h=="string"&&{url:h}||h;if(this.pending[d.name]){return"pending"}if(e.old===g){return e.valid}e.old=g;var b=this;this.startRequest(d);var f={};f[d.name]=g;a.ajax(a.extend(true,{url:h,mode:"abort",port:"validate"+d.name,dataType:"json",data:f,success:function(k){b.settings.messages[d.name].remote=e.originalMessage;var m=k===true;if(m){var j=b.formSubmitted;b.prepareElement(d);b.formSubmitted=j;b.successList.push(d);b.showErrors()}else{var n={};var l=k||b.defaultMessage(d,"remote");n[d.name]=e.message=a.isFunction(l)?l(g):l;b.showErrors(n)}e.valid=m;b.stopRequest(d,m)}},h));return"pending"},minlength:function(d,b,e){return this.optional(b)||this.getLength(a.trim(d),b)>=e},maxlength:function(d,b,e){return this.optional(b)||this.getLength(a.trim(d),b)<=e},rangelength:function(e,b,f){var d=this.getLength(a.trim(e),b);return this.optional(b)||(d>=f[0]&&d<=f[1])},min:function(d,b,e){return this.optional(b)||d>=e},max:function(d,b,e){return this.optional(b)||d<=e},range:function(d,b,e){return this.optional(b)||(d>=e[0]&&d<=e[1])},email:function(d,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(d)},url:function(d,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(d)},date:function(d,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(d))},dateISO:function(d,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(d)},number:function(d,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(d)},digits:function(d,b){return this.optional(b)||/^\d+$/.test(d)},creditcard:function(g,d){if(this.optional(d)){return"dependency-mismatch"}if(/[^0-9 -]+/.test(g)){return false}var h=0,f=0,b=false;g=g.replace(/\D/g,"");for(var j=g.length-1;j>=0;j--){var e=g.charAt(j);var f=parseInt(e,10);if(b){if((f*=2)>9){f-=9}}h+=f;b=!b}return(h%10)==0},accept:function(d,b,e){e=typeof e=="string"?e.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||d.match(new RegExp(".("+e+")$","i"))},equalTo:function(d,b,f){var e=a(f).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(b).valid()});return d==e.val()}}});a.format=a.validator.format})(jQuery);(function(d){var a={};if(d.ajaxPrefilter){d.ajaxPrefilter(function(g,f,h){var e=g.port;if(g.mode=="abort"){if(a[e]){a[e].abort()}a[e]=h}})}else{var b=d.ajax;d.ajax=function(f){var g=("mode" in f?f:d.ajaxSettings).mode,e=("port" in f?f:d.ajaxSettings).port;if(g=="abort"){if(a[e]){a[e].abort()}return(a[e]=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,e,true)},teardown:function(){this.removeEventListener(d,e,true)},handler:function(f){arguments[0]=a.event.fix(f);arguments[0].type=b;return a.event.handle.apply(this,arguments)}};function e(f){f=a.event.fix(f);f.type=b;return a.event.handle.call(this,f)}})}a.extend(a.fn,{validateDelegate:function(e,d,b){return this.bind(d,function(f){var g=a(f.target);if(g.is(e)){return b.apply(g,arguments)}})}})})(jQuery);(function(a){if(window.XDomainRequest){jQuery.ajaxTransport(function(d){if(d.crossDomain&&d.async){if(d.timeout){d.xdrTimeout=d.timeout;delete d.timeout}var b;return{send:function(f,e){function g(h,l,k,j){b.onload=b.onerror=b.ontimeout=jQuery.noop;b=null;e(h,l,k,j)}b=new XDomainRequest();if(d.type==="DELETE"){d.url=d.url+(/\?/.test(d.url)?"&":"?")+"_method=DELETE";d.type="POST"}else{if(d.type==="PUT"){d.url=d.url+(/\?/.test(d.url)?"&":"?")+"_method=PUT";d.type="POST"}}b.open(d.type,d.url);b.onload=function(){g(200,"OK",{text:b.responseText},"Content-Type: "+b.contentType)};b.onerror=function(){g(404,"Not Found")};if(d.xdrTimeout){b.ontimeout=function(){g(0,"timeout")};b.timeout=d.xdrTimeout}b.send((d.hasContent&&d.data)||null)},abort:function(){if(b){b.onerror=jQuery.noop();b.abort()}}}}})}})(jQuery);(function(a){a.fn.xBreadcrumbs=function(g){var f=a(this);var g=a.extend({},a.fn.xBreadcrumbs.defaults,g);function e(){if(g.collapsible){var j=f.children("LI").length;f.children("LI").children("A").css("white-space","nowrap").css("float","left");f.children("LI").children("A").each(function(k,l){if(k!=j-1){a(this).css("overflow","hidden");a(this).attr("init-width",a(this).width());a(this).width(g.collapsedWidth)}})}f.children("LI").mouseenter(function(){if(a(this).hasClass("hover")){return}h();if(!b(a(this))){return}var l=a(this).children("UL");d(l,true);if(g.collapsible&&!a(this).hasClass("current")){var k=a(this).children("A").attr("init-width");a(this).children("A").animate({width:k},"normal")}});f.children("LI").mouseleave(function(){var k=a(this).children("UL");d(k,false);if(g.collapsible&&!a(this).hasClass("current")){a(this).children("A").animate({width:g.collapsedWidth},"fast")}})}function h(){f.children("LI").children("UL").each(function(){a(this).hide();a(this).parent().removeClass("hover")})}function d(l,j){if(j){l.parent().addClass("hover");if(a.browser.msie){var k=l.parent().position();l.css("left",parseInt(k.left))}if(g.showSpeed!=""){l.fadeIn(g.showSpeed)}else{l.show()}}else{l.parent().removeClass("hover");if(g.hideSpeed!=""){l.fadeOut(g.hideSpeed)}else{l.hide()}}}function b(j){return j.children("UL").length>0}e()};a.fn.xBreadcrumbs.defaults={showSpeed:"fast",hideSpeed:"",collapsible:false,collapsedWidth:10}})(jQuery);"use strict";(function(){if(jQuery&&jQuery.jstree){return}var d=false,b=false,a=false;(function(h){h.vakata={};h.vakata.css={get_css:function(o,l,m){o=o.toLowerCase();var n=m.cssRules||m.rules,k=0;do{if(n.length&&k>n.length+5){return false}if(n[k].selectorText&&n[k].selectorText.toLowerCase()==o){if(l===true){if(m.removeRule){m.removeRule(k)}if(m.deleteRule){m.deleteRule(k)}return true}else{return n[k]}}}while(n[++k]);return false},add_css:function(l,k){if(h.jstree.css.get_css(l,false,k)){return false}if(k.insertRule){k.insertRule(l+" { }",0)}else{k.addRule(l,null,0)}return h.vakata.css.get_css(l)},remove_css:function(l,k){return h.vakata.css.get_css(l,true,k)},add_sheet:function(l){var k=false,n=true;if(l.str){if(l.title){k=h("style[id='"+l.title+"-stylesheet']")[0]}if(k){n=false}else{k=document.createElement("style");k.setAttribute("type","text/css");if(l.title){k.setAttribute("id",l.title+"-stylesheet")}}if(k.styleSheet){if(n){document.getElementsByTagName("head")[0].appendChild(k);k.styleSheet.cssText=l.str}else{k.styleSheet.cssText=k.styleSheet.cssText+" "+l.str}}else{k.appendChild(document.createTextNode(l.str));document.getElementsByTagName("head")[0].appendChild(k)}return k.sheet||k.styleSheet}if(l.url){if(document.createStyleSheet){try{k=document.createStyleSheet(l.url)}catch(m){}}else{k=document.createElement("link");k.rel="stylesheet";k.type="text/css";k.media="all";k.href=l.url;document.getElementsByTagName("head")[0].appendChild(k);return k.styleSheet}}}};var j=[],g=-1,f={},e={};h.fn.jstree=function(n){var k=(typeof n=="string"),l=Array.prototype.slice.call(arguments,1),m=this;if(k){if(n.substring(0,1)=="_"){return m}this.each(function(){var o=j[h.data(this,"jstree_instance_id")],p=(o&&h.isFunction(o[n]))?o[n].apply(o,l):o;if(typeof p!=="undefined"&&(n.indexOf("is_")===0||(p!==true&&p!==false))){m=p;return false}})}else{this.each(function(){var u=h.data(this,"jstree_instance_id"),p=[],o=n?h.extend({},true,n):{},v=h(this),r=false,q=[];p=p.concat(l);if(v.data("jstree")){p.push(v.data("jstree"))}o=p.length?h.extend.apply(null,[true,o].concat(p)):o;if(typeof u!=="undefined"&&j[u]){j[u].destroy()}u=parseInt(j.push({}),10)-1;h.data(this,"jstree_instance_id",u);o.plugins=h.isArray(o.plugins)?o.plugins:h.jstree.defaults.plugins.slice();o.plugins.unshift("core");o.plugins=o.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");r=h.extend(true,{},h.jstree.defaults,o);r.plugins=o.plugins;h.each(f,function(s,t){if(h.inArray(s,r.plugins)===-1){r[s]=null;delete r[s]}else{q.push(s)}});r.plugins=q;j[u]=new h.jstree._instance(u,h(this).addClass("jstree jstree-"+u),r);h.each(j[u]._get_settings().plugins,function(s,t){j[u].data[t]={}});h.each(j[u]._get_settings().plugins,function(s,t){if(f[t]){f[t].__init.apply(j[u])}});setTimeout(function(){if(j[u]){j[u].init()}},0)})}return m};h.jstree={defaults:{plugins:[]},_focused:function(){return j[g]||null},_reference:function(k){if(j[k]){return j[k]}var l=h(k);if(!l.length&&typeof k==="string"){l=h("#"+k)}if(!l.length){return null}return j[l.closest(".jstree").data("jstree_instance_id")]||null},_instance:function(l,k,m){this.data={core:{}};this.get_settings=function(){return h.extend(true,{},m)};this._get_settings=function(){return m};this.get_index=function(){return l};this.get_container=function(){return k};this.get_container_ul=function(){return k.children("ul:eq(0)")};this._set_settings=function(n){m=h.extend(true,{},m,n)}},_fn:{},plugin:function(k,l){l=h.extend({},{__init:h.noop,__destroy:h.noop,_fn:{},defaults:false},l);f[k]=l;h.jstree.defaults[k]=l.defaults;h.each(l._fn,function(m,n){n.plugin=k;n.old=h.jstree._fn[m];h.jstree._fn[m]=function(){var o,q=n,p=Array.prototype.slice.call(arguments),s=new h.Event("before.jstree"),r=false;if(this.data.core.locked===true&&m!=="unlock"&&m!=="is_locked"){return}do{if(q&&q.plugin&&h.inArray(q.plugin,this._get_settings().plugins)!==-1){break}q=q.old}while(q);if(!q){return}if(m.indexOf("_")===0){o=q.apply(this,p)}else{o=this.get_container().triggerHandler(s,{func:m,inst:this,args:p,plugin:q.plugin});if(o===false){return}if(typeof o!=="undefined"){p=o}o=q.apply(h.extend({},this,{__callback:function(t){this.get_container().triggerHandler(m+".jstree",{inst:this,args:p,rslt:t,rlbk:r})},__rollback:function(){r=this.get_rollback();return r},__call_old:function(t){return q.old.apply(this,(t?Array.prototype.slice.call(arguments,1):p))}}),p)}return o};h.jstree._fn[m].old=n.old;h.jstree._fn[m].plugin=k})},rollback:function(k){if(k){if(!h.isArray(k)){k=[k]}h.each(k,function(l,m){j[m.i].set_rollback(m.h,m.d)})}}};h.jstree._fn=h.jstree._instance.prototype={};h(function(){var m=navigator.userAgent.toLowerCase(),l=(m.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],k=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(/msie/.test(m)&&parseInt(l,10)==6){d=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(n){}k+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}if(/msie/.test(m)&&parseInt(l,10)==7){b=true;k+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "}if(!/compatible/.test(m)&&/mozilla/.test(m)&&parseFloat(l,10)<1.9){a=true;k+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "}h.vakata.css.add_sheet({str:k,title:"jstree"})});h.jstree.plugin("core",{__init:function(){this.data.core.locked=false;this.data.core.to_open=this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:false,animation:500,initially_open:[],initially_load:[],open_parents:true,notify_plugins:true,rtl:false,load_open:false,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();if(this._get_settings().core.rtl){this.get_container().addClass("jstree-rtl").css("direction","rtl")}this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"+this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",h.proxy(function(l){var k=h(l.target);this.toggle_node(k)},this)).bind("mousedown.jstree",h.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(l){var m;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){m=window.getSelection();try{m.removeAllRanges();m.collapse()}catch(k){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",h.proxy(function(m,l){var n=this._get_node(l.rslt.obj),k=this;if(n===-1){n=this.get_container_ul()}if(!n.length){return}n.find("li").each(function(){var o=h(this);if(o.data("jstree")){h.each(o.data("jstree"),function(q,p){if(k.data[q]&&h.isFunction(k["_"+q+"_notify"])){k["_"+q+"_notify"].call(k,o,p)}})}})},this))}if(this._get_settings().core.load_open){this.get_container().bind("load_node.jstree",h.proxy(function(m,l){var n=this._get_node(l.rslt.obj),k=this;if(n===-1){n=this.get_container_ul()}if(!n.length){return}n.find("li.jstree-open:not(:has(ul))").each(function(){k.load_node(this,h.noop,h.noop)})},this))}this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var k,o=this.get_index(),l=this._get_settings(),m=this;h.each(l.plugins,function(n,q){try{f[q].__destroy.apply(m)}catch(p){}});this.__callback();if(this.is_focused()){for(k in j){if(j.hasOwnProperty(k)&&k!=o){j[k].set_focus();break}}}if(o===g){g=-1}this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});h(document).unbind(".jstree-"+o).undelegate(".jstree-"+o);j[o]=null;delete j[o]},_core_notify:function(l,k){if(k.opened){this.open_node(l,false,true)}},lock:function(){this.data.core.locked=true;this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");this.__callback({})},unlock:function(){this.data.core.locked=false;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var k=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){k.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(k.data.core.to_open)},save_loaded:function(){},reload_nodes:function(l){var o=this,k=true,n=[],m=[];if(!l){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=h.map(h.makeArray(this.data.core.to_open),function(p){return"#"+p.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.data.core.to_load=h.map(h.makeArray(this.data.core.to_load),function(p){return"#"+p.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});if(this.data.core.to_open.length){this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)}}if(this.data.core.to_load.length){h.each(this.data.core.to_load,function(p,q){if(q=="#"){return true}if(h(q).length){n.push(q)}else{m.push(q)}});if(n.length){this.data.core.to_load=m;h.each(n,function(p,q){if(!o._is_loaded(q)){o.load_node(q,function(){o.reload_nodes(true)},function(){o.reload_nodes(true)});k=false}})}}if(this.data.core.to_open.length){h.each(this.data.core.to_open,function(p,q){o.open_node(q,false,true)})}if(k){if(this.data.core.reopen){clearTimeout(this.data.core.reopen)}this.data.core.reopen=setTimeout(function(){o.__callback({},o)},50);this.data.core.refreshing=false;this.reopen()}},reopen:function(){var k=this;if(this.data.core.to_open.length){h.each(this.data.core.to_open,function(l,m){k.open_node(m,false,true)})}this.__callback({})},refresh:function(k){var l=this;this.save_opened();if(!k){k=-1}k=this._get_node(k);if(!k){k=-1}if(k!==-1){k.children("UL").remove()}else{this.get_container_ul().empty()}this.load_node(k,function(){l.__callback({obj:k});l.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused()){return}var k=h.jstree._focused();if(k){k.unset_focus()}this.get_container().addClass("jstree-focused");g=this.get_index();this.__callback()},is_focused:function(){return g==this.get_index()},unset_focus:function(){if(this.is_focused()){this.get_container().removeClass("jstree-focused");g=-1}this.__callback()},_get_node:function(k){var l=h(k,this.get_container());if(l.is(".jstree")||k==-1){return -1}l=l.closest("li",this.get_container());return l.length?l:false},_get_next:function(l,k){l=this._get_node(l);if(l===-1){return this.get_container().find("> ul > li:first-child")}if(!l.length){return false}if(k){return(l.nextAll("li").size()>0)?l.nextAll("li:eq(0)"):false}if(l.hasClass("jstree-open")){return l.find("li:eq(0)")}else{if(l.nextAll("li").size()>0){return l.nextAll("li:eq(0)")}else{return l.parentsUntil(".jstree","li").next("li").eq(0)}}},_get_prev:function(l,k){l=this._get_node(l);if(l===-1){return this.get_container().find("> ul > li:last-child")}if(!l.length){return false}if(k){return(l.prevAll("li").length>0)?l.prevAll("li:eq(0)"):false}if(l.prev("li").length){l=l.prev("li").eq(0);while(l.hasClass("jstree-open")){l=l.children("ul:eq(0)").children("li:last")}return l}else{var m=l.parentsUntil(".jstree","li:eq(0)");return m.length?m:false}},_get_parent:function(k){k=this._get_node(k);if(k==-1||!k.length){return false}var l=k.parentsUntil(".jstree","li:eq(0)");return l.length?l:-1},_get_children:function(k){k=this._get_node(k);if(k===-1){return this.get_container().children("ul:eq(0)").children("li")}if(!k.length){return false}return k.children("ul:eq(0)").children("li")},get_path:function(m,k){var l=[],n=this;m=this._get_node(m);if(m===-1||!m||!m.length){return false}m.parentsUntil(".jstree","li").each(function(){l.push(k?this.id:n.get_text(this))});l.reverse();l.push(k?m.attr("id"):this.get_text(m));return l},_get_string:function(k){return this._get_settings().core.strings[k]||k},is_open:function(k){k=this._get_node(k);return k&&k!==-1&&k.hasClass("jstree-open")},is_closed:function(k){k=this._get_node(k);return k&&k!==-1&&k.hasClass("jstree-closed")},is_leaf:function(k){k=this._get_node(k);return k&&k!==-1&&k.hasClass("jstree-leaf")},correct_state:function(k){k=this._get_node(k);if(!k||k===-1){return false}k.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:k})},open_node:function(n,o,l){n=this._get_node(n);if(!n.length){return false}if(!n.hasClass("jstree-closed")){if(o){o.call()}return false}var m=l||d?0:this._get_settings().core.animation,k=this;if(!this._is_loaded(n)){n.children("a").addClass("jstree-loading");this.load_node(n,function(){k.open_node(n,o,l)},o)}else{if(this._get_settings().core.open_parents){n.parentsUntil(".jstree",".jstree-closed").each(function(){k.open_node(this,false,true)})}if(m){n.children("ul").css("display","none")}n.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");if(m){n.children("ul").stop(true,true).slideDown(m,function(){this.style.display="";k.after_open(n)})}else{k.after_open(n)}this.__callback({obj:n});if(o){o.call()}}},after_open:function(k){this.__callback({obj:k})},close_node:function(n,l){n=this._get_node(n);var m=l||d?0:this._get_settings().core.animation,k=this;if(!n.length||!n.hasClass("jstree-open")){return false}if(m){n.children("ul").attr("style","display:block !important")}n.removeClass("jstree-open").addClass("jstree-closed");if(m){n.children("ul").stop(true,true).slideUp(m,function(){this.style.display="";k.after_close(n)})}else{k.after_close(n)}this.__callback({obj:n})},after_close:function(k){this.__callback({obj:k})},toggle_node:function(k){k=this._get_node(k);if(k.hasClass("jstree-closed")){return this.open_node(k)}if(k.hasClass("jstree-open")){return this.close_node(k)}},open_all:function(m,l,k){m=m?this._get_node(m):-1;if(!m||m===-1){m=this.get_container_ul()}if(k){m=m.find("li.jstree-closed")}else{k=m;if(m.is(".jstree-closed")){m=m.find("li.jstree-closed").andSelf()}else{m=m.find("li.jstree-closed")}}var n=this;m.each(function(){var o=this;if(!n._is_loaded(this)){n.open_node(this,function(){n.open_all(o,l,k)},!l)}else{n.open_node(this,false,!l)}});if(k.find("li.jstree-closed").length===0){this.__callback({obj:k})}},close_all:function(l,k){var m=this;l=l?this._get_node(l):this.get_container();if(!l||l===-1){l=this.get_container_ul()}l.find("li.jstree-open").andSelf().each(function(){m.close_node(this,!k)});this.__callback({obj:l})},clean_node:function(k){k=k&&k!=-1?h(k):this.get_container_ul();k=k.is("li")?k.find("li").andSelf():k.find("li");k.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");k.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:k})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(k,l){this.get_container().empty().append(k);this.data=l;this.__callback()},load_node:function(m,k,l){this.__callback({obj:m})},_is_loaded:function(k){return true},create_node:function(p,k,o,r,l){p=this._get_node(p);k=typeof k==="undefined"?"last":k;var q=h("<li />"),n=this._get_settings().core,m;if(p!==-1&&!p.length){return false}if(!l&&!this._is_loaded(p)){this.load_node(p,function(){this.create_node(p,k,o,r,true)});return false}this.__rollback();if(typeof o==="string"){o={data:o}}if(!o){o={}}if(o.attr){q.attr(o.attr)}if(o.metadata){q.data(o.metadata)}if(o.state){q.addClass("jstree-"+o.state)}if(!o.data){o.data=this._get_string("new_node")}if(!h.isArray(o.data)){m=o.data;o.data=[];o.data.push(m)}h.each(o.data,function(t,s){m=h("<a />");if(h.isFunction(s)){s=s.call(this,o)}if(typeof s=="string"){m.attr("href","#")[n.html_titles?"html":"text"](s)}else{if(!s.attr){s.attr={}}if(!s.attr.href){s.attr.href="#"}m.attr(s.attr)[n.html_titles?"html":"text"](s.title);if(s.language){m.addClass(s.language)}}m.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!s.icon&&o.icon){s.icon=o.icon}if(s.icon){if(s.icon.indexOf("/")===-1){m.children("ins").addClass(s.icon)}else{m.children("ins").css("background","url('"+s.icon+"') center center no-repeat")}}q.append(m)});q.prepend("<ins class='jstree-icon'>&#160;</ins>");if(p===-1){p=this.get_container();if(k==="before"){k="first"}if(k==="after"){k="last"}}switch(k){case"before":p.before(q);m=this._get_parent(p);break;case"after":p.after(q);m=this._get_parent(p);break;case"inside":case"first":if(!p.children("ul").length){p.append("<ul />")}p.children("ul").prepend(q);m=p;break;case"last":if(!p.children("ul").length){p.append("<ul />")}p.children("ul").append(q);m=p;break;default:if(!p.children("ul").length){p.append("<ul />")}if(!k){k=0}m=p.children("ul").children("li").eq(k);if(m.length){m.before(q)}else{p.children("ul").append(q)}m=p;break}if(m===-1||m.get(0)===this.get_container().get(0)){m=-1}this.clean_node(m);this.__callback({obj:q,parent:m});if(r){r.call(this,q)}return q},get_text:function(l){l=this._get_node(l);if(!l.length){return false}var k=this._get_settings().core.html_titles;l=l.children("a:eq(0)");if(k){l=l.clone();l.children("INS").remove();return l.html()}else{l=l.contents().filter(function(){return this.nodeType==3})[0];return l.nodeValue}},set_text:function(l,m){l=this._get_node(l);if(!l.length){return false}l=l.children("a:eq(0)");if(this._get_settings().core.html_titles){var k=l.children("INS").clone();l.html(m).prepend(k);this.__callback({obj:l,name:m});return true}else{l=l.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:l,name:m});return(l.nodeValue=m)}},rename_node:function(k,l){k=this._get_node(k);this.__rollback();if(k&&k.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))){this.__callback({obj:k,name:l})}},delete_node:function(n){n=this._get_node(n);if(!n.length){return false}this.__rollback();var m=this._get_parent(n),l=h([]),k=this;n.each(function(){l=l.add(k._get_prev(this))});n=n.detach();if(m!==-1&&m.find("> ul > li").length===0){m.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}this.clean_node(m);this.__callback({obj:n,prev:l,parent:m});return n},prepare_move:function(q,m,s,k,l){var n={};n.ot=h.jstree._reference(q)||this;n.o=n.ot._get_node(q);n.r=m===-1?-1:this._get_node(m);n.p=(typeof s==="undefined"||s===false)?"last":s;if(!l&&e.o&&e.o[0]===n.o[0]&&e.r[0]===n.r[0]&&e.p===n.p){this.__callback(e);if(k){k.call(this,e)}return}n.ot=h.jstree._reference(n.o)||this;n.rt=h.jstree._reference(n.r)||this;if(n.r===-1||!n.r){n.cr=-1;switch(n.p){case"first":case"before":case"inside":n.cp=0;break;case"after":case"last":n.cp=n.rt.get_container().find(" > ul > li").length;break;default:n.cp=n.p;break}}else{if(!/^(before|after)$/.test(n.p)&&!this._is_loaded(n.r)){return this.load_node(n.r,function(){this.prepare_move(q,m,s,k,true)})}switch(n.p){case"before":n.cp=n.r.index();n.cr=n.rt._get_parent(n.r);break;case"after":n.cp=n.r.index()+1;n.cr=n.rt._get_parent(n.r);break;case"inside":case"first":n.cp=0;n.cr=n.r;break;case"last":n.cp=n.r.find(" > ul > li").length;n.cr=n.r;break;default:n.cp=n.p;n.cr=n.r;break}}n.np=n.cr==-1?n.rt.get_container():n.cr;n.op=n.ot._get_parent(n.o);n.cop=n.o.index();if(n.op===-1){n.op=n.ot?n.ot.get_container():this.get_container()}if(!/^(before|after)$/.test(n.p)&&n.op&&n.np&&n.op[0]===n.np[0]&&n.o.index()<n.cp){n.cp++}n.or=n.np.find(" > ul > li:nth-child("+(n.cp+1)+")");e=n;this.__callback(e);if(k){k.call(this,e)}},check_move:function(){var m=e,k=true,l=m.r===-1?this.get_container():m.r;if(!m||!m.o||m.or[0]===m.o[0]){return false}if(!m.cy){if(m.op&&m.np&&m.op[0]===m.np[0]&&m.cp-1===m.o.index()){return false}m.o.each(function(){if(l.parentsUntil(".jstree","li").andSelf().index(this)!==-1){k=false;return false}})}return k},move_node:function(r,n,k,m,l,q){if(!l){return this.prepare_move(r,n,k,function(o){this.move_node(o,false,false,m,true,q)})}if(m){e.cy=true}if(!q&&!this.check_move()){return false}this.__rollback();var s=false;if(m){s=r.o.clone(true);s.find("*[id]").andSelf().each(function(){if(this.id){this.id="copy_"+this.id}})}else{s=r.o}if(r.or.length){r.or.before(s)}else{if(!r.np.children("ul").length){h("<ul />").appendTo(r.np)}r.np.children("ul:eq(0)").append(s)}try{r.ot.clean_node(r.op);r.rt.clean_node(r.np);if(!r.op.find("> ul > li").length){r.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}}catch(p){}if(m){e.cy=true;e.oc=s}this.__callback(e);return e},_get_move:function(){return e}}})})(jQuery);(function(e){var h,g,f;e(function(){if(/msie/.test(navigator.userAgent.toLowerCase())){g=e('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");f=e('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");h=g.width()-f.width();g.add(f).remove()}else{g=e("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200});h=100-g.width();g.parent().remove()}});e.jstree.plugin("ui",{__init:function(){this.data.ui.selected=e();this.data.ui.last_selected=false;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",e.proxy(function(j){j.preventDefault();j.currentTarget.blur();if(!e(j.currentTarget).hasClass("jstree-loading")){this.select_node(j.currentTarget,true,j)}},this)).delegate("a","mouseenter.jstree",e.proxy(function(j){if(!e(j.currentTarget).hasClass("jstree-loading")){this.hover_node(j.target)}},this)).delegate("a","mouseleave.jstree",e.proxy(function(j){if(!e(j.currentTarget).hasClass("jstree-loading")){this.dehover_node(j.target)}},this)).bind("reopen.jstree",e.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",e.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",e.proxy(function(){this.reselect()},this)).bind("close_node.jstree",e.proxy(function(k,l){var j=this._get_settings().ui,m=this._get_node(l.rslt.obj),n=(m&&m.length)?m.children("ul").find("a.jstree-clicked"):e(),o=this;if(j.selected_parent_close===false||!n.length){return}n.each(function(){o.deselect_node(this);if(j.selected_parent_close==="select_parent"){o.select_node(m)}})},this)).bind("delete_node.jstree",e.proxy(function(k,l){var j=this._get_settings().ui.select_prev_on_delete,m=this._get_node(l.rslt.obj),n=(m&&m.length)?m.find("a.jstree-clicked"):[],o=this;n.each(function(){o.deselect_node(this)});if(j&&n.length){l.rslt.prev.each(function(){if(this.parentNode){o.select_node(this);return false}})}},this)).bind("move_node.jstree",e.proxy(function(j,k){if(k.rslt.cy){k.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")}},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:true,select_prev_on_delete:true,disable_selecting_children:false,initially_select:[]},_fn:{_get_node:function(j,k){if(typeof j==="undefined"||j===null){return k?this.data.ui.selected:this.data.ui.last_selected}var l=e(j,this.get_container());if(l.is(".jstree")||j==-1){return -1}l=l.closest("li",this.get_container());return l.length?l:false},_ui_notify:function(k,j){if(j.selected){this.select_node(k,false)}},save_selected:function(){var j=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){if(this.id){j.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(this.data.ui.to_select)},reselect:function(){var k=this,j=this.data.ui.to_select;j=e.map(e.makeArray(j),function(l){return"#"+l.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});e.each(j,function(l,m){if(m&&m!=="#"){k.select_node(m)}});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(j){this.save_selected();return this.__call_old()},hover_node:function(j){j=this._get_node(j);if(!j.length){return false}if(!j.hasClass("jstree-hovered")){this.dehover_node()}this.data.ui.hovered=j.children("a").addClass("jstree-hovered").parent();this._fix_scroll(j);this.__callback({obj:j})},dehover_node:function(){var k=this.data.ui.hovered,j;if(!k||!k.length){return false}j=k.children("a").removeClass("jstree-hovered").parent();if(this.data.ui.hovered[0]===j[0]){this.data.ui.hovered=null}this.__callback({obj:k})},select_node:function(m,j,n){m=this._get_node(m);if(m==-1||!m||!m.length){return false}var r=this._get_settings().ui,p=(r.select_multiple_modifier=="on"||(r.select_multiple_modifier!==false&&n&&n[r.select_multiple_modifier+"Key"])),k=(r.select_range_modifier!==false&&n&&n[r.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==m[0]&&this.data.ui.last_selected.parent()[0]===m.parent()[0]),l=this.is_selected(m),o=true,q=this;if(j){if(r.disable_selecting_children&&p&&((m.parentsUntil(".jstree","li").children("a.jstree-clicked").length)||(m.children("ul").find("a.jstree-clicked:eq(0)").length))){return false}o=false;switch(!0){case (k):this.data.ui.last_selected.addClass("jstree-last-selected");m=m[m.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();if(r.select_limit==-1||m.length<r.select_limit){this.data.ui.last_selected.removeClass("jstree-last-selected");this.data.ui.selected.each(function(){if(this!==q.data.ui.last_selected[0]){q.deselect_node(this)}});l=false;o=true}else{o=false}break;case (l&&!p):this.deselect_all();l=false;o=true;break;case (!l&&!p):if(r.select_limit==-1||r.select_limit>0){this.deselect_all();o=true}break;case (l&&p):this.deselect_node(m);break;case (!l&&p):if(r.select_limit==-1||this.data.ui.selected.length+1<=r.select_limit){o=true}break}}if(o&&!l){if(!k){this.data.ui.last_selected=m}m.children("a").addClass("jstree-clicked");if(r.selected_parent_open){m.parents(".jstree-closed").each(function(){q.open_node(this,false,true)})}this.data.ui.selected=this.data.ui.selected.add(m);this._fix_scroll(m.eq(0));this.__callback({obj:m,e:n})}},_fix_scroll:function(k){var l=this.get_container()[0],j;if(l.scrollHeight>l.offsetHeight){k=this._get_node(k);if(!k||k===-1||!k.length||!k.is(":visible")){return}j=k.offset().top-this.get_container().offset().top;if(j<0){l.scrollTop=l.scrollTop+j-1}if(j+this.data.core.li_height+(l.scrollWidth>l.offsetWidth?h:0)>l.offsetHeight){l.scrollTop=l.scrollTop+(j-l.offsetHeight+this.data.core.li_height+1+(l.scrollWidth>l.offsetWidth?h:0))}}},deselect_node:function(j){j=this._get_node(j);if(!j.length){return false}if(this.is_selected(j)){j.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(j);if(this.data.ui.last_selected.get(0)===j.get(0)){this.data.ui.last_selected=this.data.ui.selected.eq(0)}this.__callback({obj:j})}},toggle_select:function(j){j=this._get_node(j);if(!j.length){return false}if(this.is_selected(j)){this.deselect_node(j)}else{this.select_node(j)}},is_selected:function(j){return this.data.ui.selected.index(this._get_node(j))>=0},get_selected:function(j){return j?e(j).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(k){var j=k?e(k).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();j.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=e([]);this.data.ui.last_selected=false;this.__callback({obj:j})}}});e.jstree.defaults.plugins.push("ui")})(jQuery);(function(e){e.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",e.proxy(function(h,g){if(this._get_settings().crrm.move.open_onmove){var f=this;g.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){f.open_node(this,false,true)})}},this))},defaults:{input_width_limit:200,move:{always_copy:false,open_onmove:true,default_position:"last",check_move:function(f){return true}}},_fn:{_show_input:function(f,n){f=this._get_node(f);var l=this._get_settings().core.rtl,m=this._get_settings().crrm.input_width_limit,h=f.children("ins").width(),g=f.find("> a:visible > ins").width()*f.find("> a:visible > ins").length,o=this.get_text(f),k=e("<div />",{css:{position:"absolute",top:"-200px",left:(l?"0px":"-1000px"),visibility:"hidden"}}).appendTo("body"),j=f.css("position","relative").append(e("<input />",{value:o,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:(l?"auto":(h+g+4)+"px"),right:(l?(h+g+4)+"px":"auto"),top:"0px",height:(this.data.core.li_height-2)+"px",lineHeight:(this.data.core.li_height-2)+"px",width:"150px"},blur:e.proxy(function(){var q=f.children(".jstree-rename-input"),p=q.val();if(p===""){p=o}k.remove();q.remove();this.set_text(f,o);this.rename_node(f,p);n.call(this,f,p,o);f.css("position","")},this),keyup:function(q){var p=q.keyCode||q.which;if(p==27){this.value=o;this.blur();return}else{if(p==13){this.blur();return}else{j.width(Math.min(k.text("pW"+this.value).width(),m))}}},keypress:function(q){var p=q.keyCode||q.which;if(p==13){return false}}})).children(".jstree-rename-input");this.set_text(f,"");k.css({fontFamily:j.css("fontFamily")||"",fontSize:j.css("fontSize")||"",fontWeight:j.css("fontWeight")||"",fontStyle:j.css("fontStyle")||"",fontStretch:j.css("fontStretch")||"",fontVariant:j.css("fontVariant")||"",letterSpacing:j.css("letterSpacing")||"",wordSpacing:j.css("wordSpacing")||""});j.width(Math.min(k.text("pW"+j[0].value).width(),m))[0].select()},rename:function(h){h=this._get_node(h);this.__rollback();var g=this.__callback;this._show_input(h,function(k,j,f){g.call(this,{obj:k,new_name:j,old_name:f})})},create:function(k,g,j,m,f){var h,l=this;k=this._get_node(k);if(!k){k=-1}this.__rollback();h=this.create_node(k,g,j,function(n){var o=this._get_parent(n),q=e(n).index();if(m){m.call(this,n)}if(o.length&&o.hasClass("jstree-closed")){this.open_node(o,false,true)}if(!f){this._show_input(n,function(s,r,p){l.__callback({obj:s,name:r,parent:o,position:q})})}else{l.__callback({obj:n,name:this.get_text(n),parent:o,position:q})}});return h},remove:function(h){h=this._get_node(h,true);var g=this._get_parent(h),f=this._get_prev(h);this.__rollback();h=this.delete_node(h);if(h!==false){this.__callback({obj:h,prev:f,parent:g})}},check_move:function(){if(!this.__call_old()){return false}var f=this._get_settings().crrm.move;if(!f.check_move.call(this,this._get_move())){return false}return true},move_node:function(m,k,f,h,g,l){var j=this._get_settings().crrm.move;if(!g){if(typeof f==="undefined"){f=j.default_position}if(f==="inside"&&!j.default_position.match(/^(before|after)$/)){f=j.default_position}return this.__call_old(true,m,k,f,h,false,l)}if(j.always_copy===true||(j.always_copy==="multitree"&&m.rt.get_index()!==m.ot.get_index())){h=true}this.__call_old(true,m,k,f,h,true,l)},cut:function(f){f=this._get_node(f,true);if(!f||!f.length){return false}this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=f;this.__callback({obj:f})},copy:function(f){f=this._get_node(f,true);if(!f||!f.length){return false}this.data.crrm.ct_nodes=false;this.data.crrm.cp_nodes=f;this.__callback({obj:f})},paste:function(g){g=this._get_node(g);if(!g||!g.length){return false}var f=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes){return false}if(this.data.crrm.ct_nodes){this.move_node(this.data.crrm.ct_nodes,g);this.data.crrm.ct_nodes=false}if(this.data.crrm.cp_nodes){this.move_node(this.data.crrm.cp_nodes,g,false,true)}this.__callback({obj:g,nodes:f})}}})})(jQuery);(function(e){var f=[];e.jstree._themes=false;e.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",e.proxy(function(){var g=this._get_settings().themes;this.data.themes.dots=g.dots;this.data.themes.icons=g.icons;this.set_theme(g.theme,g.url)},this)).bind("loaded.jstree",e.proxy(function(){if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}},this))},defaults:{theme:"default",url:false,dots:true,icons:true},_fn:{set_theme:function(h,g){if(!h){return false}if(!g){g=e.jstree._themes+h+"/style.css"}if(e.inArray(g,f)==-1){e.vakata.css.add_sheet({url:g});f.push(g)}if(this.data.themes.theme!=h){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=h}this.get_container().addClass("jstree-"+h);if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=true;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=false;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){if(this.data.themes.dots){this.hide_dots()}else{this.show_dots()}},show_icons:function(){this.data.themes.icons=true;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=false;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){if(this.data.themes.icons){this.hide_icons()}else{this.show_icons()}}}});e(function(){if(e.jstree._themes===false){e("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){e.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}})}if(e.jstree._themes===false){e.jstree._themes="themes/"}});e.jstree.defaults.plugins.push("themes")})(jQuery);(function(g){var f=[];function e(j,k){var l=g.jstree._focused(),h;if(l&&l.data&&l.data.hotkeys&&l.data.hotkeys.enabled){h=l._get_settings().hotkeys[j];if(h){return h.call(l,k)}}}g.jstree.plugin("hotkeys",{__init:function(){if(typeof g.hotkeys==="undefined"){throw"jsTree hotkeys: jQuery hotkeys plugin not included."}if(!this.data.ui){throw"jsTree hotkeys: jsTree UI plugin not included."}g.each(this._get_settings().hotkeys,function(j,h){if(h!==false&&g.inArray(j,f)==-1){g(document).bind("keydown",j,function(k){return e(j,k)});f.push(j)}});this.get_container().bind("lock.jstree",g.proxy(function(){if(this.data.hotkeys.enabled){this.data.hotkeys.enabled=false;this.data.hotkeys.revert=true}},this)).bind("unlock.jstree",g.proxy(function(){if(this.data.hotkeys.revert){this.data.hotkeys.enabled=true}},this));this.enable_hotkeys()},defaults:{up:function(){var h=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(h));return false},"ctrl+up":function(){var h=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(h));return false},"shift+up":function(){var h=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(h));return false},down:function(){var h=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(h));return false},"ctrl+down":function(){var h=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(h));return false},"shift+down":function(){var h=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(h));return false},left:function(){var h=this.data.ui.hovered||this.data.ui.last_selected;if(h){if(h.hasClass("jstree-open")){this.close_node(h)}else{this.hover_node(this._get_prev(h))}}return false},"ctrl+left":function(){var h=this.data.ui.hovered||this.data.ui.last_selected;if(h){if(h.hasClass("jstree-open")){this.close_node(h)}else{this.hover_node(this._get_prev(h))}}return false},"shift+left":function(){var h=this.data.ui.hovered||this.data.ui.last_selected;if(h){if(h.hasClass("jstree-open")){this.close_node(h)}else{this.hover_node(this._get_prev(h))}}return false},right:function(){var h=this.data.ui.hovered||this.data.ui.last_selected;if(h&&h.length){if(h.hasClass("jstree-closed")){this.open_node(h)}else{this.hover_node(this._get_next(h))}}return false},"ctrl+right":function(){var h=this.data.ui.hovered||this.data.ui.last_selected;if(h&&h.length){if(h.hasClass("jstree-closed")){this.open_node(h)}else{this.hover_node(this._get_next(h))}}return false},"shift+right":function(){var h=this.data.ui.hovered||this.data.ui.last_selected;if(h&&h.length){if(h.hasClass("jstree-closed")){this.open_node(h)}else{this.hover_node(this._get_next(h))}}return false},space:function(){if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").click()}return false},"ctrl+space":function(h){h.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(h)}return false},"shift+space":function(h){h.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(h)}return false},f2:function(){this.rename(this.data.ui.hovered||this.data.ui.last_selected)},del:function(){this.remove(this.data.ui.hovered||this._get_node(null))}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=true},disable_hotkeys:function(){this.data.hotkeys.enabled=false}}})})(jQuery);(function(e){e.jstree.plugin("json_data",{__init:function(){var f=this._get_settings().json_data;if(f.progressive_unload){this.get_container().bind("after_close.jstree",function(h,g){g.rslt.obj.children("ul").remove()})}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(h,f,g){var j=this;this.load_node_json(h,function(){j.__callback({obj:j._get_node(h)});f.call(this)},g)},_is_loaded:function(g){var f=this._get_settings().json_data;g=this._get_node(g);return g==-1||!g||(!f.ajax&&!f.progressive_render&&!e.isFunction(f.data))||g.is(".jstree-open, .jstree-leaf")||g.children("ul").children("li").length>0},refresh:function(g){g=this._get_node(g);var f=this._get_settings().json_data;if(g&&g!==-1&&f.progressive_unload&&(e.isFunction(f.data)||!!f.ajax)){g.removeData("jstree_children")}return this.__call_old()},load_node_json:function(k,f,h){var j=this.get_settings().json_data,m,g=function(){},l=function(){};k=this._get_node(k);if(k&&k!==-1&&(j.progressive_render||j.progressive_unload)&&!k.is(".jstree-open, .jstree-leaf")&&k.children("ul").children("li").length===0&&k.data("jstree_children")){m=this._parse_json(k.data("jstree_children"),k);if(m){k.append(m);if(!j.progressive_unload){k.removeData("jstree_children")}}this.clean_node(k);if(f){f.call(this)}return}if(k&&k!==-1){if(k.data("jstree_is_loading")){return}else{k.data("jstree_is_loading",true)}}switch(!0){case (!j.data&&!j.ajax):throw"Neither data nor ajax settings supplied.";case (e.isFunction(j.data)):j.data.call(this,k,e.proxy(function(n){n=this._parse_json(n,k);if(!n){if(k===-1||!k){if(j.correct_state){this.get_container().children("ul").empty()}}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(j.correct_state){this.correct_state(k)}}if(h){h.call(this)}}else{if(k===-1||!k){this.get_container().children("ul").empty().append(n.children())}else{k.append(n).children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading")}this.clean_node(k);if(f){f.call(this)}}},this));break;case (!!j.data&&!j.ajax)||(!!j.data&&!!j.ajax&&(!k||k===-1)):if(!k||k==-1){m=this._parse_json(j.data,k);if(m){this.get_container().children("ul").empty().append(m.children());this.clean_node()}else{if(j.correct_state){this.get_container().children("ul").empty()}}}if(f){f.call(this)}break;case (!j.data&&!!j.ajax)||(!!j.data&&!!j.ajax&&k&&k!==-1):g=function(o,p,q){var n=this.get_settings().json_data.ajax.error;if(n){n.call(this,o,p,q)}if(k!=-1&&k.length){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(p==="success"&&j.correct_state){this.correct_state(k)}}else{if(p==="success"&&j.correct_state){this.get_container().children("ul").empty()}}if(h){h.call(this)}};l=function(q,o,n){var p=this.get_settings().json_data.ajax.success;if(p){q=p.call(this,q,o,n)||q}if(q===""||(q&&q.toString&&q.toString().replace(/^[\s\n]+$/,"")==="")||(!e.isArray(q)&&!e.isPlainObject(q))){return g.call(this,n,o,"")}q=this._parse_json(q,k);if(q){if(k===-1||!k){this.get_container().children("ul").empty().append(q.children())}else{k.append(q).children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading")}this.clean_node(k);if(f){f.call(this)}}else{if(k===-1||!k){if(j.correct_state){this.get_container().children("ul").empty();if(f){f.call(this)}}}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(j.correct_state){this.correct_state(k);if(f){f.call(this)}}}}};j.ajax.context=this;j.ajax.error=g;j.ajax.success=l;if(!j.ajax.dataType){j.ajax.dataType="json"}if(e.isFunction(j.ajax.url)){j.ajax.url=j.ajax.url.call(this,k)}if(e.isFunction(j.ajax.data)){j.ajax.data=j.ajax.data.call(this,k)}e.ajax(j.ajax);break}},_parse_json:function(f,l,r){var n=false,g=this._get_settings(),v=g.json_data,u=g.core.html_titles,m,k,h,q,o;if(!f){return n}if(v.progressive_unload&&l&&l!==-1){l.data("jstree_children",n)}if(e.isArray(f)){n=e();if(!f.length){return false}for(k=0,h=f.length;k<h;k++){m=this._parse_json(f[k],l,true);if(m.length){n=n.add(m)}}}else{if(typeof f=="string"){f={data:f}}if(!f.data&&f.data!==""){return n}n=e("<li />");if(f.attr){n.attr(f.attr)}if(f.metadata){n.data(f.metadata)}if(f.state){n.addClass("jstree-"+f.state)}if(!e.isArray(f.data)){m=f.data;f.data=[];f.data.push(m)}e.each(f.data,function(p,j){m=e("<a />");if(e.isFunction(j)){j=j.call(this,f)}if(typeof j=="string"){m.attr("href","#")[u?"html":"text"](j)}else{if(!j.attr){j.attr={}}if(!j.attr.href){j.attr.href="#"}m.attr(j.attr)[u?"html":"text"](j.title);if(j.language){m.addClass(j.language)}}m.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!j.icon&&f.icon){j.icon=f.icon}if(j.icon){if(j.icon.indexOf("/")===-1){m.children("ins").addClass(j.icon)}else{m.children("ins").css("background","url('"+j.icon+"') center center no-repeat")}}n.append(m)});n.prepend("<ins class='jstree-icon'>&#160;</ins>");if(f.children){if(v.progressive_render&&f.state!=="open"){n.addClass("jstree-closed").data("jstree_children",f.children)}else{if(v.progressive_unload){n.data("jstree_children",f.children)}if(e.isArray(f.children)&&f.children.length){m=this._parse_json(f.children,l,true);if(m.length){o=e("<ul />");o.append(m);n.append(o)}}}}}if(!r){q=e("<ul />");q.append(n);n=q}return n},get_json:function(l,h,f,p){var u=[],r=this._get_settings(),m=this,k,j,o,n,q,g;l=this._get_node(l);if(!l||l===-1){l=this.get_container().find("> ul > li")}h=e.isArray(h)?h:["id","class"];if(!p&&this.data.types){h.push(r.types.type_attr)}f=e.isArray(f)?f:[];l.each(function(){o=e(this);k={data:[]};if(h.length){k.attr={}}e.each(h,function(t,s){j=o.attr(s);if(j&&j.length&&j.replace(/jstree[^ ]*/ig,"").length){k.attr[s]=(" "+j).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}});if(o.hasClass("jstree-open")){k.state="open"}if(o.hasClass("jstree-closed")){k.state="closed"}if(o.data()){k.metadata=o.data()}n=o.children("a");n.each(function(){q=e(this);if(f.length||e.inArray("languages",r.plugins)!==-1||q.children("ins").get(0).style.backgroundImage.length||(q.children("ins").get(0).className&&q.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length)){g=false;if(e.inArray("languages",r.plugins)!==-1&&e.isArray(r.languages)&&r.languages.length){e.each(r.languages,function(s,t){if(q.hasClass(t)){g=t;return false}})}j={attr:{},title:m.get_text(q,g)};e.each(f,function(s,t){j.attr[t]=(" "+(q.attr(t)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});if(e.inArray("languages",r.plugins)!==-1&&e.isArray(r.languages)&&r.languages.length){e.each(r.languages,function(s,t){if(q.hasClass(t)){j.language=t;return true}})}if(q.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){j.icon=q.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}if(q.children("ins").get(0).style.backgroundImage.length){j.icon=q.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}}else{j=m.get_text(q)}if(n.length>1){k.data.push(j)}else{k.data=j}});o=o.find("> ul > li");if(o.length){k.children=m.get_json(o,h,f,true)}u.push(k)});return u}}})})(jQuery);(function(f){var e=false;f.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(j){var k=this._get_settings().languages,h=false,g=".jstree-"+this.get_index()+" a";if(!f.isArray(k)||k.length===0){return false}if(f.inArray(j,k)==-1){if(!!k[j]){j=k[j]}else{return false}}if(j==this.data.languages.current_language){return true}h=f.vakata.css.get_css(g+"."+this.data.languages.current_language,false,e);if(h!==false){h.style.display="none"}h=f.vakata.css.get_css(g+"."+j,false,e);if(h!==false){h.style.display=""}this.data.languages.current_language=j;this.__callback(j);return true},get_lang:function(){return this.data.languages.current_language},_get_string:function(g,k){var j=this._get_settings().languages,h=this._get_settings().core.strings;if(f.isArray(j)&&j.length){k=(k&&f.inArray(k,j)!=-1)?k:this.data.languages.current_language}if(h[k]&&h[k][g]){return h[k][g]}if(h[g]){return h[g]}return g},get_text:function(j,k){j=this._get_node(j)||this.data.ui.last_selected;if(!j.size()){return false}var h=this._get_settings().languages,g=this._get_settings().core.html_titles;if(f.isArray(h)&&h.length){k=(k&&f.inArray(k,h)!=-1)?k:this.data.languages.current_language;j=j.children("a."+k)}else{j=j.children("a:eq(0)")}if(g){j=j.clone();j.children("INS").remove();return j.html()}else{j=j.contents().filter(function(){return this.nodeType==3})[0];return j.nodeValue}},set_text:function(k,m,l){k=this._get_node(k)||this.data.ui.last_selected;if(!k.size()){return false}var j=this._get_settings().languages,h=this._get_settings().core.html_titles,g;if(f.isArray(j)&&j.length){l=(l&&f.inArray(l,j)!=-1)?l:this.data.languages.current_language;k=k.children("a."+l)}else{k=k.children("a:eq(0)")}if(h){g=k.children("INS").clone();k.html(m).prepend(g);this.__callback({obj:k,name:m,lang:l});return true}else{k=k.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:k,name:m,lang:l});return(k.nodeValue=m)}},_load_css:function(){var j=this._get_settings().languages,k="/* languages css */",g=".jstree-"+this.get_index()+" a",h;if(f.isArray(j)&&j.length){this.data.languages.current_language=j[0];for(h=0;h<j.length;h++){k+=g+"."+j[h]+" {";if(j[h]!=this.data.languages.current_language){k+=" display:none; "}k+=" } "}e=f.vakata.css.add_sheet({str:k,title:"jstree-languages"})}},create_node:function(k,g,j,l){var h=this.__call_old(true,k,g,j,function(n){var p=this._get_settings().languages,m=n.children("a"),o;if(f.isArray(p)&&p.length){for(o=0;o<p.length;o++){if(!m.is("."+p[o])){n.append(m.eq(0).clone().removeClass(p.join(" ")).addClass(p[o]))}}m.not("."+p.join(", .")).remove()}if(l){l.call(this,n)}});return h}}})})(jQuery);(function(e){e.jstree.plugin("cookies",{__init:function(){if(typeof e.cookie==="undefined"){throw"jsTree cookie: jQuery cookie plugin not included."}var g=this._get_settings().cookies,f;if(!!g.save_loaded){f=e.cookie(g.save_loaded);if(f&&f.length){this.data.core.to_load=f.split(",")}}if(!!g.save_opened){f=e.cookie(g.save_opened);if(f&&f.length){this.data.core.to_open=f.split(",")}}if(!!g.save_selected){f=e.cookie(g.save_selected);if(f&&f.length&&this.data.ui){this.data.ui.to_select=f.split(",")}}this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",e.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",e.proxy(function(h){if(this._get_settings().cookies.auto_save){this.save_cookie((h.handleObj.namespace+h.handleObj.type).replace("jstree",""))}},this))},this))},defaults:{save_loaded:"jstree_load",save_opened:"jstree_open",save_selected:"jstree_select",auto_save:true,cookie_options:{}},_fn:{save_cookie:function(g){if(this.data.core.refreshing){return}var f=this._get_settings().cookies;if(!g){if(f.save_loaded){this.save_loaded();e.cookie(f.save_loaded,this.data.core.to_load.join(","),f.cookie_options)}if(f.save_opened){this.save_opened();e.cookie(f.save_opened,this.data.core.to_open.join(","),f.cookie_options)}if(f.save_selected&&this.data.ui){this.save_selected();e.cookie(f.save_selected,this.data.ui.to_select.join(","),f.cookie_options)}return}switch(g){case"open_node":case"close_node":if(!!f.save_opened){this.save_opened();e.cookie(f.save_opened,this.data.core.to_open.join(","),f.cookie_options)}if(!!f.save_loaded){this.save_loaded();e.cookie(f.save_loaded,this.data.core.to_load.join(","),f.cookie_options)}break;case"select_node":case"deselect_node":if(!!f.save_selected&&this.data.ui){this.save_selected();e.cookie(f.save_selected,this.data.ui.to_select.join(","),f.cookie_options)}break}}}})})(jQuery);(function(e){e.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",e.proxy(function(h,f){var g=this._get_node(f.rslt.obj);g=g===-1?this.get_container().children("ul"):g.children("ul");this.sort(g)},this)).bind("rename_node.jstree create_node.jstree create.jstree",e.proxy(function(g,f){this.sort(f.rslt.obj.parent())},this)).bind("move_node.jstree",e.proxy(function(h,g){var f=g.rslt.np==-1?this.get_container():g.rslt.np;this.sort(f.children("ul"))},this))},defaults:function(g,f){return this.get_text(g)>this.get_text(f)?1:-1},_fn:{sort:function(h){var g=this._get_settings().sort,f=this;h.append(e.makeArray(h.children("li")).sort(e.proxy(g,f)));h.find("> li > ul").each(function(){f.sort(e(this))});this.clean_node(h)}}})})(jQuery);(function(l){var g=false,e=false,h=false,j=false,n=false,f=false,q=false,p=false,k=false;l.vakata.dnd={is_down:false,is_drag:false,helper:false,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(s,r,m){if(l.vakata.dnd.is_drag){l.vakata.drag_stop({})}try{s.currentTarget.unselectable="on";s.currentTarget.onselectstart=function(){return false};if(s.currentTarget.style){s.currentTarget.style.MozUserSelect="none"}}catch(o){}l.vakata.dnd.init_x=s.pageX;l.vakata.dnd.init_y=s.pageY;l.vakata.dnd.user_data=r;l.vakata.dnd.is_down=true;l.vakata.dnd.helper=l("<div id='vakata-dragged' />").html(m);l(document).bind("mousemove",l.vakata.dnd.drag);l(document).bind("mouseup",l.vakata.dnd.drag_stop);return false},drag:function(r){if(!l.vakata.dnd.is_down){return}if(!l.vakata.dnd.is_drag){if(Math.abs(r.pageX-l.vakata.dnd.init_x)>5||Math.abs(r.pageY-l.vakata.dnd.init_y)>5){l.vakata.dnd.helper.appendTo("body");l.vakata.dnd.is_drag=true;l(document).triggerHandler("drag_start.vakata",{event:r,data:l.vakata.dnd.user_data})}else{return}}if(r.type==="mousemove"){var s=l(document),o=s.scrollTop(),m=s.scrollLeft();if(r.pageY-o<20){if(f&&q==="down"){clearInterval(f);f=false}if(!f){q="up";f=setInterval(function(){l(document).scrollTop(l(document).scrollTop()-l.vakata.dnd.scroll_spd)},150)}}else{if(f&&q==="up"){clearInterval(f);f=false}}if(l(window).height()-(r.pageY-o)<20){if(f&&q==="up"){clearInterval(f);f=false}if(!f){q="down";f=setInterval(function(){l(document).scrollTop(l(document).scrollTop()+l.vakata.dnd.scroll_spd)},150)}}else{if(f&&q==="down"){clearInterval(f);f=false}}if(r.pageX-m<20){if(n&&p==="right"){clearInterval(n);n=false}if(!n){p="left";n=setInterval(function(){l(document).scrollLeft(l(document).scrollLeft()-l.vakata.dnd.scroll_spd)},150)}}else{if(n&&p==="left"){clearInterval(n);n=false}}if(l(window).width()-(r.pageX-m)<20){if(n&&p==="left"){clearInterval(n);n=false}if(!n){p="right";n=setInterval(function(){l(document).scrollLeft(l(document).scrollLeft()+l.vakata.dnd.scroll_spd)},150)}}else{if(n&&p==="right"){clearInterval(n);n=false}}}l.vakata.dnd.helper.css({left:(r.pageX+l.vakata.dnd.helper_left)+"px",top:(r.pageY+l.vakata.dnd.helper_top)+"px"});l(document).triggerHandler("drag.vakata",{event:r,data:l.vakata.dnd.user_data})},drag_stop:function(m){if(n){clearInterval(n)}if(f){clearInterval(f)}l(document).unbind("mousemove",l.vakata.dnd.drag);l(document).unbind("mouseup",l.vakata.dnd.drag_stop);l(document).triggerHandler("drag_stop.vakata",{event:m,data:l.vakata.dnd.user_data});l.vakata.dnd.helper.remove();l.vakata.dnd.init_x=0;l.vakata.dnd.init_y=0;l.vakata.dnd.user_data={};l.vakata.dnd.is_down=false;l.vakata.dnd.is_drag=false}};l(function(){var m="#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ";l.vakata.css.add_sheet({str:m,title:"vakata"})});l.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:false,after:false,inside:false,before:false,off:false,prepared:false,w:0,to1:false,to2:false,cof:false,cw:false,ch:false,i1:false,i2:false,mto:false};this.get_container().bind("mouseenter.jstree",l.proxy(function(s){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){if(this.data.themes){h.attr("class","jstree-"+this.data.themes.theme);if(j){j.attr("class","jstree-"+this.data.themes.theme)}l.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}if(s.currentTarget===s.target&&l.vakata.dnd.user_data.obj&&l(l.vakata.dnd.user_data.obj).length&&l(l.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==s.target){var r=l.jstree._reference(s.target),o;if(r.data.dnd.foreign){o=r._get_settings().dnd.drag_check.call(this,{o:g,r:r.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){l.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}else{r.prepare_move(g,r.get_container(),"last");if(r.check_move()){l.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}}}},this)).bind("mouseup.jstree",l.proxy(function(s){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree&&s.currentTarget===s.target&&l.vakata.dnd.user_data.obj&&l(l.vakata.dnd.user_data.obj).length&&l(l.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==s.target){var r=l.jstree._reference(s.currentTarget),o;if(r.data.dnd.foreign){o=r._get_settings().dnd.drag_check.call(this,{o:g,r:r.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){r._get_settings().dnd.drag_finish.call(this,{o:g,r:r.get_container(),is_root:true})}}else{r.move_node(g,r.get_container(),"last",s[r._get_settings().dnd.copy_modifier+"Key"])}}},this)).bind("mouseleave.jstree",l.proxy(function(o){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(l.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){l.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}}},this)).bind("mousemove.jstree",l.proxy(function(r){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){var o=this.get_container()[0];if(r.pageX+24>this.data.dnd.cof.left+this.data.dnd.cw){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(l.proxy(function(){this.scrollLeft+=l.vakata.dnd.scroll_spd},o),100)}else{if(r.pageX-24<this.data.dnd.cof.left){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(l.proxy(function(){this.scrollLeft-=l.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}}}if(r.pageY+24>this.data.dnd.cof.top+this.data.dnd.ch){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(l.proxy(function(){this.scrollTop+=l.vakata.dnd.scroll_spd},o),100)}else{if(r.pageY-24<this.data.dnd.cof.top){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(l.proxy(function(){this.scrollTop-=l.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}}}}},this)).bind("scroll.jstree",l.proxy(function(o){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree&&h&&j){h.hide();j.hide()}},this)).delegate("a","mousedown.jstree",l.proxy(function(o){if(o.which===1){this.start_drag(o.currentTarget,o);return false}},this)).delegate("a","mouseenter.jstree",l.proxy(function(o){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){this.dnd_enter(o.currentTarget)}},this)).delegate("a","mousemove.jstree",l.proxy(function(o){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){if(!e||!e.length||e.children("a")[0]!==o.currentTarget){this.dnd_enter(o.currentTarget)}if(typeof this.data.dnd.off.top==="undefined"){this.data.dnd.off=l(o.target).offset()}this.data.dnd.w=(o.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height;if(this.data.dnd.w<0){this.data.dnd.w+=this.data.core.li_height}this.dnd_show()}},this)).delegate("a","mouseleave.jstree",l.proxy(function(o){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(h){h.hide()}if(j){j.hide()}this.data.dnd.mto=setTimeout((function(r){return function(){r.dnd_leave(o)}})(this),0)}},this)).delegate("a","mouseup.jstree",l.proxy(function(o){if(l.vakata.dnd.is_drag&&l.vakata.dnd.user_data.jstree){this.dnd_finish(o)}},this));l(document).bind("drag_stop.vakata",l.proxy(function(){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;this.data.dnd.off=false;this.data.dnd.prepared=false;this.data.dnd.w=false;this.data.dnd.to1=false;this.data.dnd.to2=false;this.data.dnd.i1=false;this.data.dnd.i2=false;this.data.dnd.active=false;this.data.dnd.foreign=false;if(h){h.css({top:"-2000px"})}if(j){j.css({top:"-2000px"})}},this)).bind("drag_start.vakata",l.proxy(function(s,o){if(o.data.jstree){var r=l(o.event.target);if(r.closest(".jstree").hasClass("jstree-"+this.get_index())){this.dnd_enter(r)}}},this));var m=this._get_settings().dnd;if(m.drag_target){l(document).delegate(m.drag_target,"mousedown.jstree-"+this.get_index(),l.proxy(function(r){g=r.target;l.vakata.dnd.drag_start(r,{jstree:true,obj:r.target},"<ins class='jstree-icon'></ins>"+l(r.target).text());if(this.data.themes){if(h){h.attr("class","jstree-"+this.data.themes.theme)}if(j){j.attr("class","jstree-"+this.data.themes.theme)}l.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}l.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var o=this.get_container();this.data.dnd.cof=o.offset();this.data.dnd.cw=parseInt(o.width(),10);this.data.dnd.ch=parseInt(o.height(),10);this.data.dnd.foreign=true;r.preventDefault()},this))}if(m.drop_target){l(document).delegate(m.drop_target,"mouseenter.jstree-"+this.get_index(),l.proxy(function(o){if(this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:g,r:l(o.target),e:o})){l.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}},this)).delegate(m.drop_target,"mouseleave.jstree-"+this.get_index(),l.proxy(function(o){if(this.data.dnd.active){l.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}},this)).delegate(m.drop_target,"mouseup.jstree-"+this.get_index(),l.proxy(function(o){if(this.data.dnd.active&&l.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){this._get_settings().dnd.drop_finish.call(this,{o:g,r:l(o.target),e:o})}},this))}},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,drop_target:".jstree-drop",drop_check:function(m){return true},drop_finish:l.noop,drag_target:".jstree-draggable",drag_finish:l.noop,drag_check:function(m){return{after:false,before:false,inside:true}}},_fn:{dnd_prepare:function(){if(!e||!e.length){return}this.data.dnd.off=e.offset();if(this._get_settings().core.rtl){this.data.dnd.off.right=this.data.dnd.off.left+e.width()}if(this.data.dnd.foreign){var m=this._get_settings().dnd.drag_check.call(this,{o:g,r:e});this.data.dnd.after=m.after;this.data.dnd.before=m.before;this.data.dnd.inside=m.inside;this.data.dnd.prepared=true;return this.dnd_show()}this.prepare_move(g,e,"before");this.data.dnd.before=this.check_move();this.prepare_move(g,e,"after");this.data.dnd.after=this.check_move();if(this._is_loaded(e)){this.prepare_move(g,e,"inside");this.data.dnd.inside=this.check_move()}else{this.data.dnd.inside=false}this.data.dnd.prepared=true;return this.dnd_show()},dnd_show:function(){if(!this.data.dnd.prepared){return}var t=["before","inside","after"],m=false,s=this._get_settings().core.rtl,u;if(this.data.dnd.w<this.data.core.li_height/3){t=["before","inside","after"]}else{if(this.data.dnd.w<=this.data.core.li_height*2/3){t=this.data.dnd.w<this.data.core.li_height/2?["inside","before","after"]:["inside","after","before"]}else{t=["after","inside","before"]}}l.each(t,l.proxy(function(o,r){if(this.data.dnd[r]){l.vakata.dnd.helper.children("ins").attr("class","jstree-ok");m=r;return false}},this));if(m===false){l.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}u=s?(this.data.dnd.off.right-18):(this.data.dnd.off.left+10);switch(m){case"before":h.css({left:u+"px",top:(this.data.dnd.off.top-6)+"px"}).show();if(j){j.css({left:(u+8)+"px",top:(this.data.dnd.off.top-1)+"px"}).show()}break;case"after":h.css({left:u+"px",top:(this.data.dnd.off.top+this.data.core.li_height-6)+"px"}).show();if(j){j.css({left:(u+8)+"px",top:(this.data.dnd.off.top+this.data.core.li_height-1)+"px"}).show()}break;case"inside":h.css({left:u+(s?-4:4)+"px",top:(this.data.dnd.off.top+this.data.core.li_height/2-5)+"px"}).show();if(j){j.hide()}break;default:h.hide();if(j){j.hide()}break}k=m;return m},dnd_open:function(){this.data.dnd.to2=false;this.open_node(e,l.proxy(this.dnd_prepare,this),true)},dnd_finish:function(m){if(this.data.dnd.foreign){if(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside){this._get_settings().dnd.drag_finish.call(this,{o:g,r:e,p:k})}}else{this.dnd_prepare();this.move_node(g,e,k,m[this._get_settings().dnd.copy_modifier+"Key"])}g=false;e=false;h.hide();if(j){j.hide()}},dnd_enter:function(o){if(this.data.dnd.mto){clearTimeout(this.data.dnd.mto);this.data.dnd.mto=false}var m=this._get_settings().dnd;this.data.dnd.prepared=false;e=this._get_node(o);if(m.check_timeout){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}this.data.dnd.to1=setTimeout(l.proxy(this.dnd_prepare,this),m.check_timeout)}else{this.dnd_prepare()}if(m.open_timeout){if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(e&&e.length&&e.hasClass("jstree-closed")){this.data.dnd.to2=setTimeout(l.proxy(this.dnd_open,this),m.open_timeout)}}else{if(e&&e.length&&e.hasClass("jstree-closed")){this.dnd_open()}}},dnd_leave:function(m){this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;l.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");h.hide();if(j){j.hide()}if(e&&e[0]===m.target.parentNode){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1);this.data.dnd.to1=false}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2);this.data.dnd.to2=false}}},start_drag:function(s,r){g=this._get_node(s);if(this.data.ui&&this.is_selected(g)){g=this._get_node(null,true)}var o=g.length>1?this._get_string("multiple_selection"):this.get_text(g),m=this.get_container();if(!this._get_settings().core.html_titles){o=o.replace(/</ig,"&lt;").replace(/>/ig,"&gt;")}l.vakata.dnd.drag_start(r,{jstree:true,obj:g},"<ins class='jstree-icon'></ins>"+o);if(this.data.themes){if(h){h.attr("class","jstree-"+this.data.themes.theme)}if(j){j.attr("class","jstree-"+this.data.themes.theme)}l.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}this.data.dnd.cof=m.offset();this.data.dnd.cw=parseInt(m.width(),10);this.data.dnd.ch=parseInt(m.height(),10);this.data.dnd.active=true}}});l(function(){var m="#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px;  -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43;  cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666;  -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }";l.vakata.css.add_sheet({str:m,title:"jstree"});h=l("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(o){h.hide();j.hide();o.preventDefault();o.stopImmediatePropagation();return false}).appendTo("body");j=l("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(o){if(e&&e.length){e.children("a").trigger(o);o.preventDefault();o.stopImmediatePropagation();return false}}).bind("mouseleave",function(r){var o=l(r.relatedTarget);if(o.is(".jstree")||o.closest(".jstree").length===0){if(e&&e.length){e.children("a").trigger(r);h.hide();j.hide();r.preventDefault();r.stopImmediatePropagation();return false}}}).appendTo("body");l(document).bind("drag_start.vakata",function(r,o){if(o.data.jstree){h.show();if(j){j.show()}}});l(document).bind("drag_stop.vakata",function(r,o){if(o.data.jstree){h.hide();if(j){j.hide()}}})})})(jQuery);(function(e){e.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;if(this.data.ui&&this.data.checkbox.noui){this.select_node=this.deselect_node=this.deselect_all=e.noop;this.get_selected=this.get_checked}this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",e.proxy(function(g,f){this._prepare_checkboxes(f.rslt.obj)},this)).bind("loaded.jstree",e.proxy(function(f){this._prepare_checkboxes()},this)).delegate((this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox"),"click.jstree",e.proxy(function(f){f.preventDefault();if(this._get_node(f.target).hasClass("jstree-checked")){this.uncheck_node(f.target)}else{this.check_node(f.target)}if(this.data.ui&&this.data.checkbox.noui){this.save_selected();if(this.data.cookies){this.save_cookie("select_node")}}else{f.stopImmediatePropagation();return false}},this))},defaults:{override_ui:false,two_state:false,real_checkboxes:false,checked_parent_open:true,real_checkboxes_names:function(f){return[("check_"+(f[0].id||Math.ceil(Math.random()*10000))),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(g,f){if(f.checked){this.check_node(g,false)}},_prepare_checkboxes:function(k){k=!k||k==-1?this.get_container().find("> ul > li"):this._get_node(k);if(k===false){return}var m,l=this,f,h=this._get_settings().checkbox.two_state,j=this._get_settings().checkbox.real_checkboxes,g=this._get_settings().checkbox.real_checkboxes_names;k.each(function(){f=e(this);m=f.is("li")&&(f.hasClass("jstree-checked")||(j&&f.children(":checked").length))?"jstree-checked":"jstree-unchecked";f.find("li").andSelf().each(function(){var o=e(this),n;o.children("a"+(l.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(h?"jstree-unchecked":m);if(j){if(!o.children(":checkbox").length){n=g.call(l,o);o.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+n[0]+"' name='"+n[0]+"' value='"+n[1]+"' />")}else{o.children(":checkbox").addClass("jstree-real-checkbox")}}if(!h){if(m==="jstree-checked"||o.hasClass("jstree-checked")||o.children(":checked").length){o.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",true)}}else{if(o.hasClass("jstree-checked")||o.children(":checked").length){o.addClass("jstree-checked").children(":checkbox").prop("checked",true)}}})});if(!h){k.find(".jstree-checked").parent().parent().each(function(){l._repair_state(this)})}},change_state:function(j,h){j=this._get_node(j);var f=false,g=this._get_settings().checkbox.real_checkboxes;if(!j||j===-1){return false}h=(h===false||h===true)?h:j.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(h){j.removeClass("jstree-checked").addClass("jstree-unchecked");if(g){j.children(":checkbox").prop("checked",false)}}else{j.removeClass("jstree-unchecked").addClass("jstree-checked");if(g){j.children(":checkbox").prop("checked",true)}}}else{if(h){f=j.find("li").andSelf();if(!f.filter(".jstree-checked, .jstree-undetermined").length){return false}f.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(g){f.children(":checkbox").prop("checked",false)}}else{f=j.find("li").andSelf();if(!f.filter(".jstree-unchecked, .jstree-undetermined").length){return false}f.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(g){f.children(":checkbox").prop("checked",true)}if(this.data.ui){this.data.ui.last_selected=j}this.data.checkbox.last_selected=j}j.parentsUntil(".jstree","li").each(function(){var k=e(this);if(h){if(k.children("ul").children("li.jstree-checked, li.jstree-undetermined").length){k.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(g){k.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{k.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(g){k.children(":checkbox").prop("checked",false)}}}else{if(k.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){k.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(g){k.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{k.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(g){k.children(":checkbox").prop("checked",true)}}}})}if(this.data.ui&&this.data.checkbox.noui){this.data.ui.selected=this.get_checked()}this.__callback(j);return true},check_node:function(g){if(this.change_state(g,false)){g=this._get_node(g);if(this._get_settings().checkbox.checked_parent_open){var f=this;g.parents(".jstree-closed").each(function(){f.open_node(this,false,true)})}this.__callback({obj:g})}},uncheck_node:function(f){if(this.change_state(f,true)){this.__callback({obj:this._get_node(f)})}},check_all:function(){var g=this,f=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");f.each(function(){g.change_state(this,false)});this.__callback()},uncheck_all:function(){var g=this,f=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");f.each(function(){g.change_state(this,true)});this.__callback()},is_checked:function(f){f=this._get_node(f);return f.length?f.is(".jstree-checked"):false},get_checked:function(g,f){g=!g||g===-1?this.get_container():this._get_node(g);return f||this._get_settings().checkbox.two_state?g.find(".jstree-checked"):g.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(g,f){g=!g||g===-1?this.get_container():this._get_node(g);return f||this._get_settings().checkbox.two_state?g.find(".jstree-unchecked"):g.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(j){j=this._get_node(j);if(!j.length){return}if(this._get_settings().checkbox.two_state){j.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",true);return}var h=this._get_settings().checkbox.real_checkboxes,g=j.find("> ul > .jstree-checked").length,f=j.find("> ul > .jstree-undetermined").length,k=j.find("> ul > li").length;if(k===0){if(j.hasClass("jstree-undetermined")){this.change_state(j,false)}}else{if(g===0&&f===0){this.change_state(j,true)}else{if(g===k){this.change_state(j,false)}else{j.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(h){j.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}}}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var g=this,f=this.data.ui.to_select;f=e.map(e.makeArray(f),function(h){return"#"+h.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();e.each(f,function(h,j){g.check_node(j)});this.__callback()}else{this.__call_old()}},save_loaded:function(){var f=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){if(this.id){f.data.core.to_load.push("#"+this.id)}})}}});e(function(){var f=".jstree .jstree-real-checkbox { display:none; } ";e.vakata.css.add_sheet({str:f,title:"jstree"})})})(jQuery);(function(g){g.vakata.xslt=function(h,j,t){var l=false,o,m,k;if(l===false&&window.ActiveXObject){try{l=new ActiveXObject("Msxml2.XSLTemplate");m=new ActiveXObject("Msxml2.DOMDocument");m.loadXML(h);k=new ActiveXObject("Msxml2.FreeThreadedDOMDocument");k.loadXML(j);l.stylesheet=k;o=l.createProcessor();o.input=m;o.transform();l=o.output}catch(n){}}h=g.parseXML(h);j=g.parseXML(j);if(l===false&&typeof(XSLTProcessor)!=="undefined"){o=new XSLTProcessor();o.importStylesheet(j);l=o.transformToFragment(h,document);l=g("<div />").append(l).html()}if(l===false&&typeof(h.transformNode)!=="undefined"){l=h.transformNode(j)}t.call(null,l)};var f={nest:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" /><xsl:template match="/">	<xsl:call-template name="nodes">		<xsl:with-param name="node" select="/root" />	</xsl:call-template></xsl:template><xsl:template name="nodes">	<xsl:param name="node" />	<ul>	<xsl:for-each select="$node/item">		<xsl:variable name="children" select="count(./item) &gt; 0" />		<li>			<xsl:attribute name="class">				<xsl:if test="position() = last()">jstree-last </xsl:if>				<xsl:choose>					<xsl:when test="@state = \'open\'">jstree-open </xsl:when>					<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>					<xsl:otherwise>jstree-leaf </xsl:otherwise>				</xsl:choose>				<xsl:value-of select="@class" />			</xsl:attribute>			<xsl:for-each select="@*">				<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">					<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>				</xsl:if>			</xsl:for-each>	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>			<xsl:for-each select="content/name">				<a>				<xsl:attribute name="href">					<xsl:choose>					<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>					<xsl:otherwise>#</xsl:otherwise>					</xsl:choose>				</xsl:attribute>				<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>				<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>				<xsl:for-each select="@*">					<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">						<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>					</xsl:if>				</xsl:for-each>					<ins>						<xsl:attribute name="class">jstree-icon 							<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>						</xsl:attribute>						<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>						<xsl:text>&#xa0;</xsl:text>					</ins>					<xsl:copy-of select="./child::node()" />				</a>			</xsl:for-each>			<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>		</li>	</xsl:for-each>	</ul></xsl:template></xsl:stylesheet>',flat:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" /><xsl:template match="/">	<ul>	<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">		<xsl:call-template name="nodes">			<xsl:with-param name="node" select="." />			<xsl:with-param name="is_last" select="number(position() = last())" />		</xsl:call-template>	</xsl:for-each>	</ul></xsl:template><xsl:template name="nodes">	<xsl:param name="node" />	<xsl:param name="is_last" />	<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />	<li>	<xsl:attribute name="class">		<xsl:if test="$is_last = true()">jstree-last </xsl:if>		<xsl:choose>			<xsl:when test="@state = \'open\'">jstree-open </xsl:when>			<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>			<xsl:otherwise>jstree-leaf </xsl:otherwise>		</xsl:choose>		<xsl:value-of select="@class" />	</xsl:attribute>	<xsl:for-each select="@*">		<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">		<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>		</xsl:if>	</xsl:for-each>	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>	<xsl:for-each select="content/name">		<a>		<xsl:attribute name="href">			<xsl:choose>			<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>			<xsl:otherwise>#</xsl:otherwise>			</xsl:choose>		</xsl:attribute>		<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>		<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>		<xsl:for-each select="@*">			<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">				<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>			</xsl:if>		</xsl:for-each>			<ins>				<xsl:attribute name="class">jstree-icon 					<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>				</xsl:attribute>				<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>				<xsl:text>&#xa0;</xsl:text>			</ins>			<xsl:copy-of select="./child::node()" />		</a>	</xsl:for-each>	<xsl:if test="$children">		<ul>		<xsl:for-each select="//item[@parent_id=$node/attribute::id]">			<xsl:call-template name="nodes">				<xsl:with-param name="node" select="." />				<xsl:with-param name="is_last" select="number(position() = last())" />			</xsl:call-template>		</xsl:for-each>		</ul>	</xsl:if>	</li></xsl:template></xsl:stylesheet>'},e=function(h){return h.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};g.jstree.plugin("xml_data",{defaults:{data:false,ajax:false,xsl:"flat",clean_node:false,correct_state:true,get_skip_empty:false,get_include_preamble:true},_fn:{load_node:function(k,h,j){var l=this;this.load_node_xml(k,function(){l.__callback({obj:l._get_node(k)});h.call(this)},j)},_is_loaded:function(j){var h=this._get_settings().xml_data;j=this._get_node(j);return j==-1||!j||(!h.ajax&&!g.isFunction(h.data))||j.is(".jstree-open, .jstree-leaf")||j.children("ul").children("li").size()>0},load_node_xml:function(m,h,k){var l=this.get_settings().xml_data,j=function(){},n=function(){};m=this._get_node(m);if(m&&m!==-1){if(m.data("jstree_is_loading")){return}else{m.data("jstree_is_loading",true)}}switch(!0){case (!l.data&&!l.ajax):throw"Neither data nor ajax settings supplied.";case (g.isFunction(l.data)):l.data.call(this,m,g.proxy(function(o){this.parse_xml(o,g.proxy(function(p){if(p){p=p.replace(/ ?xmlns="[^"]*"/ig,"");if(p.length>10){p=g(p);if(m===-1||!m){this.get_container().children("ul").empty().append(p.children())}else{m.children("a.jstree-loading").removeClass("jstree-loading");m.append(p);m.removeData("jstree_is_loading")}if(l.clean_node){this.clean_node(m)}if(h){h.call(this)}}else{if(m&&m!==-1){m.children("a.jstree-loading").removeClass("jstree-loading");m.removeData("jstree_is_loading");if(l.correct_state){this.correct_state(m);if(h){h.call(this)}}}else{if(l.correct_state){this.get_container().children("ul").empty();if(h){h.call(this)}}}}}},this))},this));break;case (!!l.data&&!l.ajax)||(!!l.data&&!!l.ajax&&(!m||m===-1)):if(!m||m==-1){this.parse_xml(l.data,g.proxy(function(o){if(o){o=o.replace(/ ?xmlns="[^"]*"/ig,"");if(o.length>10){o=g(o);this.get_container().children("ul").empty().append(o.children());if(l.clean_node){this.clean_node(m)}if(h){h.call(this)}}}else{if(l.correct_state){this.get_container().children("ul").empty();if(h){h.call(this)}}}},this))}break;case (!l.data&&!!l.ajax)||(!!l.data&&!!l.ajax&&m&&m!==-1):j=function(p,q,r){var o=this.get_settings().xml_data.ajax.error;if(o){o.call(this,p,q,r)}if(m!==-1&&m.length){m.children("a.jstree-loading").removeClass("jstree-loading");m.removeData("jstree_is_loading");if(q==="success"&&l.correct_state){this.correct_state(m)}}else{if(q==="success"&&l.correct_state){this.get_container().children("ul").empty()}}if(k){k.call(this)}};n=function(r,p,o){r=o.responseText;var q=this.get_settings().xml_data.ajax.success;if(q){r=q.call(this,r,p,o)||r}if(r===""||(r&&r.toString&&r.toString().replace(/^[\s\n]+$/,"")==="")){return j.call(this,o,p,"")}this.parse_xml(r,g.proxy(function(s){if(s){s=s.replace(/ ?xmlns="[^"]*"/ig,"");if(s.length>10){s=g(s);if(m===-1||!m){this.get_container().children("ul").empty().append(s.children())}else{m.children("a.jstree-loading").removeClass("jstree-loading");m.append(s);m.removeData("jstree_is_loading")}if(l.clean_node){this.clean_node(m)}if(h){h.call(this)}}else{if(m&&m!==-1){m.children("a.jstree-loading").removeClass("jstree-loading");m.removeData("jstree_is_loading");if(l.correct_state){this.correct_state(m);if(h){h.call(this)}}}else{if(l.correct_state){this.get_container().children("ul").empty();if(h){h.call(this)}}}}}},this))};l.ajax.context=this;l.ajax.error=j;l.ajax.success=n;if(!l.ajax.dataType){l.ajax.dataType="xml"}if(g.isFunction(l.ajax.url)){l.ajax.url=l.ajax.url.call(this,m)}if(g.isFunction(l.ajax.data)){l.ajax.data=l.ajax.data.call(this,m)}g.ajax(l.ajax);break}},parse_xml:function(h,k){var j=this._get_settings().xml_data;g.vakata.xslt(h,f[j.xsl],k)},get_xml:function(q,n,k,h,t){var v="",u=this._get_settings(),o=this,m,l,r,p,j;if(!q){q="flat"}if(!t){t=0}n=this._get_node(n);if(!n||n===-1){n=this.get_container().find("> ul > li")}k=g.isArray(k)?k:["id","class"];if(!t&&this.data.types&&g.inArray(u.types.type_attr,k)===-1){k.push(u.types.type_attr)}h=g.isArray(h)?h:[];if(!t){if(u.xml_data.get_include_preamble){v+='<?xml version="1.0" encoding="UTF-8"?>'}v+="<root>"}n.each(function(){v+="<item";r=g(this);g.each(k,function(x,s){var w=r.attr(s);if(!u.xml_data.get_skip_empty||typeof w!=="undefined"){v+=" "+s+'="'+e((" "+(w||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}});if(r.hasClass("jstree-open")){v+=' state="open"'}if(r.hasClass("jstree-closed")){v+=' state="closed"'}if(q==="flat"){v+=' parent_id="'+e(t)+'"'}v+=">";v+="<content>";p=r.children("a");p.each(function(){m=g(this);j=false;v+="<name";if(g.inArray("languages",u.plugins)!==-1){g.each(u.languages,function(s,w){if(m.hasClass(w)){v+=' lang="'+e(w)+'"';j=w;return false}})}if(h.length){g.each(h,function(s,x){var w=m.attr(x);if(!u.xml_data.get_skip_empty||typeof w!=="undefined"){v+=" "+x+'="'+e((" "+w||"").replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}})}if(m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){v+=' icon="'+e(m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}if(m.children("ins").get(0).style.backgroundImage.length){v+=' icon="'+e(m.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,""))+'"'}v+=">";v+="<![CDATA["+o.get_text(m,j)+"]]>";v+="</name>"});v+="</content>";l=r[0].id||true;r=r.find("> ul > li");if(r.length){l=o.get_xml(q,r,k,h,l)}else{l=""}if(q=="nest"){v+=l}v+="</item>";if(q=="flat"){v+=l}});if(!t){v+="</root>"}return v}}})})(jQuery);(function(e){if(e().jquery.split(".")[1]>=8){e.expr[":"].jstree_contains=e.expr.createPseudo(function(f){return function(g){return(g.textContent||g.innerText||"").toLowerCase().indexOf(f.toLowerCase())>=0}});e.expr[":"].jstree_title_contains=e.expr.createPseudo(function(f){return function(g){return(g.getAttribute("title")||"").toLowerCase().indexOf(f.toLowerCase())>=0}})}else{e.expr[":"].jstree_contains=function(g,h,f){return(g.textContent||g.innerText||"").toLowerCase().indexOf(f[3].toLowerCase())>=0};e.expr[":"].jstree_title_contains=function(g,h,f){return(g.getAttribute("title")||"").toLowerCase().indexOf(f[3].toLowerCase())>=0}}e.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=e();if(this._get_settings().search.show_only_matches){this.get_container().bind("search.jstree",function(g,f){e(this).children("ul").find("li").hide().removeClass("jstree-last");f.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){e(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){e(this).children("ul").find("li").css("display","").end().end().jstree("clean_node",-1)})}},defaults:{ajax:false,search_method:"jstree_contains",show_only_matches:false},_fn:{search:function(l,f){if(e.trim(l)===""){this.clear_search();return}var j=this.get_settings().search,h=this,g=function(){},k=function(){};this.data.search.str=l;if(!f&&j.ajax!==false&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0){this.search.supress_callback=true;g=function(){};k=function(p,n,m){var o=this.get_settings().search.ajax.success;if(o){p=o.call(this,p,n,m)||p}this.data.search.to_open=p;this._search_open()};j.ajax.context=this;j.ajax.error=g;j.ajax.success=k;if(e.isFunction(j.ajax.url)){j.ajax.url=j.ajax.url.call(this,l)}if(e.isFunction(j.ajax.data)){j.ajax.data=j.ajax.data.call(this,l)}if(!j.ajax.data){j.ajax.data={search_string:l}}if(!j.ajax.dataType||/^json/.exec(j.ajax.dataType)){j.ajax.dataType="json"}e.ajax(j.ajax);return}if(this.data.search.result.length){this.clear_search()}this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+(j.search_method)+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){h.open_node(this,false,true)});this.__callback({nodes:this.data.search.result,str:l})},clear_search:function(f){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=e()},_search_open:function(g){var k=this,f=true,j=[],h=[];if(this.data.search.to_open.length){e.each(this.data.search.to_open,function(l,m){if(m=="#"){return true}if(e(m).length&&e(m).is(".jstree-closed")){j.push(m)}else{h.push(m)}});if(j.length){this.data.search.to_open=h;e.each(j,function(l,m){k.open_node(m,function(){k._search_open(true)})});f=false}}if(f){this.search(this.data.search.str,true)}}}})})(jQuery);(function(e){e.vakata.context={hide_on_mouseleave:false,cnt:e("<div id='vakata-contextmenu' />"),vis:false,tgt:false,par:false,func:false,data:false,rtl:false,show:function(r,q,n,l,k,f,m){e.vakata.context.rtl=!!m;var j=e.vakata.context.parse(r),g,o;if(!j){return}e.vakata.context.vis=true;e.vakata.context.tgt=q;e.vakata.context.par=f||q||null;e.vakata.context.data=k||null;e.vakata.context.cnt.html(j).css({visibility:"hidden",display:"block",left:0,top:0});if(e.vakata.context.hide_on_mouseleave){e.vakata.context.cnt.one("mouseleave",function(h){e.vakata.context.hide()})}g=e.vakata.context.cnt.height();o=e.vakata.context.cnt.width();if(n+o>e(document).width()){n=e(document).width()-(o+5);e.vakata.context.cnt.find("li > ul").addClass("right")}if(l+g>e(document).height()){l=l-(g+q[0].offsetHeight);e.vakata.context.cnt.find("li > ul").addClass("bottom")}e.vakata.context.cnt.css({left:n,top:l}).find("li:has(ul)").bind("mouseenter",function(u){var p=e(document).width(),t=e(document).height(),s=e(this).children("ul").show();if(p!==e(document).width()){s.toggleClass("right")}if(t!==e(document).height()){s.toggleClass("bottom")}}).bind("mouseleave",function(h){e(this).children("ul").hide()}).end().css({visibility:"visible"}).show();e(document).triggerHandler("context_show.vakata")},hide:function(){e.vakata.context.vis=false;e.vakata.context.cnt.attr("class","").css({visibility:"hidden"});e(document).triggerHandler("context_hide.vakata")},parse:function(j,h){if(!j){return false}var k="",g=false,f=true;if(!h){e.vakata.context.func={}}k+="<ul>";e.each(j,function(l,m){if(!m){return true}e.vakata.context.func[l]=m.action;if(!f&&m.separator_before){k+="<li class='vakata-separator vakata-separator-before'></li>"}f=false;k+="<li class='"+(m._class||"")+(m._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";if(m.icon&&m.icon.indexOf("/")===-1){k+=" class='"+m.icon+"' "}if(m.icon&&m.icon.indexOf("/")!==-1){k+=" style='background:url("+m.icon+") center center no-repeat;' "}k+=">&#160;</ins><a href='#' rel='"+l+"'>";if(m.submenu){k+="<span style='float:"+(e.vakata.context.rtl?"left":"right")+";'>&raquo;</span>"}k+=m.label+"</a>";if(m.submenu){g=e.vakata.context.parse(m.submenu,true);if(g){k+=g}}k+="</li>";if(m.separator_after){k+="<li class='vakata-separator vakata-separator-after'></li>";f=true}});k=k.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");k+="</ul>";e(document).triggerHandler("context_parse.vakata");return k.length>10?k:false},exec:function(f){if(e.isFunction(e.vakata.context.func[f])){e.vakata.context.func[f].call(e.vakata.context.data,e.vakata.context.par);return true}else{return false}}};e(function(){var f="#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ";e.vakata.css.add_sheet({str:f,title:"vakata"});e.vakata.context.cnt.delegate("a","click",function(g){g.preventDefault()}).delegate("a","mouseup",function(g){if(!e(this).parent().hasClass("jstree-contextmenu-disabled")&&e.vakata.context.exec(e(this).attr("rel"))){e.vakata.context.hide()}else{e(this).blur()}}).delegate("a","mouseover",function(){e.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");e(document).bind("mousedown",function(g){if(e.vakata.context.vis&&!e.contains(e.vakata.context.cnt[0],g.target)){e.vakata.context.hide()}});if(typeof e.hotkeys!=="undefined"){e(document).bind("keydown","up",function(g){if(e.vakata.context.vis){var h=e.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();if(!h.length){h=e.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()}h.addClass("vakata-hover");g.stopImmediatePropagation();g.preventDefault()}}).bind("keydown","down",function(g){if(e.vakata.context.vis){var h=e.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();if(!h.length){h=e.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()}h.addClass("vakata-hover");g.stopImmediatePropagation();g.preventDefault()}}).bind("keydown","right",function(g){if(e.vakata.context.vis){e.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");g.stopImmediatePropagation();g.preventDefault()}}).bind("keydown","left",function(g){if(e.vakata.context.vis){e.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");g.stopImmediatePropagation();g.preventDefault()}}).bind("keydown","esc",function(g){e.vakata.context.hide();g.preventDefault()}).bind("keydown","space",function(g){e.vakata.context.cnt.find(".vakata-hover").last().children("a").click();g.preventDefault()})}});e.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",e.proxy(function(f){f.preventDefault();if(!e(f.currentTarget).hasClass("jstree-loading")){this.show_contextmenu(f.currentTarget,f.pageX,f.pageY)}},this)).delegate("a","click.jstree",e.proxy(function(f){if(this.data.contextmenu){e.vakata.context.hide()}},this)).bind("destroy.jstree",e.proxy(function(){if(this.data.contextmenu){e.vakata.context.hide()}},this));e(document).bind("context_hide.vakata",e.proxy(function(){this.data.contextmenu=false},this))},defaults:{select_node:false,show_at_node:true,items:{create:{separator_before:false,separator_after:true,label:"Create",action:function(f){this.create(f)}},rename:{separator_before:false,separator_after:false,label:"Rename",action:function(f){this.rename(f)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(f){if(this.is_selected(f)){this.remove()}else{this.remove(f)}}},ccp:{separator_before:true,icon:false,separator_after:false,label:"Edit",action:false,submenu:{cut:{separator_before:false,separator_after:false,label:"Cut",action:function(f){this.cut(f)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(f){this.copy(f)}},paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(f){this.paste(f)}}}}}},_fn:{show_contextmenu:function(k,f,m){k=this._get_node(k);var j=this.get_settings().contextmenu,g=k.children("a:visible:eq(0)"),l=false,h=false;if(j.select_node&&this.data.ui&&!this.is_selected(k)){this.deselect_all();this.select_node(k,true)}if(j.show_at_node||typeof f==="undefined"||typeof m==="undefined"){l=g.offset();f=l.left;m=l.top+this.data.core.li_height}h=k.data("jstree")&&k.data("jstree").contextmenu?k.data("jstree").contextmenu:j.items;if(e.isFunction(h)){h=h.call(this,k)}this.data.contextmenu=true;e.vakata.context.show(h,g,f,m,this,k,this._get_settings().core.rtl);if(this.data.themes){e.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}}})})(jQuery);(function(e){e.jstree.plugin("types",{__init:function(){var f=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",e.proxy(function(){var j=f.types,h=f.type_attr,g="",k=this;e.each(j,function(l,m){e.each(m,function(o,n){if(!/^(max_depth|max_children|icon|valid_children)$/.test(o)){k.data.types.attach_to.push(o)}});if(!m.icon){return true}if(m.icon.image||m.icon.position){if(l=="default"){g+=".jstree-"+k.get_index()+" a > .jstree-icon { "}else{g+=".jstree-"+k.get_index()+" li["+h+'="'+l+'"] > a > .jstree-icon { '}if(m.icon.image){g+=" background-image:url("+m.icon.image+"); "}if(m.icon.position){g+=" background-position:"+m.icon.position+"; "}else{g+=" background-position:0 0; "}g+="} "}});if(g!==""){e.vakata.css.add_sheet({str:g,title:"jstree-types"})}},this)).bind("before.jstree",e.proxy(function(k,j){var h,g,m=this._get_settings().types.use_data?this._get_node(j.args[0]):false,l=m&&m!==-1&&m.length?m.data("jstree"):false;if(l&&l.types&&l.types[j.func]===false){k.stopImmediatePropagation();return false}if(e.inArray(j.func,this.data.types.attach_to)!==-1){if(!j.args[0]||(!j.args[0].tagName&&!j.args[0].jquery)){return}h=this._get_settings().types.types;g=this._get_type(j.args[0]);if(((h[g]&&typeof h[g][j.func]!=="undefined")||(h["default"]&&typeof h["default"][j.func]!=="undefined"))&&this._check(j.func,j.args[0])===false){k.stopImmediatePropagation();return false}}},this));if(d){this.get_container().bind("load_node.jstree set_type.jstree",e.proxy(function(k,j){var h=j&&j.rslt&&j.rslt.obj&&j.rslt.obj!==-1?this._get_node(j.rslt.obj).parent():this.get_container_ul(),l=false,g=this._get_settings().types;e.each(g.types,function(m,n){if(n.icon&&(n.icon.image||n.icon.position)){l=m==="default"?h.find("li > a > .jstree-icon"):h.find("li["+g.type_attr+"='"+m+"'] > a > .jstree-icon");if(n.icon.image){l.css("backgroundImage","url("+n.icon.image+")")}l.css("backgroundPosition",n.icon.position||"0 0")}})},this))}},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:false,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(g,f){if(f.type&&this._get_settings().types.use_data){this.set_type(f.type,g)}},_get_type:function(f){f=this._get_node(f);return(!f||!f.length)?false:f.attr(this._get_settings().types.type_attr)||"default"},set_type:function(h,g){g=this._get_node(g);var f=(!g.length||!h)?false:g.attr(this._get_settings().types.type_attr,h);if(f){this.__callback({obj:g,type:h})}return f},_check:function(l,h,f){h=this._get_node(h);var m=false,n=this._get_type(h),k=0,j=this,o=this._get_settings().types,g=false;if(h===-1){if(!!o[l]){m=o[l]}else{return}}else{if(n===false){return}g=o.use_data?h.data("jstree"):false;if(g&&g.types&&typeof g.types[l]!=="undefined"){m=g.types[l]}else{if(!!o.types[n]&&typeof o.types[n][l]!=="undefined"){m=o.types[n][l]}else{if(!!o.types["default"]&&typeof o.types["default"][l]!=="undefined"){m=o.types["default"][l]}}}}if(e.isFunction(m)){m=m.call(this,h)}if(l==="max_depth"&&h!==-1&&f!==false&&o.max_depth!==-2&&m!==0){h.children("a:eq(0)").parentsUntil(".jstree","li").each(function(p){if(o.max_depth!==-1&&o.max_depth-(p+1)<=0){m=0;return false}k=(p===0)?m:j._check(l,this,false);if(k!==-1&&k-(p+1)<=0){m=0;return false}if(k>=0&&(k-(p+1)<m||m<0)){m=k-(p+1)}if(o.max_depth>=0&&(o.max_depth-(p+1)<m||m<0)){m=o.max_depth-(p+1)}})}return m},check_move:function(){if(!this.__call_old()){return false}var f=this._get_move(),k=f.rt._get_settings().types,n=f.rt._check("max_children",f.cr),l=f.rt._check("max_depth",f.cr),h=f.rt._check("valid_children",f.cr),j=0,o=1,g;if(h==="none"){return false}if(e.isArray(h)&&f.ot&&f.ot._get_type){f.o.each(function(){if(e.inArray(f.ot._get_type(this),h)===-1){o=false;return false}});if(o===false){return false}}if(k.max_children!==-2&&n!==-1){j=f.cr===-1?this.get_container().find("> ul > li").not(f.o).length:f.cr.find("> ul > li").not(f.o).length;if(j+f.o.length>n){return false}}if(k.max_depth!==-2&&l!==-1){o=0;if(l===0){return false}if(typeof f.o.d==="undefined"){g=f.o;while(g.length>0){g=g.find("> ul > li");o++}f.o.d=o}if(l-f.o.d<0){return false}}return true},create_node:function(j,k,g,r,m,q){if(!q&&(m||this._is_loaded(j))){var h=(typeof k=="string"&&k.match(/^before|after$/i)&&j!==-1)?this._get_parent(j):this._get_node(j),t=this._get_settings().types,o=this._check("max_children",h),n=this._check("max_depth",h),l=this._check("valid_children",h),f;if(typeof g==="string"){g={data:g}}if(!g){g={}}if(l==="none"){return false}if(e.isArray(l)){if(!g.attr||!g.attr[t.type_attr]){if(!g.attr){g.attr={}}g.attr[t.type_attr]=l[0]}else{if(e.inArray(g.attr[t.type_attr],l)===-1){return false}}}if(t.max_children!==-2&&o!==-1){f=h===-1?this.get_container().find("> ul > li").length:h.find("> ul > li").length;if(f+1>o){return false}}if(t.max_depth!==-2&&n!==-1&&(n-1)<0){return false}}return this.__call_old(true,j,k,g,r,m,q)}}})})(jQuery);(function(e){e.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(true);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:false,ajax:false,correct_state:true},_fn:{load_node:function(h,f,g){var j=this;this.load_node_html(h,function(){j.__callback({obj:j._get_node(h)});f.call(this)},g)},_is_loaded:function(f){f=this._get_node(f);return f==-1||!f||(!this._get_settings().html_data.ajax&&!e.isFunction(this._get_settings().html_data.data))||f.is(".jstree-open, .jstree-leaf")||f.children("ul").children("li").size()>0},load_node_html:function(k,f,h){var m,j=this.get_settings().html_data,g=function(){},l=function(){};k=this._get_node(k);if(k&&k!==-1){if(k.data("jstree_is_loading")){return}else{k.data("jstree_is_loading",true)}}switch(!0){case (e.isFunction(j.data)):j.data.call(this,k,e.proxy(function(n){if(n&&n!==""&&n.toString&&n.toString().replace(/^[\s\n]+$/,"")!==""){n=e(n);if(!n.is("ul")){n=e("<ul />").append(n)}if(k==-1||!k){this.get_container().children("ul").empty().append(n.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.append(n).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");k.removeData("jstree_is_loading")}this.clean_node(k);if(f){f.call(this)}}else{if(k&&k!==-1){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(j.correct_state){this.correct_state(k);if(f){f.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(f){f.call(this)}}}}},this));break;case (!j.data&&!j.ajax):if(!k||k==-1){this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(f){f.call(this)}break;case (!!j.data&&!j.ajax)||(!!j.data&&!!j.ajax&&(!k||k===-1)):if(!k||k==-1){m=e(j.data);if(!m.is("ul")){m=e("<ul />").append(m)}this.get_container().children("ul").empty().append(m.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(f){f.call(this)}break;case (!j.data&&!!j.ajax)||(!!j.data&&!!j.ajax&&k&&k!==-1):k=this._get_node(k);g=function(o,p,q){var n=this.get_settings().html_data.ajax.error;if(n){n.call(this,o,p,q)}if(k!=-1&&k.length){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(p==="success"&&j.correct_state){this.correct_state(k)}}else{if(p==="success"&&j.correct_state){this.get_container().children("ul").empty()}}if(h){h.call(this)}};l=function(q,o,n){var p=this.get_settings().html_data.ajax.success;if(p){q=p.call(this,q,o,n)||q}if(q===""||(q&&q.toString&&q.toString().replace(/^[\s\n]+$/,"")==="")){return g.call(this,n,o,"")}if(q){q=e(q);if(!q.is("ul")){q=e("<ul />").append(q)}if(k==-1||!k){this.get_container().children("ul").empty().append(q.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{k.children("a.jstree-loading").removeClass("jstree-loading");k.append(q).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");k.removeData("jstree_is_loading")}this.clean_node(k);if(f){f.call(this)}}else{if(k&&k!==-1){k.children("a.jstree-loading").removeClass("jstree-loading");k.removeData("jstree_is_loading");if(j.correct_state){this.correct_state(k);if(f){f.call(this)}}}else{if(j.correct_state){this.get_container().children("ul").empty();if(f){f.call(this)}}}}};j.ajax.context=this;j.ajax.error=g;j.ajax.success=l;if(!j.ajax.dataType){j.ajax.dataType="html"}if(e.isFunction(j.ajax.url)){j.ajax.url=j.ajax.url.call(this,k)}if(e.isFunction(j.ajax.data)){j.ajax.data=j.ajax.data.call(this,k)}e.ajax(j.ajax);break}}}});e.jstree.defaults.plugins.push("html_data")})(jQuery);(function(e){e.jstree.plugin("themeroller",{__init:function(){var f=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a","mouseenter.jstree",function(g){if(!e(g.currentTarget).hasClass("jstree-loading")){e(this).addClass(f.item_h)}}).delegate("a","mouseleave.jstree",function(){e(this).removeClass(f.item_h)}).bind("init.jstree",e.proxy(function(h,g){g.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(g.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",e.proxy(function(h,g){this._themeroller(g.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",e.proxy(function(g){this._themeroller()},this)).bind("close_node.jstree",e.proxy(function(h,g){this._themeroller(g.rslt.obj)},this)).bind("delete_node.jstree",e.proxy(function(h,g){this._themeroller(g.rslt.parent)},this)).bind("correct_state.jstree",e.proxy(function(h,g){g.rslt.obj.children("ins.jstree-icon").removeClass(f.opened+" "+f.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return this.className.toString().replace(f.item_clsd,"").replace(f.item_open,"").replace(f.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(f.item_open+" "+f.item_clsd).addClass(f.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",e.proxy(function(h,g){g.rslt.obj.children("a").addClass(f.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",e.proxy(function(h,g){this.get_container().find("a."+f.item_a).removeClass(f.item_a).end().find("a.jstree-clicked").addClass(f.item_a)},this)).bind("dehover_node.jstree",e.proxy(function(h,g){g.rslt.obj.children("a").removeClass(f.item_h)},this)).bind("hover_node.jstree",e.proxy(function(h,g){this.get_container().find("a."+f.item_h).not(g.rslt.obj).removeClass(f.item_h);g.rslt.obj.children("a").addClass(f.item_h)},this)).bind("move_node.jstree",e.proxy(function(h,g){this._themeroller(g.rslt.o);this._themeroller(g.rslt.op)},this))},__destroy:function(){var f=this._get_settings().themeroller,g=["ui-icon"];e.each(f,function(j,h){h=h.split(" ");if(h.length){g=g.concat(h)}});this.get_container().removeClass("ui-widget-content").find("."+g.join(", .")).removeClass(g.join(" "))},_fn:{_themeroller:function(g){var f=this._get_settings().themeroller;g=(!g||g==-1)?this.get_container_ul():this._get_node(g);g=(!g||g==-1)?this.get_container_ul():g.parent();g.find("li.jstree-closed").children("ins.jstree-icon").removeClass(f.opened).addClass("ui-icon "+f.closed).end().children("a").addClass(f.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(f.item_clsd,"").replace(f.item_open,"").replace(f.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(f.item_leaf+" "+f.item_open).addClass(f.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(f.closed).addClass("ui-icon "+f.opened).end().children("a").addClass(f.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(f.item_clsd,"").replace(f.item_open,"").replace(f.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(f.item_leaf+" "+f.item_clsd).addClass(f.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(f.closed+" ui-icon "+f.opened).end().children("a").addClass(f.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(f.item_clsd,"").replace(f.item_open,"").replace(f.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(f.item_clsd+" "+f.item_open).addClass(f.item_leaf||"jstree-no-icon")}},defaults:{opened:"ui-icon-triangle-1-se",closed:"ui-icon-triangle-1-e",item:"ui-state-default",item_h:"ui-state-hover",item_a:"ui-state-active",item_open:"ui-icon-folder-open",item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}});e(function(){var f=".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }";e.vakata.css.add_sheet({str:f,title:"jstree"})})})(jQuery);(function(e){e.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",e.proxy(function(l,j){var f=[],h=true,k,g;if(j.func=="move_node"){if(j.args[4]===true){if(j.args[0].o&&j.args[0].o.length){j.args[0].o.children("a").each(function(){f.push(e(this).text().replace(/^\s+/g,""))});h=this._check_unique(f,j.args[0].np.find("> ul > li").not(j.args[0].o),"move_node")}}}if(j.func=="create_node"){if(j.args[4]||this._is_loaded(j.args[0])){k=this._get_node(j.args[0]);if(j.args[1]&&(j.args[1]==="before"||j.args[1]==="after")){k=this._get_parent(j.args[0]);if(!k||k===-1){k=this.get_container()}}if(typeof j.args[2]==="string"){f.push(j.args[2])}else{if(!j.args[2]||!j.args[2].data){f.push(this._get_string("new_node"))}else{f.push(j.args[2].data)}}h=this._check_unique(f,k.find("> ul > li"),"create_node")}}if(j.func=="rename_node"){f.push(j.args[1]);g=this._get_node(j.args[0]);k=this._get_parent(g);if(!k||k===-1){k=this.get_container()}h=this._check_unique(f,k.find("> ul > li").not(g),"rename_node")}if(!h){l.stopPropagation();return false}},this))},defaults:{error_callback:e.noop},_fn:{_check_unique:function(g,k,j){var f=[],h=true;k.children("a").each(function(){f.push(e(this).text().replace(/^\s+/g,""))});if(!f.length||!g.length){return true}e.each(g,function(m,l){if(e.inArray(l,f)!==-1){h=false;return false}});if(!h){this._get_settings().unique.error_callback.call(null,g,k,j)}return h},check_move:function(){if(!this.__call_old()){return false}var g=this._get_move(),f=[];if(g.o&&g.o.length){g.o.children("a").each(function(){f.push(e(this).text().replace(/^\s+/g,""))});return this._check_unique(f,g.np.find("> ul > li").not(g.o),"check_move")}return true}}})})(jQuery);(function(e){e.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui){throw"jsTree wholerow: jsTree UI plugin not included."}this.data.wholerow.html=false;this.data.wholerow.to=false;this.get_container().bind("init.jstree",e.proxy(function(g,f){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",e.proxy(function(g,f){this._prepare_wholerow_span(f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",e.proxy(function(g,f){if(this.data.to){clearTimeout(this.data.to)}this.data.to=setTimeout((function(h,j){return function(){h._prepare_wholerow_ul(j)}})(this,f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",e.proxy(function(g,f){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",e.proxy(function(g,f){f.rslt.obj.each(function(){var h=f.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((e(this).offset().top-f.inst.get_container().offset().top+f.inst.get_container()[0].scrollTop)/f.inst.data.core.li_height),10))+")");h.children("a").attr("class",f.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",e.proxy(function(h,g){this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:""));if(h.type==="hover_node"){var f=this.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((g.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height),10))+")");f.children("a").attr("class",g.rslt.obj.children(".jstree-hovered").attr("class"))}},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(f){var g=e(f.currentTarget);if(f.target.tagName==="A"||(f.target.tagName==="INS"&&g.closest("li").is(".jstree-open, .jstree-closed"))){return}g.closest("li").children("a:visible:eq(0)").click();f.stopImmediatePropagation()}).delegate("li","mouseover.jstree",e.proxy(function(f){f.stopImmediatePropagation();if(e(f.currentTarget).children(".jstree-hovered, .jstree-clicked").length){return false}this.hover_node(f.currentTarget);return false},this)).delegate("li","mouseleave.jstree",e.proxy(function(f){if(e(f.currentTarget).children("a").hasClass("jstree-hovered").length){return}this.dehover_node(f.currentTarget)},this));if(b||d){e.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})}},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove();this.get_container().find(".jstree-wholerow-span").remove()},_fn:{_prepare_wholerow_span:function(f){f=!f||f==-1?this.get_container().find("> ul > li"):this._get_node(f);if(f===false){return}f.each(function(){e(this).find("li").andSelf().each(function(){var g=e(this);if(g.children(".jstree-wholerow-span").length){return true}g.prepend("<span class='jstree-wholerow-span' style='width:"+(g.parentsUntil(".jstree","li").length*18)+"px;'>&#160;</span>")})})},_prepare_wholerow_ul:function(){var g=this.get_container().children("ul").eq(0),f=g.html();g.addClass("jstree-wholerow-real");if(this.data.wholerow.last_html!==f){this.data.wholerow.last_html=f;this.get_container().children(".jstree-wholerow").remove();this.get_container().append(g.clone().removeClass("jstree-wholerow-real").wrapAll("<div class='jstree-wholerow' />").parent().width(g.parent()[0].scrollWidth).css("top",(g.height()+(b?5:0))*-1).find("li[id]").each(function(){this.removeAttribute("id")}).end())}}}});e(function(){var f=".jstree .jstree-wholerow-real { position:relative; z-index:1; } .jstree .jstree-wholerow-real li { cursor:pointer; } .jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } .jstree .jstree-wholerow { position:relative; z-index:0; height:0; } .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } .jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }";if(a){f+=".jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } .jstree .jstree-wholerow-real a { border-color:transparent !important; } "}if(b||d){f+=".jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } .jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } "}e.vakata.css.add_sheet({str:f,title:"jstree"})})})(jQuery);(function(e){var f=["getChildren","getChildrenCount","getAttr","getName","getProps"],g=function(k,h){var j=true;k=k||{};h=[].concat(h);e.each(h,function(m,l){if(!e.isFunction(k[l])){j=false;return false}});return j};e.jstree.plugin("model",{__init:function(){if(!this.data.json_data){throw"jsTree model: jsTree json_data plugin not included."}this._get_settings().json_data.data=function(k,h){var j=(k==-1)?this._get_settings().model.object:k.data("jstree_model");if(!g(j,f)){return h.call(null,false)}if(this._get_settings().model.async){j.getChildren(e.proxy(function(l){this.model_done(l,h)},this))}else{this.model_done(j.getChildren(),h)}}},defaults:{object:false,id_prefix:false,async:false},_fn:{model_done:function(k,m){var h=[],j=this._get_settings(),l=this;if(!e.isArray(k)){k=[k]}e.each(k,function(n,p){var o=p.getProps()||{};o.attr=p.getAttr()||{};if(p.getChildrenCount()){o.state="closed"}o.data=p.getName();if(!e.isArray(o.data)){o.data=[o.data]}if(l.data.types&&e.isFunction(p.getType)){o.attr[j.types.type_attr]=p.getType()}if(o.attr.id&&j.model.id_prefix){o.attr.id=j.model.id_prefix+o.attr.id}if(!o.metadata){o.metadata={}}o.metadata.jstree_model=p;h.push(o)});m.call(null,h)}}})})(jQuery)})();(function(b){b.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};function a(e){if(typeof e.data!=="string"){return}var d=e.handler,f=e.data.toLowerCase().split(" ");e.handler=function(o){if(this!==o.target&&(/textarea|select/i.test(o.target.nodeName)||o.target.type==="text")){return}var j=o.type!=="keypress"&&b.hotkeys.specialKeys[o.which],p=String.fromCharCode(o.which).toLowerCase(),m,n="",h={};if(o.altKey&&j!=="alt"){n+="alt+"}if(o.ctrlKey&&j!=="ctrl"){n+="ctrl+"}if(o.metaKey&&!o.ctrlKey&&j!=="meta"){n+="meta+"}if(o.shiftKey&&j!=="shift"){n+="shift+"}if(j){h[n+j]=true}else{h[n+p]=true;h[n+b.hotkeys.shiftNums[p]]=true;if(n==="shift+"){h[b.hotkeys.shiftNums[p]]=true}}for(var k=0,g=f.length;k<g;k++){if(h[f[k]]){return d.apply(this,arguments)}}}}b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:a}})})(jQuery);
/*
 * jQuery contextMenu - Plugin for simple contextMenu handling
 *
 * Version: git-master
 *
 * Authors: Rodney Rehm, Addy Osmani (patches for FF)
 * Web: http://medialize.github.com/jQuery-contextMenu/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *   GPL v3 http://opensource.org/licenses/GPL-3.0
 *
 */
(function(d,e){d.support.htmlMenuitem=("HTMLMenuItemElement" in window);d.support.htmlCommand=("HTMLCommandElement" in window);d.support.eventSelectstart=("onselectstart" in document.documentElement);if(!d.ui||!d.ui.widget){var s=d.cleanData;d.cleanData=function(u){for(var v=0,w;(w=u[v])!=null;v++){try{d(w).triggerHandler("remove")}catch(x){}}s(u)}}var r=null,b=false,p=d(window),j=0,h={},n={},m={},k={selector:null,appendTo:null,trigger:"right",autoHide:false,delay:200,reposition:true,determinePosition:function(u){if(d.ui&&d.ui.position){u.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none")}else{var v=this.offset();v.top+=this.outerHeight();v.left+=this.outerWidth()/2-u.outerWidth()/2;u.css(v)}},position:function(w,C,B){var A=this,z;if(!C&&!B){w.determinePosition.call(this,w.$menu);return}else{if(C==="maintain"&&B==="maintain"){z=w.$menu.position()}else{z={top:B,left:C}}}var u=p.scrollTop()+p.height(),D=p.scrollLeft()+p.width(),E=w.$menu.height(),v=w.$menu.width();if(z.top+E>u){z.top-=E}if(z.left+v>D){z.left-=v}w.$menu.css(z)},positionSubmenu:function(u){if(d.ui&&d.ui.position){u.css("display","block").position({my:"left top",at:"right top",of:this,collision:"flipfit fit"}).css("display","")}else{var v={top:0,left:this.outerWidth()};u.css(v)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:d.noop,hide:d.noop},callback:null,items:{}},l={timer:null,pageX:null,pageY:null},f=function(w){var v=0,u=w;while(true){v=Math.max(v,parseInt(u.css("z-index"),10)||0);u=u.parent();if(!u||!u.length||"html body".indexOf(u.prop("nodeName").toLowerCase())>-1){break}}return v},t={abortevent:function(u){u.preventDefault();u.stopImmediatePropagation()},contextmenu:function(w){var v=d(this);w.preventDefault();w.stopImmediatePropagation();if(w.data.trigger!="right"&&w.originalEvent){return}if(v.hasClass("context-menu-active")){return}if(!v.hasClass("context-menu-disabled")){r=v;if(w.data.build){var u=w.data.build(r,w);if(u===false){return}w.data=d.extend(true,{},k,w.data,u||{});if(!w.data.items||d.isEmptyObject(w.data.items)){if(window.console){(console.error||console.log)("No items specified to show in contextMenu")}throw new Error("No Items sepcified")}w.data.$trigger=r;g.create(w.data)}g.show.call(v,w.data,w.pageX,w.pageY)}},click:function(u){u.preventDefault();u.stopImmediatePropagation();d(this).trigger(d.Event("contextmenu",{data:u.data,pageX:u.pageX,pageY:u.pageY}))},mousedown:function(v){var u=d(this);if(r&&r.length&&!r.is(u)){r.data("contextMenu").$menu.trigger("contextmenu:hide")}if(v.button==2){r=u.data("contextMenuActive",true)}},mouseup:function(v){var u=d(this);if(u.data("contextMenuActive")&&r&&r.length&&r.is(u)&&!u.hasClass("context-menu-disabled")){v.preventDefault();v.stopImmediatePropagation();r=u;u.trigger(d.Event("contextmenu",{data:v.data,pageX:v.pageX,pageY:v.pageY}))}u.removeData("contextMenuActive")},mouseenter:function(w){var v=d(this),u=d(w.relatedTarget),x=d(document);if(u.is(".context-menu-list")||u.closest(".context-menu-list").length){return}if(r&&r.length){return}l.pageX=w.pageX;l.pageY=w.pageY;l.data=w.data;x.on("mousemove.contextMenuShow",t.mousemove);l.timer=setTimeout(function(){l.timer=null;x.off("mousemove.contextMenuShow");r=v;v.trigger(d.Event("contextmenu",{data:l.data,pageX:l.pageX,pageY:l.pageY}))},w.data.delay)},mousemove:function(u){l.pageX=u.pageX;l.pageY=u.pageY},mouseleave:function(v){var u=d(v.relatedTarget);if(u.is(".context-menu-list")||u.closest(".context-menu-list").length){return}try{clearTimeout(l.timer)}catch(v){}l.timer=null},layerClick:function(z){var B=d(this),D=B.data("contextMenuRoot"),v=false,w=z.button,E=z.pageX,C=z.pageY,A,u,F;z.preventDefault();z.stopImmediatePropagation();setTimeout(function(){var H,G,y;var x=((D.trigger=="left"&&w===0)||(D.trigger=="right"&&w===2));if(document.elementFromPoint){D.$layer.hide();A=document.elementFromPoint(E-p.scrollLeft(),C-p.scrollTop());D.$layer.show()}if(D.reposition&&x){if(document.elementFromPoint){if(D.$trigger.is(A)||D.$trigger.has(A).length){D.position.call(D.$trigger,D,E,C);return}}else{u=D.$trigger.offset();H=d(window);u.top+=H.scrollTop();if(u.top<=z.pageY){u.left+=H.scrollLeft();if(u.left<=z.pageX){u.bottom=u.top+D.$trigger.outerHeight();if(u.bottom>=z.pageY){u.right=u.left+D.$trigger.outerWidth();if(u.right>=z.pageX){D.position.call(D.$trigger,D,E,C);return}}}}}}if(A&&x){D.$trigger.one("contextmenu:hidden",function(){d(A).contextMenu({x:E,y:C})})}D.$menu.trigger("contextmenu:hide")},50)},keyStop:function(v,u){if(!u.isInput){v.preventDefault()}v.stopPropagation()},key:function(y){var w=r.data("contextMenu")||{};switch(y.keyCode){case 9:case 38:t.keyStop(y,w);if(w.isInput){if(y.keyCode==9&&y.shiftKey){y.preventDefault();w.$selected&&w.$selected.find("input, textarea, select").blur();w.$menu.trigger("prevcommand");return}else{if(y.keyCode==38&&w.$selected.find("input, textarea, select").prop("type")=="checkbox"){y.preventDefault();return}}}else{if(y.keyCode!=9||y.shiftKey){w.$menu.trigger("prevcommand");return}}case 40:t.keyStop(y,w);if(w.isInput){if(y.keyCode==9){y.preventDefault();w.$selected&&w.$selected.find("input, textarea, select").blur();w.$menu.trigger("nextcommand");return}else{if(y.keyCode==40&&w.$selected.find("input, textarea, select").prop("type")=="checkbox"){y.preventDefault();return}}}else{w.$menu.trigger("nextcommand");return}break;case 37:t.keyStop(y,w);if(w.isInput||!w.$selected||!w.$selected.length){break}if(!w.$selected.parent().hasClass("context-menu-root")){var x=w.$selected.parent().parent();w.$selected.trigger("contextmenu:blur");w.$selected=x;return}break;case 39:t.keyStop(y,w);if(w.isInput||!w.$selected||!w.$selected.length){break}var v=w.$selected.data("contextMenu")||{};if(v.$menu&&w.$selected.hasClass("context-menu-submenu")){w.$selected=null;v.$selected=null;v.$menu.trigger("nextcommand");return}break;case 35:case 36:if(w.$selected&&w.$selected.find("input, textarea, select").length){return}else{(w.$selected&&w.$selected.parent()||w.$menu).children(":not(.disabled, .not-selectable)")[y.keyCode==36?"first":"last"]().trigger("contextmenu:focus");y.preventDefault();return}break;case 13:t.keyStop(y,w);if(w.isInput){if(w.$selected&&!w.$selected.is("textarea, select")){y.preventDefault();return}break}w.$selected&&w.$selected.trigger("mouseup");return;case 32:case 33:case 34:t.keyStop(y,w);return;case 27:t.keyStop(y,w);w.$menu.trigger("contextmenu:hide");return;default:var u=(String.fromCharCode(y.keyCode)).toUpperCase();if(w.accesskeys[u]){w.accesskeys[u].$node.trigger(w.accesskeys[u].$menu?"contextmenu:focus":"mouseup");return}break}y.stopPropagation();w.$selected&&w.$selected.trigger(y)},prevItem:function(y){y.stopPropagation();var x=d(this).data("contextMenu")||{};if(x.$selected){var u=x.$selected;x=x.$selected.parent().data("contextMenu")||{};x.$selected=u}var w=x.$menu.children(),v=!x.$selected||!x.$selected.prev().length?w.last():x.$selected.prev(),A=v;while(v.hasClass("disabled")||v.hasClass("not-selectable")){if(v.prev().length){v=v.prev()}else{v=w.last()}if(v.is(A)){return}}if(x.$selected){t.itemMouseleave.call(x.$selected.get(0),y)}t.itemMouseenter.call(v.get(0),y);var z=v.find("input, textarea, select");if(z.length){z.focus()}},nextItem:function(y){y.stopPropagation();var x=d(this).data("contextMenu")||{};if(x.$selected){var u=x.$selected;x=x.$selected.parent().data("contextMenu")||{};x.$selected=u}var w=x.$menu.children(),v=!x.$selected||!x.$selected.next().length?w.first():x.$selected.next(),A=v;while(v.hasClass("disabled")||v.hasClass("not-selectable")){if(v.next().length){v=v.next()}else{v=w.first()}if(v.is(A)){return}}if(x.$selected){t.itemMouseleave.call(x.$selected.get(0),y)}t.itemMouseenter.call(v.get(0),y);var z=v.find("input, textarea, select");if(z.length){z.focus()}},focusInput:function(y){var x=d(this).closest(".context-menu-item"),w=x.data(),v=w.contextMenu,u=w.contextMenuRoot;u.$selected=v.$selected=x;u.isInput=v.isInput=true},blurInput:function(y){var x=d(this).closest(".context-menu-item"),w=x.data(),v=w.contextMenu,u=w.contextMenuRoot;u.isInput=v.isInput=false},menuMouseenter:function(v){var u=d(this).data().contextMenuRoot;u.hovering=true},menuMouseleave:function(v){var u=d(this).data().contextMenuRoot;if(u.$layer&&u.$layer.is(v.relatedTarget)){u.hovering=false}},itemMouseenter:function(y){var x=d(this),w=x.data(),v=w.contextMenu,u=w.contextMenuRoot;u.hovering=true;if(y&&u.$layer&&u.$layer.is(y.relatedTarget)){y.preventDefault();y.stopImmediatePropagation()}(v.$menu?v:u).$menu.children(".hover").trigger("contextmenu:blur");if(x.hasClass("disabled")||x.hasClass("not-selectable")){v.$selected=null;return}x.trigger("contextmenu:focus")},itemMouseleave:function(y){var x=d(this),w=x.data(),v=w.contextMenu,u=w.contextMenuRoot;if(u!==v&&u.$layer&&u.$layer.is(y.relatedTarget)){u.$selected&&u.$selected.trigger("contextmenu:blur");y.preventDefault();y.stopImmediatePropagation();u.$selected=v.$selected=v.$node;return}x.trigger("contextmenu:blur")},itemClick:function(z){var y=d(this),x=y.data(),w=x.contextMenu,u=x.contextMenuRoot,v=x.contextMenuKey,A;if(!w.items[v]||y.is(".disabled, .context-menu-submenu, .context-menu-separator, .not-selectable")){return}z.preventDefault();z.stopImmediatePropagation();if(d.isFunction(u.callbacks[v])&&Object.prototype.hasOwnProperty.call(u.callbacks,v)){A=u.callbacks[v]}else{if(d.isFunction(u.callback)){A=u.callback}else{return}}if(A.call(u.$trigger,v,u)!==false){u.$menu.trigger("contextmenu:hide")}else{if(u.$menu.parent().length){g.update.call(u.$trigger,u)}}},inputClick:function(u){u.stopImmediatePropagation()},hideMenu:function(w,v){var u=d(this).data("contextMenuRoot");g.hide.call(u.$trigger,u,v&&v.force)},focusItem:function(y){y.stopPropagation();var x=d(this),w=x.data(),v=w.contextMenu,u=w.contextMenuRoot;x.addClass("hover").siblings(".hover").trigger("contextmenu:blur");v.$selected=u.$selected=x;if(v.$node){u.positionSubmenu.call(v.$node,v.$menu)}},blurItem:function(y){y.stopPropagation();var x=d(this),w=x.data(),v=w.contextMenu,u=w.contextMenuRoot;x.removeClass("hover");v.$selected=null}},g={show:function(z,v,B){var u=d(this),A,w={};d("#context-menu-layer").trigger("mousedown");z.$trigger=u;if(z.events.show.call(u,z)===false){r=null;return}g.update.call(u,z);z.position.call(u,z,v,B);if(z.zIndex){w.zIndex=f(u)+z.zIndex}g.layer.call(z.$menu,z,w.zIndex);z.$menu.find("ul").css("zIndex",w.zIndex+1);z.$menu.css(w)[z.animation.show](z.animation.duration,function(){u.trigger("contextmenu:visible")});u.data("contextMenu",z).addClass("context-menu-active");d(document).off("keydown.contextMenu").on("keydown.contextMenu",t.key);if(z.autoHide){d(document).on("mousemove.contextMenuAutoHide",function(x){var y=u.offset();y.right=y.left+u.outerWidth();y.bottom=y.top+u.outerHeight();if(z.$layer&&!z.hovering&&(!(x.pageX>=y.left&&x.pageX<=y.right)||!(x.pageY>=y.top&&x.pageY<=y.bottom))){z.$menu.trigger("contextmenu:hide")}})}},hide:function(v,w){var u=d(this);if(!v){v=u.data("contextMenu")||{}}if(!w&&v.events&&v.events.hide.call(u,v)===false){return}u.removeData("contextMenu").removeClass("context-menu-active");if(v.$layer){setTimeout((function(y){return function(){y.remove()}})(v.$layer),10);try{delete v.$layer}catch(x){v.$layer=null}}r=null;v.$menu.find(".hover").trigger("contextmenu:blur");v.$selected=null;d(document).off(".contextMenuAutoHide").off("keydown.contextMenu");v.$menu&&v.$menu[v.animation.hide](v.animation.duration,function(){if(v.build){v.$menu.remove();d.each(v,function(y,z){switch(y){case"ns":case"selector":case"build":case"trigger":return true;default:v[y]=e;try{delete v[y]}catch(A){}return true}})}setTimeout(function(){u.trigger("contextmenu:hidden")},10)})},create:function(v,u){if(u===e){u=v}v.$menu=d('<ul class="context-menu-list"></ul>').addClass(v.className||"").data({contextMenu:v,contextMenuRoot:u});d.each(["callbacks","commands","inputs"],function(x,w){v[w]={};if(!u[w]){u[w]={}}});u.accesskeys||(u.accesskeys={});d.each(v.items,function(y,z){var D=d('<li class="context-menu-item"></li>').addClass(z.className||""),w=null,C=null;D.on("click",d.noop);z.$node=D.data({contextMenu:v,contextMenuRoot:u,contextMenuKey:y});if(z.accesskey){var A=o(z.accesskey);for(var x=0,B;B=A[x];x++){if(!u.accesskeys[B]){u.accesskeys[B]=z;z._name=z.name.replace(new RegExp("("+B+")","i"),'<span class="context-menu-accesskey">$1</span>');break}}}if(typeof z=="string"){D.addClass("context-menu-separator not-selectable")}else{if(z.type&&m[z.type]){m[z.type].call(D,z,v,u);d.each([v,u],function(F,E){E.commands[y]=z;if(d.isFunction(z.callback)){E.callbacks[y]=z.callback}})}else{if(z.type=="html"){D.addClass("context-menu-html not-selectable")}else{if(z.type){w=d("<label></label>").appendTo(D);d("<span></span>").html(z._name||z.name).appendTo(w);D.addClass("context-menu-input");v.hasTypes=true;d.each([v,u],function(F,E){E.commands[y]=z;E.inputs[y]=z})}else{if(z.items){z.type="sub"}}}switch(z.type){case"text":C=d('<input type="text" value="1" name="" value="">').attr("name","context-menu-input-"+y).val(z.value||"").appendTo(w);break;case"textarea":C=d('<textarea name=""></textarea>').attr("name","context-menu-input-"+y).val(z.value||"").appendTo(w);if(z.height){C.height(z.height)}break;case"checkbox":C=d('<input type="checkbox" value="1" name="" value="">').attr("name","context-menu-input-"+y).val(z.value||"").prop("checked",!!z.selected).prependTo(w);break;case"radio":C=d('<input type="radio" value="1" name="" value="">').attr("name","context-menu-input-"+z.radio).val(z.value||"").prop("checked",!!z.selected).prependTo(w);break;case"select":C=d('<select name="">').attr("name","context-menu-input-"+y).appendTo(w);if(z.options){d.each(z.options,function(E,F){d("<option></option>").val(E).text(F).appendTo(C)});C.val(z.selected)}break;case"sub":d("<span></span>").html(z._name||z.name).appendTo(D);z.appendTo=z.$node;g.create(z,u);D.data("contextMenu",z).addClass("context-menu-submenu");z.callback=null;break;case"html":d(z.html).appendTo(D);break;default:d.each([v,u],function(F,E){E.commands[y]=z;if(d.isFunction(z.callback)){E.callbacks[y]=z.callback}});d("<span></span>").html(z._name||z.name||"").appendTo(D);break}if(z.type&&z.type!="sub"&&z.type!="html"){C.on("focus",t.focusInput).on("blur",t.blurInput);if(z.events){C.on(z.events,v)}}if(z.icon){D.addClass("icon icon-"+z.icon)}}}z.$input=C;z.$label=w;D.appendTo(v.$menu);if(!v.hasTypes&&d.support.eventSelectstart){D.on("selectstart.disableTextSelect",t.abortevent)}});if(!v.$node){v.$menu.css("display","none").addClass("context-menu-root")}v.$menu.appendTo(v.appendTo||document.body)},resize:function(u,v){u.css({position:"absolute",display:"block"});u.data("width",Math.ceil(u.width())+1);u.css({position:"static",minWidth:"0px",maxWidth:"100000px"});u.find("> li > ul").each(function(){g.resize(d(this),true)});if(!v){u.find("ul").andSelf().css({position:"",display:"",minWidth:"",maxWidth:""}).width(function(){return d(this).data("width")})}},update:function(w,v){var u=this;if(v===e){v=w;g.resize(w.$menu)}w.$menu.children().each(function(){var x=d(this),y=x.data("contextMenuKey"),A=w.items[y],z=(d.isFunction(A.disabled)&&A.disabled.call(u,y,v))||A.disabled===true;x[z?"addClass":"removeClass"]("disabled");if(A.type){x.find("input, select, textarea").prop("disabled",z);switch(A.type){case"text":case"textarea":A.$input.val(A.value||"");break;case"checkbox":case"radio":A.$input.val(A.value||"").prop("checked",!!A.selected);break;case"select":A.$input.val(A.selected||"");break}}if(A.$menu){g.update.call(u,A,v)}})},layer:function(v,w){var u=v.$layer=d('<div id="context-menu-layer" style="position:fixed; z-index:'+w+'; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>').css({height:p.height(),width:p.width(),display:"block"}).data("contextMenuRoot",v).insertBefore(this).on("contextmenu",t.abortevent).on("mousedown",t.layerClick);if(!d.support.fixedPosition){u.css({position:"absolute",height:d(document).height()})}return u}};function o(y){var w=y.split(/\s+/),x=[];for(var v=0,u;u=w[v];v++){u=u[0].toUpperCase();x.push(u)}return x}d.fn.contextMenu=function(u){if(u===e){this.first().trigger("contextmenu")}else{if(u.x&&u.y){this.first().trigger(d.Event("contextmenu",{pageX:u.x,pageY:u.y}))}else{if(u==="hide"){var v=this.data("contextMenu").$menu;v&&v.trigger("contextmenu:hide")}else{if(u==="destroy"){d.contextMenu("destroy",{context:this})}else{if(d.isPlainObject(u)){u.context=this;d.contextMenu("create",u)}else{if(u){this.removeClass("context-menu-disabled")}else{if(!u){this.addClass("context-menu-disabled")}}}}}}}return this};d.contextMenu=function(y,C){if(typeof y!="string"){C=y;y="create"}if(typeof C=="string"){C={selector:C}}else{if(C===e){C={}}}var w=d.extend(true,{},k,C||{});var x=d(document);var A=x;var B=false;if(!w.context||!w.context.length){w.context=document}else{A=d(w.context).first();w.context=A.get(0);B=w.context!==document}switch(y){case"create":if(!w.selector){throw new Error("No selector specified")}if(w.selector.match(/.context-menu-(list|item|input)($|\s)/)){throw new Error('Cannot bind to selector "'+w.selector+'" as it contains a reserved className')}if(!w.build&&(!w.items||d.isEmptyObject(w.items))){throw new Error("No Items sepcified")}j++;w.ns=".contextMenu"+j;if(!B){h[w.selector]=w.ns}n[w.ns]=w;if(!w.trigger){w.trigger="right"}if(!b){x.on({"contextmenu:hide.contextMenu":t.hideMenu,"prevcommand.contextMenu":t.prevItem,"nextcommand.contextMenu":t.nextItem,"contextmenu.contextMenu":t.abortevent,"mouseenter.contextMenu":t.menuMouseenter,"mouseleave.contextMenu":t.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",t.inputClick).on({"mouseup.contextMenu":t.itemClick,"contextmenu:focus.contextMenu":t.focusItem,"contextmenu:blur.contextMenu":t.blurItem,"contextmenu.contextMenu":t.abortevent,"mouseenter.contextMenu":t.itemMouseenter,"mouseleave.contextMenu":t.itemMouseleave},".context-menu-item");b=true}A.on("contextmenu"+w.ns,w.selector,w,t.contextmenu);if(B){A.on("remove"+w.ns,function(){d(this).contextMenu("destroy")})}switch(w.trigger){case"hover":A.on("mouseenter"+w.ns,w.selector,w,t.mouseenter).on("mouseleave"+w.ns,w.selector,w,t.mouseleave);break;case"left":A.on("click"+w.ns,w.selector,w,t.click);break}if(!w.build){g.create(w)}break;case"destroy":var u;if(B){var v=w.context;d.each(n,function(D,F){if(F.context!==v){return true}u=d(".context-menu-list").filter(":visible");if(u.length&&u.data().contextMenuRoot.$trigger.is(d(F.context).find(F.selector))){u.trigger("contextmenu:hide",{force:true})}try{if(n[F.ns].$menu){n[F.ns].$menu.remove()}delete n[F.ns]}catch(E){n[F.ns]=null}d(F.context).off(F.ns);return true})}else{if(!w.selector){x.off(".contextMenu .contextMenuAutoHide");d.each(n,function(D,E){d(E.context).off(E.ns)});h={};n={};j=0;b=false;d("#context-menu-layer, .context-menu-list").remove()}else{if(h[w.selector]){u=d(".context-menu-list").filter(":visible");if(u.length&&u.data().contextMenuRoot.$trigger.is(w.selector)){u.trigger("contextmenu:hide",{force:true})}try{if(n[h[w.selector]].$menu){n[h[w.selector]].$menu.remove()}delete n[h[w.selector]]}catch(z){n[h[w.selector]]=null}x.off(h[w.selector])}}}break;case"html5":if((!d.support.htmlCommand&&!d.support.htmlMenuitem)||(typeof C=="boolean"&&C)){d('menu[type="context"]').each(function(){if(this.id){d.contextMenu({selector:"[contextmenu="+this.id+"]",items:d.contextMenu.fromMenu(this)})}}).css("display","none")}break;default:throw new Error('Unknown operation "'+y+'"')}return this};d.contextMenu.setInputValues=function(u,v){if(v===e){v={}}d.each(u.inputs,function(w,x){switch(x.type){case"text":case"textarea":x.value=v[w]||"";break;case"checkbox":x.selected=v[w]?true:false;break;case"radio":x.selected=(v[x.radio]||"")==x.value?true:false;break;case"select":x.selected=v[w]||"";break}})};d.contextMenu.getInputValues=function(u,v){if(v===e){v={}}d.each(u.inputs,function(w,x){switch(x.type){case"text":case"textarea":case"select":v[w]=x.$input.val();break;case"checkbox":v[w]=x.$input.prop("checked");break;case"radio":if(x.$input.prop("checked")){v[x.radio]=x.value}break}});return v};function q(u){return(u.id&&d('label[for="'+u.id+'"]').val())||u.name}function a(w,v,u){if(!u){u=0}v.each(function(){var x=d(this),A=this,B=this.nodeName.toLowerCase(),y,z;if(B=="label"&&x.find("input, textarea, select").length){y=x.text();x=x.children().first();A=x.get(0);B=A.nodeName.toLowerCase()}switch(B){case"menu":z={name:x.attr("label"),items:{}};u=a(z.items,x.children(),u);break;case"a":case"button":z={name:x.text(),disabled:!!x.attr("disabled"),callback:(function(){return function(){x.click()}})()};break;case"menuitem":case"command":switch(x.attr("type")){case e:case"command":case"menuitem":z={name:x.attr("label"),disabled:!!x.attr("disabled"),callback:(function(){return function(){x.click()}})()};break;case"checkbox":z={type:"checkbox",disabled:!!x.attr("disabled"),name:x.attr("label"),selected:!!x.attr("checked")};break;case"radio":z={type:"radio",disabled:!!x.attr("disabled"),name:x.attr("label"),radio:x.attr("radiogroup"),value:x.attr("id"),selected:!!x.attr("checked")};break;default:z=e}break;case"hr":z="-------";break;case"input":switch(x.attr("type")){case"text":z={type:"text",name:y||q(A),disabled:!!x.attr("disabled"),value:x.val()};break;case"checkbox":z={type:"checkbox",name:y||q(A),disabled:!!x.attr("disabled"),selected:!!x.attr("checked")};break;case"radio":z={type:"radio",name:y||q(A),disabled:!!x.attr("disabled"),radio:!!x.attr("name"),value:x.val(),selected:!!x.attr("checked")};break;default:z=e;break}break;case"select":z={type:"select",name:y||q(A),disabled:!!x.attr("disabled"),selected:x.val(),options:{}};x.children().each(function(){z.options[this.value]=d(this).text()});break;case"textarea":z={type:"textarea",name:y||q(A),disabled:!!x.attr("disabled"),value:x.val()};break;case"label":break;default:z={type:"html",html:x.clone(true)};break}if(z){u++;w["key"+u]=z}});return u}d.contextMenu.fromMenu=function(v){var w=d(v),u={};a(u,w.children());return u};d.contextMenu.defaults=k;d.contextMenu.types=m;d.contextMenu.handle=t;d.contextMenu.op=g;d.contextMenu.menus=n})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_accordion",a));b.fn.rup_accordion("extend",{destroy:function(){b(this).accordion("destroy")},disable:function(){b(this).accordion("disable")},enable:function(){b(this).accordion("enable")},option:function(d,e){if(e!==undefined){b(this).accordion("option",d,e)}else{b(this).accordion("option",d)}},widget:function(){b(this).accordion("widget")},activate:function(d){b(this).accordion("activate",d)},resize:function(){b(this).accordion("resize")}});b.fn.rup_accordion("extend",{_init:function(e){if(e.length>1){b.rup.errorGestor(b.rup.i18n.base.rup_global.initError+b(this).attr("id"))}else{var h=this.children(),g=(h.length)/2,f=b.extend({},b.fn.rup_accordion.defaults,e[0]);this.removeClass("rup_accordion");this.data("settings",f);createUserEvent=f.create;f.create=function(j,k){if(createUserEvent!==undefined){if(createUserEvent(j,k)===false){return false}}d(j,k)};function d(j,k){b(j.target).addClass("rup_accordion_create")}if(f.validation){if(parseInt(g)!==g){b.rup.errorGestor(b.rup.i18n.base.rup_accordion.strucPairError);return false}else{h.each(function(k,j){if((parseInt(k/2)===k/2)&&(b(j).find("a").length===0)){b.rup.errorGestor(b.rup.i18n.base.rup_accordion.headFormatError);return false}})}}this.accordion(f)}}});b.fn.rup_accordion.defaults={validation:true}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_autocomplete",a));b.fn.rup_autocomplete("extend",{getRupValue:function(){return b(this).val()},setRupValue:function(d){b(this).val(d)},destroy:function(){var d;if(b(this).attr("id").indexOf("_label")>=0){d=b(this)}else{d=b("#"+b(this).attr("id")+"_label")}d.autocomplete("destroy")},off:function(){var d;if(b(this).attr("id").indexOf("_label")>=0){d=b(this)}else{d=b("#"+b(this).attr("id")+"_label")}d.storeEvents()},on:function(){var d;if(b(this).attr("id").indexOf("_label")>=0){d=b(this)}else{d=b("#"+b(this).attr("id")+"_label")}d.restoreEvents()},disable:function(){var d;if(b(this).attr("id").indexOf("_label")>=0){d=b(this)}else{d=b("#"+b(this).attr("id")+"_label")}d.attr("disabled","disabled")},enable:function(){var d;if(b(this).attr("id").indexOf("_label")>=0){d=b(this)}else{d=b("#"+b(this).attr("id")+"_label")}d.removeAttr("disabled")},option:function(f,h,d){var e;if(b(this).attr("id").indexOf("_label")>=0){e=b(this)}else{e=b("#"+b(this).attr("id")+"_label")}var g=e.data("settings");if(f==="source"){if(typeof h==="object"){if(d!==undefined){g.i18nId=d}else{g.i18nId=g.id}e.autocomplete("option",f,this._sourceLOCAL);e.autocomplete("option","minLength",g.minLength!==undefined?g.minLength:0)}else{if(d!==undefined){g.sourceParam=d;e.autocomplete("option",f,this._sourceREMOTE);e.autocomplete("option","minLength",g.minLength>3?g.minLength:3)}else{return undefined}}g.data=h;e.data("settings",g)}else{g[f]=h;e.data("settings",g);e.autocomplete("option",f,h)}},search:function(d){if(b._data(b(this)[0],"events")!==undefined){b(this).focus();b(this).val(d);b(this).autocomplete("search",d)}},close:function(){b(this).autocomplete("close")},val:function(){return b("#"+b(this).attr("id")).val()},set:function(g,d){var j=b(this),f=jQuery("[id='"+j.attr("id")+"_label']"),h,e={};j.val(g);j.attr("rup_autocomplete_label",d);f.val(d);h=f.data("loadObjects");e[d]=g;f.data("loadObjects",jQuery.extend(true,{},h,e))}});b.fn.rup_autocomplete("extend",{_parseResponse:function(e,d,f){return{label:d.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.ui.autocomplete.escapeRegex(e)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>"),value:f}},_sourceLOCAL:function(g,d){var f,k={},e,l;if(this.element.data("settings")!==undefined){f=this.element.data("settings")}else{f=this.options}if(f.loadObjects!==undefined){l=f.loadObjects}else{l=f.id}var j=f.contains?b.ui.autocomplete.escapeRegex(g.term):"^"+b.ui.autocomplete.escapeRegex(g.term),h=b.rup.i18n.app[f.i18nId];j=new RegExp(j,"i");data=b.map(f.data,function(n){var m=n,o=n;if(typeof n==="object"){if(n.i18nCaption!==undefined){m=b.rup.i18nParse(h,n.i18nCaption)}else{if(n.label!==undefined){m=n.label}else{m=n.value}}o=n.value}if(!g.term||j.test(m)){e=f._parseResponse(g.term,m,o);k[e.label.replace(/<strong>/g,"").replace(/<\/strong>/g,"")]=e.value;return e}});b("#"+l).data("loadObjects",k);data=b.grep(data,function(m){return m!=undefined});d(data)},_sourceREMOTE:function(h,d){var g,k={},f,l;if(this.element.data("settings")!==undefined){g=this.element.data("settings")}else{g=this.options}if(g.loadObjects!==undefined){l=g.loadObjects}else{l=g.id}var e=h.term.replace(/%/g,"\\%").replace(/_/g,"\\_"),j=b.extend({q:e,c:this.options.contains},this.options.extraParams);b.rup_ajax({url:g.data,data:j,dataType:"json",contentType:"application/json",beforeSend:function(m){b("#"+g.id+"_label").addClass("rup-autocomplete_loading");m.setRequestHeader("RUP",b.toJSON(g.sourceParam))},success:function(m){d(b.map(m,function(n){f=g._parseResponse(h.term,n.label,n.value);k[f.label.replace(/<strong>/g,"").replace(/<\/strong>/g,"")]=f.value;return f}));b("#"+l).data("loadObjects",k)},error:function(n,o,m){if(g.onLoadError!==null&&typeof g.onLoadError==="function"){jQuery(g.onLoadError(n,o,m))}else{b.rup.showErrorToUser(b.rup.i18n.base.rup_autocomplete.ajaxError)}},complete:function(m,n){b("#"+g.id+"_label").removeClass("rup-autocomplete_loading")}})},_init:function(e){if(e.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var g=b.extend({},b.fn.rup_autocomplete.defaults,e[0]),d=b(this).attr("name"),f;b(this).attr("ruptype","autocomplete");g.id=b(this).attr("id");g.loadObjects=g.id;g.data=g.source;g._parseResponse=this._parseResponse;g.loadValue=b("#"+g.id).attr("value");if(!g.i18nId){g.i18nId=g.id}g._change=g.change;g._select=g.select;g._focus=g.focus;g.change=function(h,j){if(f!=null){b("#"+h.target.id).val(f);b("#"+h.target.id).focus()}f=null;if(g._change!==undefined){g._change(h,j)}};g.select=function(h,j){f=j.item.label.replace(/<strong>/g,"").replace(/<\/strong>/g,"");if(g._select!==undefined){g._select(h,j)}b("#"+g.id).attr("rup_autocomplete_label",f);b("#"+g.id).data("selected",true)};g.focus=function(h,j){b("#"+h.target.id).val(j.item.label.replace(/<strong>/g,"").replace(/<\/strong>/g,""));if(g._focus!==undefined){g._focus(h,j)}return false};b("#"+g.id).after(b("<input>").attr({type:"hidden",id:g.id+"_value",name:(g.valueName===null?d:g.valueName),ruptype:"autocomplete"})).attr("name",(g.labelName===null?d+"_label":g.labelName)).addClass("rup-autocomplete_label");if(typeof g.source==="object"){g.source=this._sourceLOCAL}else{g.minLength=g.minLength>3?g.minLength:3;g.source=this._sourceREMOTE}b("#"+g.id).data("loadObjects",{});b("#"+g.id).autocomplete(g);if(b.rup_utils.aplicatioInPortal()){b("div.r01gContainer").append(b("body > .ui-autocomplete"))}if(g.disabled){b("#"+g.id).rup_autocomplete("disable")}if(g.defaultValue){b("#"+g.id).rup_autocomplete("search",g.defaultValue)}if(g.loadValue){b("#"+g.id).val(g.loadValue);b("#"+g.id+"_value").val(g.loadValue)}g.loadObjects=g.id+"_label";b("#"+g.id).attr("id",g.id+"_label");b("#"+g.id+"_value").attr("id",g.id);b("#"+g.id+"_label").bind("blur keydown",function(k){var j=b("#"+g.id).data("selected"),h=b(".ui-autocomplete:visible").length>0?true:false;b("#"+g.id).data("selected",false);if(k.type==="keydown"&&k.keyCode!==13){return true}var l=b(k.currentTarget),m=b("#"+g.loadObjects).data("loadObjects");if(g.getText==true){if(m[l.val()]!==undefined){b("#"+g.id).val(l.val());b("#"+g.id).attr("rup_autocomplete_label",l.val())}else{b("#"+g.id).val(l.val());b("#"+g.id).attr("rup_autocomplete_label",l.val())}}else{if(m[l.val()]!==undefined){b("#"+g.id).val(m[l.val()]);b("#"+g.id).attr("rup_autocomplete_label",m[l.val()])}else{b("#"+g.id).val("");b("#"+g.id).attr("rup_autocomplete_label","");l.val("");l.autocomplete("close")}}if(k.type==="keydown"&&k.keyCode===13&&(j||h)){return false}})}b("#"+g.id+"_label").data("settings",g)}});b.fn.rup_autocomplete.defaults={onLoadError:null,contains:true,valueName:null,labelName:null,getText:false}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){a.widget("$.rup_breadCrumb",{options:{showSpeed:"fast",hideSpeed:"",collapsible:false,collapsedWidth:10,breadCrumb:a.rup.APP_RESOURCES+".breadCrumb"},_create:function(){var b=window.location.pathname,d=b.substring(a.rup.CTX_PATH.length),g=d.split("/"),j=a("<ul>").attr("id","rup_breadCrumbs_ul").addClass("rup-breadCrumb_main"),k=null,e=null,l=(this.options.initUrl!==undefined)?a.rup.CTX_PATH+this.options.initUrl:a.rup.CTX_PATH,h=(this.options.i18nId===undefined)?this.element.attr("id"):this.options.i18nId;if(this.options.breadCrumb instanceof Object){k=this.options.breadCrumb}else{a.rup.getFile(this.options.breadCrumb);k=a.rup.i18n[this.options.breadCrumb]}if(!window.LOGGED_USER||LOGGED_USER==="NULL"){LOGGED_USER=""}if(!window.DESTROY_XLNETS_SESSION){DESTROY_XLNETS_SESSION="false"}if(LOGGED_USER!==""){if(this.options.logOutUrl!==undefined){if(DESTROY_XLNETS_SESSION==="false"){this.element.append(a("<div id='logOutDiv' class='rup-breadCrumb_logoutDiv'>").append(a("<a>").addClass("rup-breadCrumb_link").attr("logOutHref",this.options.logOutUrl).bind("click",function(){a.rup_messages("msgConfirm",{message:a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.menuDisconnectMessage"),title:a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.menuDisconnectTitle"),OKFunction:function(){a(window).attr("location",a("#logOutLink").attr("logOutHref"))}})}).html(a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.exit")).attr("id","logOutLink").append(a("<span>").addClass("ui-icon rup-icon rup-icon-door-out rup-breadCrumb_exitImg"))))}else{this.element.append(a("<div id='logOutDiv' class='rup-breadCrumb_logoutDiv'>").append(a("<a>").addClass("rup-breadCrumb_link").attr("logOutHref",this.options.logOutUrl).bind("click",function(){a.rup_messages("msgConfirm",{message:a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.menuSecuritySystemDisconnectMessage"),title:a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.menuDisconnectTitle"),OKFunction:function(){a(window).attr("location",a("#logOutLink").attr("logOutHref"))}})}).mouseover(function(m){a(this).find("span").removeClass("rup-breadCrumb_logoutImg").addClass("rup-breadCrumb_logoutImg_active")}).mouseleave(function(m){a(this).find("span").addClass("rup-breadCrumb_logoutImg").removeClass("rup-breadCrumb_logoutImg_active")}).html(a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.disconnect")).attr("id","logOutLink").append(a("<span>").addClass("rup-breadCrumb_logoutImg ui-icon"))))}}breadCrumbSpan=a("<span>").addClass("rup-breadCrumbs_span").text(LOGGED_USER+a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.userAre"));this.element.append(breadCrumbSpan)}else{breadCrumbSpan=a("<span>").addClass("rup-breadCrumbs_span").text(a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.youAre"));this.element.append(breadCrumbSpan)}j.append(this._createLI(a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.start"),l));for(var f=0;f<g.length;f++){if(k[g[f]]){k=this._createBreadCrumb(k[g[f]],g[f],j,h)}}a(j.children()[j.children().length-1]).addClass("rup-breadCrumb_current").find("img.rup-icon").remove();e=a("a:first",a(j.children()[j.children().length-1]));e.replaceWith(a("<span>").text(e.text()).css({"font-weight":"bold",color:"#333333"}));delete e;this.element.append(j);j.xBreadcrumbs()},_createLI:function(d,f){var b=a("<li>"),e=a("<a>").attr("href",f).text(d);b.append(e);b.append(a("<img>").addClass("ui-icon rup-icon rup-icon-separator-arrow"));return b},_createBreadCrumb:function(g,h,e,b){var j,f=a("<ul>");if(g.i18nCaption){j=this._createLI(a.rup.i18nParse(a.rup.i18n.app[b],g.i18nCaption),(g.url?a.rup.CTX_PATH+g.url:"#"))}if(g.subLevel){for(var d=0;d<g.subLevel.length;d++){f.append(this._createLI(a.rup.i18nParse(a.rup.i18n.app[b],g.subLevel[d].i18nCaption),(g.subLevel[d].url?g.subLevel[d].url:"#")).css("background","none"))}j.append(f);a(j).bind("mouseover",function(k){a(this).find("a:eq(1)").focus()});j.bind("keydown",function(m){switch(m.keyCode){case a.ui.keyCode.UP:var l=a(this).find("li > a");for(var k=0;k<=l.length;k++){if(l[k].text===a(m.target).text()){break}}if(a(l[k-1]).length>0){a(l[k-1]).focus()}else{a(this).find("li > a").last().focus()}break;case a.ui.keyCode.DOWN:var l=a(this).find("li > a");for(var k=0;k<=l.length;k++){if(l[k].text===a(m.target).text()){break}}if(a(l[k+1]).length>0){a(l[k+1]).focus()}else{a(this).find("li > a").first().focus()}break;case a.ui.keyCode.ESCAPE:a(this).children("ul").hide();break;default:}})}e.append(j);return g},_setOption:function(b,d){a.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){var b={};a.extend(a.rup.iniRup,a.rup.rupSelectorObjectConstructor("rup_combo",b));a.fn.rup_combo("extend",{getRupValue:function(j){if(a(this).data("settings").submitAsJSON){var h=a(this).attr("name").split("."),l=h[h.length-1],e=a(this).rup_combo("value"),k=e.length,g=[];for(var d=0;d<k;d++){var f={};f[l]=e[d];g.push(f)}return g}return a(this).data("settings").submitAsString?a(this).rup_combo("value").toString():a(this).rup_combo("value")},setRupValue:function(d){if(this.length===0||!a(this).data("settings").multiselect){a.data(this[0],"setRupValue",d.toString());a(this).rup_combo("select",d.toString())}else{a(this).rup_combo("select",d)}},clear:function(){if(this.length===0||!a(this).data("settings").multiselect){a(this).rup_combo("select")}else{a(this).multiselect("uncheckAll")}},reset:function(){var d=a(this);d.rup_combo("select",d.find("option[selected]").attr("value"))},checkAll:function(){if(a(this).data("settings").multiselect){a(this).multiselect("checkAll")}else{alert("Función no soportada.")}},select:function(g){if(this.length===0||!a(this).data("settings").multiselect){var e=this._setElement(a(this),g);if(e){var d=a(this).data("childs");if(d!==undefined){for(var f=0;f<d.length;f=f+1){a("#"+d[f]).rup_combo("reload",d[f])}}}}else{this._setElement(a(this),g,true)}},selectLabel:function(g){if(this.length===0||!a(this).data("settings").multiselect){var e=this._selectLabel(a(this),g,true);if(e){var d=a(this).data("childs");if(d!==undefined){for(var f=0;f<d.length;f=f+1){a("#"+d[f]).rup_combo("reload",d[f])}}}}else{for(var f=0;f<g.length;f++){a("input[name='multiselect_"+a(this).attr("id")+"'][title='"+g[f]+"']").attr("checked",true)}a(this).multiselect("update")}},value:function(){if(this.length===0||!a(this).data("settings").multiselect){return(a(this).selectmenu("value"))}else{var f=new Array(),e=a(this).multiselect("getChecked");for(var d=0;d<e.size();d++){f.push(a(e[d]).val())}return f}},label:function(){if(this.length===0||!a(this).data("settings").multiselect){return(this[0].options[a(this).selectmenu("index")].text)}else{var f=new Array(),e=a(this).multiselect("getChecked");for(var d=0;d<e.size();d++){f.push(a(e[d]).next().text())}return f}},index:function(){if(this.length===0||!a(this).data("settings").multiselect){return(a(this).selectmenu("index"))}else{var g=new Array(),f=a(this).rup_combo("value"),d=a(this).find("option");for(var e=0;e<d.size();e++){if(a.inArray(a(d[e]).val(),f)!==-1){g.push(e)}}return g}},disable:function(){var d=a(this);a("#"+a(this).attr("id")+"-button").attr("tabindex",-1);a("#"+a(this).attr("id")+"-button").on("focus.rup_combo",function(e){a("#"+d.attr("id")+"-button").blur();return false});if(this.length===0||!a(this).data("settings").multiselect){a(this).selectmenu("disable")}else{a(this).multiselect("disable")}},enable:function(){var e=a(this),d=a(this).data("settings");a("#"+a(this).attr("id")+"-button").off("focus.rup_combo");a("#"+a(this).attr("id")+"-button").attr("tabindex",(d.tabindex?d.tabindex:0));if(this.length===0||!a(this).data("settings").multiselect){a(this).selectmenu("enable")}else{a(this).multiselect("enable")}},isDisabled:function(){if(a(this).attr("aria-disabled")==="false"){return false}else{return true}},disableChild:function(){a(this).empty().append("<option></option>").selectmenu("disable");a("#"+a(this).attr("id")+"-button span:first-child").text("");var d=a(this).data("childs");if(d!==undefined){for(var e=0;e<d.length;e=e+1){a("#"+d[e]).rup_combo("disableChild")}}},disableOpt:function(j){if(a(this).data("settings").multiselect){this.find("[value='"+j+"']").attr("disabled","disabled");var h=a("#rup-multiCombo_"+a(this).attr("id")).find("[value='"+j+"']");h.attr("disabled","disabled");h.parent().css("color","grey");if(a(this).data("settings").sourceGroup!=undefined){var d=h.parentsUntil("ul").last().prevAll("li.ui-multiselect-optgroup-label").first(),e=d.nextUntil("li.ui-multiselect-optgroup-label").find("input"),f=true;for(var g=0;g<e.length;g++){if(!e[g].disabled){f=false;break}}if(f){d.css("color","grey");d.children("a").remove();d.children("span").not(".rup-combo_multiOptgroupLabel").remove()}}}else{alert("Función no soportada.")}},disableOptArr:function(e){if(a(this).data("settings").multiselect){for(var d=0;d<e.length;d++){a(this).rup_combo("disableOpt",e[d])}}else{alert("Función no soportada.")}},enableOpt:function(f){if(a(this).data("settings").multiselect){this.find("[value='"+f+"']").removeAttr("disabled");var e=a("#rup-multiCombo_"+a(this).attr("id")).find("[value='"+f+"']");e.removeAttr("disabled");e.parent().css("color","black");if(a(this).data("settings").sourceGroup!=undefined){var d=e.parentsUntil("ul").last().prevAll("li.ui-multiselect-optgroup-label").first();if(d.children("a").length===0){d.css("color","black");this._generateOptGroupLabel(d,a(this).data("settings").multiOptgroupIconText)}}}else{alert("Función no soportada.")}},enableOptArr:function(e){if(a(this).data("settings").multiselect){for(var d=0;d<e.length;d++){a(this).rup_combo("enableOpt",e[d])}}else{alert("Función no soportada.")}},refresh:function(){if(this.length===0||!a(this).data("settings").multiselect){return a(this).selectmenu()}else{a(this).multiselect("refresh");var e=a(this).data("settings").multiOptgroupIconText,d=this;a.each(a("#rup-multiCombo_"+a(this).attr("id")).find(".ui-multiselect-optgroup-label"),function(g,f){d._generateOptGroupLabel(f,e)});a("#rup-multiCombo_"+a(this).attr("id")).find(".ui-multiselect-all").attr("title",a.rup.i18n.base.rup_combo["multiselect"]["checkAllTitle"]).rup_tooltip();a("#rup-multiCombo_"+a(this).attr("id")).find(".ui-multiselect-none").attr("title",a.rup.i18n.base.rup_combo["multiselect"]["uncheckAllTitle"]).rup_tooltip();return a(this).multiselect("uncheckAll")}},reload:function(j){if(this.length!==0){var e=a(this).data("settings"),h,f;a("#"+e.id).rup_combo("disableChild");if(e.source==undefined||typeof e.source==="object"||typeof e.sourceGroup==="object"){h=e.source[this._getParentsValues(e.parent,false,e.multiValueToken)];if(h!==undefined){this._parseLOCAL(h,e,a("#"+e.id));this._makeCombo(e);if(e.onLoadSuccess!==null){jQuery(e.onLoadSuccess(a("#"+e.id)))}a("#"+e.id).selectmenu("change");f=a.data(a("#"+e.id)[0],"setRupValue");if(f){a("#"+e.id).rup_combo("select",f)}}}else{if(typeof e.source==="string"||typeof e.sourceGroup==="string"){var g=this._getParentsValues(e.parent,true),d=this;if(g===null){return false}a.rup_ajax({url:e.source,data:g,dataType:"json",contentType:"application/json",beforeSend:function(k){d._ajaxBeforeSend(k,e)},success:function(l,m,k){d._ajaxSuccess(l,e,a("#"+e.id));if(e.onLoadSuccess!==null){jQuery(e.onLoadSuccess(a("#"+e.id)))}},error:function(l,m,k){if(e.onLoadError!==null){jQuery(e.onLoadError(l,m,k))}else{d._ajaxError(l,m,k)}}});delete d}else{if(typeof e.source==="function"||typeof e.sourceGroup==="function"){jQuery(e.source);this._makeCombo(e)}}}}},order:function(j,o,m){var d=a(this),n=a("option",d),h=[],f=null;if(d.length>0){var k=d.rup_combo("value");n.each(function(){if(m){m=false;f={val:a(this).val(),text:a(this).text()};return true}h.push({val:a(this).val(),text:a(this).text(),clazz:a(this).attr("class")})});if(!j){if(!o){h.sort(function(p,l){if(p.text==null||p.text==undefined||p.text==""||p.text=="&nbsp;"){return 1}if(l.text==null||l.text==undefined||l.text==""||l.text=="&nbsp;"){return 0}return p.text.localeCompare(l.text)})}else{h.sort(function(p,l){return p.text-l.text})}}else{if(!o){h.sort(function(p,l){if(p.val>l.val){return 1}else{if(p.val==l.val){return 0}else{return -1}}})}else{h.sort(function(p,l){return p.val-l.val})}}for(var g=0,e=h.length;g<e;g++){a(n[g]).val(h[g].val).text(h[g].text);if(h[g].clazz){a(n[g]).attr("class",h[g].clazz)}}if(f){d.prepend(a("<option>").attr("value",f.val).text(f.text));a(n[h.length]).remove()}d.rup_combo("refresh");this._setElement(a(this),k,a(this).data("settings").multiselect);delete d;delete n;delete h}}});a.fn.rup_combo("extend",{_setElement:function(d,h,e,g){if(e!==true){if(typeof h==="string"){if(a("option[value='"+h+"']",d).length>0){if(g===true){a("option[value='"+h+"']",d).attr("selected","selected")}a(d).selectmenu("value",h)}else{return false}}else{if(typeof h==="number"){if(a("option",d).length>=h){if(g===true){a("option:eq("+h+")",d).attr("selected","selected")}a(d).selectmenu("index",h)}else{return false}}else{a(d).selectmenu("index",0)}}return true}else{if(h!==null&&typeof h==="object"){for(var f=0;f<h.length;f++){if(typeof h[f]==="number"){a(a("input[name='multiselect_"+a(this).attr("id")+"']")[h[f]]).attr("checked",true)}else{if(typeof h[f]==="string"){a("input[name='multiselect_"+a(this).attr("id")+"'][value='"+h[f]+"']").attr("checked",true)}}}a(d).multiselect("update")}return true}},_selectLabel:function(d,f){for(var e=0;e<a("option",d).length;e=e+1){if(a("option",d)[e].label===f){a(d).selectmenu("index",a("option",d)[e].index);return true}}return false},_getBlankLabel:function(e){var d=a.rup.i18n.app;if(d[e]&&d[e]["_blank"]){return d[e]["_blank"]}return a.rup.i18n.base.rup_combo["blankNotDefined"]},_defaultFormatting:function(f){var d=[{find:/^([^\-]+) \- /g,rep:'<span class="ui-selectmenu-item-header">$1</span>'},{find:/([^\|><]+) \| /g,rep:'<span class="ui-selectmenu-item-content">$1</span>'},{find:/([^\|><\(\)]+) (\()/g,rep:'<span class="ui-selectmenu-item-content">$1</span>$2'},{find:/([^\|><\(\)]+)$/g,rep:'<span class="ui-selectmenu-item-content">$1</span>'},{find:/(\([^\|><]+\))$/g,rep:'<span class="ui-selectmenu-item-footer">$1</span>'}];for(var e in d){f=f.replace(d[e].find,d[e].rep)}return f},_getParentsValues:function(l,j,f){var h="",k,d,f=f!=null?f:"",e;if(l===undefined){return h}for(var g=0;g<l.length;g=g+1){k=l[g];if(a("#"+k).rup_combo("index")===0){d=a("#"+k+"-button span:first-child").text();if(d===a.rup.i18n.base.rup_combo["blankNotDefined"]||((a.rup.i18n.app[k]!==undefined)&&(d===a.rup.i18n.app[l[g]]["_blank"]))){return null}}if(a("#"+k).data("settings").blank!==undefined&&a("#"+k).data("settings").blank!==null){e=a("#"+k).data("settings").blank}else{e=""}if(a("#"+k).val()===null||a("#"+k).val()===e){return null}if(j){h+=a("#"+k).attr("name")+"="+a("#"+k).val()+"&"}else{h+=a("#"+k).val()+f}}if(h!==""){if(j){h=h.substring(0,h.length-1)}else{h=h.substring(0,h.length-f.length)}}return h},_makeCombo:function(g){if(g.blank!=null){a("#"+g.id).prepend(a("<option>").attr("value",g.blank).text(this._getBlankLabel(g.id)))}if(g.imgs){var f=[],e=[];a.map(g.imgs,function(h){a.each(h,function(j,k){if(j.indexOf("###")==-1){a("#"+g.id+" [value='"+j+"']").addClass(k);f[f.length]={find:"."+k}}else{e=j.split("###");a("#"+g.id+" > [label='"+e[0]+"'] > [value='"+e[1]+"']").addClass(h[e[0]+"###"+e[1]]);f[f.length]={find:"."+h[e[0]+"###"+e[1]]}}})});g.icons=f}g.format=g.format==="default"?this._defaultFormatting:g.format;a("#"+g.id).data("settings",g);if(!g.multiselect){a("#"+g.id).selectmenu(g)}else{a("#"+g.id).width("0");g.minWidth=g.width;a("#"+g.id).multiselect(g);a("#"+g.id).rup_combo("refresh");a("#"+g.id).attr("multiple","multiple")}if(a.rup_utils.aplicatioInPortal()){if(!g.multiselect){a("div.r01gContainer").append(a("#"+g.id+"-menu"))}else{a("div.r01gContainer").append(a("#rup-multiCombo_"+g.id))}}if(g.ordered){a("#"+g.id).rup_combo("order",g.orderedByValue,g.orderAsNumber,g.blank)}if(!g.loadFromSelect&&(g.inputValue===undefined||g.inputValue==="")||g.loadFromSelect&&g.selected!==undefined){this._setElement(a("#"+g.id),g.selected,g.multiselect,true)}else{if(g.multiselect){g.inputValue=g.inputValue.split("##")}this._setElement(a("#"+g.id),g.inputValue,g.multiselect,true)}if(!g.disabled){a("#"+g.id).rup_combo("enable")}else{a("#"+g.id).rup_combo("disable")}if(g.multiselect){if(g.disabledOpts!==undefined){a("#"+g.id).rup_combo("disableOptArr",g.disabledOpts)}if(g.enabledOpts!==undefined){a("#"+g.id).rup_combo("enableOptArr",g.enabledOpts)}}var d=g.parent;if(d!==undefined){a.each(d,function(j,h){if(a("#"+h).rup_combo("isDisabled")){a("#"+g.id).rup_combo("disable");return}})}if(g.rowStriping){if(!g.multiselect){a("#"+g.id+"-menu li:nth-child(2n+1):not(.ui-selectmenu-group)").addClass("rup-combo_odd");a("#"+g.id+"-menu li:nth-child(2n):not(.ui-selectmenu-group)").addClass("rup-combo_even");a("#"+g.id+"-menu li:nth-child(2n+1).ui-selectmenu-group").addClass("rup-combo_groupOdd");a("#"+g.id+"-menu li:nth-child(2n).ui-selectmenu-group").addClass("rup-combo_groupEven")}else{a("#rup-multiCombo_"+g.id+" .ui-multiselect-checkboxes li:nth-child(2n+1):not(.ui-multiselect-optgroup-label)").addClass("rup-combo_odd");a("#rup-multiCombo_"+g.id+" .ui-multiselect-checkboxes li:nth-child(2n):not(.ui-multiselect-optgroup-label)").addClass("rup-combo_even");a.each(a("#rup-multiCombo_"+g.id+" .ui-multiselect-optgroup-label"),function(h,j){(h%2==0)?a(j).addClass("rup-combo_groupOdd"):a(j).addClass("rup-combo_groupEven")})}}},_parseLOCAL:function(k,g,f){var j=g.imgs?g.imgs:[],d,h;for(var e=0;e<k.length;e=e+1){d=h=k[e];if(typeof k[e]==="object"){if(k[e]["i18nCaption"]){d=a.rup.i18nParse(a.rup.i18n.app[g.i18nId],k[e]["i18nCaption"])}else{d=k[e]["label"]}h=k[e]["value"]}if(k[e]!=undefined&&k[e]["style"]){j[j.length]={};j[j.length-1][h]=k[e]["style"];g.imgs=j}f.append(a("<option>").attr("value",h).text(g.showValue?h+g.token+d:d))}},_parseOptGroupLOCAL:function(h,g,f){var j,d=this;for(var e=0;e<h.length;e=e+1){j=h[e];a.each(j,function(k,l){if(typeof(l[0])!=="string"){f.append(a("<optgroup>").attr("label",a.rup.i18nParse(a.rup.i18n.app[g.i18nId],k)))}else{f.append(a("<optgroup>").attr("label",k))}f=a(f).children("optgroup:last-child");d._parseLOCAL(l,g,f);f=a(f).parent()})}},_parseREMOTE:function(l,g,f,k){var e=g.imgs?g.imgs:[],j,h;for(var d=0;d<l.length;d=d+1){j=l[d];if(j.style){e[e.length]={};if(k==null){e[e.length-1][j.value]=j.style}else{e[e.length-1][k+"###"+j.value]=j.style}g.imgs=e}f.append(a("<option>").attr("value",j.value).text(g.showValue?j.value+g.token+j.label:j.label))}},_parseOptGroupREMOTE:function(h,g,f){var j,d=this;for(var e=0;e<h.length;e=e+1){j=h[e];a.each(j,function(k,l){f.append(a("<optgroup>").attr("label",k));f=a(f).children("optgroup:last-child");d._parseREMOTE(l,g,f,k);f=a(f).parent()})}},_ajaxBeforeSend:function(g,f,d){if(d!==undefined){a("#"+f.id).replaceWith(d)}this._makeCombo(f);a("#"+f.id).rup_combo("disable");a("#"+f.id+"-button span:first-child").addClass("rup-combo_loadingText").text(a.rup.i18n.base.rup_combo["loadingText"]);var e=a("#"+f.id+"-button span:last-child");a(e).removeClass("ui-icon-triangle-1-s");a(e).addClass("rup-combo_loading");g.setRequestHeader("RUP",a.toJSON(f.sourceParam))},_ajaxSuccess:function(g,f,d){a("#"+f.id+"-button span:first-child").removeClass("rup-combo_loadingText").text("");var e=a("#"+f.id+"-button span:last-child");a(e).removeClass("rup-combo_loading");a(e).addClass("ui-icon-triangle-1-s");a("#"+f.id).empty();if(g.length>0){if(f.source){this._parseREMOTE(g,f,d)}else{f.ordered=false;this._parseOptGroupREMOTE(g,f,d)}this._makeCombo(f);setRupValue=a.data(a("#"+f.id)[0],"setRupValue");if(setRupValue){a("#"+f.id).rup_combo("select",setRupValue)}else{a("#"+f.id).selectmenu("change")}}else{a("#"+f.id).append("<option></option>")}},_ajaxError:function(f,g,e,d){if(f.responseText!==null){a.rup.showErrorToUser(f.responseText)}else{a.rup.showErrorToUser(a.rup.i18n.base.rup_combo.ajaxError)}},_generateOptGroupLabel:function(d,e){a(d).append(a("<span />").text(a(d).children("a").text()).addClass("rup-combo_multiOptgroupLabel"));a(d).children("a").remove();a(d).append(a("<span />").text(" ["));a(d).append(a("<a />").text(e?a.rup.i18n.base.rup_combo["multiselect"]["optGroupSelect"]:"").prepend(a("<span />").addClass("ui-icon ui-icon-check rup-combo_multiOptgroupIcon")).attr("title",a.rup.i18n.base.rup_combo["multiselect"]["optGroupSelectTitle"]).rup_tooltip({applyToPortal:true}).click(function(){var f=a(d).nextUntil("li.ui-multiselect-optgroup-label").find("input");for(var g=0;g<f.length;g++){if(!f[g].disabled){f[g].checked=false}}}));a(d).append(a("<span />").text(" | "));a(d).append(a("<a />").text(e?a.rup.i18n.base.rup_combo["multiselect"]["optGroupDeselect"]:"").prepend(a("<span />").addClass("ui-icon ui-icon-closethick rup-combo_multiOptgroupIcon")).attr("title",a.rup.i18n.base.rup_combo["multiselect"]["optGroupDeselectTitle"]).rup_tooltip({applyToPortal:true}).click(function(){var f=a(d).nextUntil("li.ui-multiselect-optgroup-label").find("input");for(var g=0;g<f.length;g++){if(!f[g].disabled){f[g].checked=true}}}));a(d).append(a("<span />").text(" ]"))},_init:function(m){if(m.length>1){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_global.initError")+a(this).attr("id"))}else{var f=a.extend({},a.fn.rup_combo.defaults,m[0]),k,h=false,e=false;f.tabindex=a(this).attr("tabindex");a.extend(a.ech.multiselect.prototype.options,a.rup.i18n.base.rup_combo["multiselect"]);f.id=a.rup_utils.escapeId(a(this).attr("id"));f.name=a(this).attr("name");if(!f.i18nId){f.i18nId=f.id}f.inputValue=a("#"+f.id).attr("value");k=a("<select>").attr({id:a(this).attr("id"),name:f.name,ruptype:"combo","class":a(this).attr("class")}).addClass("rup_combo");if(a(this).hasClass("validableElem")){e=true;k.addClass("validableElem")}if(a(this).hasClass("customelement")){e=true;k.addClass("customelement")}if(f.firstLoad===null&&(a(this).is("select")&&f.loadFromSelect)){h=true}if(f.parent){a.map(f.parent,function(q){var p=a("#"+q).data("childs")===undefined?[]:a("#"+q).data("childs");p[p.length]=f.id;a("#"+q).data("childs",p)});if(f.loadFromSelect===false){if(f.firstLoad!==null){this._parseLOCAL(f.firstLoad,f,k)}a("#"+f.id).replaceWith(k)}else{a("#"+f.id).attr("ruptype","combo").removeClass().addClass("rup_combo");if(e){a("#"+f.id).removeClass().addClass("validableElem")}}this._makeCombo(f);if(!(a(this).is("select")&&f.loadFromSelect)){a("#"+f.id).rup_combo("disable")}else{var o=a(this).find("option");var l=true;for(var j=0;j<o.size();j=j+1){if(a(o[j]).attr("value")!==""){l=false;break}}if(l){a("#"+f.id).rup_combo("disable")}}a("#"+f.id).data("settings",f);if(this._getParentsValues(f.parent)!==null&&(f.firstLoad===null&&f.loadFromSelect===false)){a("#"+f.id).rup_combo("reload",f.id)}}else{if(typeof f.source==="object"||typeof f.sourceGroup==="object"||h){if(f.loadFromSelect===false){if(f.source){this._parseLOCAL((f.firstLoad!==null?f.firstLoad:f.source),f,k)}else{f.ordered=false;this._parseOptGroupLOCAL((f.firstLoad!==null?f.firstLoad:f.sourceGroup),f,k)}a("#"+f.id).replaceWith(k)}else{a("#"+f.id).attr("ruptype","combo").removeClass().addClass("rup_combo");if(e){a("#"+f.id).removeClass().addClass("validableElem")}}this._makeCombo(f);if(f.onLoadSuccess!==null){jQuery(f.onLoadSuccess(a("#"+f.id)))}a("#"+f.id).data("settings",f)}else{if(typeof f.source==="string"||typeof f.sourceGroup==="string"){var d=f.source?f.source:f.sourceGroup,g=this,n=this;a.rup_ajax({url:d,dataType:"json",contentType:"application/json",beforeSend:function(p){g._ajaxBeforeSend(p,f,k)},success:function(q,r,p){g._ajaxSuccess(q,f,k);if(f.onLoadSuccess!==null){jQuery(f.onLoadSuccess(a("#"+f.id)))}},error:function(q,r,p){if(f.onLoadError!==null){jQuery(f.onLoadError(q,r,p))}else{g._ajaxError(q,r,p)}}});delete g;a("#"+f.id).data("settings",f)}else{if(typeof f.source==="function"||typeof f.sourceGroup==="function"){jQuery(f.source);this._makeCombo(f);a("#"+f.id).data("settings",f)}}}}a("#"+f.id).bind("change",function(p,q){a("#"+f.id).rup_combo("select",a("#"+f.id).val())});delete k;a("#"+f.id).next("a").click(function(p){a("#ui-datepicker-div").hide()})}}});a.fn.rup_combo.defaults={onLoadError:null,width:200,blank:null,style:"dropdown",showValue:false,token:"|",multiValueToken:"##",ordered:true,orderedByValue:false,firstLoad:null,onLoadSuccess:null,loadFromSelect:false,multiselect:false,multiOptgroupIconText:true,submitAsString:false,submitAsJSON:false,rowStriping:false}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_contextMenu",a));b.fn.rup_contextMenu("extend",{show:function(d){b(this).contextMenu(d)},hide:function(){b(this).contextMenu("hide")},enable:function(){b(this).contextMenu(true)},disable:function(){b(this).contextMenu(false)},destroy:function(){b.contextMenu("destroy",this.selector)}});b.fn.rup_contextMenu("extend",{_init:function(e){if(e.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var g=b.extend({},b.fn.rup_contextMenu.defaults,e[0]),f,d;g.selector=this.selector;jQuery.contextMenu(g);b.each(b(".context-menu-list.context-menu-root"),function(j,k){var h=jQuery(k);if(h.data("contextMenuRoot").selector===g.selector){b.each(b(".context-menu-item"),function(m,n){var l=jQuery(n),q=l.data("contextMenuKey"),p,o;if(q!==undefined){o=g.items[q];if(o!==undefined){p=o.cssSprite;if(p!==undefined&&!l.hasClass("rup-css-sprite")){l.addClass("rup-css-sprite");l.prepend(b("<img>").addClass(p))}}}})}})}}});b.fn.rup_contextMenu.defaults={autoHide:true}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};var d={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_date",a));b.extend(b.rup.iniRup,b.rup.rupObjectConstructor("rup_date",d));b.fn.rup_date("extend",{getRupValue:function(){if(b(this).data("datepicker").settings.datetimepicker){var g=b(this).datepicker("getDate");if(g===null||g.toString()==="Invalid Date"){return""}var f={hour:g.getHours(),minute:g.getMinutes(),second:g.getSeconds()};var h=b.timepicker._formatTime(f,"hh:mm:ss");var e=b(this).data("datepicker").settings.dateFormat;return b.datepicker.formatDate(e,g)+" "+b.timepicker._formatTime(f,"hh:mm:ss")}else{return b(this).rup_date("getDate")}},setRupValue:function(k){if(b(this).data("datepicker").settings.datetimepicker){var h=k.split(" ");var f=new Date(h[0]);var j=h[1];var f=new Date(k);if(f.toString()==="Invalid Date"){return""}var e={hour:f.getHours(),minute:f.getMinutes(),second:f.getSeconds()};var g=b.timepicker._formatTime(e,b(this).data("datepicker").settings.timeFormat);b(this).datepicker("setTime",k);b(this).val(h[0]+" "+g)}else{b(this).val(k)}},destroy:function(){var e=b(this).data("datepicker").settings.labelMaskId;if(e){b("#"+e).text("")}delete e;b(this).datepicker("destroy")},disable:function(){b(this).datepicker("disable")},enable:function(){b(this).datepicker("enable")},isDisabled:function(){return b(this).datepicker("isDisabled")},hide:function(){b(this).datepicker("hide")},show:function(){b(this).datepicker("show")},getDate:function(){return b(this).val()},setDate:function(e){b(this).datepicker("setDate",e)},refresh:function(){b(this).datepicker("refresh")},option:function(e,f){b(this).datepicker("option",e,f)}});b.fn.rup_date("extend",{_init:function(e){if(e.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var h=b.extend({},b.fn.rup_date.defaults,e[0]);h._onClose=h.onClose;h.onClose=function(k,l){if(h._onClose!==undefined){h._onClose(k,l)}if(!b.rup.browser.isIE){b(this).focus()}};h.id=b(this).attr("id");(this).attr("ruptype","date");var j=b.rup.i18n.base.rup_date;for(var g in j){h[g]=j[g]}if(h.labelMaskId){if(h.datetimepicker){if(h.showSecond){b("#"+h.labelMaskId).text(b.rup.i18nParse(b.rup.i18n.base,"rup_date.maskDateTimeSec")+" ")}else{b("#"+h.labelMaskId).text(b.rup.i18nParse(b.rup.i18n.base,"rup_date.maskDateTime")+" ")}}else{b("#"+h.labelMaskId).text(b.rup.i18nParse(b.rup.i18n.base,"rup_date.mask")+" ")}}if(b("#"+h.id).is("div")&&h.numberOfMonths[1]===1){if(!h.showWeek){b("#"+h.id).css("width","15.4em")}else{b("#"+h.id).css("width","17.1em")}}h.buttonImage=b.rup.STATICS+(h.buttonImage?h.buttonImage:"/rup/basic-theme/images/calendario.png");if(h.noWeekend){h.beforeShowDay=b.datepicker.noWeekends}h.buttonImageOnly=true;h.constrainInput=true;h.showOn="both";if(!h.multiSelect){if(h.datetimepicker){(this).attr("maxlength","16");b("#"+h.id).datetimepicker(h)}else{(this).attr("maxlength","10");b("#"+h.id).datepicker(h)}}else{var f=0;if(typeof h.multiSelect==="number"){h.mode={modeName:"normal",options:{maxPicks:h.multiSelect}};f=(10*h.multiSelect)+(h.multiSelect-1)}else{if(typeof h.multiSelect==="object"){h.mode={modeName:"daysRange",options:{autoselectRange:h.multiSelect}};f=h.multiSelect[1]-h.multiSelect[0];f=(10*f)+(f-1)}}(this).attr("maxlength",f);b.datepicker._defaults.dateFormat=h.dateFormat;b("#"+h.id).multiDatesPicker(h);b(this).keypress(function(l){if(l.charCode===44){var m=b(l.currentTarget).val(),n=l.originalEvent.originalTarget.selectionStart,k=l.originalEvent.originalTarget.selectionEnd;begin=m.substring(0,n),end=m.substring(k);if(m.length<b(l.currentTarget).attr("maxlength")||n!==k){b(l.currentTarget).val(begin+","+end);l.originalEvent.originalTarget.selectionStart=n+1;l.originalEvent.originalTarget.selectionEnd=n+1}}})}if(b.rup_utils.aplicatioInPortal()&&!b("#"+h.id).is("div")){b(".r01gContainer").append(b(".ui-datepicker:not(.r01gContainer .ui-datepicker)"))}b(this).parent().find("[title]").rup_tooltip({applyToPortal:true});if(h.disabled){b("#"+h.id).rup_date("disable")}}}});b.rup_date("extend",{_init:function(f){if(f.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var g=b.extend({},b.fn.rup_date.defaults,f[0]),e=b.extend(true,{},g),h=b.extend(true,{},g);e.onClose=function(n,m){var k=b("#"+g.to);if(k.val()!=""){var l=new Date(n);var j=new Date(k.val());if(l>j){k.val(n)}}else{k.val(n)}if(g.onClose!==undefined){g.onClose(n,m)}};e.onSelect=function(j){var k=b(this).datetimepicker("getDate");b("#"+g.to).datetimepicker("option","minDate",new Date(k.getTime()));if(g.datetimepicker){b("#"+g.to).datetimepicker("option","minDateTime",new Date(k.getTime()))}if(g.onSelect!==undefined){g.onSelect(j)}};h.onClose=function(n,m){var l=b("#"+g.from);if(l.val()!=""){var k=new Date(l.val());var j=new Date(n);if(k>j){l.val(n)}}else{l.val(n)}if(g.onClose!==undefined){g.onClose(n,m)}};h.onSelect=function(k){var j=b(this).datetimepicker("getDate");b("#"+g.from).datetimepicker("option","maxDate",new Date(j.getTime()));if(g.datetimepicker){b("#"+g.from).datetimepicker("option","maxDateTime",new Date(j.getTime()))}if(g.onClose!==undefined){g.onSelect(k)}};b("#"+g.from).rup_date(e);b("#"+g.to).rup_date(h)}}});b.fn.rup_date.defaults={datetimepicker:false,multiSelect:false,changeMonth:true,changeYear:true,noWeekend:false,showSecond:true}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){b.extend(b.rup,{dialog:{DIV:"dialogDIV",TEXT:"textDialog",AJAX:"ajaxDialog",LINK:"linkButton",IKER:"IKER"}});var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_dialog",a));b.fn.rup_dialog("extend",{open:function(){b(this).data("focus",b(document.activeElement));var d=b(document).height(),e=b(document).width();if(b(this).dialog("option","ajaxCache")===false){var f=b.extend({},b(this).dialog("option"));f.id=b(this).attr("id");f.autoOpen=true;this._ajaxLoad(f)}else{b(this).dialog("open")}if(b.rup_utils.aplicatioInPortal()){b(".r01gContainer").append(b(".ui-widget-overlay"));b(".ui-widget-overlay").css("height",d).css("width",e);b(".ui-dialog").css("position","absolute").css("top",(d/2)-(b("div[aria-labelledby=ui-dialog-title-"+this[0].id+"]").height()/2))}b("div[aria-labelledby=ui-dialog-title-"+this[0].id+"] .ui-dialog-buttonpane button:first").focus()},destroy:function(){b(this).dialog("destroy")},disable:function(){b(this).dialog("disable")},enable:function(){b(this).dialog("enable")},widget:function(){return(b(this).dialog("widget"))},moveToTop:function(){b(this).dialog("moveToTop")},close:function(){b(this).dialog("close")},isOpen:function(){return b(this).dialog("isOpen")},getOption:function(d){return b(this).dialog("option",d)},setOption:function(l,m){if(l==="buttons"){var g=m.length,d,k,f,e=[],h;if(g>1){d=m;for(k=0;k<m.length;k++){if(m[k].btnType===b.rup.dialog.LINK){e.push(m.splice(k,1));k--}}k=null}h=e.length;if(g>1&&h===0){b.rup.msgAlert({message:b.rup.i18nParse(b.rup.i18n,"base.rup_global.rupCheckStyleError")});return false}b(this).dialog("option",l,m);if(h>0){for(f=0;f<h;f++){this.createBtnLinks(e[f][0],this[0].id)}f=null}return}if(l!=="title"){if(m!==undefined){b(this).dialog("option",l,m)}else{b(this).dialog("option",l)}}else{b("#ui-dialog-title-"+b(this).attr("id")).html(m)}},createBtnLinks:function(d,f){var e=b("<a href='#'></a>").attr("role","button").attr("id","rup_dialog"+d.text).addClass("rup-enlaceCancelar").html(d.text).click(d.click);b("div[aria-labelledby=ui-dialog-title-"+f+"] .ui-dialog-buttonset ").append(e)}});b.fn.rup_dialog("extend",{_init:function(d){if(d.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError"+b(this).attr("id")))}else{var h=b.extend({},b.fn.rup_dialog.defaults,d[0]),j,e=this,g,f=undefined;h._close=h.close;h.close=function(k,l){if(b(this).data("focus")!==undefined){b(this).data("focus").focus()}if(h._close!==undefined){h._close(k,l)}};if(h.type!==null&&b(this).length>0){b.each(b(this),function(t,o){if(b(this).attr("id")!==undefined){h.id=b(this).attr("id")}else{h.id="rup_"+h.type+"DIV";g=b("<div/>").attr("id",h.id);g.appendTo("body")}var w=false,u=[],r,l,s,v=0,m,q,p,n=false,x=undefined;if(b("div[aria-labelledby=ui-dialog-title-"+h.id+"]").length>0){n=true}else{if(b("body #"+h.id).not(".ui-dialog-content").length>1){b(b("body #"+h.id).not(".ui-dialog-content")[1]).remove()}if(h.specificLocation!==""){x=function(y,z){b("#"+h.id).parent(".ui-dialog").insertAfter(b("#"+h.specificLocation))}}else{if(b.rup_utils.aplicatioInPortal()){x=function(y,z){b(".r01gContainer").append(b(".ui-dialog"))}}}}if(x!==undefined){var k=h.create;h.create=function(y,z){if(k!==undefined&&k!==null){if(k.call(y,z)===false){return false}}x(y,z)}}switch(h.type){case b.rup.dialog.DIV:if(h.clone!==undefined){b("#"+h.id).clone(true).attr("id",h.clone).insertAfter("#"+h.id);h.id=h.clone}break;case b.rup.dialog.TEXT:b("#"+h.id).html(h.message);break;case b.rup.dialog.AJAX:e._ajaxLoad(h);break;case b.rup.dialog.IKER:e._ajaxIFrame(h);break}if(h.autoOpen===true){w=true;h.autoOpen=false}if(h.buttons&&h.buttons!==null){r=h.buttons.length;if(r>1){l=h.buttons;for(q=0;q<h.buttons.length;q++){if(h.buttons[q].btnType===b.rup.dialog.LINK){u.push(h.buttons.splice(q,1));q--}}q=null}v=u.length;if(r>1&&v===0&&h.rupCheckStyle){b(document).rup().msgAlert({message:b.rup.i18nParse(b.rup.i18n.base,"rup_global.rupCheckStyleError")});h.stack=false;h.modal=false;h.zIndex=9999}}if(!n){b("#"+h.id).dialog(h);m="<span id='closeText_"+h.id+"' style='float:right;font-size:0.85em'>"+b.rup.i18nParse(b.rup.i18n.base,"rup_global.cerrar")+"</span>";s=b("<a href='#'></a>").attr("role","button").css("margin-right","0.9em").css("float","right").css("width","50px").addClass("ui-dialog-title").html(m).click(function(y){b("#"+h.id).dialog("close");return false}).hover(function(y){b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-titlebar-close").addClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-titlebar-close").css("padding","0px")},function(y){b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-titlebar-close").removeClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-titlebar-close").attr("style","")}).insertAfter("#ui-dialog-title-"+h.id);b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-titlebar-close").hover(function(){s.css("text-decoration","none")},function(){s.css("text-decoration","")})}else{b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-buttonset a").remove();if(h.title){b("#ui-dialog-title-"+h.id).text(h.title)}}if(v>0){for(p=0;p<v;p++){b(this).rup_dialog("createBtnLinks",u[p][0],h.id)}p=null}if(w){if(h.type!==b.rup.dialog.AJAX){b("#"+h.id).rup_dialog("open");b("div[aria-labelledby=ui-dialog-title-"+h.id+"] .ui-dialog-buttonpane button:first").focus()}else{h.autoOpen=true}}})}else{if(b(this).length===0){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.selectorError"))}else{b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.dialogTypeError"))}}}},_ajaxIFrame:function(d){if(!d.url||d.url===null||d.url===""){b.rup.msgAlert({title:b.rup.i18nParse(b.rup.i18n.base,"rup_global.error"),message:b.rup.i18nParse(b.rup.i18n.base,"rup_dialog.noURL")});return false}if(d.showLoading&&d.autoOpen===true){b.blockUI({message:'<img src="'+b.rup.RUP+'/basic-theme/images/rup.ajaxLoader.gif" style="position:absolute;top:12px;left:15px;" alt="'+b.rup.i18nParse(b.rup.i18n.base,"rup_blockUI.cargando")+'" ><h1 class="loading">'+b.rup.i18nParse(b.rup.i18n.base,"rup_blockUI.cargando")+"...</h1>"})}b("#"+d.id).html("<iframe width='100%' height='100%' src='"+d.url+"'/>")},_ajaxLoad:function(e){if(!e.url||e.url===null||e.url===""){b.rup.msgAlert({title:b.rup.i18nParse(b.rup.i18n.base,"rup_global.error"),message:b.rup.i18nParse(b.rup.i18n.base,"rup_dialog.noURL")});return false}if(e.showLoading&&e.autoOpen===true){b.blockUI({message:'<img src="'+b.rup.RUP+'/basic-theme/images/rup.ajaxLoader.gif" style="position:absolute;top:12px;left:15px;" alt="'+b.rup.i18nParse(b.rup.i18n.base,"rup_blockUI.cargando")+'" ><h1 class="loading">'+b.rup.i18nParse(b.rup.i18n.base,"rup_blockUI.cargando")+"...</h1>"})}var d=b.extend({},e.ajaxOptions);d.success=function(g,h,f){if(g!==""||g!==null){b("#"+e.id).html(g);b.unblockUI();if(e.autoOpen===true){b("#"+e.id).rup_dialog("open");b("div[aria-labelledby=ui-dialog-title-"+e.id+"] .ui-dialog-buttonpane button:first").focus()}}if(e.ajaxOptions&&e.ajaxOptions.success!==undefined&&e.ajaxOptions.success!==null&&typeof e.ajaxOptions.success==="function"){e.ajaxOptions.success(g,h,f)}};d.error=function(f,h,g){b.unblockUI();b(document).rup().msgAlert({message:b.rup.i18nParse(b.rup.i18n.base,"rup_dialog.errorLoadingData")});if(e.ajaxOptions.error!==undefined&&e.ajaxOptions.error!==null&&typeof e.ajaxOptions.error==="function"){e.ajaxOptions.error(f,h,g)}};d.url=b.rup_utils.setNoPortalParam(e.url);d.type="GET";d.cache=false;d.dataType="text";b.rup_ajax(d)}});b.fn.rup_dialog.defaults={rupCheckStyle:true,type:null,url:null,minHeight:100,ajaxCache:true,specificLocation:"",clone:undefined}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
var defaultDelay=20000;(function($){$.widget("$.rup_feedback",{options:{type:null,imgClass:null,delay:null,fadeSpeed:null,gotoTop:true,block:true,closeLink:true,_idFeedback:null,_divClose:null},_setOption:function(key,value){var opciones=this.options,element=this.element;switch(key){case"type":if(value!==null){element.removeClass(opciones.imgClass+" rup-feedback_image_"+opciones.type);element.addClass("rup-feedback_image rup-feedback_image_"+value)}else{element.removeClass("rup-feedback_image rup-feedback_image_"+opciones.type)}break;case"imgClass":if(value!==null){element.removeClass(opciones.imgClass+" rup-feedback_image rup-feedback_image_"+opciones.type);element.addClass(value)}else{element.removeClass(opciones.imgClass)}break;case"closeLink":if(value){this._addCloseLink()}else{$("#"+this.options._idFeedback+"_closeDiv").remove()}break}delete opciones;delete element;$.Widget.prototype._setOption.apply(this,arguments)},_create:function(){var opciones=this.options;opciones._idFeedback=this.element.addClass("rup-feedback ui-widget ui-widget-content ui-corner-all").addClass(opciones.imgClass!=null?opciones.imgClass:opciones.type!=null?"rup-feedback_image rup-feedback_image_"+opciones.type:"").attr({role:"alert"}).css("display",opciones.block?"block":"none").css("visibility","hidden").context.id;opciones._divClose=$("<div />").html($.rup.i18nParse($.rup.i18n.base,"rup_global.cerrar")).attr("id",opciones._idFeedback+"_closeDiv").attr("title",$.rup.i18nParse($.rup.i18n.base,"rup_feedback.closingLiteral")).addClass("rup-feedback_closeLink");if(opciones.message){this.set(opciones.message,opciones.type,opciones.imgClass)}delete opciones},_addCloseLink:function(){var opciones=this.options;opciones._divClose.click(function(){$("#"+opciones._idFeedback).rup_feedback("close")});this.element.prepend(opciones._divClose);delete opciones},destroy:function(){var opciones=this.options;this.element.removeClass().removeAttr("role").css("cssText","").html("").stop().animate({opacity:"100"});delete opciones;$.Widget.prototype.destroy.apply(this,arguments)},set:function(message,type,imgClass){var element=this.element,opciones=this.options;element.stop().animate({opacity:"100"});if(type!=undefined){element.removeClass(opciones.imgClass);if(opciones.type!=null){element.removeClass("rup-feedback_image_"+opciones.type)}else{element.addClass("rup-feedback_image")}element.addClass("rup-feedback_image_"+type);opciones.type=type}else{if(type===null){element.removeClass("rup-feedback_image rup-feedback_image_"+opciones.type);opciones.type=null}}if(imgClass!=undefined){if(opciones.imgClass!=null){element.removeClass(opciones.imgClass)}element.addClass(imgClass);opciones.imgClass=imgClass}$("#"+opciones._idFeedback+"_content").remove();element.append($("<div/>").attr("id",opciones._idFeedback+"_content").html(message));if(opciones.closeLink){this._addCloseLink()}this.show();if(opciones.gotoTop){$("html, body").animate({scrollTop:"0px"},0)}if(opciones.delay!=null){this.hide()}delete element;delete opciones},hide:function(delay,fadeSpeed){var opciones=this.options,element=this.element;if(delay==undefined){delay=opciones.delay}if(fadeSpeed==undefined){fadeSpeed=opciones.fadeSpeed}element.delay(delay).fadeOut(eval(fadeSpeed),function(){$("#"+opciones._idFeedback).rup_feedback("close",true)});delete opciones;delete element},close:function(notEmpty){var element=this.element;element.css("display",this.options.block?"block":"none");element.css("visibility","hidden");if(notEmpty===undefined){element.empty()}delete element},show:function(){var element=this.element;element.css("display","block");element.css("visibility","visible");this.element.find("[title]").rup_tooltip({position:{at:"bottom center",my:"top center"},applyToPortal:true});delete element}})})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_form",a));b.fn.rup_form("extend",{ajaxFormSubmit:function(d){var e=this;b.set_uda_ajax_mode_on();e.ajaxSubmit(d)},ajaxSubmit:function(d){var e=this;b.set_uda_ajax_mode_on();e.rup_form("configureOptions",d);if(d.formValidationRequired){e.rup_validate(d.validate);e.submit()}else{b(this).ajaxSubmit(d)}},destroy:function(){var d=this;b.removeData(d[0]);d.ajaxFormUnbind();d.unbind()},formSerialize:function(){var f=this,g,e,d,g=[];b.each(f.formToArray(),function(h,j){e=b("[name='"+j.name+"']",self);d=e.attr("ruptype");if(d!==undefined){j.value=e["rup_"+d]("getRupValue");g.push(j)}else{g.push(j)}});return b.param(g)},formToJson:function(){return form2object(this[0])},fieldSerialize:function(){var d=[];this.each(function(){var h=b(this).attr("name");if(!h){return}var f=b(this).rup_form("fieldValue");if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){d.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){d.push({name:b(this).attr("name"),value:f})}}});return b.param(d)},fieldValue:function(){var d=[],e;this.each(function(){var f=b(this).attr("ruptype");if(f!==undefined){e=b(this)["rup_"+f]("getRupValue");d.push(e)}else{b.merge(d,b(this).fieldValue())}});return d},resetForm:function(){return this.each(function(){b(this).resetForm()})},clearForm:function(d){return this.each(function(){b("input,select,textarea",this).rup_form("clearFields",d)})},clearFields:function(d){return this.each(function(){var e=b(this).attr("ruptype");if(e===undefined||e!=="combo"){b(this).clearFields(d)}else{b(this).rup_combo("clear")}})},configureOptions:function(e){var h=this,f,d,g;f=b("input:file",h).length>0;if(e.useJsonIfPossible&&!f){e.contentType="application/json"}d=e.beforeSend;e.beforeSend=function(m,j){var k=true;if(b.isFunction(d)){k=d.call(this,m,j)}if(k===false){return false}else{if(k!=="skip"){if(j.contentType.indexOf("application/json")!==-1){var l=h.rup_form("formToJson");if(e.multimodel===true){m.setRequestHeader("RUP_MULTI_ENTITY","true");l.rupEntityMapping=e.multimodel}if(j.extraData!==undefined&&j.extraData!==null){b.extend(l,j.extraData)}j.data=b.toJSON(l)}}}};g=e.beforeSubmit;e.beforeSubmit=function(j,l,m){var k,o,n;if(b.isFunction(g)){if(g.call(this,j,l,m)===false){return false}}n=jQuery("input:file",l).length>0;if((b.rup.browser.isIE&&n)||m.iframe===true){k=e.type!==undefined?e.type:m.type;if(b.inArray(k.toUpperCase(),b.rup.IFRAME_ONLY_SUPPORTED_METHODS)===-1){m.extraData=b.extend({},m.extraData,{_method:k.toUpperCase()})}m.url=b.rup_utils.setNoPortalParam(m.url);m.extraData=b.extend({},m.extraData,{_emulate_iframe_http_status:"true"});m.url=m.url+(m.url.match("\\?")===null?"?":"&")+"_emulate_iframe_http_status=true";o=m.error;m.error=function(r,s,q){var p=b.rup.rupAjaxDefaultError(r,s,q);if(o!=null){b(o(r,s,q))}else{if(p){b.rup.showErrorToUser(p)}}}}};e.formValidationRequired=(e.validate!==undefined);if(e.formValidationRequired){if(e.error===undefined){e.error=function(k,j,o,n){try{var m=jQuery.parseJSON(k.responseText);h.validate().invalid=m.rupErrorFields;h.validate().submited=m.rupErrorFields;h.validate().showErrors(m.rupErrorFields);if(m.rupFeedback!==undefined&&h.validate().settings.feedback!==undefined){h.validate().settings.feedback.rup_feedback("set",b.rup_utils.printMsg(m.rupFeedback.message),(m.rupFeedback.imgClass!==undefined?m.rupFeedback.imgClass:null))}}catch(l){h.validate().settings.feedback.rup_feedback("set",k.responseText,"error")}}}e.validate.submitHandler=function(j){jQuery(j).ajaxSubmit(b(j).data("ajaxSettings"))};e.validate.feedback=e.feedback}h.data("ajaxSettings",e);h.data("settings",e)}});b.fn.rup_form("extend",{});b.fn.rup_form("extend",{_init:function(e){var j=this,d,f,g={},h={};f=b.extend(true,{},b.fn.rup_form.defaults,e[0]);j.addClass("rup_form");j.attr("ruptype","form");j.rup_form("configureOptions",f);if(f.formValidationRequired){j.rup_validate(f.validate)}else{j.ajaxForm(f)}j.data(j[0],"settings",f)}});b.fn.rup_form.defaults={ajaxForm:null,feedback:null,multimodel:false,useJsonIfPossible:true}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_grid",a));b.fn.rup_grid("extend",{addRowData:function(g,h,e,d){var f=b(this)[0].id;if(b("#"+f+" #separadorAadidos").html()===null){b("#"+f+" tr:first-child").after(b("#"+f+" tr:first-child").clone(false).css("display","none").css("height","").attr("id","separadorAadidos"));b.each(b("#"+f+" #separadorAadidos td"),function(k,j){b(this).html("").attr("class","tdAddSeparator")});b("#"+f+" #separadorAadidos").addClass("trAddSeparator");b("#"+f+" #separadorAadidos").css("display","")}b(this).jqGrid("addRowData",g,h,e,d);b("#"+f+" #"+g).addClass("addElement")},delRowData:function(d){b(this).jqGrid("delRowData",d);if(b(this).jqGrid("getDataIDs").length===Number(b(this).jqGrid("getGridParam","rowNum"))){b("#"+b(this)[0].id+" #separadorAadidos").remove()}},setRowData:function(d,e,f){b(this).jqGrid("setRowData",d,e,f);this._tooltip(d)},getRowData:function(d){return b(this).jqGrid("getRowData",d)},setSelection:function(e,d){b(this).jqGrid("setSelection",e,d)},resetSelection:function(){var d=this;if(!d[0].rup_gridProps.hasMaint&&d[0].rup_gridProps.multiselect){b(d).data("selectedRows",new Array());b(d).data("selectedRowsCont",0);b(d).data("rowsSelectedPage",0);b(d).data("allSelected",false);b("#"+d[0].rup_gridProps.pagerName+"_left").html(b(d).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}this[0].rup_gridProps.allPksArray=[];if(b.isFunction(this[0].rup_gridProps.resetSelection)){this[0].rup_gridProps.resetSelection.call()}else{b(this).jqGrid("resetSelection")}},getDataIDs:function(){return b(this).jqGrid("getDataIDs")},getGridParam:function(d){return b(this).jqGrid("getGridParam",d)},setGridParam:function(d){b(this).jqGrid("setGridParam",d)},clearGridData:function(d){b(this).jqGrid("clearGridData",d)},getSelectedRows:function(){var e=b(this).jqGrid("getGridParam","multiselect"),d;if(e){d=jQuery.map(this[0].rup_gridProps.allPksArray,function(g,f){if(g.indexOf("/")===0){return g.substring(1)}else{return g}});return d}else{return[b(this).jqGrid("getGridParam","selrow")]}},reloadGrid:function(f,g){var d=this;var e=d[0].rup_gridProps;b("#lui_"+d.attr("id")).show();b("#load_"+d.attr("id")).show();if(f!==undefined){e.systemReloadGridFunction=function(){f.call(this,g);d[0].rup_gridProps.systemReloadGridFunction=undefined}}window.setTimeout(function(){d.trigger("reloadGrid")},0,f,g)},editRow:function(e,l,k,m,d,g,f,h,j){b(this).jqGrid("editRow",e,l,k,m,d,g,f,h,j)},saveRow:function(k,j,g,h,f,e,d){function l(q,o){var n,p=b("tr#"+q+" select.rup_combo",this);for(var m=0;m<p.length;m=m+1){n=b(p[m]).rup_combo("label");b(p[m]).parent().html(n)}if(f){f.call(q,o)}}b(this).jqGrid("saveRow",k,j,g,h,l,e,d);this._tooltip(k)},restoreRow:function(h,d){var f,g=b("tr#"+h+" select.rup_combo",this);var j=b(this).jqGrid("getGridParam","savedRow");for(var e=0;e<g.length;e=e+1){f=b(g[e]).rup_combo("value");j[0][b(g[e]).attr("name")]=f}b(this).jqGrid("restoreRow",h,d);this._tooltip(h)},getColModel:function(){return b(this).jqGrid("getGridParam","colModel")},GridToForm:function(d,e){b(this).jqGrid("GridToForm",d,e)},FormToGrid:function(e,f,g,d){b(this).jqGrid("FormToGrid",e,f,g,d)},isMultiselect:function(){return b(this).jqGrid("getGridParam","multiselect")},getCol:function(e,d){return b(this).jqGrid("getCell",e,d)},isEditable:function(){return this[0].rup_gridProps.editable},getEditingRowData:function(g){var h=this.jqGrid("getInd",g,true),d={},e=this,f;if(h===false){return}b("td",h).each(function(j){if(e.jqGrid("getGridParam","colModel")[j]){f=b(":first",this).attr("type");if(f!=="checkbox"||(f==="checkbox"&&b(":first",this).is(":checked"))){d[e.jqGrid("getGridParam","colModel")[j].name]=b(":first",this).val()}}});return d},isEditing:function(){var e=this.jqGrid("getDataIDs");for(var d=0;d<e.length;d++){if(b(this.jqGrid("getInd",e[d],true)).attr("editable")==="1"){return true}}return false},reorderColumns:function(d){if(b.isFunction(this[0].rup_gridProps.onAfterDragAndDrop)){this[0].rup_gridProps.onAfterDragAndDrop.call(this,d)}}});b.fn.rup_grid("extend",{_init:function(f){if(f.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var G=b.extend(true,{},b.fn.rup_grid.defaults,f[0]);G.groupingView=b.extend({},b.fn.rup_grid.defaults.groupingView,G.groupingView);var u=this,h=[2],t,j,k,E;var v,A,m,x,o,w,q,z,B,l,p,s,n,g,r,y,C,F,D;v=G.beforeRequest;G.beforeRequest=function(){if(v!==undefined&&v!==null){if(typeof v==="function"){if(v()===false){return false}}else{if(typeof v==="object"){if(v.pre!==undefined&&v.pre()===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeRequest_default()===false){return false}if(v.post!==undefined&&v.post()===false){return false}return true}}}return b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeRequest_default()};m=G.serializeGridData;G.serializeGridData=function(H){var I;if(m!==undefined&&m!==null){if(typeof m==="function"){if(m(H)===false){return false}}else{if(typeof m==="object"){if(m.pre!==undefined){I=m.pre(H);if(I===false){return false}}I=b("#"+b(this).attr("id")).data("defaultEventFunctions").serializeGridData_default(H,I);if(I===false){return false}if(m.post!==undefined){I=m.post(H,I)}return I}}}return b("#"+b(this).attr("id")).data("defaultEventFunctions").serializeGridData_default(H)};A=G.loadBeforeSend;G.loadBeforeSend=function(I,H){if(A!==undefined&&A!==null){if(typeof A==="function"){if(A(I,H)===false){return false}}else{if(typeof A==="object"){if(A.pre!==undefined&&A.pre(I,H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadBeforeSend_default(I,H)===false){return false}if(A.post!==undefined&&A.post(I,H)===false){return false}return true}}}return(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadBeforeSend_default(I,H))};x=G.loadError;G.loadError=function(J,H,I){if(x!==undefined&&x!==null){if(typeof x==="function"){if(x(J,H,I)===false){return false}}else{if(typeof x==="object"){if(x.pre!==undefined&&x.pre(J,H,I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadError_default(J,H,I)===false){return false}if(x.post!==undefined){x.post(J,H,I)}return false}}}b(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadError_default(J,H,I))};o=G.beforeProcessing;G.beforeProcessing=function(I,H,J){if(o!==undefined&&o!==null){if(typeof o==="function"){if(o(I,H,J)===false){return false}}else{if(typeof o==="object"){if(o.pre!==undefined&&o.pre(I,H,J)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeProcessing_default(I,H,J)===false){return false}if(o.post!==undefined){o.post(I,H,J)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeProcessing_default(I,H,J)};w=G.gridComplete;G.gridComplete=function(){var H;if(w!==undefined&&w!==null){if(typeof w==="function"){if(w()===false){return false}}else{if(typeof w==="object"){if(w.pre!==undefined&&w.pre()===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").gridComplete_default()===false){return false}if(w.post!==undefined){w.post()}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").gridComplete_default();b("#"+b(this).attr("id")+" [title]").each(function(J,K){var I=b(K);I.attr("grid_tooltip",I.attr("title")).removeAttr("title")});H=jQuery("#"+b(this).attr("id")+" tbody:first");H.on("mousestop",{delay:500},function(J,I){var K=b.rup_utils.elementFromPoint(I.clientX,I.clientY,true),L=b(K);if(!L.attr("rup_tooltip")&&L.attr("grid_tooltip")){L.attr("title",L.attr("grid_tooltip"));L.rup_tooltip({show:{delay:0},position:{viewport:b(window),adjust:{method:"flip"}}});L.triggerHandler("mouseenter");L.rup_tooltip("option","show.delay",500)}})};q=G.loadComplete;G.loadComplete=function(I){if(q!==undefined&&q!==null){if(typeof q==="function"){if(q(I)===false){return false}}else{if(typeof q==="object"){if(q.pre!==undefined&&q.pre(I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadComplete_default(I)===false){return false}if(q.post!==undefined){q.post(I)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").loadComplete_default(I);var H=u[0].rup_gridProps.systemReloadGridFunction;if(H!==undefined){u[0].rup_gridProps.systemReloadGridFunction.call()}};z=G.afterInsertRow;G.afterInsertRow=function(H,J,I){if(z!==undefined&&z!==null){if(typeof z==="function"){if(z(H,J,I)===false){return false}}else{if(typeof z==="object"){if(z.pre!==undefined&&z.pre(H,J,I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").afterInsertRow_default(H,J,I)===false){return false}if(z.post!==undefined){z.post(H,J,I)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").afterInsertRow_default(H,J,I)};B=G.beforeSelectRow;G.beforeSelectRow=function(H,I){if(B!==undefined&&B!==null){if(typeof B==="function"){if(B(H,I)===false){return false}}else{if(typeof B==="object"){if(B.pre!==undefined&&B.pre(H,I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeSelectRow_default(H,I)===false){return false}if(B.post!==undefined&&B.post(H,I)===false){return false}return true}}}return(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeSelectRow_default(H,I))};l=G.onCellSelect;G.onCellSelect=function(I,H,J,K){if(l!==undefined&&l!==null){if(typeof l==="function"){if(l(I,H,J,K)===false){return false}}else{if(typeof l==="object"){if(l.pre!==undefined&&l.pre(I,H,J,K)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onCellSelect_default(I,H,J,K)===false){return false}if(l.post!==undefined){l.post(I,H,J,K)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onCellSelect_default(I,H,J,K)};p=G.ondblClickRow;G.ondblClickRow=function(I,K,H,J){if(p!==undefined&&p!==null){if(typeof p==="function"){if(p(I,K,H,J)===false){return false}}else{if(typeof p==="object"){if(p.pre!==undefined&&p.pre(I,K,H,J)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").ondblClickRow_default(I,K,H,J)===false){return false}if(p.post!==undefined){p.post(I,K,H,J)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").ondblClickRow_default(I,K,H,J)};s=G.onHeaderClick;G.onHeaderClick=function(H){if(s!==undefined&&s!==null){if(typeof s==="function"){if(s(H)===false){return false}}else{if(typeof s==="object"){if(s.pre!==undefined&&s.pre(H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onHeaderClick_default(H)===false){return false}if(s.post!==undefined){s.post(H)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onHeaderClick_default(H)};n=G.onPaging;G.onPaging=function(K){b(".ui-tooltip").hide();if(K==="records"&&!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect){if(b(u).data("selectedRows")!==undefined&&b(u).data("selectedRows").length>0){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();b.rup_messages("msgConfirm",{message:b.rup.i18nParse(b.rup.i18n.base,"rup_maint.checkSelectedElems"),title:b.rup.i18nParse(b.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){b(u).data("selectedRows",new Array());b(u).data("selectedRowsCont",0);b(u).data("rowsSelectedPage",0);b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"));u.trigger("reloadGrid")}});return"stop"}}if(K==="user"){var J=parseInt(b("#gbox_"+b(this).attr("id")).find(".pagControls > input").val()),I=parseInt(b("#gbox_"+b(this).attr("id")).find(".pagControls > input").next().text());if(J==0){I=1;J=2}if(J>I){var H=b(this).rup_grid("getGridParam");H.page=I;b(this).rup_grid("setGridParam",H)}}b("#lui_"+u.attr("id")).show();b("#load_"+u.attr("id")).show();if(n!==undefined&&n!==null){if(typeof n==="function"){if(n(K)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}}else{if(typeof n==="object"){if(n.pre!==undefined&&n.pre(K)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onPaging_default(K)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}if(n.post!==undefined&&n.post(K)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}return""}}}window.setTimeout(function(){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();u.trigger("reloadGrid")},0)};C=G.onRightClickRow;G.onRightClickRow=function(I,K,H,J){if(C!==undefined&&C!==null){if(typeof C==="function"){if(C(I,K,H,J)===false){return false}}else{if(typeof C==="object"){if(C.pre!==undefined&&C.pre(I,K,H,J)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onRightClickRow_default(I,K,H,J)===false){return false}if(C.post!==undefined){C.post(I,K,H,J)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onRightClickRow_default(I,K,H,J)};g=G.onSelectAll;G.onSelectAll=function(I,H){if(g!==undefined&&g!==null){if(typeof g==="function"){if(g(I,H)===false){return false}}else{if(typeof g==="object"){if(g.pre!==undefined&&g.pre(I,H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectAll_default(I,H)===false){return false}if(g.post!==undefined){g.post(I,H)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectAll_default(I,H)};r=G.onSelectRow;G.onSelectRow=function(I,H){if(r!==undefined&&r!==null){if(typeof r==="function"){if(r(I,H)===false){return false}}else{if(typeof r==="object"){if(r.pre!==undefined&&r.pre(I,H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectRow_default(I,H)===false){return false}if(r.post!==undefined){r.post(I,H)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectRow_default(I,H)};y=G.onSortCol;G.onSortCol=function(J,I,H){b("#lui_"+u.attr("id")).show();b("#load_"+u.attr("id")).show();if(y!==undefined&&y!==null){if(typeof y==="function"){if(y(J,I,H)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}}else{if(typeof y==="object"){if(y.pre!==undefined&&y.pre(J,I,H)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onSortCol_default(J,I,H)==="stop"){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return false}if(y.post!==undefined&&y.post(J,I,H)===false){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();return"stop"}return"stop"}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onSortCol_default(J,I,H);return"stop"};F=G.resizeStart;G.resizeStart=function(I,H){if(F!==undefined&&F!==null){if(typeof F==="function"){if(F(I,H)===false){return false}}else{if(typeof F==="object"){if(F.pre!==undefined&&F.pre(I,H)===false){return false}if(b("#"+b(u).attr("id")).data("defaultEventFunctions").resizeStart_default(I,H)===false){return false}if(F.post!==undefined){F.post(I,H)}return false}}}b("#"+b(u).attr("id")).data("defaultEventFunctions").resizeStart_default(I,H)};D=G.resizeStop;G.resizeStop=function(H,I){if(D!==undefined&&D!==null){if(typeof D==="function"){if(D(H,I)===false){return false}}else{if(typeof D==="object"){if(D.pre!==undefined&&D.pre(H,I)===false){return false}if(b("#"+b(u).attr("id")).data("defaultEventFunctions").resizeStop_default(H,I)===false){return false}if(D.post!==undefined){D.post(H,I)}return false}}}b("#"+b(u).attr("id")).data("defaultEventFunctions").resizeStop_default(H,I)};b("#"+b(this).attr("id")).data("defaultEventFunctions",{beforeRequest_default:function(){var H=b(this).rup_grid("getGridParam","url");b(this).rup_grid("setGridParam",{url:b.rup_utils.setNoPortalParam(H)});return true},serializeGridData_default:function(H){if(H.page!==undefined&&H.page!==null&&Number(H.page)>u.rup_grid("getGridParam","lastpage")&&u.rup_grid("getGridParam","lastpage")>0){H.page=u.rup_grid("getGridParam","lastpage")}return H},loadBeforeSend_default:function(I,H){I.setRequestHeader("JQGridModel","true");I.setRequestHeader("Content-Type","application/json");return true},loadError_default:function(K,H,I){u.rup_grid("clearGridData");if(b.data(u[0],"maintName")&&b.data(u[0],"maintName")!==null&&b.data(u[0],"maintName")!==""){b("#"+b.data(u[0],"maintName"))[0].prop.feedback.rup_feedback("option","closeLink",true);b("#"+b.data(u[0],"maintName"))[0].prop.feedback.rup_feedback("option","delay",null);var J=b.rup.i18nParse(b.rup.i18n.base,"rup_ajax.httpStatus"+K.status);if(J.indexOf("rup_ajax.")!==-1){J=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.errors.errorOnGet")}b("#"+b.data(u[0],"maintName"))[0].prop.feedback.rup_feedback("set",J,"error");b("#"+b.data(u[0],"maintName"))[0].prop.feedback.rup_feedback("option","delay",defaultDelay)}else{b("#rup_feedback_"+u[0].id).rup_feedback("option","closeLink",true);b("#rup_feedback_"+u[0].id).rup_feedback("option","delay",null);b("#rup_feedback_"+u[0].id).rup_feedback("set",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.errors.errorOnGet"),"error");b("#rup_feedback_"+u[0].id).rup_feedback("option","delay",defaultDelay)}},beforeProcessing_default:function(I,H,J){},gridComplete_default:function(){var I=null,J=true,H;if(b("#rup_feedback_"+u[0].id)){b("#rup_feedback_"+u[0].id).rup_feedback("close")}b("#"+u[0].id+" tr:nth-child(even)").addClass("rup-grid_evenRow");b("#"+u[0].id+" tr:nth-child(odd)").addClass("rup-grid_oddRow");b(".ui-jqgrid tr.jqgrow td").addClass("rup-grid_cellPadding");if(u.jqGrid("getDataIDs").length===0){b(b.find("#cb_"+u.attr("id"))[0]).attr("disabled",true);b(u).prev().remove();b(u.jqGrid("getGridParam","pager")).hide();if(b("#RUP_GRID_"+u[0].id+"_noRecords").length===0){var O='<tr class="ui-widget-content jqgrow ui-row-ltr" role="row" id="RUP_GRID_'+u[0].id+'_noRecords" aria-selected="false">';O+='<td aria-describedby="RUP_GRID_'+u[0].id+'_NO_REGISTROS" title="'+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.noRecordsFound")+'" style="border:0;padding-left: 0.5em ! important;text-align: left;width:'+b("#gview_"+b(u).attr("id")).width()+'px;background:white;" role="gridcell">';O+=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.noRecordsFound");O+="</td></tr>";u.before(O);b('[aria-describedby="RUP_GRID_'+u[0].id+'_NO_REGISTROS"]').rup_tooltip({position:{my:"center",at:"center"}})}}else{b(b.find("#cb_"+u.attr("id"))[0]).attr("disabled",false);if(b("#RUP_GRID_"+u[0].id+"_noRecords").length){b("#RUP_GRID_"+u[0].id+"_noRecords").remove()}b(u.jqGrid("getGridParam","pager")).show();if(b.isFunction(u[0].rup_gridProps.onAfterGridComplete)){u[0].rup_gridProps.onAfterGridComplete.call(u,I,J)}if(!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect&&!b.isFunction(u[0].rup_gridProps.onAfterGridComplete)){var K=b(u).data("selectedRows"),R=b(u).data("selectedRowsCont"),S=false,Q=u.rup_grid("getDataIDs"),P=u.rup_grid("getGridParam","page"),L=b(u).data("selectedRows"),M=new Array();if(L!==undefined&&L[(P-1)]!==undefined){S=true;M=b(u).data("selectedRows")[(P-1)]}for(var N=0;N<Q.length;N++){if(b.inArray(Q[N],M)!==-1){u.rup_grid("setSelection",Q[N],true)}else{if(!S&&b(u).data("allSelected")===true){u.rup_grid("setSelection",Q[N],true)}}}b(u).data("selectedRows",K);b(u).data("selectedRowsCont",R);b(u).data("rowsSelectedPage",u.find('[aria-describedby="'+u.attr("id")+'_cb"] input:checked').length);b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}}},loadComplete_default:function(I){if(I.rows.length>0&&I.rows[0].id instanceof Object){for(var H=0;H<I.rows.length;H++){if(I.rows[H].id instanceof Object){I.rows[H]["JPA_ID"]=I.rows[H].id;delete I.rows[H].id}}this.addJSONData(I)}},afterInsertRow_default:function(H,J,I){},beforeSelectRow_default:function(H,I){return true},onCellSelect_default:function(I,H,J,K){},ondblClickRow_default:function(I,K,H,J){},onHeaderClick_default:function(H){},onPaging_default:function(J){if(J=="user"){var I=parseInt(b("td.pagControls .ui-pg-input",b("#gbox_"+u[0].id)).val());if(I===0){u.rup_grid("setGridParam",{page:1})}else{var H=parseInt(u.rup_grid("getGridParam","lastpage"));if(I>H){u.rup_grid("setGridParam",{page:H})}}}return""},onRightClickRow_default:function(I,K,H,J){},onSelectAll_default:function(P,R){var H=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.selectMsg"),T=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.selectRestMsg"),I=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.deselectMsg"),U=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.deselectRestMsg"),W=0;if(R){var M=u.rup_grid("getGridParam","records"),L=u.rup_grid("getGridParam","reccount"),S=b.data(u[0],"rowsSelectedPage"),J=b.data(u[0],"selectedRowsCont"),O=((M-L)!==0)?M-L-(J-S):0;X=b.jgrid.format(T,O),N=b("<input/>").attr("type","button").attr("id","rup_grid_"+u[0].id+"_selectAll").css("margin-left","1em").addClass("botonElementosRestantes").attr("value",X).attr("alt",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.selectAll"));numFilas="<b>"+P.length+"</b>",K="<b>"+jqGrid.rup_grid("getGridParam","page")+"</b>",msg=b.jgrid.format(H,numFilas,K);if(O!==0){b("#rup_feedback_"+u[0].id).rup_feedback("set",msg+b(N)[0].outerHTML)}else{b("#rup_feedback_"+u[0].id).rup_feedback("set",msg)}b("#rup_grid_"+u[0].id+"_selectAll").bind("click",function(Z){b.data(u[0],"selectedRowsCont",u.rup_grid("getGridParam","records"));b.data(u[0],"allSelected",true);b("#rup_feedback_"+u[0].id).rup_feedback("close");if(b.isFunction(u[0].rup_gridProps.selectAllGetPrimaryKeys)){u[0].rup_gridProps.selectAllGetPrimaryKeys.call(u);u[0].rup_gridProps.onSelectAllRows.call(u)}b.data(u[0],"deSelectedPages",[]);if(!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect&&!b.isFunction(u[0].rup_gridProps.onAfterSelectAll)){b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}});W=b.data(u[0],"selectedRowsCont")+u.rup_grid("getGridParam","reccount")-b.data(u[0],"rowsSelectedPage")}else{b.data(u[0],"rowsSelectedPage",0);var O=Number(b.data(u[0],"selectedRowsCont")-u.rup_grid("getGridParam","reccount"));if(O>0){var X=b.jgrid.format(U,O),N=b("<input/>").attr("type","button").attr("id","rup_grid_"+u[0].id+"_deSelectAll").css("margin-left","1em").addClass("botonElementosRestantes").attr("value",X).attr("alt",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.deSelectAll"));numFilas="<b>"+P.length+"</b>",K="<b>"+jqGrid.rup_grid("getGridParam","page")+"</b>",msg=b.jgrid.format(I,numFilas,K);b("#rup_feedback_"+u[0].id).rup_feedback("set",msg+b(N)[0].outerHTML);b("#rup_grid_"+u[0].id+"_deSelectAll").bind("click",function(Z){b.data(u[0],"selectedRowsCont",0);b.data(u[0],"allSelected",false);b("#rup_feedback_"+u[0].id).rup_feedback("close");if(b.isFunction(u[0].rup_gridProps.onAfterSelectAll)){u[0].rup_gridProps.onDeSelectAllRows.call(u);if(b.isFunction(u[0].rup_gridProps.onDeselectAllGetPKs)){u[0].rup_gridProps.onDeselectAllGetPKs.call(u)}}if(!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect&&!b.isFunction(u[0].rup_gridProps.onAfterSelectAll)){b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}})}else{b("#rup_feedback_"+u[0].id).rup_feedback("close")}W=O}if(b.isFunction(u[0].rup_gridProps.onAfterSelectAll)){u[0].rup_gridProps.onAfterSelectAll.call(u,P,R,W)}if(!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect&&!b.isFunction(u[0].rup_gridProps.onAfterSelectAll)){var Q=(b(u).data("selectedRows")===undefined)?new Array():b(u).data("selectedRows"),Y=u.rup_grid("getDataIDs"),K=b(u).rup_grid("getGridParam","page");Q[K-1]=(Q[K-1]===undefined)?new Array():Q[K-1];for(var V=0;V<Y.length;V++){if(R){if(b.inArray(Y[V],Q[K-1])===-1){Q[K-1].push(Y[V])}}else{Q[K-1].splice(b.inArray(Y[V],Q[K-1]),1)}}b(u).data("selectedRows",Q);b(u).data("selectedRowsCont",W);b(u).data("rowsSelectedPage",(R)?(u.find('[aria-describedby="'+u.attr("id")+'_cb"] input:checked').length):0);b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}},onSelectRow_default:function(I,H){if(b.isFunction(u[0].rup_gridProps.onAfterSelectRow)){u[0].rup_gridProps.onAfterSelectRow.call(u,I,H)}if(!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect&&!b.isFunction(u[0].rup_gridProps.onAfterSelectRow)){var K=(b(u).data("selectedRows")===undefined)?new Array():b(u).data("selectedRows"),J=b(u).rup_grid("getGridParam","page");K[J-1]=(K[J-1]===undefined)?new Array():K[J-1];if(H){if(b.inArray(I,K[J-1])===-1){K[J-1].push(I)}}else{K[J-1].splice(b.inArray(I,K[J-1]),1)}b(u).data("selectedRows",K);b(u).data("selectedRowsCont",(H)?(b(u).data("selectedRowsCont")+1):(b(u).data("selectedRowsCont")-1));b(u).data("rowsSelectedPage",u.find('[aria-describedby="'+u.attr("id")+'_cb"] input:checked').length);b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"));if(u.find('[aria-describedby="'+u.attr("id")+'_cb"] input:checked').length===u.find('[aria-describedby="'+u.attr("id")+'_cb"] input').length){b(b.find("#cb_"+u.attr("id"))[0]).attr("checked",true)}}if(b("#rup_feedback_"+u[0].id)){b("#rup_feedback_"+u[0].id).rup_feedback("close")}},onSortCol_default:function(J,I,H){if(!u[0].rup_gridProps.hasMaint&&u[0].rup_gridProps.multiselect){if(b(u).data("selectedRows")!==undefined&&b(u).data("selectedRows").length>0){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();b.rup_messages("msgConfirm",{message:b.rup.i18nParse(b.rup.i18n.base,"rup_maint.checkSelectedElems"),title:b.rup.i18nParse(b.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){b(u).data("selectedRows",new Array());b(u).data("selectedRowsCont",0);b(u).data("rowsSelectedPage",0);b("#"+u[0].rup_gridProps.pagerName+"_left").html(b(u).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"));u.trigger("reloadGrid")}});return""}}window.setTimeout(function(){b("#lui_"+u.attr("id")).hide();b("#load_"+u.attr("id")).hide();u.trigger("reloadGrid")},0);return""},resizeStart_default:function(I,H){h[0]=b("#gbox_"+u[0].id+" .ui-jqgrid-htable th:eq(1)").css("cursor");if(h[0]==="col-resize"){h[0]="default"}b("#gbox_"+u[0].id+" .ui-jqgrid-htable th").css("cursor","col-resize");h[1]=b("#gbox_"+u[0].id+" .ui-jqgrid-sortable").css("cursor");b("#gbox_"+u[0].id+" .ui-jqgrid-sortable").css("cursor","col-resize");b("#gbox_"+u[0].id+" .ui-jqgrid-sortable div").css("cursor","col-resize");b("#gbox_"+u[0].id+" .ui-grid-ico-sort").css("cssText","cursor: col-resize !important;")},resizeStop_default:function(H,I){b("#gbox_"+u[0].id+" .ui-jqgrid-htable th").css("cursor",h[0]);b("#gbox_"+u[0].id+" .ui-jqgrid-sortable").css("cursor",h[1]);b("#gbox_"+u[0].id+" .ui-jqgrid-sortable div").css("cursor","pointer");b("#gbox_"+u[0].id+" .ui-grid-ico-sort").css("cssText","cursor: pointer !important;")}});if(G.loadOnStartUp&&!G.hasMaint){G.url=b.rup_utils.setNoPortalParam(G.url)}else{null}if(G.sortable!==false){E=G.sortable;G.sortable={update:function(H){u.reorderColumns(H)}}}G.jsonReader={repeatitems:false,id:"rup_id"};G.prmNames={id:"rup_id"};G.loadui="block";G.pager=b("#"+G.pagerName);if(G.datatype===undefined){if(G.loadOnStartUp&&!G.hasMaint){G.datatype="json"}else{G.datatype="clientSide"}}u[0].rup_gridProps=G;u[0].rup_gridProps.allPksArray=[];b.data(u[0],"selectedRowsCont",0);var e=u.jqGrid(G);if(G.fluidBaseLayer===null){G.fluidBaseLayer=b("#gbox_"+e.attr("id")).parent();if(G.fluidBaseLayer.attr("id").indexOf("RUP_GRID_")!==-1){G.fluidBaseLayer=G.fluidBaseLayer.parent()}}b("#"+u[0].id).bind("fluidWidth.resize",function(I,J,H){b(e).setGridWidth(H)});if(G.hasMaint===false&&G.width==="auto"){b("#"+u[0].id).fluidWidth({fluidBaseLayer:G.fluidBaseLayer,minWidth:G.minWidth,maxWidth:G.maxWidth,fluidOffset:G.fluidOffset})}if(!G.loadOnStartUp){u.setGridParam({url:(!G.hasMaint?G.url:null),datatype:(!G.hasMaint?"json":"clientSide")})}b("<div/>").attr("id","rup_feedback_"+u[0].id).insertBefore("#gbox_"+u[0].id);if(b("#"+u[0].id).getGridParam("sortable")){b("#gview_"+u[0].id+" .ui-jqgrid-sortable").css("cursor","move")}else{b("#gview_"+u[0].id+" .ui-jqgrid-sortable").css("cursor","default")}b("#rup_feedback_"+u[0].id).rup_feedback({closeLink:false,gotoTop:false,block:false});b.each(b("#gview_"+u[0].id+" .ui-jqgrid-sortable"),function(H,I){t=b(I).text();j=b(I).children();b(I).text("").prepend(b("<div />").css("cursor","pointer").css("display","inline-table").html(t)).append(j)});if(G.multiselect){b("#gview_"+u[0].id+" thead th").first().attr("title",b.rup.i18nParse(b.rup.i18n.base,"rup_maint.multiselectHeader"))}b("#gview_"+u[0].id+" thead th[title]").rup_tooltip({show:{delay:500},position:{viewport:b(window),adjust:{method:"flip"}}});b("#"+G.pagerName).css("height","auto");b("#"+G.pagerName+"_left").addClass("pager_left");b("#"+G.pagerName+"_center").addClass("pager_center");b("#"+G.pagerName+"_right").addClass("pager_right");b("#"+G.pagerName+"_left").html("");if(G.multiselect===true){b("#"+G.pagerName+"_left").append(b("<div/>").addClass("ui-paging-selected").html("0 "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected")))}b("#"+G.pagerName+" .pager_center table td").addClass("pagControls");b("#"+G.pagerName+"_center .ui-pg-table #first_"+G.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.primPag")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("#"+G.pagerName+"_center .ui-pg-table #prev_"+G.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.anterior")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("#"+G.pagerName+"_center .ui-pg-table #next_"+G.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.siguiente")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("#"+G.pagerName+"_center .ui-pg-table #last_"+G.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.ultiPag")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("td.pagControls input",b("#gbox_"+u[0].id)).numeric(false).attr("title",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.input")).rup_tooltip();b("td.pagControls select").attr("title",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.select")).rup_tooltip();if(!G.pagerInline){b("#"+G.pagerName+" tr:eq(0)").parent().append(b("<tr/>").attr("id",G.pagerName+"_pagerNewLine"));b("#"+G.pagerName+"_pagerNewLine").append(b("#"+G.pagerName+"_left"));b("#"+G.pagerName+"_pagerNewLine").append(b("#"+G.pagerName+"_right"));b("#"+G.pagerName+"_right").attr("colspan","2");b("#"+G.pagerName+"_center").attr("colspan","3")}if(G.multiselect===true){b("#cb_"+b.jgrid.jqID(u[0].id),"#gbox_"+u[0].id).unbind("click");b("#cb_"+b.jgrid.jqID(u[0].id),"#gbox_"+u[0].id).bind("click",function(){if(this.checked){u[0].p.selarrrow=[];b("[id^=jqg_"+u[0].id+"_]").attr("checked","checked");b(u[0].rows).each(function(H){if(H>0){if(!b(this).hasClass("subgrid")&&!b(this).hasClass("jqgroup")){b(this).addClass("ui-state-highlight").attr("aria-selected","true");u[0].p.selarrrow.push(this.id);u[0].p.selrow=this.id}}});chk=true;emp=[]}else{b("[id^=jqg_"+u[0].p.id+"_]").removeAttr("checked");b(u[0].rows).each(function(H){if(H>0){if(!b(this).hasClass("subgrid")){b(this).removeClass("ui-state-highlight").attr("aria-selected","false");emp.push(this.id)}}});u[0].p.selarrrow=[];u[0].p.selrow=null;chk=false}if(b.isFunction(u[0].p.onSelectAll)){u[0].p.onSelectAll.call(u[0],chk?u[0].p.selarrrow:emp,chk)}});b("#RUP_"+u[0].id).width(this.width())}}var d=b("#gbox_"+b(this).attr("id")).find("table");b(d[0]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.cabecera"));if(G.summary){b(d[1]).attr("sumary",G.summary)}else{b(d[1]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.datos"))}b(d[2]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.paginador"));b(d[3]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.paginador_navegar"));b(G.colModel).each(function(I,J){if(J.classes==="ui-ellipsis"){b("[id='jqgh_"+b(u).attr("id")+"_"+J.name+"']").css("display","block").css("text-overflow","ellipsis")}var H=b("[id='jqgh_"+b(u).attr("id")+"_"+J.name+"']").children("div");b(H).replaceWith(b("<span>").text(b(H).text()).css("cursor","pointer"))})},_tooltip:function(d){b("tr#"+d+" > td").each(function(e){b.attr(this,"rup_tooltip",b.attr(this,"title"))}).removeAttr("title");b(".qtip").qtip("hide",true)}});b.fn.rup_grid.defaults={altclass:"",altRows:false,autoencode:true,botones:null,checkMultiBoxOnly:false,colModel:[],colNames:[],editable:false,editurl:null,filterParameters:null,fluidBaseLayer:null,fluidOffset:0,grouping:false,groupingView:{groupDataSorted:true,groupText:["<b>{0} - {1} "+b.rup.i18nParse(b.rup.i18n.base,"rup_maint.elements")+"</b>"]},hasMaint:false,height:"auto",imgpath:"",loadOnStartUp:true,maxWidth:null,menuContextual:null,minWidth:null,multiboxonly:false,multiselect:false,multiselectWidth:40,noMulticheckSelection:false,offset:0,pagerName:"pager",pagerInline:true,rowList:[10,20,30],rowNum:10,searchOnEnter:true,sortable:true,sortname:null,sortorder:"asc",tableclose:true,treeGrid:false,headertitles:false,treedatatype:"json",url:"",viewrecords:true,width:"auto",tooltipDelay:500}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(g){var d={};g.extend(g.rup.iniRup,g.rup.rupSelectorObjectConstructor("rup_grid_jerarquia",d));g.fn.rup_grid_jerarquia("extend",{reset:function(){g(this).data("jerarquia.tree",[]);postData=g(this).getGridParam("postData");delete postData["jerarquia.tree"]},resetMultiselect:function(){var k=this,j=g(k).attr("id");k.data("treeSelection",[]);k.getGridParam("selarrrow").length=0;g.each(k.find("tr[aria-selected='true']"),function(m,l){g(l).removeClass("ui-state-highlight").attr("aria-selected","false");g(l).find("[aria-describedby='"+j+"_cb'] input").removeAttr("checked")});k._refreshFooter.call(k)},getMultiselect:function(){var j=this;if(j.data("settings")!==undefined){var k=j.data("settings").token;return g.map(this.data("treeSelection"),function(m,l){return m.substring(m.lastIndexOf(k)+k.length)})}else{return[]}}});g.fn.rup_grid_jerarquia("extend",{_init:function h(r){if(r.length>1){g.rup.errorGestor(g.rup.i18nParse(g.rup.i18n.base,"rup_global.initError")+g(this).attr("id"))}else{var m=g.extend(true,{},g.fn.rup_grid_jerarquia.defaults,r[0]),w=this,u=null,v=null,p=null,q=null,j=null;m.id=g(this).attr("id");var k=g(w).getGridParam("postData");k["jerarquia.token"]=m.token;u=g(w).getGridParam("colModel");for(var n=0;n<u.length;n++){if(u[n]["name"]===m.expandColName){v=u[n].formatter;u[n].formatter=function(x,y,z){p=((x!==undefined)?x:"");if(v!==undefined){p=v.call(this,x,y,z)}return w._formatter(m,x,y,z)+p};break}}q=g(w).getGridParam("loadComplete");j=function l(x){if(!g.isEmptyObject(x.rows)){q.call(this,x);w._loadComplete(m,x)}w._refreshFooter.call(w)};g(w).setGridParam({loadComplete:j});g.each(m.resetEvents,function(y,x){var B=g.isFunction(x[0])?x.shift():null,A="#"+x.join(", #");g(A).on(y,function(C){if(B===null||B.call(this,C)===false){g(w).rup_grid_jerarquia("reset")}});for(var z=0;z<x.length;z++){g._data(g("#"+x[z])[0],"events")[y]=g._data(g("#"+x[z])[0],"events")[y].reverse()}});g(w).data("jerarquia.tree",[]);g(w).data("settings",m);k=g(w).getGridParam("postData");if(g(w).getGridParam("multiselect")){w._multiselect();var s=w.data("maintName");toolbar=g("#"+s)[0].prop.toolbar.self;function t(){var x=jQuery.extend({},g(w).getGridParam("postData"));x["jerarquia.parentId"]=g(w).data("treeSelection").toString();g.rup_ajax({url:w[0].rup_gridProps.url,dataType:"json",type:"GET",async:false,data:x,contentType:"application/json",beforeSend:function(y){y.setRequestHeader("JQGridModel_selected",true)},success:function(C,y){var B=[],A=[],z=w.data("settings").token;g.map(C,function(E,F){B.push(parseInt(F));var D=[];g.map(E,function(I,G){D.push(parseInt(G));var H=[];H.push(I);A.push(I);H["id_"+I]=z+I;D["l_"+G]=H});B["p_"+F]=D});g("#"+s)[0].prop.selectedRows=B;w[0].rup_gridProps.allPksArray=A;g("#"+s)[0].prop.selectedRowsCont=A.length},error:function(A,y,z){g.rup_messages("msgError",{title:g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.errorTitle"),message:g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.errorMessageSelected")})},complete:function(y,z){}})}if(toolbar.find("[id$='rup-maint_toolbar-"+s+"##edit']").length>0){toolbar.find("[id$='rup-maint_toolbar-"+s+"##edit']").click(t);g._data(toolbar.find("[id$='rup-maint_toolbar-"+s+"##edit']")[0],"events")["click"].reverse()}if(toolbar.find("[id$='rup-maint_toolbar-"+s+"##delete']").length>0){toolbar.find("[id$='rup-maint_toolbar-"+s+"##delete']").click(t);g._data(toolbar.find("[id$='rup-maint_toolbar-"+s+"##delete']")[0],"events")["click"].reverse();toolbar.find("[id$='rup-maint_toolbar-"+s+"##delete']").click(function(){g(".ui-dialog:visible").find("button").click(function(){g(w).rup_grid_jerarquia("resetMultiselect")});g(".ui-dialog:visible").on("dialogclose",function(y){var x=w.data("maintName");g("#"+x)[0].prop.selectedRows=[];w[0].rup_gridProps.allPksArray=[];g("#"+x)[0].prop.selectedRowsCont=0})})}if(toolbar.find("[id$='rup-maint_toolbar-"+s+"##new']").length>0){var o=function(){w.data("treeSelection",[]);w._reloadMultiselect.call(w)};toolbar.find("[id$='rup-maint_toolbar-"+s+"##new']").click(function(x){if(w.data("treeSelection").length>0&&g("#"+s)[0].prop.selectedRows.length===0){g.rup_messages("msgConfirm",{message:g.rup.i18nParse(g.rup.i18n.base,"rup_maint.checkSelectedElems"),title:g.rup.i18nParse(g.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){o.call(w);g("#"+s).rup_maint("newElement")}});x.stopImmediatePropagation()}else{o.call(w)}});g._data(toolbar.find("[id$='rup-maint_toolbar-"+s+"##new']")[0],"events")["click"].reverse()}}}},_formatter:function f(m,k,l,q){if(q.level===undefined){var p=this.getRowData(l.rowId);q.hasChildren=g.parseJSON(p.hasChildren);q.filter=g.parseJSON(p.filter);q.level=p.level}var o=g("<span />").addClass("rup-grid-jerarquia rup-grid-jerarquia_level_"+q.level+" ui-icon");if(q.hasChildren){var j=g("#"+m.id).data("jerarquia.tree"),n=""+q[m.relatedColName];if(g.inArray(n,j)===-1){o.addClass(m.expandedClass).text(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.icons.expanded"))}else{o.addClass(m.unExpandedClass).text(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.icons.unexpanded"))}}else{o.addClass(m.noChildClass).text(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.icons.nochild"))}if(q.filter){o=g(o).before(g("<span />").addClass("rup-grid-jerarquia rup-grid-jerarquia_filter_"+q.level+" ui-icon").addClass("rup-grid-jerarquia_filter").addClass(m.filterClass).text(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.icons.filtered")));return(o[0].outerHTML+o[1].outerHTML)||new XMLSerializer().serializeToString(o[0]+o[1])}return o[0].outerHTML||new XMLSerializer().serializeToString(o[0])},_loadComplete:function e(k,l){g.each(g("td[aria-describedby$='hasChildren']:contains('true')"),function(m,n){g(n).parent().find("span[class^='rup-grid-jerarquia']").click(function(o){if(g(this).hasClass(k.filterClass)){return false}g(this).rup_tooltip("destroy");g(this).parent().rup_tooltip("destroy");var w=g("#"+k.id),u=g(w).getGridParam("colModel"),t=0,v,r,s,p=null;for(var q=0;q<u.length;q++){if(u[q]["name"]===k.relatedColName){t=q;break}}v=g(g(n).parent().children()[t]);parentValue=g.trim(v.contents(":not(span[class^='rup-grid-jerarquia'])").first().text()),s=g(w).data("jerarquia.tree");if(g.inArray(parentValue,s)===-1){s.push(parentValue)}else{s.splice(g.inArray(parentValue,s),1)}g(w).data("jerarquia.tree",s);p=g(w).getGridParam("postData");p["jerarquia.tree"]=s.toString();g(w).trigger("reloadGrid");return false})});if(k.parentNodesTooltip){var j=this;g.each(this.find("span[class^='rup-grid-jerarquia']"),function(n,o){var m=g(j).attr("id"),q=g(o).parentsUntil("tr").siblings("[aria-describedby='"+m+"_parentNodes']").html(),p=g(o).parent();p.rup_tooltip("destroy");p.attr("title",j._parseParentNodes(q));p.rup_tooltip({show:{delay:k.tooltipDelay}})})}if(j.getGridParam("multiselect")){if(g(this).getGridParam("selarrrow").length===g(this).getGridParam("rowNum")){g("#cb_"+g(this).attr("id")).attr("checked","checked")}}},_parseParentNodes:function b(j){var l=this.data("settings")["parentNodesTooltipFnc"];nodes=j.split(this.data("settings").token).slice(1);if(l===null){var n="",m="&nbsp;&nbsp;";for(var k=0;k<nodes.length;k++){if(k!==(nodes.length-1)){n+=nodes[k]+"<br/>"+m+"└&nbsp;";m+="&nbsp;&nbsp;&nbsp;"}else{n+="<b>"+nodes[k]+"</b>"}}return n}else{return l.call(this,nodes)}},_multiselect:function a(){var k=this,j=g(k).attr("id");g(k).data("treeSelection",[]);if(k.data("settings").multiboxonly){g(k).data("defaultEventFunctions").beforeSelectRow_default=function(l,m){return(m.target.type=="checkbox")?true:false};g(k).data("defaultEventFunctions").onCellSelect_default=function(n,l,o,m){if(g(m.target).attr("id")!=="jqg_"+j+"_"+n){return false}}}g(k).data("defaultEventFunctions").onSelectRow_default=function(m,l){k._selectRow.call(k,m,l)};g(k).data("defaultEventFunctions").onSelectAll_default=function(m,l){k._selectAll.call(k,m,l)};g("#"+k.data("maintName"))[0].prop.detailDiv.on("dialogclose",function(m){var l=k.data("maintName");g("#"+l)[0].prop.selectedRows=[];k[0].rup_gridProps.allPksArray=[];g("#"+l)[0].prop.selectedRowsCont=0});g(k).on("jqGridLoadComplete",function(){k._reloadMultiselect.call(k);g("#"+j+"_cb").rup_tooltip("destroy");g("#"+j+"_cb").removeAttr("title");var n=g(),l=k.data("settings").multiMenu,m=function(o){k.data("checkMenuValue",g(this).data("checkMenuValue"));if(n.data("rowId")!==undefined){g("#"+j).setSelection(n.data("rowId"),true)}else{k._selectRow()}k.removeData("checkMenuValue");n.hide()};g.each(g.merge(g("#"+j+"_cb"),g(k).find("[aria-describedby='"+j+"_cb']")),function(q,p){g(p).find("input").css("margin-right","1em").after(g("<a />").attr("href","javascript:void(0)").addClass("ui-icon rup-grid-jerarquia_checkmenu_arrow").click(function(){if((k.getGridParam("records")===0)||n.is(":visible")){n.hide();return false}g("#"+j+"_checkmenu").remove();var r=g(this).parent(),z=r.offset();n=g("<ul />").attr("id",j+"_checkmenu").addClass("rup-grid-jerarquia_checkmenu").on({mouseenter:function(){g(this).show()},mouseleave:function(){g(this).hide()},keydown:function(E){switch(E.keyCode){case 27:g(this).hide();break;case 13:g(this).find(".ui-state-focus").click();break}}}).css({top:z.top+r.height(),left:z.left});if(!g.rup_utils.aplicatioInPortal()){n.appendTo("body")}else{n.appendTo(".r01gContainer")}var t=g(this).parents("tr").attr("id"),w=g(k).getRowData(t),u=g(k).data("treeSelection"),C=u.length,D=function(F,E,G){n.append(g("<a />").text(F).data("checkMenuValue",G).click(function(){m.call(this)}).append(g("<span />").addClass("ui-icon "+E)).wrap(g("<li />")).parent())};if(r.attr("id")===undefined){if(w.hasChildren==="true"){if(l.hijos){D(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.menu.opt_1"),"child_icon",1)}if(l.descendientes){D(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.menu.opt_2"),"hierarchy-down_icon",2)}}var y=false,v=k.data("settings").token;for(var x=0;x<C;x++){var s=u[x];if(s.indexOf(w.treeNodes)===0){s=s.substr(w.treeNodes.length);if(s.split(v).length>=2){y=true;break}}}if(y&&l.hijos){D(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.menu.opt_3"),"child_icon",3)}if(y&&l.descendientes){D(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.menu.opt_4"),"hierarchy-down_icon",4)}}else{var B=g(k).getGridParam("records"),A=g(k).data("treeSelection").length;if(B!==A){D(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.menu.opt_5"),"check_icon",5)}else{D(g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.menu.opt_6"),"uncheck_icon",6)}}n.data("rowId",t);n.rup_menu({display:"vertical"});n.find("a:first").focus()}));if(this.nodeName==="TD"){var o=g(k).getRowData(g(this).parent().attr("id")).hasChildren;if(((l.hijos&&o==="false")&&!l.descendientes)||(!l.hijos&&(l.descendientes&&o==="false"))||((l.hijos&&o==="false")&&(l.descendientes&&o==="false"))){if(k.data("settings").multiMenuDisabled){g(this).find("a").addClass("ui-state-disabled").off("click")}else{g(this).find("a").remove()}}}else{if(k.getGridParam("records")===0){if(k.data("settings").multiMenuDisabled){g(this).find("a").addClass("ui-state-disabled")}else{g(this).find("a").remove()}}}g(p).on("mouseleave",function(){if(n.is(":visible")){n.hide()}})})});g.each(g(k).data("settings").resetMultiEvents,function(m,l){var p=g.isFunction(l[0])?l.shift():null,o="#"+l.join(", #");g(o).on(m,function(q){if(p===null||p.call(this,q)===false){g(k).rup_grid_jerarquia("resetMultiselect")}});for(var n=0;n<l.length;n++){g._data(g("#"+l[n])[0],"events")[m]=g._data(g("#"+l[n])[0],"events")[m].reverse()}})},_selectRow:function(n,l){var m=this,j=g(m).attr("id"),k=g(m).data("treeSelection"),o=g(m).getRowData(n).treeNodes;ajaxData=jQuery.extend({},g(m).getGridParam("postData")),checkMenuValue=m.data("checkMenuValue"),token=m.data("settings").token;switch(checkMenuValue){default:if(m.getGridParam("selarrrow").length===m.getGridParam("rowNum")){g("#cb_"+j).attr("checked","checked")}g("#"+j+"_checkmenu").hide();if(l){if(g.inArray(o,k)===-1){k.push(o)}}else{k.splice(g.inArray(o,k),1)}m._refreshFooter.call(m);break;case 5:case 6:o=token;case 1:case 2:case 3:case 4:m._checkNode.call(m,o,false);ajaxData.page=ajaxData.rows=null;ajaxData["jerarquia.tree"]=null;ajaxData["jerarquia.parentId"]=o.substring(o.lastIndexOf(token)+token.length);g.rup_ajax({url:m[0].rup_gridProps.url,dataType:"json",type:"GET",async:false,data:ajaxData,contentType:"application/json",beforeSend:function(p){p.setRequestHeader("RUP",g.toJSON({treeNodes:"treeNodes"}));p.setRequestHeader("JQGridModel",true);g("#lui_"+j).show();g("#load_"+j).show()},success:function(u,q){u=u.rows;var p=[],t=0,s=m.data("settings").token;switch(checkMenuValue){case 1:case 3:p=g.map(u,function(w,v){var x=w.treeNodes;if(x.split(s).length<3){return o+x}});break;case 5:case 6:o="";case 2:case 4:p=g.map(u,function(w,v){var x=w.treeNodes;return o+x});break}t=p.length;if(checkMenuValue===1||checkMenuValue===2||checkMenuValue===5){for(var r=0;r<t;r++){if(g.inArray(p[r],k)===-1){k.push(p[r])}}}else{for(var r=0;r<t;r++){k.splice(g.inArray(p[r],k),1)}}g(m).data("treeSelection",k);if(checkMenuValue===5||checkMenuValue===6){if(checkMenuValue===5){g("#cb_"+j).attr("checked","checked");feedbackTxt=g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.feedbackTableSelect")}if(checkMenuValue===6){g("#cb_"+j).removeAttr("checked");feedbackTxt=g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.feedbackTableDeselect")}g("#rup_feedback_"+j).rup_feedback("option",{closeLink:true});g("#rup_feedback_"+j).rup_feedback("set",feedbackTxt)}},error:function(r,p,q){g.rup_messages("msgError",{title:g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.errorTitle"),message:g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.errorMessageMulti")})},complete:function(p,q){m._reloadMultiselect.call(m);g("#lui_"+j).hide();g("#load_"+j).hide();if(m.data("settings").multiMenuCallback!==undefined){m.data("settings").multiMenuCallback.call(this)}}});break}},_selectAll:function(j,l){var r=this,p=g(r).attr("id"),q=j.length,k=g(r).data("treeSelection"),m="";if(l){m=g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.feedbackVisualSelect")}else{m=g.rup.i18nParse(g.rup.i18n.base,"rup_grid_jerarquia.feedbackVisualDeselect")}g("#rup_feedback_"+p).rup_feedback("option",{closeLink:true});g("#rup_feedback_"+p).rup_feedback("set",m);for(var n=0;n<q;n++){if(j[n].indexOf("ghead")!==-1){continue}var o=g(r).getRowData(j[n]).treeNodes;if(l){if(g.inArray(o,k)===-1){k.push(o)}}else{k.splice(g.inArray(o,k),1)}}r._refreshFooter.call(r)},_checkNode:function(p,m){var n=this,j=g(n).attr("id"),q=n.getGridParam("selarrrow"),l=g(n).data("treeSelection"),o=n.find("td[aria-describedby='"+j+"_treeNodes']").filter(function(){return g(this).html()===p}),k=g(o).parent().attr("id");if(m){g(o).parent().addClass("ui-state-highlight").attr("aria-selected","true");g(o).parent().find("[aria-describedby='"+j+"_cb'] input").attr("checked","checked");if(g.inArray(k,q)==-1){q.push(k)}}else{g(o).parent().removeClass("ui-state-highlight").attr("aria-selected","false");g(o).parent().find("[aria-describedby='"+j+"_cb'] input").removeAttr("checked");if(g.inArray(k,q)!==-1){q.splice(g.inArray(k,q),1)}}},_reloadMultiselect:function(){var l=this,j=g(l).attr("id"),k=g(l).data("treeSelection");g.each(l.find("td[aria-describedby='"+j+"_treeNodes']"),function(n,m){if(g.inArray(g(m).html(),k)!==-1){l._checkNode.call(l,g(m).html(),true)}else{l._checkNode.call(l,g(m).html(),false)}});if(g(this).getGridParam("multiselect")){if(g(this).getGridParam("selarrrow").length===g(this).getGridParam("rowNum")){g("#cb_"+g(this).attr("id")).attr("checked","checked")}}l._refreshFooter.call(l)},_refreshFooter:function(){var m=this,k=g(m).attr("id"),l=g(m).data("treeSelection");if(m.getGridParam("multiselect")){g("#"+m[0].rup_gridProps.pagerName+"_left").html(l.length+" "+g.rup.i18nParse(g.rup.i18n.base,"rup_grid.pager.selected"));var o=g("#"+m.data("maintName"))[0].prop.toolbar.self,j=g(m).data("jerarquia.tree"),n=[];n=g.grep(l,function(r,p){var q=false;selectionNodes=r.split(m.data("settings").token),selectionNodes_length=selectionNodes.length;g.each(selectionNodes,function(s,t){if((g.inArray(t,j)!==-1)&&(s+1!==selectionNodes_length)){q=true;return false}});return q},true);if(n.length>0){o.enableButton("edit");o.enableButton("delete")}else{o.disableButton("edit");o.disableButton("delete")}}}});g.fn.rup_grid_jerarquia.defaults={token:"/",resetEvents:{},resetMultiEvents:{},parentNodesTooltip:true,parentNodesTooltipFnc:null,tooltipDelay:500,multiMenu:{hijos:true,descendientes:true},multiMenuDisabled:true,multiboxonly:false,expandedClass:"ui-icon-triangle-1-se",unExpandedClass:"ui-icon-triangle-1-e",noChildClass:"ui-icon-none",filterClass:"ui-icon-star"}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){a.widget("$.rup_language",{options:{languages:null,active:null,modo:""},_create:function(){this.options.active=a.rup.lang==null?"[lang]":a.rup.lang,active=this.options.active;this.options.languages=a.rup.AVAILABLE_LANGS.split(",");var p=this.element,l=a("<a>").attr("id","rup_language_choice").addClass("rup-language_change_option").text(a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguage"));a(p).addClass("ui-widget");if(this.options.modo==="portal"){var k=a("<ul>").addClass("rup-language_portal"),m=a(this.options.languages).size();a.each(this.options.languages,function(s,t){t=t.replace(/^\s*|\s*$/g,"");var r=a.rup.i18nParse(a.rup.i18n.base,"rup_language."+t+"_short");if(t!==active){a("<li>").append(a("<a>").attr("href","?"+a.rup.LOCALE_PARAM_NAME+"="+t).text(r).addClass("rup-language_portal_list ui-corner-all").attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral_"+t)+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+t))).appendTo(k)}else{a("<li>").addClass("ui-state-active").append(a("<a>").attr("href","javascript:void(0);").text(r).addClass("rup-language_portal_list_active ui-corner-all").attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral")+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+t))).appendTo(k)}if(s<m-1){k.append(a("<div>").html("|").addClass("rup-language_portal_separator"))}});p.append(k)}else{var k=a("<ul>").attr("id","ulGeneral"),n,b=a("<li>").attr("id","rup_active_language").addClass("rup-language_active").text(a.rup.i18nParse(a.rup.i18n.base,"rup_language."+this.options.active)).attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral")+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+active)),g=a("<li>").addClass("rup-language_change").attr("id","rup_language_link"),j=a("<li>").attr("id","rup_language_list").addClass("rup-language_change_opened").css("visibility","hidden"),q=a("<div>"),d=a("<div>").addClass("rup-language_language_list"),o=a("<a>").addClass("rup-language_close_languages").attr("id","rup_language_close").attr("href","#").attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.closingLiteral")).html(a.rup.i18nParse(a.rup.i18n.base,"rup_global.cerrar")),h=a("<ul>");k.append(b);a("<a>").attr("href","#").text(a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguage")).appendTo(g);k.append(g);q.append(l);d.append(o);a.each(this.options.languages,function(t,u){u=u.replace(/^\s*|\s*$/g,"");var s=a("<li>").attr("id","rup_language_lng_"+u),r=a.rup.i18nParse(a.rup.i18n.base,"rup_language."+u);if(u!==active){a("<a>").appendTo(s).attr("href","?"+a.rup.LOCALE_PARAM_NAME+"="+u).text(r).attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral_"+u)+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+u))}else{a("<a>").appendTo(s).attr("href","javascript:void(0);").text(r).attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral")+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+u))}s.appendTo(h)});d.append(h);q.append(d);j.append(q);k.append(j);p.append(k);var e=d.css("width","0.8em").width();var f=g.css("margin-right");g.css("margin-right","0px");d.width((j.position()).left-e);d.css("padding-left","0.6em");d.css("padding-right","0.2em");d.css("top",b.height()-1);j.hide();j.css("visibility","");g.css("margin-right",f);a("#rup_language_lng_"+a.rup.lang).addClass("ui-state-active");g.click(function(){g.hide();j.show();a(".rup-language_language_list").find("li:not(.rup-language_language_list_active)").first().children("a").focus()});l.click(function(){j.hide();g.show()});o.click(function(){j.hide();g.show()});j.mouseenter(function(){p.one("mouseleave",function(){j.hide();g.show()})});p.bind("keydown",function(r){switch(r.keyCode){case a.ui.keyCode.UP:if(a(r.target).parent().prevAll("li:not(.rup-language_language_list_active)").length>0){a(r.target).parent().prevAll("li:not(.rup-language_language_list_active)").first().children().focus()}else{a(r.target).parent().siblings("li:not(.rup-language_language_list_active)").last().children().focus()}break;case a.ui.keyCode.DOWN:if(a(r.target).parent().nextAll("li:not(.rup-language_language_list_active)").length>0){a(r.target).parent().nextAll("li:not(.rup-language_language_list_active)").first().children().focus()}else{a(r.target).parent().siblings("li:not(.rup-language_language_list_active)").first().children().focus()}break;case a.ui.keyCode.ESCAPE:j.hide();g.show();break;default:}})}p.find("[title]").rup_tooltip({applyToPortal:true})},_setOption:function(b,d){a.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function($){$.fn.fmatter.rup_combo=function(cellval,opts,rwd,act){var source=opts.colModel.editoptions.source,i18n="",entidad=opts.colModel.name,entidadAux,data,CollectionRupCombo,rowId=opts.rowId,parentColName,parentColValue,primero=true,multiValueToken,parentValuesChain,objCombo;if(typeof source==="string"){if(opts.colModel.jsonmap){entidad=opts.colModel.jsonmap}else{entidad=opts.colModel.name}if(entidad.indexOf(".")!==-1){entidadAux=entidad.substring(0,entidad.lastIndexOf("."))}else{entidadAux=""}var valRwd=$.rup_utils.unnestjson(rwd)[(entidadAux!==""?entidadAux+".":"")+opts.colModel.editoptions.sourceParam.label];if(valRwd===undefined){valRwd=$("#"+opts.gid).data("Collection_rup_combo")[parseInt(opts.rowId)][opts.colModel.name]["label"]}if(valRwd!==undefined){data=valRwd}}else{if(opts.colModel.editoptions.parent!==undefined){objCombo=$("#detailForm_"+opts.gid.split("GRID_")[1]+"_"+opts.colModel.name);if(objCombo.length!==0){primero=true;multiValueToken=objCombo.data("settings").multiValueToken;parentValuesChain="";$.each(opts.colModel.editoptions.parent,function(index,element){parentColName=opts.colModel.editoptions.parent[index].split("detailForm_"+opts.gid.split("GRID_")[1]+"_")[1];parentColValue=$("#"+opts.gid).data("Collection_rup_combo")[rowId][parentColName]["value"];if(primero){parentValuesChain+=parentColValue;primero=false}else{parentValuesChain+=multiValueToken+parentColValue}});source=source[parentValuesChain]}}$.each(source,function(index,element){if(element.value===cellval){if(opts.colModel.editoptions.i18nId===undefined){i18n=$.rup.i18nParse($.rup.i18n.app[opts.gid+"##"+entidad],element.i18nCaption)}else{i18n=$.rup.i18nParse($.rup.i18n.app[opts.colModel.editoptions.i18nId],element.i18nCaption)}return false}});data=i18n}CollectionRupCombo=$("#"+opts.gid).data("Collection_rup_combo");if(CollectionRupCombo===undefined){CollectionRupCombo={};$("#"+opts.gid).data("Collection_rup_combo",CollectionRupCombo)}$.extend(true,CollectionRupCombo,CollectionRupCombo,$.parseJSON('{"'+rowId+'":{"'+opts.colModel.name+'":{"value": "'+cellval+'" ,"label":"'+data+'"}}}'));return data};$.fn.fmatter.rup_time=function(cellval,opts,rwd,act){if(!cellval){return""}var op=opts.colModel.formatoptions,dateFormatterOps=$.rup.i18nParse($.rup.i18n.base,"rup_grid.formatter.date");return $.fmatter.util.DateFormat(op.newformat,cellval,op.newformat,dateFormatterOps)};$.maint=$.maint||{};$.extend($.maint,{extend:function(methods){$.fn.extend(methods)},getPrimaryKeys:function(oldRows){var aPKS=[],i=0,j=0;for(i=0;i<oldRows.length;i++){for(j=0;j<oldRows[oldRows[i]].length;j++){aPKS.push(oldRows[oldRows[i]][oldRows[oldRows[i]][j]])}}return aPKS}});$.extend($.rup,{maint:{detailButtons:{ALL:"all",SAVE:"onlySave",SAVE_REPEAT:"save_repeat"}}});var rup_maint={};$.extend($.rup.iniRup,$.rup.rupSelectorObjectConstructor("rup_maint",rup_maint));$.fn.rup_maint("extend",{getSerializedForm:function(form){return $.param($.merge(form.serializeArray(),$.map($("input[type='file']",form),function(a,b){return{name:$(a).attr("name"),value:$(a).attr("value")}})))},newElement:function(){return this.each(function(){if(this.prop.jQueryGrid.rup_grid("isEditable")){$(this).rup_maint("newElementEditable")}else{if(this.prop.isLazyCreationDone===false){$(this).rup_maint("defineDetailForm");$(this).rup_maint("defineValidationConfig");if($.isFunction(this.prop.onAfterLazyDetailLoad)){this.prop.onAfterLazyDetailLoad.call()}this.prop.isLazyCreationDone=true}this.prop.MODO="new";$(this).rup_maint("resetForm",this.prop.detailForm);this.prop.detailForm.data("initialData",$(this).rup_maint("getSerializedForm",this.prop.detailForm));$("#"+this.prop.detailDiv[0].id+" .rup-maint_validateIcon").remove();this.prop.detailFeedback.rup_feedback("close");if($.isFunction(this.prop.onbeforeDetailShow)){this.prop.onbeforeDetailShow.call(this,this.prop.detailDiv)}$(this).rup_maint("updateDetailPagination",1,1);this.prop.detailDiv.rup_dialog("open");$("input:not([readonly]):not(:disabled):visible,.ui-selectmenu:not(.ui-state-disabled):visible",this.prop.detailForm).first().focus()}})},resetForm:function(form){if(form.data("validator")!=undefined){var errorClass=form.data("validator").settings.errorClass;$("."+errorClass,form).removeClass(errorClass)}$("input[type!='button'][type!='checkbox'][type!='radio'], textarea",form).val("");$("input[type='checkbox']").not("[name*='jqg_GRID_']").not("[disabled='disabled']",form).removeAttr("checked");$.each($("select.rup_combo",form),function(index,elem){$(elem).rup_combo("clear")});$("[ruptype='autocomplete']",form).each(function(index,element){$(element).val("")});if(this[0].prop.clearSearchFormMode==="reset"){form.resetForm()}else{$("input[type='radio']").removeAttr("checked")}},updateDetailPagination:function(rowPos,totalElements){return this.each(function(){$("#rup_maint_selectedElements_"+this.prop.name).text($.jgrid.format($.rup.i18nParse($.rup.i18n.base,"rup_grid.defaults.detailForm_pager"),rowPos,totalElements));if(rowPos===totalElements){$("#last_"+this.prop.name+", #forward_"+this.prop.name,this.prop.detailDiv).addClass("ui-state-disabled");if(rowPos===1){$("#first_"+this.prop.name+", #back_"+this.prop.name,this.prop.detailDiv).addClass("ui-state-disabled")}else{$("#first_"+this.prop.name+", #back_"+this.prop.name,this.prop.detailDiv).removeClass("ui-state-disabled")}}else{if(rowPos===1&&totalElements>1){$("#first_"+this.prop.name+", #back_"+this.prop.name,this.prop.detailDiv).addClass("ui-state-disabled");$("#last_"+this.prop.name+", #forward_"+this.prop.name,this.prop.detailDiv).removeClass("ui-state-disabled")}else{$("#last_"+this.prop.name+", #forward_"+this.prop.name,this.prop.detailDiv).removeClass("ui-state-disabled");$("#first_"+this.prop.name+", #back_"+this.prop.name,this.prop.detailDiv).removeClass("ui-state-disabled")}}})},loadDetailFromServer:function(id,detailForm){var self=this;return this.each(function(){var mnt=this,t=this.prop.jQueryGrid.rup_grid("getDataIDs"),detailURL,parentColPks,parent,parentSelectedRow,page=this.prop.jQueryGrid.rup_grid("getGridParam","page");detailURL=self._getDetailUrl(id);$.rup_ajax({url:detailURL,dataType:"json",type:"GET",async:false,contentType:"application/json",success:function(xhr,ajaxOptions){var detailIndex,page=mnt.prop.jQueryGrid.rup_grid("getGridParam","page"),totalRows,rowsXpage,totalElements,xhrArray,objSerializedForm;detailIndex=self._getCurrentDetailIndex(id);self.rup_maint("updateDetailPagination",detailIndex.current,detailIndex.total);if(xhr.id&&xhr.id instanceof Object){if(xhr.id instanceof Object){xhr.JPA_ID=xhr.id;delete xhr.id}}xhrArray=$.rup_utils.jsontoarray(xhr);$.rup_utils.populateForm(xhrArray,mnt.prop.detailForm);if($.isFunction(mnt.prop.onbeforeDetailShow)){mnt.prop.onbeforeDetailShow.call(mnt,mnt.prop.detailDiv,xhr,ajaxOptions)}objSerializedForm=$.map(self._getDataForFormModifications(mnt.prop.detailForm),function(elem,i){if(xhrArray[elem.name]){return{name:elem.name,value:(xhrArray[elem.name]!==null?xhrArray[elem.name]:"")}}else{return{name:elem.name,value:(elem.value!==null?elem.value:"")}}});mnt.prop.detailForm.data("initialData",$.param(objSerializedForm));if(!mnt.prop.detailDiv.rup_dialog("isOpen")){mnt.prop.detailDiv.rup_dialog("open")}if($.isFunction(mnt.prop.onafterDetailShow)){mnt.prop.onafterDetailShow.call(mnt,mnt.prop.detailDiv,xhr,ajaxOptions)}$("input:not([readonly]):not(:disabled):visible,.ui-selectmenu:not(.ui-state-disabled):visible",mnt.prop.detailForm).first().focus();return false},error:function(xhr,ajaxOptions,thrownError){mnt.prop.feedback.rup_feedback("option","delay",null);mnt.prop.feedback.rup_feedback("set",xhr.responseText,"error");mnt.prop.feedback.rup_feedback("option","delay",defaultDelay)}})})},onBeforeEdit:function(rowN){var self=this,ret,rowColModel,mntName=$.data(this,"maintName"),relatedGrid=$(this),firstInput;$("#"+mntName)[0].prop.toolbar.self.enableButton("cancel");$("#"+mntName)[0].prop.toolbar.self.disableButton("new");$("#"+mntName)[0].prop.toolbar.self.disableButton("filter");if($.isFunction($("#"+mntName)[0].prop.onbeforeDetailShow)){ret=$("#"+mntName)[0].prop.onbeforeDetailShow.call(this,rowN)}if(ret){return false}firstInput=$("[id='"+rowN+"']",relatedGrid);rowColModel=relatedGrid.rup_grid("getColModel");for(var i=0;i<rowColModel.length;i++){if(rowColModel[i].editable){var rupType=rowColModel[i].rupType,elc=$("[id='"+rowN+"_"+rowColModel[i].name+"']"),editoptions=rowColModel[i].editoptions;if(relatedGrid.rup_grid("isEditable")){elc.parent().removeClass("ui-ellipsis")}if(rupType){if(rupType==="datepicker"){elc.rup_date(rowColModel[i].editoptions);if(relatedGrid.rup_grid("isEditable")){elc.parent().find("img.ui-datepicker-trigger").remove()}}else{if(rupType==="numeric"){elc.numeric(",")}else{if(rupType==="integer"){elc.numeric(false)}else{if(editoptions&&editoptions.i18nId===undefined){rowColModel[i].i18nId=relatedGrid.attr("id")+"##"+rowColModel[i].name}$.rup["rup_combo_"+elc.attr("id")]={index:i,rowN:rowN,rupType:rowColModel[i].rupType,name:rowColModel[i].name};if(rupType==="combo"){editoptions=$.extend(editoptions,{width:"auto",menuWidth:elc.width()});editoptions.onLoadSuccess=function(combo){if(typeof combo==="object"){var data=$.rup["rup_combo_"+combo.attr("id")];if(relatedGrid.data("Collection_rup_combo")!==undefined){combo["rup_"+data.rupType]("setRupValue",relatedGrid.data("Collection_rup_combo")[data.rowN][data.name]["value"])}combo.attr("rup_combo_col_position",data.index);$("#gview_"+relatedGrid.attr("id")).append($("#"+relatedGrid.attr("id")+" ul.rup_combo").attr("rup_combo_col_position",data.index));$("#"+relatedGrid.attr("id")+" a.rup_combo[id='"+combo.attr("id")+"-button']").attr("rup_combo_col_position",data.index);delete $.rup["rup_combo_"+combo.attr("id")]}}}elc["rup_"+rowColModel[i].rupType](editoptions);if(rupType==="date"){elc["rup_"+rowColModel[i].rupType]("setRupValue",elc.val());if(relatedGrid.rup_grid("isEditable")){elc.parent().find("img.ui-datepicker-trigger").remove()}}else{if(rupType!=="combo"){elc["rup_"+rowColModel[i].rupType]("setRupValue",elc.val())}}}}}}if($.rup.browser.isIE&&rowColModel[i+1]!==undefined){if(rowColModel[i+1].rupType==="combo"){elc.width(elc.width()-0.01)}}}}$(".validableElem").live("change",function(){var data=[],elem=this;data.push({name:"property",value:this.name});data.push({name:"bean",value:$("#"+mntName)[0].prop.modelObject});data.push({name:"value",value:$(this).val()});$.rup_ajax({url:$("#"+mntName)[0].prop.validationUrl,dataType:"json",type:"POST",data:data,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(xhr,ajaxOptions){$("#"+mntName)[0].prop.feedback.rup_feedback("close")},error:function(xhr,ajaxOptions,thrownError){var errorTXT=$.rup.i18nParse($.rup.i18n.base,"rup_maint.validateError"),errors=null,errorKey=null,causedErrors=null,errMsg="",errorMesg="";if(xhr.responseText!==null&&xhr.responseText!==""){if(xhr.status===406){$(mant).rup_maint("showFieldValidationErrors",xhr)}else{$("#"+mntName)[0].prop.feedback.rup_feedback("option","delay",null);$("#"+mntName)[0].prop.feedback.rup_feedback("set",errorTXT,"error");$("#"+mntName)[0].prop.feedback.rup_feedback("option","delay",defaultDelay)}}}})});function manageTabKeyPageChange(relatedGrid,newPage){var dataIds=relatedGrid.rup_grid("getDataIDs");relatedGrid[0].p.ajaxGridOptions={async:false};relatedGrid.rup_grid("setGridParam",{page:parseFloat(newPage)});relatedGrid.rup_grid("reloadGrid");relatedGrid[0].p.ajaxGridOptions={async:true}}function manageTabKey(relatedGrid,event){var rowNumber,dataIds,rowID,lastPage,numPag;if(event.keyCode==9){if($(this).hasClass("hasDatepicker")){$(this).datepicker("hide")}$("#"+mntName).rup_maint("saveMaint",null,rowN,function(){rowNumber=Number(relatedGrid.rup_grid("getInd",rowN,false))-1;dataIds=relatedGrid.rup_grid("getDataIDs");page=Number(relatedGrid.rup_grid("getGridParam","page"));if(!event.shiftKey){rowId=dataIds[rowNumber+1];if(rowNumber==dataIds.length-1){lastPage=Number(relatedGrid.rup_grid("getGridParam","lastpage"));if(parseFloat(page)+1<=lastPage){manageTabKeyPageChange(relatedGrid,page+1);dataIds=relatedGrid.rup_grid("getDataIDs");rowId=dataIds[0]}else{return false}}}else{rowId=dataIds[rowNumber-1];if(rowNumber==0){page=Number(relatedGrid.rup_grid("getGridParam","page"));if(parseFloat(page)>1){manageTabKeyPageChange(relatedGrid,page-1);dataIds=relatedGrid.rup_grid("getDataIDs");rowId=dataIds[dataIds.length-1]}else{return false}}}if($("#"+mntName)[0].prop.MODO==="new"){if(!event.shiftKey){$("#"+mntName).rup_maint("newElement");$("tr.addElement:first .editable:first",relatedGrid).focus()}}else{var rowColmodel=$("#"+mntName)[0].prop.jQueryGrid.rup_grid("getColModel");if(!event.shiftKey){for(var i=0;i<rowColmodel.length;i=i+1){if(rowColmodel[i].editable===true&&rowColmodel[i].hidden!==true){$("#"+mntName)[0].prop.selectedCell=i;break}}}else{for(var i=rowColmodel.length-1;i>=0;i=i-1){if(rowColmodel[i].editable===true&&rowColmodel[i].hidden!==true){$("#"+mntName)[0].prop.selectedCell=i;break}}}$("#"+mntName).rup_maint("editElement",rowId);$("#"+rowId+"_"+rowColModel[$("#"+mntName)[0].prop.selectedCell].name,relatedGrid).focus();$("#"+mntName)[0].prop.jQueryGrid.rup_grid("setSelection",rowId,false)}return false});return false}return true}var lastColName=rowColModel[rowColModel.length-1].name;var firstColName=rowColModel[0].name;$("input[name='"+lastColName+"']",relatedGrid).bind("keydown",function(event){if(event.keyCode==9){if(!event.shiftKey){return manageTabKey(relatedGrid,event)}}});$("input[name='"+firstColName+"']",relatedGrid).bind("keydown",function(event){if(event.keyCode==9){if(event.shiftKey){return manageTabKey(relatedGrid,event)}}})},saveEditableError:function(){},saveEditableSucces:function(){},saveEditable:function(){$(this).rup_maint("saveMaint")},restore:function(){var maint=$("#"+$.data(this,"maintName"));maint[0].prop.toolbar.self.disableButton("cancel");maint[0].prop.toolbar.self.enableButton("new");maint[0].prop.toolbar.self.enableButton("filter");maint.data("initialData",null);maint[0].prop.feedback.rup_feedback("close");if(maint[0].prop.MODO==="new"){maint[0].prop.jQueryGrid.rup_grid("delRowData",maint[0].prop.jQueryGrid.rup_grid("getGridParam","selrow"))}},aftersavefunc:function(rowid,res){if(res){var maint=$("#"+$.data(this,"maintName"));maint.rup_maint("saveMaint",null,rowid)}},checkOutOfGrid:function(evt,obj){var maint=this;if(evt.target.id===""){if(evt.target.className!==""&&$("#gbox_"+maint[0].prop.jQueryGrid[0].id).find("."+evt.target.className).length>0){return false}else{if(this[0].prop.toolbar.self!==null&&$(evt.target).find(".rup-maint_cancel").length>0){return false}}}else{if($("#gbox_"+maint[0].prop.jQueryGrid[0].id).find("#"+evt.target.id).length>0){return false}}if(maint[0].prop.jQueryGrid.rup_grid("isEditable")){if(maint[0].prop.jQueryGrid.rup_grid("isEditing")){maint[0].prop.toolbar.self.disableButton("cancel");maint[0].prop.toolbar.self.enableButton("new");maint[0].prop.toolbar.self.enableButton("filter");this.rup_maint("saveMaint",null,maint[0].prop.lastsel,function(){maint[0].prop.lastsel=null});return false}}},editElement:function(id,noChangeMode){var self=this;var self=this;if(self[0].prop.isLazyCreationDone===false){self.rup_maint("defineDetailForm");self.rup_maint("defineValidationConfig");if($.isFunction(self[0].prop.onAfterLazyDetailLoad)){self[0].prop.onAfterLazyDetailLoad.call()}self[0].prop.isLazyCreationDone=true}function inlineEditKeyEvents(rowId,elem,relatedGrid,mant){$(elem).unbind("keydown").bind("keydown",function(e){if(e.keyCode===27){self.rup_maint("cancelEditing")}if(e.keyCode===13){var ta=e.target;if(ta.tagName=="TEXTAREA"){return true}$(mant).rup_maint("saveMaint",null,id,function(){mant.prop.lastsel=null;mant.prop.toolbar.self.disableButton("cancel");mant.prop.toolbar.self.enableButton("new");mant.prop.toolbar.self.enableButton("filter")});return false}e.stopPropagation()})}return this.each(function(m,a){if(id!==null){var rowPos,page,totalRows,rowsXpage,totalElements,mant=this,mnt=$(this),relatedGrid=this.prop.jQueryGrid,lastsel=this.prop.lastsel;if(relatedGrid.rup_grid("isEditable")){if(!self._checkValidRowId_editline(id)){return false}$("#gbox_"+relatedGrid[0].id).parent().bind("mousedown",function(event){mnt.rup_maint("checkOutOfGrid",event,this)});this.prop.searchForm.parent().bind("mousedown",function(event){mnt.rup_maint("checkOutOfGrid",event,this)});if(this.prop.lastsel!==null){if(mnt.data("initialData")===null){if(!noChangeMode){this.prop.MODO="edit"}relatedGrid.rup_grid("editRow",id,true,rup_maint.onBeforeEdit,rup_maint.saveEditable,"clientArray",null,rup_maint.aftersavefunc,null,rup_maint.restore);var ind=relatedGrid.rup_grid("getInd",id,true);inlineEditKeyEvents(id,ind,relatedGrid,mant);mnt.data("initialData",$.toJSON(relatedGrid.rup_grid("getEditingRowData",id)));if(this.prop.MODO==="edit"){relatedGrid.rup_grid("setSelection",id,false)}this.prop.lastsel=id;if($.isFunction(this.prop.onafterDetailShow)){this.prop.onafterDetailShow.call(this,id)}return false}else{$(this).rup_maint("saveMaint",null,this.prop.lastsel,function(){if(!noChangeMode){mant.prop.MODO="edit"}relatedGrid.rup_grid("editRow",id,true,rup_maint.onBeforeEdit,rup_maint.saveEditable,"clientArray",null,rup_maint.aftersavefunc,null,rup_maint.restore);var ind=relatedGrid.rup_grid("getInd",id,true);inlineEditKeyEvents(id,ind,relatedGrid,mant);mnt.data("initialData",$.toJSON(relatedGrid.rup_grid("getEditingRowData",id)));mant.prop.lastsel=id;return false},function(){relatedGrid.rup_grid("setSelection",lastsel,null);mant.prop.lastsel=lastsel;return false});return false}}if(!noChangeMode){this.prop.MODO="edit"}relatedGrid.rup_grid("editRow",id,true,rup_maint.onBeforeEdit,rup_maint.saveEditable,"clientArray",null,rup_maint.aftersavefunc,null,rup_maint.restore);var ind=relatedGrid.rup_grid("getInd",id,true);inlineEditKeyEvents(id,ind,relatedGrid,mant);mnt.data("initialData",$.toJSON(relatedGrid.rup_grid("getEditingRowData",id)));this.prop.lastsel=id;if($.isFunction(this.prop.onafterDetailShow)){this.prop.onafterDetailShow.call(this,id)}}else{$("#"+this.prop.detailDiv[0].id+" .rup-maint_validateIcon").remove();var errorClass=this.prop.detailForm.data("validator").settings.errorClass;$("."+errorClass,this.prop.detailForm).removeClass(errorClass);this.prop.detailFeedback.rup_feedback("close");if(this.prop.detailServer||relatedGrid.rup_grid("isMultiselect")){$(this).rup_maint("loadDetailFromServer",id,this.prop.detailForm);return false}else{page=relatedGrid.rup_grid("getGridParam","page");totalElements=relatedGrid.rup_grid("getGridParam","records");rowsXpage=relatedGrid.rup_grid("getGridParam","rowNum");var rowNumber=Number(relatedGrid.rup_grid("getInd",rowN,false))-1;rowPos=((parseInt(page)*parseInt(rowsXpage))-parseInt(rowsXpage))+rowNumber;$(this).rup_maint("updateDetailPagination",rowPos,totalElements);if($.isFunction(this.prop.onbeforeDetailShow)){this.prop.onbeforeDetailShow.call(this,this.prop.detailDiv)}relatedGrid.rup_grid("GridToForm",id,this.prop.detailForm);this.prop.detailDiv.rup_dialog("open");$("input:not([readonly]):not(:disabled):visible,.ui-selectmenu:not(.ui-state-disabled):visible",this.prop.detailForm).first().focus()}}}else{alert($.rup.i18nParse($.rup.i18n.base,"rup_grid.nav.alerttext"))}})},deleteElement:function(id){return this.each(function(){var maintID="",rowData=null,mnt=null,lng="",i=0,arrayPK,url=null,pks=[],jsonData=null,detailPks=[],rows,intNewPage;mnt=this;if(this.prop.jQueryGrid.rup_grid("isMultiselect")){if(this.prop.selectedRows.length<=0&&this.prop.jQueryGrid[0].rup_gridProps.allPksArray.length<=0){$.rup_messages("msgAlert",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.noReg"),title:$.rup.i18nParse($.rup.i18n.base,"rup_maint.titleDelAll")})}else{$.rup_messages("msgConfirm",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.deleteAll"),title:$.rup.i18nParse($.rup.i18n.base,"rup_maint.titleDelAll"),OKFunction:function(){if($.data(mnt.prop.jQueryGrid[0],"allSelected")!==null&&$.data(mnt.prop.jQueryGrid[0],"allSelected")!==undefined){for(var i=0;i<mnt.prop.jQueryGrid[0].rup_gridProps.allPksArray.length;i++){if(mnt.prop.primaryKey.indexOf(";")>0){arrayPK=mnt.prop.jQueryGrid[0].rup_gridProps.allPksArray[i].substring(1).split("/");lng=arrayPK.length;for(var k=0;k<lng;k++){detailPks.push(arrayPK[k])}}else{detailPks.push(mnt.prop.jQueryGrid[0].rup_gridProps.allPksArray[i].substring(1))}pks.push(detailPks);detailPks=[]}}else{for(i=0;i<mnt.prop.selectedRows.length;i++){var selectedRows=mnt.prop.selectedRows;var selectedPage=selectedRows[i];var selectedLines=selectedRows["p_"+selectedPage];for(var j=0;j<selectedLines.length;j++){var selectedLine=selectedLines[j];var pk=selectedLines["l_"+selectedLine][0];if(mnt.prop.primaryKey.indexOf(";")>0){arrayPK=pk.split("/");lng=arrayPK.length;for(var k=0;k<lng;k++){detailPks.push(arrayPK[k])}}else{detailPks.push(pk)}pks.push(detailPks);detailPks=[]}}}url=mnt.prop.jQueryGrid[0].rup_gridProps.url+"/deleteAll";jsonData=$.toJSON(pks);$.rup_ajax({url:url,data:jsonData,async:false,type:"POST",contentType:"application/json",success:function(xhr,ajaxOptions){mnt.prop.selectedRows=[];mnt.prop.selectedRowsCont=0;mnt.prop.jQueryGrid[0].rup_gridProps.allPksArray=[];mnt.prop.jQueryGrid.rup_grid("reloadGrid");rows=mnt.prop.jQueryGrid.rup_grid("getGridParam","reccount");mnt.prop.jQueryGrid.rup_grid("resetSelection");$.data(mnt.prop.jQueryGrid[0],"allSelected",null);$.data(mnt.prop.jQueryGrid[0],"deSelectedPages",[]);if(rows===0){intNewPage=mnt.prop.jQueryGrid.rup_grid("getGridParam","page")-1;mnt.prop.jQueryGrid.rup_grid("setGridParam",{page:intNewPage});mnt.prop.jQueryGrid.rup_grid("reloadGrid")}if(mnt.prop.showMessages){mnt.prop.feedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.deletedOK"),"ok")}mnt.prop.jQueryGrid.rup_grid("reloadGrid")},error:function(xhr,ajaxOptions,thrownError){mnt.prop.feedback.rup_feedback("option","delay",null);mnt.prop.feedback.rup_feedback("set",xhr.responseText,"error");mnt.prop.feedback.rup_feedback("option","delay",defaultDelay)}})}})}return false}else{if(mnt.prop.jQueryGrid.rup_grid("getGridParam","selrow")===null){$.rup_messages("msgAlert",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.noReg"),title:$.rup.i18nParse($.rup.i18n.base,"rup_maint.titleDelAll")})}else{$.rup_messages("msgConfirm",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.deleteAll"),title:$.rup.i18nParse($.rup.i18n.base,"rup_maint.titleDelAll"),OKFunction:function(){if(mnt.prop.jQueryGrid.rup_grid("isEditable")){if(mnt.prop.jQueryGrid.rup_grid("isEditing")){if(mnt.prop.MODO==="new"){$(mnt).rup_maint("cancelEditing",mnt);return false}mnt.prop.jQueryGrid.rup_grid("restoreRow",id)}}rowData=mnt.prop.jQueryGrid.getRowData(id);if(rowData!==null){if(mnt.prop.primaryKey.indexOf(";")>0){arrayPK=mnt.prop.primaryKey.split(";");lng=arrayPK.length;for(i=0;i<lng;i++){maintID=maintID+"/"+rowData[arrayPK[i]]}}else{maintID="/"+rowData[mnt.prop.primaryKey]}url=mnt.prop.jQueryGrid[0].rup_gridProps.url+maintID}else{return false}$.rup_ajax({url:url,data:jsonData,async:false,type:"DELETE",contentType:"application/json",success:function(xhr,ajaxOptions){rows=mnt.prop.jQueryGrid.rup_grid("getGridParam","reccount");var delOK=mnt.prop.jQueryGrid.rup_grid("delRowData",id);if(mnt.prop.showMessages){mnt.prop.feedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.deletedOK"),"ok")}if(mnt.prop.jQueryGrid.rup_grid("getDataIDs").length>0){mnt.prop.jQueryGrid.rup_grid("setSelection",mnt.prop.jQueryGrid.rup_grid("getDataIDs")[0],false)}mnt.prop.jQueryGrid.rup_grid("resetSelection");$.data(mnt.prop.jQueryGrid[0],"allSelected",null);$.data(mnt.prop.jQueryGrid[0],"deSelectedPages",[]);if(mnt.prop.jQueryGrid.rup_grid("isEditable")){mnt.prop.toolbar.self.disableButton("cancel");mnt.prop.toolbar.self.enableButton("new");mnt.prop.toolbar.self.enableButton("filter")}mnt.prop.lastsel=null;if(rows===1){intNewPage=mnt.prop.jQueryGrid.rup_grid("getGridParam","page")-1;mnt.prop.jQueryGrid.rup_grid("setGridParam",{page:intNewPage})}mnt.prop.jQueryGrid.rup_grid("reloadGrid")},error:function(xhr,ajaxOptions,thrownError){mnt.prop.feedback.rup_feedback("option","delay",null);mnt.prop.feedback.rup_feedback("set",xhr.responseText,"error");mnt.prop.feedback.rup_feedback("option","delay",defaultDelay)}})}})}}})},saveMaint:function(saveAndRepeat,rowId,aftersavefunc,aftererrorfunc){var self=this;return this.each(function(){var mant=this,id=null,dt,parent,parentColPks,parentSelectedRow,parentPKObject={},aux,rowValues;if(mant.prop.jQueryGrid.rup_grid("isEditable")){if(rowId==null){rowId=mant.prop.jQueryGrid.rup_grid("getSelectedRows")[0]}dt=form2object(mant.prop.jQueryGrid.rup_grid("getInd",rowId,true),null,false)}else{dt=form2object(mant.prop.detailForm[0],null,false)}if(dt.JPA_ID instanceof Object){dt.id=dt.JPA_ID;delete dt.JPA_ID}if(mant.prop.parent!==null){parent=$("#"+mant.prop.parent);parentColPks=parent.rup_maint("getPrimaryKey").split(";");parentSelectedRow=parent[0].prop.jQueryGrid.rup_grid("getSelectedRows")[0];if(parentColPks.length>1){for(var i=0;i<parentColPks.length;i++){parentPKObject[$.rup_utils.firstCharToLowerCase(parent[0].prop.modelObject)][parentColPks[i]]=parent[0].prop.jQueryGrid.rup_grid("getCol",parentSelectedRow,parentColPks[i])}}else{parentPKObject[$.rup_utils.firstCharToLowerCase(parent[0].prop.modelObject)]={};parentPKObject[$.rup_utils.firstCharToLowerCase(parent[0].prop.modelObject)][parentColPks[0]]=parent[0].prop.jQueryGrid.rup_grid("getCol",parentSelectedRow,parentColPks[0])}$.extend(true,dt,parentPKObject)}var init=eval("("+$(mant).data("initialData")+")");var validationErrors=[];validationErrors.push({key:mant.prop.modelObject});if(!mant.prop.detailForm.validate().checkForm()){validationErrors.push(mant.prop.detailForm.validate().errorMap);$(mant).rup_maint("showFieldValidationErrors",$.toJSON(validationErrors));if(aftererrorfunc){aftererrorfunc.call()}return false}if((mant.prop.jQueryGrid.rup_grid("isEditable")&&!$.rup_utils.compareObjects(init,dt))||(!mant.prop.jQueryGrid.rup_grid("isEditable")&&(mant.prop.detailForm&&$.param(self._getDataForFormModifications(mant.prop.detailForm))!==mant.prop.detailForm.data("initialData")))){dt=$.toJSON(dt);dt=dt.split("null").join("");var errores=false;mant.prop.detailForm.rup_form("ajaxFormSubmit",{url:$.rup_utils.setNoPortalParam(mant.prop.jQueryGrid[0].rup_gridProps.url),dataType:"json",type:(mant.prop.MODO==="new"?"POST":"PUT"),beforeSubmit:function(arr,$form,options){var data={},fileInputs=$("input:file",$form),hasFileInputs=fileInputs.length>0,httpMethod;if(!hasFileInputs){options.contentType="application/json";arr=dt}else{if($.rup.browser.isIE||options.iframe===true){httpMethod=options.type;if($.inArray(httpMethod.toUpperCase(),$.rup.IFRAME_ONLY_SUPPORTED_METHODS)===-1){options.extraData=$.extend({},options.extraData,{_method:httpMethod.toUpperCase()})}options.extraData=$.extend({},options.extraData,{_emulate_iframe_http_status:"true"});options.url=options.url+(options.url.match("\\?")===null?"?":"&")+"_emulate_iframe_http_status=true";var error_user=options.error;options.error=function(xhr,textStatus,errorThrown){var errorText=$.rup.rupAjaxDefaultError(xhr,textStatus,errorThrown);if(error_user!=null){$(error_user(xhr,textStatus,errorThrown))}else{if(errorText){$.rup.showErrorToUser(errorText)}}}}$.each(arr,function(i,elem){var field=$("[name='"+elem.name+"'][ruptype]",$form);if(field.length===1){elem.value=field["rup_"+field.attr("ruptype")]("getRupValue")}data[elem.name]=elem.value});arr=data}},success:function(xhr,ajaxOptions){return self._saveMaintSuccess(xhr,ajaxOptions,saveAndRepeat,rowId,aftersavefunc)},error:function(xhr,ajaxOptions,thrownError){return self._saveMaintError(xhr,ajaxOptions,thrownError,rowId,aftererrorfunc)},beforeSend:function(xhr,settings){if(settings.contentType.indexOf("application/json")!==-1){settings.data=dt}if(mant.prop.validationFilter){xhr.setRequestHeader("validation","true")}xhr.setRequestHeader("bean",mant.prop.modelObject);xhr.setRequestHeader("rup_maint_mode",(mant.prop.MODO==="new"?"add":"edit"));return"skip"}});return errores}else{if(mant.prop.jQueryGrid.rup_grid("isEditable")&&dt===$(mant).data("initialData")){$(mant).data("initialData",null)}if(!mant.prop.jQueryGrid.rup_grid("isEditable")){if(!saveAndRepeat){if(!mant.prop.detailFeedback.is(":visible")){mant.prop.detailDiv.rup_dialog("close")}}else{if(!mant.prop.detailFeedback.is(":visible")){mant.prop.detailFeedback.rup_feedback("option","delay",null);mant.prop.detailFeedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.emptyChanges"),"alert");mant.prop.detailFeedback.rup_feedback("option","delay",defaultDelay)}}}else{if(mant.prop.MODO==="new"){mant.prop.jQueryGrid.rup_grid("delRowData",mant.prop.lastsel)}else{mant.prop.jQueryGrid.rup_grid("restoreRow",mant.prop.lastsel);mant.prop.lastsel=null;$(mant).rup_maint("ellipsisRestoreOnEdit")}}if(aftersavefunc){aftersavefunc.call()}if(!mant.prop.jQueryGrid.rup_grid("isEditable")){$(mant).data("initialData",null)}}})},getPrimaryKey:function(){return this[0].prop.primaryKey},clearSearchCriteria:function(){var $self=this,prop=$self[0].prop;$("#titleSearch_"+prop.name).text($.rup.i18nParse($.rup.i18n.base,"rup_maint.searchOptions")).removeClass("rup-maint_searchCriteria ");$("#titleSearch_"+prop.name).rup_tooltip("destroy")},showSearchCriteria:function(){var $self=this,prop=$self[0].prop,searchString=" ",temp="",aux,searchForm,field,fieldId,fieldName,fieldValue,filterMulticombo=new Array();aux=prop.searchForm.serializeArray();searchForm=prop.searchForm;for(var i=0;i<aux.length;i++){if(aux[i].value!==""){field=$("[name='"+aux[i].name+"']",searchForm);if($.inArray(field.attr("id"),prop.filterExclude)!==-1){continue}if(field.length>1){field=$("[name='"+aux[i].name+"']:checked",searchForm)}if($(field).attr("type")==="hidden"){continue}fieldId=$(field).attr("id");if($(field).attr("ruptype")==="combo"){if(field.next(".ui-multiselect").length==0){fieldId+="-button"}}if($(field).attr("ruptype")==="autocomplete"){fieldId=fieldId.substring(0,fieldId.indexOf("_label"))}label=$("label[for^='"+fieldId+"']",searchForm);if(label.length>0){fieldName=label.html()}else{if($(field).attr("ruptype")!=="combo"){fieldName=$("[name='"+aux[i].name+"']",searchForm).prev("div").find("label").first().html()}else{fieldName=$("[name='"+aux[i].name+"']",searchForm).parent().prev("div").find("label").first().html()}}if(fieldName===null||fieldName===undefined){fieldName=""}fieldValue=" = ";switch($(field)[0].tagName){case"INPUT":fieldValue=fieldValue+$(field).val();if($(field)[0].type==="checkbox"||$(field)[0].type==="radio"){fieldValue=""}break;case"SELECT":if(field.next(".ui-multiselect").length==0){fieldValue=fieldValue+$("option[value='"+aux[i].value+"']",field).html()}else{if($.inArray($(field).attr("id"),filterMulticombo)===-1){numSelected=field.rup_combo("value").length;if(numSelected!==0){fieldValue+=numSelected}else{fieldName="";fieldValue=""}filterMulticombo.push($(field).attr("id"))}else{fieldName="";fieldValue=""}}break}var parseableChars=new Array(":","=");for(var j=0;j<parseableChars.length;j++){if(fieldName!==""&&fieldName.indexOf(parseableChars[j])!==-1){fieldName=fieldName.substring(0,fieldName.indexOf(parseableChars[j]));break}}while(fieldValue.indexOf("&amp;nbsp;")!==-1){fieldValue=fieldValue.replace("&amp;nbsp;","")}if(fieldName===""&&fieldValue.indexOf(" = ")!==-1){fieldValue=fieldValue.substring(2,fieldValue.length)}if(fieldName===""&&$.trim(fieldValue)===""){continue}searchString=searchString+fieldName+fieldValue+", "}}if(searchString.length>1){searchString=searchString.substring(0,searchString.length-2);var initialHeight=$("#titleSearch_"+prop.name).css("height"),height,tmp=searchString,tooltip=false;while(true){$("#titleSearch_"+prop.name).html($.rup.i18nParse($.rup.i18n.base,"rup_maint.searchOptions")+"<i>"+tmp+"</i>");height=$("#titleSearch_"+prop.name).css("height");if(height===initialHeight){break}tmp=tmp.substring(0,tmp.lastIndexOf(","))+" <b>...</b>";tooltip=true}if(tooltip){$("#titleSearch_"+prop.name).rup_tooltip({content:{text:searchString.substring(1)},position:{my:"bottom center",at:"top center"}})}}},toggleSearchForm:function(capa,filterCriteriaLoad){return this.each(function(){if(this.prop.searchForm===null){return false}else{var searchString=" ",temp="",aux,searchForm,field,fieldId,fieldName,fieldValue;if($("#"+capa).is(":hidden")&&filterCriteriaLoad===undefined){$("#"+capa).show({duration:"slow",effect:"blind"});$("#titleSearch_"+this.prop.name).removeClass("rup-maint_searchCriteria");$("input:first",this.prop.searchForm).focus()}else{$("#"+capa).hide({duration:"slow",effect:"blind"});$("#titleSearch_"+this.prop.name).addClass("rup-maint_searchCriteria")}this.prop.toolbar.self.tooglePressButton("filter","rup-maint_filter_pressed")}})},search:function(page){return this.each(function(){var prop=this.prop,realizarBusqueda=true;prop.feedback.rup_feedback("close");if(prop.jQueryGrid.rup_grid("isMultiselect")){prop.jQueryGrid.rup_grid("resetSelection");$.data(prop.jQueryGrid[0],"allSelected",null);$.data(prop.jQueryGrid[0],"deSelectedPages",[])}prop.jQueryGrid.rup_grid("setGridParam",{url:$.rup_utils.setNoPortalParam(prop.jQueryGrid[0].rup_gridProps.url),datatype:"json",mtype:"GET",page:(page?page:"rup")});if(prop.parent){var parent=$("#"+prop.parent),colPks=parent.rup_maint("getPrimaryKey").split(";"),row=parent[0].prop.jQueryGrid.rup_grid("getSelectedRows")[0];for(var i=0;i<colPks.length;i++){if(parent[0].prop.jQueryGrid.rup_grid("getCol",row,colPks[i])===false){realizarBusqueda=false}}}if(realizarBusqueda){$(this).rup_maint("showSearchCriteria");this.prop.jQueryGrid.rup_grid("reloadGrid")}})},toggleGrid:function(){return this.each(function(){if($("#gbox_"+this.prop.jQueryGrid[0].id).is(":hidden")){$("#gbox_"+this.prop.jQueryGrid[0].id).slideDown("fast")}else{$("#gbox_"+this.prop.jQueryGrid[0].id).slideUp("fast")}})},cleanSearchForm:function(){return this.each(function(){$(this).rup_maint("resetForm",this.prop.searchForm);$(this).rup_maint("clearSearchCriteria");if(this.prop.jQueryGrid[0].rup_gridProps.loadOnStartUp){this.prop.jQueryGrid.rup_grid("setGridParam",{url:this.prop.jQueryGrid[0].rup_gridProps.url,page:"rup"});if(this.prop.jQueryGrid.rup_grid("isMultiselect")){this.prop.jQueryGrid.rup_grid("resetSelection");$.data(this.prop.jQueryGrid[0],"allSelected",null);$.data(this.prop.jQueryGrid[0],"deSelectedPages",[])}this.prop.jQueryGrid.rup_grid("setGridParam",{url:$.rup_utils.setNoPortalParam(this.prop.jQueryGrid[0].rup_gridProps.url)});this.prop.jQueryGrid.rup_grid("reloadGrid")}else{if(this.prop.jQueryGrid.rup_grid("getDataIDs").length>0){this.prop.jQueryGrid.rup_grid("clearGridData")}}})},getMode:function(){return this[0].prop.MODO},isEditing:function(){return(this[0].prop.MODO==="edit"?true:false)},isAdding:function(){return(this[0].prop.MODO==="new"?true:false)},getToolbarObject:function(){return(this[0].prop.toolbar.self)},getAddBootonDefaultFunction:function(){return(this[0].prop.toolbar.defaultFunctionAddButton)},getCancelBootonDefaultFunction:function(){return(this[0].prop.toolbar.defaultFunctionCancelButton)},getEditBootonDefaultFunction:function(){return(this[0].prop.toolbar.defaultFunctionEditButton)},getDeleteBootonDefaultFunction:function(){return(this[0].prop.toolbar.defaultFunctionDeleteButton)},getFilterBootonDefaultFunction:function(){return(this[0].prop.toolbar.defaultFunctionFilterButton)}});$.fn.rup_maint("extend",{addChild:function(maintName){var aChildren=[];if(this.data("_children")!==null&&this.data("_children")!==undefined){aChildren=this.data("_children")}aChildren.push(maintName);this.data("_children",aChildren)},showFieldValidationErrors:function(responseText){return this.each(function(){var mant=this,errorTXT=$.rup.i18nParse($.rup.i18n.base,"rup_maint.validateError"),errors=null,errorKey=null,detailFormName,preMode,errors,causedErrors={};if(typeof responseText==="string"){try{errors=$.parseJSON(responseText)}catch(e){mant.prop.detailForm.validate().settings.feedback.rup_feedback("option","delay",null);mant.prop.detailForm.validate().settings.feedback.rup_feedback("set",responseText,"error");mant.prop.detailForm.validate().settings.feedback.rup_feedback("option","delay",defaultDelay);return}}else{errors=responseText}if(errors.rupErrorFields!==undefined||errors.rupFeedback!==undefined){causedErrors=errors.rupErrorFields}else{if($.isArray(errors)&&errors.length===2){if(jQuery.isPlainObject(errors[1])){causedErrors=errors[1]}else{causedErrors=$.parseJSON(errors[1])}}var newCausedErrors={};$.each(causedErrors,function(index,value){var obj={};if($.isArray(value)){var aux=$.map(value,function(element,index){if(typeof(element)==="object"){return $.map(element,function(value,key){return value})}else{return element}});newCausedErrors[index]=aux}else{newCausedErrors[index]=value}});causedErrors=newCausedErrors}if(causedErrors!==undefined){mant.prop.detailForm.validate().submitted=$.extend(true,mant.prop.detailForm.validate().submitted,causedErrors);mant.prop.detailForm.validate().invalid=causedErrors;mant.prop.detailForm.validate().showErrors(causedErrors)}else{if(errors.rupFeedback!==undefined){mant.prop.detailForm.validate().settings.feedback.rup_feedback("set",$.rup_utils.printMsg(errors.rupFeedback.message),(errors.rupFeedback.imgClass!==undefined?errors.rupFeedback.imgClass:null))}}})},appendRupFieldsData:function(jsonObj){return this.each(function(){var mant=this,colModel,id,label;colModel=mant.prop.jQueryGrid.rup_grid("getColModel");for(var i=0;i<colModel.length;i=i+1){if(colModel[i].formatterOnUpdate){jsonObj[colModel[i].name]=colModel[i].formatterOnUpdate.call($(this),mant.prop.detailForm)}else{if(colModel[i].rupType==="combo"){if(typeof colModel[i].editoptions.source==="string"&&colModel[i].editoptions.sourceParam.label){id=colModel[i].name;label;if(id.indexOf(".")!==-1){label=id.substring(0,id.lastIndexOf("."))}label+="."+colModel[i].editoptions.sourceParam.label;if(!mant.prop.customDetailForm){id="detailForm_"+mant.prop.name+"_"+id.replace(/[.]/g,"_")}else{id=$("[name='"+id+"']",mant.prop.detailForm[0]).attr("id")}jsonObj[label]=$("[id='"+id+"']",mant.prop.detailForm[0]).rup_combo("label")}}}}return this})},_addValidation:function addValidation(detailForm){var self=this,prop=self[0].prop;$(".validableElem",detailForm).die("change");$(".validableElem",detailForm).live("change",function(){var data=[],elem=this;data.push({name:"property",value:this.name});data.push({name:"bean",value:prop.modelObject});data.push({name:"value",value:$(this).val()});$.rup_ajax({url:prop.validationUrl,dataType:"json",type:"POST",data:data,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(xhr,ajaxOptions){var campos=$("#"+prop.detailDiv[0].id+" .rup-maint_validateIcon").parent().find("#shipmentinfo");if(campos.length!=0){campos.parent().find("img.rup-maint_validateIcon").remove()}elem=null;prop.detailFeedback.rup_feedback("close")},error:function(xhr,ajaxOptions,thrownError){var errorTXT=$.rup.i18nParse($.rup.i18n.base,"rup_maint.validateError"),errors=null,errorKey=null,causedErrors=null,errMsg="",errorMesg="";if(xhr.responseText!==null&&xhr.responseText!==""){if(xhr.status===406){self.rup_maint("showFieldValidationErrors",xhr.responseText)}else{prop.detailFeedback.rup_feedback("option","delay",null);prop.detailFeedback.rup_feedback("set",errorTXT,"error");prop.detailFeedback.rup_feedback("option","delay",defaultDelay)}}}})})},_checkDetailFormModifications:function(okCallback){var self=this,prop=self[0].prop;if($.param(self._getDataForFormModifications(prop.detailForm))!==prop.detailForm.data("initialData")){$.rup_messages("msgConfirm",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.saveAndContinue"),title:$.rup.i18nParse($.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){$(this).dialog("destroy").remove();okCallback.call()}})}else{okCallback.call()}},_getDataForFormModifications:function(form){return $.merge(form.serializeArray(),$.map($("input[type='file']",form),function(a,b){return{name:$(a).attr("name"),value:$(a).attr("value")}}))},_checkSelectedElements:function(okCallback){var self=this,prop=self[0].prop,selectedRows=prop.selectedRows,haySeleccionados=false;if(selectedRows){for(var i=0;i<selectedRows.length;i++){if(selectedRows["p_"+(i+1)].length>0){haySeleccionados=true;break}}}if(prop.showMultiselectAlerts&&haySeleccionados){$.rup_messages("msgConfirm",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.checkSelectedElems"),title:$.rup.i18nParse($.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){okCallback.call()}})}else{okCallback.call()}},_checkValidRowId:function(id,invalidCallback){var self=this,prop=self[0].prop,jqGrid=prop.jQueryGrid;if($("#"+id,jqGrid[0]).length===0){if(typeof invalidCallback==="function"){$(invalidCallback(self))}return false}return true},_createData:function createData(detailDiv,detaiBody){var self=this,prop=self[0].prop,jqGrid=prop.jQueryGrid,dtForm=$("<form>").attr("id","detailForm_"+prop.name),obj=jqGrid[0],nm,trdata,dc,elc,frmopt,editoptions;detaiBody.append(dtForm);detailDiv.append(detaiBody);$("#"+prop.name).append(detailDiv);$(obj.p.colModel).each(function(i){dc="";nm=this.name;editoptions=this.editoptions;if(nm!=="cb"&&this.editable===true){var opt=$.extend({},editoptions||{},{id:nm,name:nm});if(!this.edittype){this.edittype="text"}else{if(this.edittype==="hidden"){this.edittype="text";dc="display:none"}}opt.id="detailForm_"+prop.name+"_"+opt.id.replace(/[.]/g,"_");elc=$.jgrid.createEl(this.edittype,opt,"",false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions||{}));$(elc).attr("class","formulario_linea_input");if(prop.validationMode==="individual"&&this.editRules&&this.editRules.validate){$(elc).addClass("validableElem")}trdata=$("<div>").attr("id","rup-maint_detailInput_"+elc.id).addClass("floating_left_pad_right").append("<p>").html("<label for='"+elc.id+"' >"+(typeof this.label==="undefined"?obj.p.colNames[i]:this.label)+"</label>").append("<br>").append(elc).appendTo(dtForm);if(dc!==""){trdata.attr("style",dc)}if(this.rupType){if(this.rupType==="numeric"){$(elc).numeric(",");$(elc).addClass("numeric")}else{if(this.rupType==="integer"){$(elc).numeric(false);$(elc).addClass("integer")}else{if(this.rupType==="datepicker"){$(elc).rup_date(editoptions);$(elc).addClass("datepicker")}else{if(editoptions&&editoptions.i18nId===undefined){editoptions.i18nId=jqGrid.attr("id")+"##"+this.name}if(this.rupType==="combo"){if(editoptions.parent){var prefix="detailForm_"+prop.name+"_";$.each(editoptions.parent,function(index,elem){if(editoptions.parent[index].indexOf(prefix)===-1){editoptions.parent[index]=prefix+editoptions.parent[index].replace(/[.]/g,"_")}})}}$(elc)["rup_"+this.rupType](editoptions)}}}}}});return dtForm},_createDetailForm:function(withUserForm){var self=this,prop=self[0].prop,detailDiv=null,detaiBody="",buttons="",detailFeedBack="",formu=null,capa=self._createDetailNavigation();capa="<div id='pagination_"+prop.name+"' style='float:left;font-size:11px'><img alt='"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.numResult")+"' src='"+prop.imgPath+"/numero_elementos.png'/> <div id='rup_maint_selectedElements_"+prop.name+"' style='float: right; margin-left: 3px; margin-top: 2px; position: relative;'> </div></div>"+capa+"<div style='clear:both'/> </div>";if(withUserForm){detailDiv=prop.detailForm.parent();$("#"+prop.detailForm.attr("id")+" .datepicker").each(function(){$(this).rup_date()});$("#"+prop.detailForm.attr("id")+" .numeric").each(function(){$(this).numeric(",")});$("#"+prop.detailForm.attr("id")+" .integer").each(function(){$(this).numeric(false)});detailFeedBack=$("<div/>").attr("id","rup-feedback_detail_"+prop.name);detailDiv.prepend(detailFeedBack);if($("#pagination_"+prop.name,detailDiv).length===0){detailDiv.prepend(capa)}detailFeedBack.rup_feedback({closeLink:true,gotoTop:false,block:false,delay:defaultDelay,fadeSpeed:500});prop.detailFeedback=detailFeedBack}else{if($("#detailDiv_"+prop.name).length>0){$("#detailDiv_"+prop.name).parent().remove()}detailDiv=$("<div/>").attr("id","detailDiv_"+prop.name).attr("title",$.rup.i18nParse($.rup.i18n.base,"rup_maint.detailTitle")).attr("style","display:none");detaiBody=$("<div/>").attr("id","detailBody").attr("style","padding-top:0.6em;");detailDiv.append(capa);detailFeedBack=$("<div/>").attr("id","rup-feedback_detail_"+prop.name);detaiBody.append(detailFeedBack);detailFeedBack.rup_feedback({closeLink:true,gotoTop:false,block:false,delay:defaultDelay,fadeSpeed:500});prop.detailFeedback=detailFeedBack;formu=self._createData(detailDiv,detaiBody);prop.detailForm=$("#detailForm_"+prop.name).ajaxForm()}self._createNavigationButtons();self[0].prop.detailDiv=detailDiv;self._addValidation(prop.detailForm)},_createDetailNavigation:function(){var self=this,prop=self[0].prop;return"<div id='rup-maint_detailPagination' style='border-bottom:1px solid #D1D1D1'><div id='pag_"+prop.name+"' style='float:right'><a href='#' id='first_"+prop.name+"' alt='"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.first")+"' class='rup-maint_linkPaginacionDetalle'>"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.first")+"</a><a href='#' id='back_"+prop.name+"' alt='"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.previous")+"' class='rup-maint_linkPaginacionDetalle'>"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.previous")+"</a><a href='#' id='forward_"+prop.name+"' alt='"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.next")+"' class='rup-maint_linkPaginacionDetalle'>"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.next")+"</a><a href='#' id='last_"+prop.name+"' alt='"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.last")+"' class='rup-maint_linkPaginacionDetalle'>"+$.rup.i18nParse($.rup.i18n.base,"rup_maint.last")+"</a></div>"},_createNavigationButtons:function(){var self=this,prop=self[0].prop;$("#back_"+prop.name).click(function(e){if($(this).hasClass("ui-state-disabled")){return false}self._checkDetailFormModifications(function(){self._editPreviousElement()})});$("#forward_"+prop.name).click(function(e){if($(this).hasClass("ui-state-disabled")){return false}self._checkDetailFormModifications(function(){self._editNextElement()})});$("#first_"+prop.name).click(function(e){if($(this).hasClass("ui-state-disabled")){return false}self._checkDetailFormModifications(function(){self._editFirstElement()})});$("#last_"+prop.name).click(function(e){if($(this).hasClass("ui-state-disabled")){return false}self._checkDetailFormModifications(function(){self._editLastElement()})})},_createDetailButtons:function(detailDialog){var self=this,prop=self[0].prop,aButtons=null;switch(prop.detailButtons){case $.rup.maint.detailButtons.SAVE_REPEAT:aButtons=[{text:$.rup.i18nParse($.rup.i18n.base,"rup_global.save"),click:function(){self.rup_maint("saveMaint");prop.MODO=null}},{text:$.rup.i18nParse($.rup.i18n.base,"rup_global.save_repeat"),click:function(){self.rup_maint("saveMaint",true)}},{text:$.rup.i18nParse($.rup.i18n.base,"rup_global.cancel"),click:function(){self._checkDetailFormModifications(function(){prop.detailDiv.rup_dialog("close");prop.MODO=null});$("#"+prop.detailDiv[0].id+" .rup-maint_validateIcon").remove();prop.detailFeedback.rup_feedback("close");if(!$(jqGrid).rup_grid("isEditable")&&!$(jqGrid).rup_grid("isMultiselect")&&$(jqGrid).rup_grid("getGridParam","selrow")===null){$(jqGrid).rup_grid("setSelection",$(jqGrid).rup_grid("getDataIDs")[0],false)}return false},btnType:$.rup.dialog.LINK}];break;case $.rup.maint.detailButtons.SAVE:default:aButtons=[{text:$.rup.i18nParse($.rup.i18n.base,"rup_global.save"),click:function(){self.rup_maint("saveMaint")}},{text:$.rup.i18nParse($.rup.i18n.base,"rup_global.cancel"),click:function(){self._checkDetailFormModifications(function(){prop.detailDiv.rup_dialog("close")});$("#"+prop.detailDiv[0].id+" .rup-maint_validateIcon").remove();prop.detailFeedback.rup_feedback("close");if(!$(jqGrid).rup_grid("isEditable")&&!$(jqGrid).rup_grid("isMultiselect")&&$(jqGrid).rup_grid("getGridParam","selrow")===null){$(jqGrid).rup_grid("setSelection",$(jqGrid).rup_grid("getDataIDs")[0],false)}return false},btnType:$.rup.dialog.LINK}]}detailDialog.rup_dialog("setOption","buttons",aButtons)},_deselectAddedElements:function(){var self=this,prop=self[0].prop,aButtons=null;prop.MODO=null;$(self[0]).find(" tr.addElement td input[type='checkbox'].cbox:checked").click();prop.jQueryGrid.rup_grid("reloadGrid")},_ellipsisDeleteOnEdit:function(elem){elem.parent().removeClass("ui-ellipsis")},ellipsisRestoreOnEdit:function(){var self=this,prop=self[0].prop,aButtons=null,rowColModel,selectedRow;selectedRow=jqGrid.getInd(prop.lastsel,true);rowColModel=jqGrid.rup_grid("getColModel");for(var i=0;i<rowColModel.length;i++){if(rowColModel[i].classes!==undefined&&rowColModel[i].classes.indexOf("ui-ellipsis")!==-1){$("[aria-describedby='"+jqGrid.attr("id")+"_"+rowColModel[i].name+"']",selectedRow).addClass("ui-ellipsis")}}},_loadComplete:function(data){var self=this,prop=self[0].prop,jqGrid=prop.jQueryGrid;prop.lastsel=null;$.data(jqGrid[0],"numPags",parseInt(data.total));if(data.records==0){prop.toolbar.self.disableButton("delete");if(!prop.jQueryGrid.rup_grid("isEditable")){prop.toolbar.self.disableButton("edit")}else{prop.toolbar.self.disableButton("cancel")}}else{prop.toolbar.self.enableButton("delete");if(!prop.jQueryGrid.rup_grid("isEditable")){prop.toolbar.self.enableButton("edit")}else{prop.toolbar.self.disableButton("cancel");prop.toolbar.self.enableButton("new")}if(prop.jQueryGrid.rup_grid("isMultiselect")){if(prop.selectedRowsCont>0){prop.toolbar.self.enableButton("edit");prop.toolbar.self.enableButton("delete")}else{prop.toolbar.self.disableButton("edit");prop.toolbar.self.disableButton("delete")}}}},_onAfterGridComplete:function(rowid,launchSelectEvent){var self=this,prop=self[0].prop,jqGrid=prop.jQueryGrid,p,page=jqGrid.rup_grid("getGridParam","page"),id=0,rowData,selectedPKs,pk,pkIndex,idPK,notFound=true;if(jqGrid.rup_grid("isMultiselect")){if(prop.MODO==="new"){return false}return self._markSelectedRows_multiselect()}else{if(rowid===null){if(jqGrid.rup_grid("getDataIDs").length>0){if(jqGrid.rup_grid("isEditable")){jqGrid.rup_grid("setSelection",jqGrid.rup_grid("getDataIDs")[0],false)}else{jqGrid.rup_grid("setSelection",jqGrid.rup_grid("getDataIDs")[0],true)}}}else{if(jqGrid.rup_grid("getDataIDs").length>0){if(jqGrid.rup_grid("isEditable")){jqGrid.rup_grid("setSelection",rowid,false)}else{jqGrid.rup_grid("setSelection",rowid,true)}}}}if(rowid){self.rup_maint("editElement",rowid)}},_ondblClickRow:function(rowid,iRow,iCol,e){var self=this,prop=self[0].prop;$("body").data("e_click_mnt",false);window.clearTimeout($("body").data("clicktimer_mnt"));if(!prop.jQueryGrid.rup_grid("isMultiselect")&&!prop.jQueryGrid.rup_grid("isEditable")){prop.MODO="edit";self.rup_maint("editElement",rowid);$("#"+rowid,self).click()}},_saveMaintSuccess:function(xhr,ajaxOptions,saveAndRepeat,rowId,aftersavefunc){var self=this,prop=self[0].prop,jqGrid=prop.jQueryGrid,jsonxhr,addedRow;jsonxhr=$.rup_utils.unnestjson(xhr);prop.feedback.rup_feedback("close");if(prop.jQueryGrid.rup_grid("isEditable")){prop.toolbar.self.disableButton("cancel");prop.toolbar.self.enableButton("new");jqGrid.rup_grid("saveRow",prop.lastsel,rup_maint.saveEditableSucces,"clientArray",null,null,rup_maint.saveEditableError,null);if(prop.showMessages){if(prop.MODO==="new"){prop.feedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.insertOK"),"ok")}else{prop.feedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.modifyOK"),"ok")}}addedRow=jqGrid.rup_grid("getInd",prop.lastsel,true);if(addedRow!==false){$(addedRow).attr("id",jsonxhr[prop.primaryKey]);prop.lastsel=jsonxhr[prop.primaryKey]}self.data("initialData",null)}else{self.rup_maint("appendRupFieldsData",jsonxhr);if(saveAndRepeat){if(prop.showMessages){if(prop.MODO==="new"){self.rup_maint("resetForm",prop.detailForm);prop.detailFeedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.insertOK"),"ok")}else{prop.detailFeedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.modifyOK"),"ok")}}prop.detailForm.data("initialData",self.rup_maint("getSerializedForm",prop.detailForm))}else{self.rup_maint("resetForm",prop.detailForm);if(prop.showMessages){if(prop.MODO==="new"){prop.feedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.insertOK"),"ok")}else{prop.feedback.rup_feedback("set",$.rup.i18nParse($.rup.i18n.base,"rup_maint.modifyOK"),"ok")}}prop.detailDiv.rup_dialog("close")}if(prop.MODO==="new"){var ids=jqGrid.rup_grid("getDataIDs"),rowN=Math.max.apply(Math,ids)+1;jqGrid.rup_grid("addRowData",rowN,jsonxhr,"first");if(!jqGrid.rup_grid("isMultiselect")){jqGrid.rup_grid("setSelection",rowN,true);prop.toolbar.self.enableButton("edit");prop.toolbar.self.enableButton("delete")}}else{if(jqGrid.rup_grid("isMultiselect")){var aCurrentRow=prop.currentSelectedRow;jqGrid.rup_grid("setRowData",aCurrentRow,jsonxhr)}else{jqGrid.rup_grid("setRowData",jqGrid.rup_grid("getSelectedRows")[0],jsonxhr)}}}self.rup_maint("ellipsisRestoreOnEdit");if(aftersavefunc){aftersavefunc.call()}return false},_saveMaintError:function(xhr,ajaxOptions,thrownError,rowId,aftererrorfunc){var self=this,prop=self[0].prop,jqGrid=prop.jQueryGrid,errorTXT=$.rup.i18nParse($.rup.i18n.base,"rup_maint.validateError"),errors=null,errorKey=null,causedErrors=null,errMsg="",errorMesg="",preMode,feedback;if(!jqGrid.rup_grid("isEditable")){$("#"+prop.detailDiv[0].id+" img.rup-maint_validateIcon").remove()}if(xhr.responseText!==null&&xhr.responseText!==""){if(xhr.status===406){self.rup_maint("showFieldValidationErrors",xhr.responseText)}}if(aftererrorfunc){aftererrorfunc.call()}if(rowId!==undefined&&rowId!==null){if(jqGrid.data("Collection_rup_combo")!==undefined){var rowComboData=jqGrid.data("Collection_rup_combo")[rowId];$.each(rowComboData,function(index,object){var ffe=object[0];object.label=jqGrid.rup_grid("getCol",rowId,index);object.value=xhr[index]})}}return false},_serializeGridData:function(postData){var self=this,prop=self[0].prop;if(postData.page==="rup"){postData.page=1}else{return postData}if(prop.searchForm!==null){var searchFormArray=prop.searchForm.serializeArray();for(var i=0;i<searchFormArray.length;i++){delete postData[searchFormArray[i].name]}if(postData.page!==undefined&&postData.page!==null&&Number(postData.page)>$(this).rup_grid("getGridParam","lastpage")&&$(this).rup_grid("getGridParam","lastpage")>0){postData.page=$(this).rup_grid("getGridParam","lastpage")}var formFieldNames=$.map($.makeArray(prop.searchForm.find("[name]")),function(elem){return $(elem).attr("name")});$.each(formFieldNames,function(index){delete postData[formFieldNames[index]]});$.extend(postData,$.rup_utils.unnestjson(form2object(prop.searchForm[0])))}if(prop.parent){var parent=$("#"+prop.parent),colPks=parent.rup_maint("getPrimaryKey").split(";"),parentPKObject={},row=parent[0].prop.jQueryGrid.rup_grid("getSelectedRows")[0];if(colPks.length>1){for(var i=0;i<colPks.length;i++){parentPKObject[$.rup_utils.firstCharToLowerCase(parent[0].prop.modelObject)+colPks[i]]=parent[0].prop.jQueryGrid.rup_grid("getCol",row,colPks[i])+";"}}else{var pkLabel=colPks[0].substring(0,1).toUpperCase()+colPks[0].substring(1);parentPKObject[$.rup_utils.firstCharToLowerCase(parent[0].prop.modelObject)+pkLabel]=parent[0].prop.jQueryGrid.rup_grid("getCol",row,colPks[0])}$.extend(postData,parentPKObject)}return postData}});$.fn.rup_maint("extend",{_init:function(properties){var self=this,resize_cursors=[2],prop=self[0].prop,t=this,btSearch,lnkClean,btDiv,settings={},toolbarSettings;if(properties[0].jQueryGrid===null){$.rup_messages("msgError",{message:$.rup.i18nParse($.rup.i18n.base,"rup_maint.noGrid")});return false}properties[0].jQueryGrid=$("#"+properties[0].jQueryGrid);settings=$.extend(true,{},$.fn.rup_maint.defaults,properties[0]);if(typeof properties[0].toolbar==="string"){settings.toolbar=$.fn.rup_maint.defaults.toolbar;settings.toolbar.id=properties[0].toolbar}if(properties[0].autoAjustToolbar!==undefined){settings.toolbar.autoAjustToolbar=properties[0].autoAjustToolbar}if(properties[0].createDefaultToolButtons!==undefined){settings.toolbar.createDefaultToolButtons=properties[0].createDefaultToolButtons}settings.name=self[0].id;self[0].prop=settings;prop=self[0].prop;jqGrid=prop.jQueryGrid;$.data(jqGrid[0],"maintName",self[0].id);prop.selectedRows=[];prop.selectedRowsCont=0;prop.currentSelectedRow=0;prop.lastsel=null;if(!jqGrid.rup_grid("isEditable")){if(!prop.lazyLoadDetailForm){self.rup_maint("defineDetailForm")}else{prop.isLazyCreationDone=false}}prop.toolbar.defaultFunctionAddButton=function(){self._checkSelectedElements(function(){prop.jQueryGrid.rup_grid("resetSelection");$.data(t[0].prop.jQueryGrid[0],"allSelected",null);$.data(t[0].prop.jQueryGrid[0],"deSelectedPages",[]);t.rup_maint("newElement")});prop.MODO="new"};prop.toolbar.defaultFunctionCancelButton=function(){t.rup_maint("cancelEditing",this)};prop.toolbar.defaultFunctionEditButton=function(){var rowid=self[0].prop.jQueryGrid.rup_grid("getGridParam","selrow"),page=jqGrid.rup_grid("getGridParam","page"),firstPage=null,firstElemObj;if(jqGrid.rup_grid("isMultiselect")){firstElemObj=self._getFirstElement(page);if(firstElemObj===undefined){return false}prop.currentSelectedRow=firstElemObj.rowId;if(firstElemObj.page!==page){prop.jQueryGrid.rup_grid("setGridParam",{page:firstElemObj.page});prop.jQueryGrid.rup_grid("reloadGrid",function(){prop.currentSelectedRow=firstElemObj.rowId})}prop.MODO="edit";self.rup_maint("editElement",firstElemObj.rowId)}else{prop.MODO="edit";prop.currentSelectedRow=rowid;self.rup_maint("editElement",rowid)}return false};prop.toolbar.defaultFunctionDeleteButton=function(){self.rup_maint("deleteElement",prop.jQueryGrid.rup_grid("getGridParam","selrow"))};prop.toolbar.defaultFunctionFilterButton=function(){self.rup_maint("toggleSearchForm","FIELDSET_SEARCH_"+prop.name)};if(prop.toolbar.id!==null&&prop.toolbar.id!==undefined){prop.toolbar.self=$("#"+prop.toolbar.id)}else{prop.toolbar.id="rup-maint_toolbar-"+prop.name;prop.toolbar.self=$("<div/>").attr("id",prop.toolbar.id);self.prepend(prop.toolbar.self);prop.toolbar.self.rup_toolbar({width:796})}if(prop.toolbar.autoAjustToolbar){prop.toolbar.self.css("width",prop.jQueryGrid.rup_grid("getGridParam","width")-5)}if(prop.toolbar.createDefaultToolButtons){if(prop.toolbar.defaultAdd){self[0].prop.btnNew=prop.toolbar.self.addButton({i18nCaption:"new",css:"rup-icon rup-icon-new",index:1},$.rup.i18nParse($.rup.i18n.base,"rup_maint")).bind("click",prop.toolbar.defaultFunctionAddButton)}if(prop.toolbar.defaultCancel){if(prop.jQueryGrid.rup_grid("isEditable")){self[0].prop.btnCancel=prop.toolbar.self.addButton({i18nCaption:"cancel",css:"rup-icon rup-icon-cancel",index:2},$.rup.i18nParse($.rup.i18n.base,"rup_maint")).bind("click",prop.toolbar.defaultFunctionCancelButton).button("option","disabled",true)}}if(prop.toolbar.defaultEdit){if(!prop.jQueryGrid.rup_grid("isEditable")){self[0].prop.btnEdit=prop.toolbar.self.addButton({i18nCaption:"edit",css:"rup-icon rup-icon-edit",index:2},$.rup.i18nParse($.rup.i18n.base,"rup_maint")).bind("click",prop.toolbar.defaultFunctionEditButton)}}if(prop.toolbar.defaultDelete){prop.btnDelete=settings.toolbar.self.addButton({i18nCaption:"delete",css:"rup-icon rup-icon-delete",index:3},$.rup.i18nParse($.rup.i18n.base,"rup_maint")).bind("click",prop.toolbar.defaultFunctionDeleteButton)}if(prop.toolbar.defaultFilter){prop.btnFilter=settings.toolbar.self.addButton({i18nCaption:"filter",css:"rup-icon rup-icon-filter",index:4},$.rup.i18nParse($.rup.i18n.base,"rup_maint")).bind("click",prop.toolbar.defaultFunctionFilterButton);prop.toolbar.self.pressButton("filter","rup-maint_filter_pressed")}}if(prop.toolbar.newButtons!==undefined&&prop.toolbar.newButtons!==null){$.each(prop.toolbar.newButtons,function(index,object){if(object.json_i18n===undefined){object.json_i18n={}}if(object.obj!==undefined&&object.click!==undefined){prop.toolbar.self.addButton(object.obj,object.json_i18n).bind("click",object.click)}else{if(object.buttons!==undefined){var mButton=prop.toolbar.self.addMButton(object,object.json_i18n).bind("click",prop.toolbar.self.showMButton);prop.toolbar.self.addButtonsToMButton(object.buttons,mButton,object.json_i18n)}else{$.rup.errorGestor($.rup.i18nParse($.rup.i18n.base,"rup_maint.toolbarNewButtonError"))}}})}if(prop.feedback!==null){if(typeof(prop.feedback)!=="object"){var alter=$.rup_utils.escapeId(prop.feedback);prop.feedback=$($.rup_utils.selectorId(prop.feedback))}}else{prop.feedback=$("<div/>").attr("id","feedback_"+prop.name);self.prepend(prop.feedback);prop.feedback.rup_feedback({type:"ok",closeLink:true,delay:defaultDelay,fadeSpeed:500,block:(prop.showFeedback?true:false)});var padding_left=parseInt(prop.feedback.css("padding-left")),padding_right=parseInt(prop.feedback.css("padding-right"));prop.feedback.css("width",prop.jQueryGrid.rup_grid("getGridParam","width")-(padding_left+padding_right))}if(prop.searchForm!==null){$("#titleSearch_"+prop.name).text($.rup.i18nParse($.rup.i18n.base,"rup_maint.searchOptions"));prop.searchForm=$("#"+prop.searchForm);prop.searchForm.ajaxForm();prop.searchForm.parent().css("width",prop.jQueryGrid.rup_grid("getGridParam","width"));prop.searchURL=settings.jQueryGrid.rup_grid("getGridParam","url");prop.searchForm.bind("keydown",function(evt){if(evt.keyCode==13){self.rup_maint("search")}});btSearch=$("<input type='button' />").attr("id","bt_search_"+prop.name).bind("click",function(){if(jqGrid.rup_grid("isMultiselect")){self._checkSelectedElements(function(){prop.jQueryGrid.rup_grid("resetSelection");$.data(t[0].prop.jQueryGrid[0],"allSelected",null);$.data(t[0].prop.jQueryGrid[0],"deSelectedPages",[]);self.rup_maint("search")})}else{self.rup_maint("search")}});btSearch.button({label:$.rup.i18nParse($.rup.i18n.base,"rup_global.search")});lnkClean=$("<a href='#' />").attr("id","clean_search_"+prop.name).attr("class","rup-enlaceCancelar").text($.rup.i18nParse($.rup.i18n.base,"rup_global.clean")).bind("click",function(){self.rup_maint("cleanSearchForm")});btDiv=$("<div>").attr("id","SEARCH_FORM_BUTTONS_"+prop.name).addClass("right_buttons").append(btSearch).append("&nbsp;").append(lnkClean).append("&nbsp;");$("#FIELDSET_SEARCH_"+prop.name).append(btDiv)}if(prop.parent){if($("#"+prop.parent).length>0){$("#"+prop.parent).rup_maint("addChild",self[0].id)}}jqGrid.data("defaultEventFunctions").loadComplete_default=function(data){self._loadComplete(data)};jqGrid.data("defaultEventFunctions").ondblClickRow_default=function(rowid,iRow,iCol,e){self._ondblClickRow(rowid,iRow,iCol,e)};jqGrid.data("defaultEventFunctions").serializeGridData_default=function(postData,returnData){return self._serializeGridData(postData)};jqGrid[0].rup_gridProps.onAfterGridComplete=function(rowid,launchSelectEvent){return self._onAfterGridComplete(rowid,launchSelectEvent)};if(jqGrid.rup_grid("isMultiselect")){jqGrid[0].rup_gridProps.resetSelection=function(){return self._resetSelection_multiselect()};jqGrid[0].rup_gridProps.onAfterSelectRow=function(rowid,select){return self._onAfterSelectRow_multiselect(rowid,select)};jqGrid[0].rup_gridProps.selectAllGetPrimaryKeys=function(){return self._selectAllGetPrimaryKeys_multiselect()};jqGrid[0].rup_gridProps.onAfterSelectAll=function(aRowids,status,selectedRecords){return self._onAfterSelectAll_multiselect(aRowids,status,selectedRecords)};jqGrid[0].rup_gridProps.onSelectAllRows=function(){return self._onSelectAllRows_multiselect()};jqGrid[0].rup_gridProps.onDeSelectAllRows=function(){return self._onDeSelectAllRows_multiselect()};jqGrid.data("defaultEventFunctions").onPaging_default=function(pgButton){return self._onPaging_multiselect(pgButton)};jqGrid.data("defaultEventFunctions").onSortCol_default=function(index,iCol,sortorder){return self._onSortCol_multiselect(index,iCol,sortorder)};var pgcnt="pg_"+jqGrid[0].rup_gridProps.pagerName;$(".ui-pg-selbox","#"+pgcnt).unbind("change");$(".ui-pg-selbox","#"+pgcnt).bind("change",function(){var selectedRows=prop.selectedRows,newRowNum=this.value,combo=this,rowNum=jqGrid[0].p.rowNum;$(this).val(jqGrid[0].p.rowNum);self._checkSelectedElements(function(){$(combo).val(newRowNum);jqGrid.rup_grid("resetSelection");$.data(jqGrid[0],"allSelected",null);$.data(jqGrid[0],"deSelectedPages",[]);jqGrid[0].p.page=Math.round(jqGrid[0].p.rowNum*(jqGrid[0].p.page-1)/newRowNum-0.5)+1;jqGrid[0].p.rowNum=newRowNum;jqGrid[0].grid.populate();return false})})}if(jqGrid.rup_grid("isEditable")){var form=$("<form>").attr("id","detailForm_"+prop.name);jqGrid.wrap(form);prop.detailForm=$("#detailForm_"+prop.name);jqGrid.data("defaultEventFunctions").onCellSelect_default=function(rowid,iCol,cellcontent,e){return self._onCellSelect_editline(rowid,iCol,cellcontent,e)};jqGrid[0].rup_gridProps.onAfterSelectRow=function(rowid,select){self._onAfterSelectRow_editline(rowid,select)};jqGrid[0].rup_gridProps.onAfterDragAndDrop=function(permutations){self._onAfterDragAndDrop_editline(permutations)};jqGrid.data("defaultEventFunctions").resizeStart_default=function(event,index){resize_cursors[0]=$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-htable th:eq(1)").css("cursor");if(resize_cursors[0]==="col-resize"){resize_cursors[0]="default"}$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-htable th").css("cursor","col-resize");resize_cursors[1]=$("#gbox_"+self[0].id+" .ui-jqgrid-sortable").css("cursor");$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-sortable").css("cursor","col-resize");$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-sortable div").css("cursor","col-resize");$("#gbox_GRID_"+self[0].id+" .ui-grid-ico-sort").css("cssText","cursor: col-resize !important;")};jqGrid.data("defaultEventFunctions").resizeStop_default=function(newwidth,index){$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-htable th").css("cursor",resize_cursors[0]);$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-sortable").css("cursor",resize_cursors[1]);$("#gbox_GRID_"+self[0].id+" .ui-jqgrid-sortable div").css("cursor","pointer");$("#gbox_GRID_"+self[0].id+" .ui-grid-ico-sort").css("cssText","cursor: pointer !important;");$("#"+self[0].id+" ul.rup_combo[rup_combo_col_position = "+index+"]").width($("#"+self[0].id+" a.rup_combo[rup_combo_col_position = "+index+"]").width())}}if(jqGrid.rup_grid("isEditable")){self.rup_maint("defineValidationConfig")}else{if(!prop.lazyLoadDetailForm){self.rup_maint("defineValidationConfig")}}if(jqGrid[0].rup_gridProps.loadOnStartUp){self.rup_maint("search");if(!jqGrid.rup_grid("isMultiselect")&&!jqGrid.rup_grid("isEditable")){var gridSelectRow=jqGrid[0].p.onSelectRow;jqGrid[0].p.onSelectRow=function(rowid,select){var jqGrid=$(this);if(gridSelectRow){gridSelectRow.call(jqGrid,[rowid,select])}$("body").data("e_click_mnt",true);$("body").data("clicktimer_mnt",window.setTimeout(function(){if($("body").data("e_click_mnt")){$("body").data("e_click_mnt",false);window.clearTimeout($("body").data("clicktimer_mnt"));clearTimeout($("body").data("clicktimer_mnt"));$("body").data("clicktimer_mnt",null);if(t.data("_children")){var ln=self.data("_children").length;for(var i=0;i<ln;i++){$("#"+self.data("_children"))[i].prop.jQueryGrid[0].p.ajaxGridOptions={async:true};$("#"+self.data("_children"))[i].prop.jQueryGrid.rup_grid("setGridParam",{page:"rup"});$("#"+self.data("_children"))[i].prop.jQueryGrid.rup_grid("reloadGrid")}}}},300))}}}$(jqGrid).bind("fluidWidth.resize",function(event,previousWidth,currentWidth){$("#"+prop.name).children().width(currentWidth);var feedBackPaddingLeft=parseInt(prop.feedback.css("padding-left")),feedBackPaddingRight=parseInt(prop.feedback.css("padding-right"));prop.feedback.width(currentWidth-(feedBackPaddingLeft+feedBackPaddingRight));if(prop.toolbar.autoAjustToolbar){var toolbarPaddingLeft=parseInt(prop.toolbar.self.css("padding-left")),toolbarPaddingRight=parseInt(prop.toolbar.self.css("padding-right"));prop.toolbar.self.width(currentWidth-(toolbarPaddingLeft+toolbarPaddingRight));prop.toolbar.self.css("width",currentWidth-(toolbarPaddingLeft+toolbarPaddingRight))}});if(jqGrid[0].rup_gridProps.width==="auto"){$(jqGrid).fluidWidth({fluidBaseLayer:jqGrid[0].rup_gridProps.fluidBaseLayer,minWidth:jqGrid[0].rup_gridProps.minWidth,maxWidth:jqGrid[0].rup_gridProps.maxWidth,fluidOffset:jqGrid[0].rup_gridProps.fluidOffset})}$(jqGrid.rup_grid("getColModel")).each(function(index,element){if(element.classes==="ui-ellipsis"){$("[id='jqgh_"+$(jqGrid).attr("id")+"_"+element.name+"']").css("display","block").css("text-overflow","ellipsis")}var headerLabel=$("[id='jqgh_"+$(jqGrid).attr("id")+"_"+element.name+"']").children("div");$(headerLabel).replaceWith($("<span>").text($(headerLabel).text()).css("cursor","pointer"))})}});$.fn.rup_maint.defaults={contentPercentage:0.9,fluidOffset:0,fluid:true,clearSearchFormMode:"clear",detailButtons:$.rup.maint.detailButtons.SAVE_REPEAT,detailDiv:null,detailForm:null,detailServer:true,eventCreateDetailForm:undefined,feedback:null,imgPath:$.rup.RUP+"/basic-theme/images",jQueryGrid:null,lazyLoadDetailForm:false,modelObject:null,MODO:null,name:null,onafterDetailShow:null,onbeforeDetailShow:null,parent:null,primaryKey:null,rupCheckStyle:true,searchForm:null,showFeedback:true,showMessages:false,showMultiselectAlerts:true,toolbar:{autoAjustToolbar:true,createDefaultToolButtons:true,defaultAdd:true,defaultEdit:true,defaultCancel:true,defaultDelete:true,defaultFilter:true},validation:null,validationMode:"individual",validationFilter:true,validationUrl:$.rup.CTX_PATH+"validate",filterExclude:new Array()}})(jQuery);(function(a){a.fn.rup_maint("extend",{selectRow:function(e,g){var l=this,b=l[0].prop,d=b.jQueryGrid,h,j,k,f;h=b.jQueryGrid.rup_grid("getGridParam","page");j=b.jQueryGrid.rup_grid("getInd",e,false);k=l._getPrimaryKeysForRow(e);if(b.selectedRows["p_"+h]===undefined){b.selectedRows["p_"+h]=[];b.selectedRows.push(Number(h))}if(b.selectedRows["p_"+h]["l_"+j]===undefined){b.selectedRows["p_"+h]["l_"+j]=[];b.selectedRows["p_"+h].push(Number(j))}if(b.selectedRows["p_"+h]["l_"+j]["id_"+e]===undefined){b.selectedRows["p_"+h]["l_"+j]["id_"+e]=k;b.selectedRows["p_"+h]["l_"+j].push(e);if(g===undefined||g===true){b.selectedRowsCont+=1;a.data(d[0],"selectedRowsCont",Number(a.data(d[0],"selectedRowsCont")+1))}d[0].rup_gridProps.allPksArray.push(k);f=a.data(d[0],"deSelectedPages");if(f!=undefined){ind=a.inArray(h,f!=undefined?f:[]);if(ind>-1){f.splice(ind,1);a.data(d[0],"deSelectedPages",f)}}}b.currentSelectedRow=e},deselectRow:function(e){var b=this,j=b[0].prop,d=j.jQueryGrid,g,h,f;g=d.rup_grid("getGridParam","page");h=d.rup_grid("getInd",e,false);f=b._getPrimaryKeysForRow(e);if(b._isSelected(e,null,g,h)){delete j.selectedRows["p_"+g]["l_"+h];j.selectedRows["p_"+g].splice(a.inArray(h,j.selectedRows["p_"+g]),1)}ind=a.inArray(f,d[0].rup_gridProps.allPksArray);d[0].rup_gridProps.allPksArray.splice(ind,1);a.data(d[0],"selectedRowsCont",Number(a.data(d[0],"selectedRowsCont")-1));j.selectedRowsCont-=1}});a.fn.rup_maint("extend",{defineDetailForm:function(){var b=this,d=b[0].prop;if(d.detailForm!==null){d.customDetailForm=true;d.detailForm=a("#"+d.detailForm).ajaxForm();b._createDetailForm(true)}else{d.customDetailForm=false;b._createDetailForm()}d.detailDiv.rup_dialog({type:jQuery.rup.dialog.DIV,autoOpen:false,modal:true,width:(d.detailDivWidth!==undefined?d.detailDivWidth:569),height:(d.detailDivHeight!==undefined?d.detailDivHeight:"auto"),specificLocation:d.name,create:d.eventCreateDetailForm,open:function(){a(this).find(".ui-selectmenu-menu").each(function(e,f){a(f).appendTo(a(f).parents(".ui-dialog"))});a(".ui-dialog").css("overflow","visible");if(a.isFunction(d.onafterDetailShow)){d.onafterDetailShow.call(b[0],d.detailDiv)}},close:function(){if(!a(jqGrid).rup_grid("isEditable")&&!a(jqGrid).rup_grid("isMultiselect")&&a(jqGrid).rup_grid("getGridParam","selrow")===null){a(jqGrid).rup_grid("setSelection",a(jqGrid).rup_grid("getDataIDs")[0],false)}}});d.detailDiv.parent().find("#closeText_"+d.detailDiv.first()[0].id).parent().unbind("click").bind("click",function(){b._checkDetailFormModifications(function(){d.detailDiv.rup_dialog("close")})});d.detailDiv.parent().find(".ui-dialog-titlebar-close").unbind("click").bind("click",function(){b._checkDetailFormModifications(function(){d.detailDiv.rup_dialog("close")})});b._createDetailButtons(d.detailDiv);if(a.rup_utils.aplicatioInPortal()){d.detailDiv.dialog("widget").appendTo(a("div.r01gContainer"))}else{d.detailDiv.dialog("widget").appendTo("body")}},defineValidationConfig:function(){var e=this,h=e[0].prop,f,d,b,g;if(h.validation!==null&&h.validation.rules!==undefined){g=a.extend({feedback:(jqGrid.rup_grid("isEditable")===true?h.feedback:h.detailFeedback)},h.validation)}else{f=jqGrid.rup_grid("getColModel");d=a.map(f,function(k){var j={};if(k.validationrules!==undefined){return{name:k.name,value:k.validationrules}}else{return null}});b={};a.each(d,function(j,k){b[k.name]=k.value});g={rules:b,feedback:(jqGrid.rup_grid("isEditable")===true?h.feedback:h.detailFeedback)}}if(jqGrid.rup_grid("isEditable")){g=a.extend(g,{errorPlacement:function(j,k){},feedbackErrorConfig:{getFieldName:function(j,n,p){var m=p.attr("name");var k=h.jQueryGrid.rup_grid("getColModel");var o=h.jQueryGrid.rup_grid("getGridParam","colNames");var q=false;for(var l=0;l<k.length&&!q;l=l+1){if(k[l].name==m){errorKey=o[l];return errorKey}}return m}}})}h.detailForm.rup_validate(g)},_isFirstSelectedElement:function(f){var b=this,g=b[0].prop,e,d;e=g.selectedRows.sort(function(j,h){return j-h});d=g.selectedRows["p_"+e[0]].sort(function(j,h){return j-h});if(d["l_"+d[0]][0]===f){return true}else{return false}},_isLastSelectedElement:function(f){var b=this,g=b[0].prop,e,d;e=g.selectedRows.sort(function(j,h){return j-h});d=g.selectedRows["p_"+e[e.length-1]].sort(function(j,h){return j-h});if(d["l_"+d[d.length-1]][0]===f){return true}else{return false}},_isSelected:function(e,k,g,h){var b=this,j=b[0].prop,d=j.jQueryGrid,h,f;if(g===undefined){g=d.rup_grid("getGridParam","page")}if(h===undefined){h=d.rup_grid("getInd",e,false)}if(j.selectedRows["p_"+g]===undefined){return false}if(j.selectedRows["p_"+g]["l_"+h]===undefined){return false}if(j.selectedRows["p_"+g]["l_"+h]["id_"+e]===undefined){return false}return true},_markSelectedRows_multiselect:function(){var e=this,k=e[0].prop,f=k.jQueryGrid,d,j,b=false,h=0;d=f.rup_grid("getDataIDs");j=f.rup_grid("getGridParam","page");if(k.selectedRows["p_"+j]!==undefined){b=true}for(var g=0;g<d.length;g++){rowNum=f.rup_grid("getInd",d[g],false);if(e._isSelected(d[g],null,j,rowNum)){f.rup_grid("setSelection",d[g],true);h++}else{if(!b&&a.data(f[0],"allSelected")===true){e.rup_maint("selectRow",d[g],false);f.rup_grid("setSelection",d[g],true)}}}if(k.selectedRows["p_"+j]&&k.selectedRows["p_"+j].length===f.rup_grid("getDataIDs").length){a("#cb_"+f[0].id).attr("checked",true)}else{a("#cb_"+f[0].id).attr("checked",false)}a.data(f[0],"rowsSelectedPage",h);return false},_onAfterSelectRow_multiselect:function(e,l){var m=this,b=m[0].prop,d=b.jQueryGrid,k=d.rup_grid("getGridParam","page"),j,g=[],f,h;if(l){m.rup_maint("selectRow",e)}else{m.rup_maint("deselectRow",e)}h=b.selectedRowsCont;if(a("#cb_"+d[0].id).is(":checked")){h=Number(a.data(d[0],"selectedRowsCont"))-1;a("#cb_"+d[0].id).attr("checked",false)}h=Number(a.data(d[0],"selectedRowsCont"));if(d.rup_grid("isMultiselect")){if(h>0){b.toolbar.self.enableButton("edit");b.toolbar.self.enableButton("delete")}else{b.toolbar.self.disableButton("edit");b.toolbar.self.disableButton("delete")}}if(b.selectedRows["p_"+k]&&b.selectedRows["p_"+k].length===d.rup_grid("getDataIDs").length){a("#cb_"+d[0].id).attr("checked",true)}else{a("#cb_"+d[0].id).attr("checked",false)}a("#"+d[0].rup_gridProps.pagerName+"_left").html(h+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"));a.data(d[0],"rowsSelectedPage",d.rup_grid("getGridParam","selarrrow").length)},_onAfterSelectAll_multiselect:function(e,l,m){var p=this,b=p[0].prop,d=b.jQueryGrid,n,f,g,o,k;n=d.rup_grid("getGridParam","page");if(l){for(var h=0;h<e.length;h++){p.rup_maint("selectRow",e[h])}}else{for(var h=0;h<e.length;h++){p.rup_maint("deselectRow",e[h])}}a.data(d[0],"selectedRowsCont",m);if(m>0){b.toolbar.self.enableButton("edit");b.toolbar.self.enableButton("delete")}else{b.toolbar.self.disableButton("edit");b.toolbar.self.disableButton("delete")}a("#"+d[0].rup_gridProps.pagerName+"_left").html(m+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"))},_onSelectAllRows_multiselect:function(){var b=this,h=b[0].prop,d=h.jQueryGrid,f,g,e;a.data(d[0],"selectedRowsCont",d.rup_grid("getGridParam","records"));a.data(d[0],"allSelected",true);d[0].rup_gridProps.allPksArray=[];h.selectedRows=[];a("#"+d[0].rup_gridProps.pagerName+"_left").html(d.rup_grid("getGridParam","records")+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"))},_onDeSelectAllRows_multiselect:function(){var b=this,h=b[0].prop,d=h.jQueryGrid,f,g,e;a.data(d[0],"selectedRowsCont",0);a.data(d[0],"allSelected",false);d[0].rup_gridProps.allPksArray=[];h.selectedRows=[];a("#"+d[0].rup_gridProps.pagerName+"_left").html("0 "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"))},_onPaging_multiselect:function(h){var d=this,j=d[0].prop,e=j.jQueryGrid;var b=a(this).find(" tr.addElement td input[type='checkbox'].cbox:checked");if(b.length>0){if(j.showMultiselectAlerts){a.rup_messages("msgConfirm",{message:a.rup.i18nParse(a.rup.i18n.base,"rup_maint.checkAddedSelectedElems"),title:a.rup.i18nParse(a.rup.i18n.base,"rup_maint.changes"),OKFunction:function(k){d._deselectAddedElements()}})}else{d._deselectAddedElements()}return false}if(h=="user"){var g=parseInt(a("td.pagControls .ui-pg-input",a("#gbox_"+e[0].id)).val());if(g===0){e.setGridParam({page:1})}else{var f=parseInt(e.getGridParam("lastpage"));if(g>f){e.setGridParam({page:f})}}}return""},_onSortCol_multiselect:function(g,f,b){var d=this,j=d[0].prop,e=j.jQueryGrid,h=j.jQueryGrid.data("sorting");if(!h){d._checkSelectedElements(function(){j.jQueryGrid.rup_grid("resetSelection");a.data(e[0],"allSelected",null);a.data(e[0],"deSelectedPages",[]);e.data("sorting",true);e.jqGrid("sortGrid",g,f,b);window.setTimeout(function(){e.trigger("reloadGrid")},0)});e.data("sorting",false);a("#lui_"+e.attr("id")).hide();a("#load_"+e.attr("id")).hide();return"stop"}else{e.data("sorting",false)}},_selectAllGetPrimaryKeys_multiselect:function(){var b=this,f=b[0].prop,d=f.jQueryGrid,e;if(f.searchDivFunc===undefined){e=form2object(f.searchForm[0])}else{e=f.searchDivFunc.call()}a.rup_ajax({url:d.rup_grid("getGridParam","url"),dataType:"json",type:"GET",data:e,contentType:"application/json",success:function(l,k){var h=b.rup_maint("getPrimaryKey").split(";"),p=[],g="";for(var m=0;m<l.length;m++){if(h.length>1){for(var n=0;n<h.length;n++){g=g+"/"+l[m][h[n]]}}else{g="/"+l[m][h[0]]}p.push(g);g=""}d[0].rup_gridProps.allPksArray=p;a("#"+d[0].rup_gridProps.pagerName+"_left").html(p.length+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"));a.data(d[0],"allSelected",true);var o=d.rup_grid("getGridParam","page");for(var n=0;n<f.selectedRows.length;n=n+1){if(!f.selectedRows[n]==="p_"+o){delete f.selectedRows[n]}}f.selectedRowsCont=p.length;p=null},error:function(j,g,h){},beforeSend:function(k){var g=b.rup_maint("getPrimaryKey").split(";"),j={};if(g.length>1){for(var h=0;h<g.length;h++){j[g[h]]=g[h]}}else{j[g[0]]=g[0]}k.setRequestHeader("RUP",a.toJSON(j));g=null;if(a.isFunction(d[0].rup_gridProps.onSelectAllGetPKs)){d[0].rup_gridProps.onSelectAllGetPKs.call(this,k)}else{if(a.isPlainObject(d[0].rup_gridProps.onSelectAllGetPKs)){d[0].rup_gridProps.onSelectAllGetPKs.pre.call(this,k)}}},complete:function(g,h){if(a.isFunction(d[0].rup_gridProps.onSelectAllGetPKs)){d[0].rup_gridProps.onSelectAllGetPKs.call(this,g)}else{if(a.isPlainObject(d[0].rup_gridProps.onSelectAllGetPKs)){d[0].rup_gridProps.onSelectAllGetPKs.post.call(this,g)}}}})},_resetSelection_multiselect:function(){var b=this,e=b[0].prop,d=e.jQueryGrid;e.selectedRows=[];d.jqGrid("resetSelection");e.selectedRowsCont=0;a("#"+d[0].rup_gridProps.pagerName+"_left").html(e.selectedRowsCont+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"));e.toolbar.self.disableButton("edit");e.toolbar.self.disableButton("delete")}})})(jQuery);(function(a){a.fn.rup_maint("extend",{cancelEditing:function(){return this.each(function(){var d=this.prop;if(d.MODO==="new"){d.jQueryGrid.rup_grid("delRowData",d.jQueryGrid.rup_grid("getGridParam","selrow"))}else{d.jQueryGrid.rup_grid("restoreRow",d.lastsel);a(this).rup_maint("ellipsisRestoreOnEdit")}d.lastsel=null;d.toolbar.self.disableButton("cancel");d.toolbar.self.enableButton("new");d.toolbar.self.enableButton("filter");d.toolbar.self.enableButton("delete");d.feedback.rup_feedback("close");var b=this.prop.jQueryGrid.rup_grid("getDataIDs").length-1;a("#"+b,jqGrid).remove()})},newElementEditable:function(){return this.each(function(){if(this.prop.jQueryGrid.rup_grid("isEditing")){if(this.prop.MODO==="new"){a("#"+this.prop.lastsel+" .editable:first",this.prop.jQueryGrid).focus();return false}this.prop.jQueryGrid.rup_grid("saveRow",this.prop.lastsel,rup_maint.saveEditableSucces,"clientArray",null,rup_maint.aftersavefunc,rup_maint.saveEditableError,null)}this.prop.MODO="new";var b=this.prop.jQueryGrid.rup_grid("getDataIDs"),d=b.length;this.prop.jQueryGrid.rup_grid("addRowData",d,{},"first");this.prop.jQueryGrid.rup_grid("setSelection",d,false);this.prop.selectedCell=0;a(this)[0].prop.toolbar.self.disableButton("filter");a(this)[0].prop.toolbar.self.disableButton("delete");obj=this.prop.jQueryGrid;a("#"+d,jqGrid).children().first().click()})}});a.fn.rup_maint("extend",{_checkValidRowId_editline:function(f,d){var b=this,e=b[0].prop;return b._checkValidRowId(f,function(){e.feedback.rup_feedback("set",a.rup.i18nParse(a.rup.i18n.base,"rup_maint.invalidRowId"),"error");e.toolbar.self.disableButton("cancel");e.toolbar.self.enableButton("filter");e.toolbar.self.enableButton("new");e.toolbar.self.enableButton("delete")})},_onCellSelect_editline:function(g,f,h,j){var b=this,l=b[0].prop,d=l.jQueryGrid,k;l.selectedCell=f;k=d.rup_grid("getColModel");a("#"+g+"_"+k[l.selectedCell].name,d).focus();return true},_onAfterSelectRow_editline:function(e,b){var d=this,f=d[0].prop;if(e!==f.lastsel){d.rup_maint("editElement",e)}},_onAfterDragAndDrop_editline:function(j){var l=this,b=l[0].prop,d=b.jQueryGrid,g,k,f,h=this.rup_grid("getSelectedRows")[0],e=a.data(d,"maintName"),m;if(!d.rup_grid("isEditing")){return false}k=d.rup_grid("getColModel");m=k[k.length-1].name;a(".editable").unbind("keydown");a("input[name='"+m+"']",d).bind("keydown",function(o){var n=0,p=d.rup_grid("getGridParam","page");if(o.keyCode==9){if(!o.shiftKey){if(a(this).hasClass("hasDatepicker")){a(this).datepicker("hide")}d.rup_grid("saveRow",h,rup_maint.saveEditableSucces,"clientArray",null,rup_maint.aftersavefunc,rup_maint.saveEditableError,null);if(h==d.rup_grid("getDataIDs").length){n=d.rup_grid("getGridParam","lastpage");if(parseFloat(p)+1<=n){d[0].p.ajaxGridOptions={async:false};d.rup_grid("setGridParam",{page:parseFloat(p)+1});d.rup_grid("reloadGrid");d[0].p.ajaxGridOptions={async:true};h=0}else{return false}}d.rup_grid("setSelection",Number(h)+1,false);a("#"+e).rup_maint("editElement",Number(h)+1);a("body").data("clicktimer",window.setTimeout(function(){a("#"+Number(h+1)+" .editable:first",relatedGrid).focus()},0));return false}}});firstColName=k[0].name;a("input[name='"+firstColName+"']",relatedGrid).bind("keydown",function(o){var n=0,p=relatedGrid.rup_grid("getGridParam","page");if(o.keyCode==9){if(o.shiftKey){if(a(this).hasClass("hasDatepicker")){a(this).datepicker("hide")}relatedGrid.rup_grid("saveRow",h,rup_maint.saveEditableSucces,"clientArray",null,rup_maint.aftersavefunc,rup_maint.saveEditableError,null);if(h==1){if(parseFloat(p)>1){relatedGrid[0].p.ajaxGridOptions={async:false};relatedGrid.rup_grid("setGridParam",{page:parseFloat(p)-1});relatedGrid.rup_grid("reloadGrid");relatedGrid[0].p.ajaxGridOptions={async:true};h=relatedGrid.rup_grid("getDataIDs").length+1}else{return false}}relatedGrid.rup_grid("setSelection",Number(h-1),false);a("#"+e).rup_maint("editElement",Number(h-1));a("body").data("clicktimer",window.setTimeout(function(){a("#"+Number(h-1)+" .editable:last",relatedGrid).focus()},0));return false}}})}})})(jQuery);(function(a){a.fn.rup_maint("extend",{_editFirstElement:function(){var b=this,h=b[0].prop,d=h.jQueryGrid,e,f;e=b._getFirstElement();f=d.rup_grid("getGridParam","page");if(f!==e.page){d.rup_grid("setGridParam",{page:e.page});d.rup_grid("reloadGrid",g)}else{g()}function g(){if(e.rowId===undefined){e.rowId=d.rup_grid("getDataIDs")[0]}if(!d.rup_grid("isMultiselect")){d.find("#"+e.rowId).click()}h.currentSelectedRow=e.rowId;b.rup_maint("editElement",e.rowId)}},_editLastElement:function(){var d=this,j=d[0].prop,e=j.jQueryGrid,f,g,h;lastElement=d._getLastElement();g=e.rup_grid("getGridParam","page");if(g!==lastElement.page){e.rup_grid("setGridParam",{page:lastElement.page});e.rup_grid("reloadGrid",b)}else{b()}function b(){if(!e.rup_grid("isMultiselect")){h=e.rup_grid("getDataIDs");lastElement.rowId=h[h.length-1];e.find("#"+lastElement.rowId).click()}else{if(lastElement.rowId===undefined){dataIDs=e.rup_grid("getDataIDs");lastElement.rowId=dataIDs[dataIDs.length-1]}}j.currentSelectedRow=lastElement.rowId;d.rup_maint("editElement",lastElement.rowId)}},_editNextElement:function(){var d=this,j=d[0].prop,e=j.jQueryGrid,h=false,f=d._getNextElement(j.currentSelectedRow),g=e.rup_grid("getGridParam","page");if(g!==f.page){h=true;e.rup_grid("setGridParam",{page:f.page});e.rup_grid("reloadGrid",b,f)}else{b(f)}function b(k){if(!e.rup_grid("isMultiselect")){var l=e.rup_grid("getDataIDs");if(h){k.rowId=e.rup_grid("getDataIDs")[0]}else{k.rowId=e.rup_grid("getDataIDs")[k.line-1]}e.find("#"+k.rowId).click()}else{if(k.rowId===undefined){k.rowId=e.rup_grid("getDataIDs")[0]}}j.currentSelectedRow=k.rowId;d.rup_maint("editElement",k.rowId)}},_editPreviousElement:function(){var e=this,k=e[0].prop,g=k.jQueryGrid,j=false,f=e._getPreviousElement(k.currentSelectedRow),h=g.rup_grid("getGridParam","page"),d,j=false;if(h!==f.page){j=true;g.rup_grid("setGridParam",{page:f.page});g.rup_grid("reloadGrid",b)}else{b()}function b(){if(!g.rup_grid("isMultiselect")){if(j){var l=g.rup_grid("getDataIDs");f.rowId=l[l.length-1]}else{f.rowId=g.rup_grid("getDataIDs")[f.line-1]}g.find("#"+f.rowId).click()}else{if(f.rowId===undefined){d=g.rup_grid("getDataIDs");f.rowId=d[d.length-1]}}k.currentSelectedRow=f.rowId;e.rup_maint("editElement",f.rowId)}},_getCurrentDetailIndex:function(f){var o=this,d=o[0].prop,k,p=0,b,j,h,l,e,n,m;k=d.jQueryGrid.rup_grid("getGridParam","page");rowNum=parseInt(d.jQueryGrid.rup_grid("getInd",f,false));e=d.jQueryGrid.rup_grid("getGridParam","rowNum");m=a.data(d.jQueryGrid[0],"allSelected");if(d.jQueryGrid.rup_grid("isMultiselect")){n=d.selectedRowsCont;b=d.selectedRows.sort(function(r,q){return r-q});for(var g=0;g<b.length;g=g+1){if(b[g]<parseInt(k)){p+=d.selectedRows["p_"+b[g]].length}else{if(b[g]===parseInt(k)){j=d.selectedRows["p_"+b[g]].sort(function(r,q){return r-q});if(!isNaN(rowNum)){l=a.inArray(rowNum,j)}else{l=0}p+=l+1}}}if((m!==null)&&(m===true)){h=a.inArray(parseInt(k),b);p+=(parseInt(k)-(h+1))*parseInt(e)}}else{n=d.jQueryGrid.rup_grid("getGridParam","records");p=((parseInt(k)*parseInt(e))-parseInt(e)+rowNum)}return{current:p,total:n}},_getDetailUrl:function(h){var d=this,j=d[0].prop,g=j.jQueryGrid.rup_grid("getSelectedRows"),f=j.jQueryGrid[0].rup_gridProps.url,b=j.primaryKey.split(";");if(j.jQueryGrid.rup_grid("isMultiselect")===false){if(b.length>1){for(var e=0;e<b.length;e++){f=f+"/"+j.jQueryGrid.rup_grid("getCol",g[0],b[e])}}else{if(d._getPrimaryKeysForRow(h)==="/false"){f=f+"/"+h}else{f=f+"/"+j.jQueryGrid.rup_grid("getCol",g[0],b[0])}}}else{if(d._getPrimaryKeysForRow(h)!=="/false"){f=f+d._getPrimaryKeysForRow(h)}else{f=f+"/"+h}return f}return f},_getFirstElement:function(l){var o=this,d=o[0].prop,b,k,q,f,h,g=l,n=a.data(d.jQueryGrid[0],"allSelected"),j=a.data(jqGrid[0],"numPags"),m=false;if(d.jQueryGrid.rup_grid("isMultiselect")){if(l!==undefined){if(d.selectedRows["p_"+l]!==undefined&&d.selectedRows["p_"+l].length>0){return o._getFirstSelectedLine(l)}}if(n){for(var e=1;e<=j;e++){if(d.selectedRows["p_"+e]!==undefined&&d.selectedRows["p_"+e].length>0){return o._getFirstSelectedLine(e);break}else{if(d.selectedRows["p_"+e]===undefined){g=e;q=0;break}}}}else{b=d.selectedRows.sort(function(r,p){return r-p});a.each(b,function(r,s){if(d.selectedRows["p_"+s]!==undefined&&d.selectedRows["p_"+s].length>0){g=s;f=o._getFirstSelectedLine(s);return false}});return f}}else{g=1;q=0}return{page:g.toString(),line:q.toString(),rowId:h}},_getFirstSelectedLine:function(f){var d=this,h=d[0].prop,e,b,g;if(h.selectedRows["p_"+f]!==undefined&&h.selectedRows["p_"+f].length>0){e=h.selectedRows["p_"+f].sort(function(k,j){return k-j});b=e[0];g=h.selectedRows["p_"+f]["l_"+b][0];return{page:f.toString(),line:b.toString(),rowId:g}}else{return{page:f,line:"0",rowId:undefined}}},_getLastElement:function(m){var o=this,f=o[0].prop,b,d,l,q,j,h,n=a.data(f.jQueryGrid[0],"allSelected"),e=f.jQueryGrid,k=a.data(e[0],"numPags");if(f.jQueryGrid.rup_grid("isMultiselect")){if(m!==undefined){if(f.selectedRows["p_"+m]!==undefined&&f.selectedRows["p_"+m].length>0){return o._getLastSelectedLine(m)}}if(n){for(var g=k;g>0;g--){if(f.selectedRows["p_"+g]!==undefined&&f.selectedRows["p_"+g].length>0){return o._getLastSelectedLine(g);break}else{if(f.selectedRows["p_"+g]===undefined){h=g;q=-1;break}}}}else{b=f.selectedRows.sort(function(r,p){return p-r});a.each(b,function(r,s){if(f.selectedRows["p_"+s]!==undefined&&f.selectedRows["p_"+s].length>0){h=s;returnElem=o._getLastSelectedLine(s);return false}});return returnElem}}else{h=k;q=-1}return{page:h.toString(),line:q.toString(),rowId:j}},_getLastSelectedLine:function(f){var d=this,h=d[0].prop,e,b,g;if(h.selectedRows["p_"+f]!==undefined&&h.selectedRows["p_"+f].length>0){e=h.selectedRows["p_"+f].sort(function(k,j){return j-k});b=e[0];g=h.selectedRows["p_"+f]["l_"+b][0];return{page:f.toString(),line:b.toString(),rowId:g}}else{return{page:f,line:"0",rowId:undefined}}},_getNextElement:function(f){var r=this,d=r[0].prop,n,q,g,e,m,f,l,o=a.data(d.jQueryGrid[0],"allSelected"),b,k,p;n=r[0].prop.jQueryGrid.rup_grid("getGridParam","page");e=n;var j=a.data(jqGrid[0],"numPags");if(d.jQueryGrid.rup_grid("isMultiselect")){q=d.jQueryGrid.rup_grid("getInd",f,false);b=d.selectedRows.sort(function(t,s){return t-s});k=d.selectedRows["p_"+n].sort(function(t,s){return t-s});p=a.inArray(q,k);m=q;if(q===k[k.length-1]){posicionPage=a.inArray(parseInt(n),b);for(var h=parseInt(n)+1;h<=j;h++){if(o&&d.selectedRows["p_"+h]===undefined){e=h;m=0;break}else{if(d.selectedRows["p_"+h].length>0){e=h;m=d.selectedRows["p_"+e][0];break}}}}else{m=d.selectedRows["p_"+e][p+1];if(m===undefined){m=d.selectedRows["p_"+e][p]}}if(d.selectedRows["p_"+e]!==undefined&&d.selectedRows["p_"+e]["l_"+m]!==undefined&&d.selectedRows["p_"+e]["l_"+m].length>0){l=d.selectedRows["p_"+e]["l_"+m][0]}}else{g=d.jQueryGrid.rup_grid("getSelectedRows");q=parseInt(d.jQueryGrid.rup_grid("getInd",g[0],false));m=q;rowsPerPage=parseInt(d.jQueryGrid.rup_grid("getGridParam","rowNum"));var j=Math.ceil(d.jQueryGrid.jqGrid("getGridParam","records")/d.jQueryGrid.rup_grid("getGridParam","rowNum"));if(q===rowsPerPage){if(parseInt(n)<j){e=parseInt(e)+1;m=0}}else{m+=1}}return{page:e.toString(),line:m.toString(),rowId:l}},_getPreviousElement:function(f){var p=this,d=p[0].prop,o,f,l,n=a.data(d.jQueryGrid[0],"allSelected");var h=a.data(jqGrid[0],"numPags");var m=p[0].prop.jQueryGrid.rup_grid("getGridParam","page");var e=m;if(d.jQueryGrid.rup_grid("isMultiselect")){o=d.jQueryGrid.rup_grid("getInd",f,false);var m=p[0].prop.jQueryGrid.rup_grid("getGridParam","page");var b=d.selectedRows.sort(function(r,q){return r-q});var j=d.selectedRows["p_"+m].sort(function(r,q){return r-q});posicionLine=a.inArray(o,j);var e=m;var k=o;if(o===j[0]){posicionPage=a.inArray(parseInt(m),b);for(var g=parseInt(m)-1;g>0;g--){if(n&&d.selectedRows["p_"+g]===undefined){e=g;k=-1;break}else{if(d.selectedRows["p_"+g].length>0){e=g;k=d.selectedRows["p_"+e][d.selectedRows["p_"+e].length-1];break}}}}else{k=d.selectedRows["p_"+e][posicionLine-1]}if(d.selectedRows["p_"+e]!==undefined&&d.selectedRows["p_"+e]["l_"+k]!==undefined&&d.selectedRows["p_"+e]["l_"+k].length>0){l=d.selectedRows["p_"+e]["l_"+k][0]}}else{selectedRows=d.jQueryGrid.rup_grid("getSelectedRows");o=parseInt(d.jQueryGrid.rup_grid("getInd",selectedRows[0],false));k=o;rowsPerPage=parseInt(d.jQueryGrid.rup_grid("getGridParam","rowNum"));if(o===1){if(parseInt(m)>1){e=parseInt(e)-1;k=rowsPerPage}}else{k-=1}}return{page:e.toString(),line:k.toString(),rowId:l}},_getPrimaryKeysForRow:function(g){var d=this,h=d[0].prop,b=d.rup_maint("getPrimaryKey").split(";"),f="";if(b.length>1){for(var e=0;e<b.length;e++){f=f+"/"+h.jQueryGrid.rup_grid("getCol",g,b[e])}}else{f=f+"/"+h.jQueryGrid.rup_grid("getCol",g,b[0])}return f}})})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){var b={};a.extend(a.rup.iniRup,a.rup.rupSelectorObjectConstructor("rup_menu",b));a.fn.rup_menu("extend",{disable:function(e){var d=a("#"+e);d.addClass("ui-state-disabled")},enable:function(e){var d=a("#"+e);d.removeClass("ui-state-disabled")}});a.fn.rup_menu("extend",{_init:function(h){if(h.length>1){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_global.initError"+a(this).attr("id")))}else{if(this.length>0){var f=a.extend({},a.fn.rup_menu.defaults,h[0]),m=this,d=widgetMenu(this),g=m[0].id,l,k;d.removeClass("rup_invisible_menu");if(f.i18nId===undefined){f.i18nId=g}k=a.rup.i18n.app[f.i18nId];if(f.menu!==undefined){l=f.menu}else{if(f.json!==undefined){l=f.json}}widgetMenu.widget("ui.rupMenu",widgetMenu.ui.menu,a.rup.compatibility.menu);if(l!==undefined){m._parseJSON(l,k,d,f.forceAbs);d=widgetMenu("#"+m.attr("id"))}selectUserEvent=f.select;f.select=function(n,p){if(selectUserEvent!==undefined&&selectUserEvent!==null){if(typeof selectUserEvent==="function"){if(selectUserEvent(n,p)===false){return false}}}if(/^keydown/.test(n.originalEvent.type)){n.stopImmediatePropagation();redirectObject=a(p.item.children());if(redirectObject.attr("target")!=="_blank"){a(location).attr("href",redirectObject.attr("href"))}else{if(a.rup.browser.isFF){var o=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);var q=o.getMostRecentWindow("navigator:browser");q.delayedOpenTab(redirectObject.attr("href"),null,null,null,null)}else{if(a.rup.browser.isChrome){chrome.tabs.create({url:redirectObject.attr("href")})}else{window.open(redirectObject.attr("href"),"_blank")}}}}return false};d.find("a[target='_blank']").append("<span class='ui-icon ui-icon-extlink rup_external_link'></span>");if(f.display==="horizontal"){d.addClass("rup_menu_horizontal").addClass("ui-widget-header");d.children().addClass("rup_menu_horizontal_children");d.children().children("a").addClass("rup_menu_horizontal_children_entry");d.rupMenu(f);d.children(".ui-menu-divider").remove();d.children(".ui-state-disabled").css({"margin-top":"0em","margin-bottom":"0em"});a("#"+g+" .rup_menu_horizontal_children .rup_menu_horizontal_children_entry .ui-icon-carat-1-e").removeClass("ui-icon-carat-1-e").addClass("ui-icon-carat-1-s").addClass("rup-menu_horizontalIcon");d.children().children("a").css("font-weight","bold");d.children().each(function(n,o){var p=0;a(o).children(".rup_menu_horizontal_children_entry:has(span:not(.rup-menu_horizontalIcon))").each(function(q,r){if(a(r).find("span").size()===1){p=a(r).find("span").width()}else{p=a(r).find("span:not(.rup-menu_horizontalIcon)").width()/2}});a(o).css("width",a(o).width()+p)});d.children().children("a").css("font-weight","");d.children(":has(.rup_menu_horizontal_children_entry span:not(.rup-menu_horizontalIcon))").addClass("rup_menu_horizontal_childrenIcon");d.find(".rup_menu_horizontal_children_entry span:not(.rup-menu_horizontalIcon)").addClass("rup_menu_horizontal_children_icon");d.children(":has(.rup_menu_horizontal_children_entry span.rup-menu_horizontalIcon)").addClass("rup_menu_horizontal_childrenMenuIcon");d.children(":has(.rup_menu_horizontal_children_entry span.rup_menu_horizontal_children_icon):has(span.rup-menu_horizontalIcon)").addClass("rup_menu_horizontal_children_double");d.children(":last-child").addClass("rup_menu_horizontal_children_last");d.children().children("a[aria-haspopup='true']").parent().attr("rupMenu_firsLevel","true");a("#"+g+" [rupmenu_firslevel='true'] [role='menu']").addClass("rup_menu_vertical_horizontal");if(f.verticalWidth===undefined){a("#"+g+" [rupmenu_firslevel='true'] [role='menu']").css("white-space","nowrap")}else{a("#"+g+" [rupmenu_firslevel='true'] [role='menu']").css("width",f.verticalWidth)}d.find("a[target='_blank'] span.rup_menu_horizontal_children_icon").each(function(n,o){if(a(o).is(".ui-icon-extlink")){a(o).addClass("ui-menu-icon").removeClass("rup_menu_horizontal_children_icon")}});var e=d.find("a[target='_blank'] span.rup_menu_horizontal_children_icon").parents("li");e.css("width",e.width()+16);e.find("span.ui-icon-extlink").css("margin-left","-1em")}else{if(f.display==="vertical"){d.addClass("rup_menu_vertical");if(f.verticalWidth===undefined){d.css("white-space","nowrap")}else{d.css("width",f.verticalWidth)}d.children().addClass("rup_menu_vertical_children");d.rupMenu(f);if(f.verticalWidth!==undefined){a("#"+g+" .ui-menu .ui-menu-item").css("width",f.verticalWidth)}}else{a.rup.errorGestor(a.rup.i18n.base.rup_menu.displayMenuError)}}var j=false;a("ul.rup_menu_vertical, ul.rup_menu_vertical ul, ul.rup_menu_vertical_horizontal").each(function(o,n){a(n).children("li").children("a").children("span").each(function(p,q){if(!a(q).is(".ui-icon.ui-icon-extlink, .ui-icon.ui-icon-carat-1-e")){j=true;return false}});if(j){a(n).children("li").children("a").css("padding-left","2em")}j=false});a("#"+g+" [role = 'menuitem']").not(a("[aria-haspopup = 'true']")).css("text-decoration","underline");d.find("a").bind("click",function(n){if(a(n.currentTarget).hasClass("ui-state-disabled")){n.preventDefault();n.stopImmediatePropagation()}})}}},_parseJSON:function(l,k,m,e){var d,h,f="",j;if(m.attr("uda-submenu")==="true"){m.attr("uda-submenu","")}else{m.replaceWith(a("<ul>").attr("id",m.attr("id")).attr("style",m.attr("style")).attr("class",m.attr("class")));m=a("#"+m.attr("id"))}for(var g=l.length;g--;){h=l[g];j=a("<a>");if(h.divider!==null&&h.divider!==true){if((h.pathUrl!==undefined)||(h.url!==undefined)){if(h.pathUrl!==undefined){if((e===true)||(h.forceAbs===true)){f=a.rup_utils.relToAbsUrl(h.pathUrl)}else{f=h.pathUrl}}else{f=a.rup.CTX_PATH+h.url}if(h.newWindow!==true){if(h.icon!==undefined){m.prepend(a("<li>").append(j.text(a.rup.i18nParse(k,h.i18nCaption)).attr("href",f).css("text-decoration","underline").append(a("<span>").addClass("ui-icon").addClass(h.icon))))}else{m.prepend(a("<li>").append(j.text(a.rup.i18nParse(k,h.i18nCaption)).attr("href",f).css("text-decoration","underline")))}}else{if(h.icon!==undefined){m.prepend(a("<li>").append(j.text(a.rup.i18nParse(k,h.i18nCaption)).attr("href",f).attr("target","_blank").css("text-decoration","underline").append(a("<span>").addClass("ui-icon").addClass(h.icon))))}else{m.prepend(a("<li>").append(j.text(a.rup.i18nParse(k,h.i18nCaption)).attr("href",f).attr("target","_blank").css("text-decoration","underline")))}}}else{if(h.icon!==undefined){m.prepend(a("<li>").append(j.text(a.rup.i18nParse(k,h.i18nCaption)).css("cursor","default").append(a("<span>").addClass("ui-icon").addClass(h.icon))).append(a("<ul>").attr("uda-submenu","true")))}else{m.prepend(a("<li>").append(j.text(a.rup.i18nParse(k,h.i18nCaption)).css("cursor","default")).append(a("<ul>").attr("uda-submenu","true")))}d=a("[uda-submenu = 'true']");d.append(this._parseJSON(h.submenu,k,d));delete d}if(h.disabled===true){j.parent().addClass("ui-state-disabled")}}else{if(h.i18nCaption===undefined){m.prepend(a("<li>").addClass("ui-widget-content ui-menu-divider"))}else{m.prepend(a("<li>").append(a("<strong>").text(a.rup.i18nParse(k,h.i18nCaption))))}}}delete h}});a.fn.rup_menu.defaults={verticalWidth:undefined,display:"horizontal",forceAbs:false,i18nId:undefined,menus:"ul"}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupObjectConstructor("rup_messages",a));window.alert=function(d){b.rup_messages("msgAlert",{title:b.rup.i18nParse(b.rup.i18n.base,"rup_message.alert"),message:d})};b.rup_messages("extend",{msgError:function(g){var h=b.extend({},b.rup_messages.defaults,g),e,f,j=b(document.activeElement);this._rupProperties(h,b.rup.i18nParse(b.rup.i18n.base,"rup_message.tituloError"));h._close=h.close;h.close=function(k,l){j.focus();if(h._close!==undefined){h._close(k,l)}};h.buttons=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){d.dialog("close")}}];var d=this._createDiv().appendTo("body");d.dialog(h);this._createCloseLink(d);this._addStyles(d,"error",h.message);e=b(document).height();f=b(document).width();d.dialog("open");this._dialogInPortal(f,e)},msgConfirm:function(g){var h=b.extend({},b.rup_messages.defaults,g),e,f,k=b(document.activeElement);this._rupProperties(h,b.rup.i18nParse(b.rup.i18n.base,"rup_message.confirmacion"));h._close=h.close;h.close=function(l,m){k.focus();if(h._close!==undefined){h._close(l,m)}};var d=this._createDiv().appendTo("body"),j;d.dialog(h);j=[{text:b.rup.i18nParse(b.rup.i18n.base,(h.siNo==null||h.siNo==false)?"rup_message.aceptar":"rup_message.si"),click:function(){h.OKFunction.call(this,d);d.dialog("close")}}];d.dialog("option","buttons",j);this._createCloseLink(d);this._addStyles(d,"confirm",h.message);this._createLinkButton(d,h.CANCELFunction,h.siNo);e=b(document).height();f=b(document).width();d.dialog("open");this._dialogInPortal(f,e);b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-buttonpane button:first").focus()},msgOK:function(g){var h=b.extend({},b.rup_messages.defaults,g),e,f,j=b(document.activeElement);this._rupProperties(h,b.rup.i18nParse(b.rup.i18n.base,"rup_message.correct"));h._close=h.close;h.close=function(k,l){j.focus();if(h._close!==undefined){h._close(k,l)}};h.buttons=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){d.dialog("close")}}];var d=this._createDiv().appendTo("body");d.dialog(h);this._createCloseLink(d);this._addStyles(d,"ok",h.message);e=b(document).height();f=b(document).width();d.dialog("open");this._dialogInPortal(f,e)},msgAlert:function(g){var h=b.extend({},b.rup_messages.defaults,g),e,f,j=b(document.activeElement);this._rupProperties(h,b.rup.i18nParse(b.rup.i18n.base,"rup_message.alert"));h._close=h.close;h.close=function(k,l){j.focus();if(h._close!==undefined){h._close(k,l)}};h.buttons=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){d.dialog("close")}}];var d=this._createDiv().appendTo("body");d.dialog(h);this._createCloseLink(d);this._addStyles(d,"alert",h.message);e=b(document).height();f=b(document).width();d.dialog("open");this._dialogInPortal(f,e)}});b.rup_messages("extend",{_createDiv:function(){return b("<div/>").attr("id","rup_msgDIV_"+new Date().getTime()).attr("rup_message","true")},_createCloseLink:function(d){var e="<span id='closeText_"+d[0].id+"' style='float:right;font-size:0.85em;'>"+b.rup.i18nParse(b.rup.i18n.base,"rup_global.cerrar")+"</span>",f=b("<a href='#'></a>").attr("role","button").css("margin-right","0.9em").css("float","right").addClass("ui-dialog-title").html(e).click(function(g){d.dialog("close");return false}).hover(function(g){b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-titlebar-close").addClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-titlebar-close").css("padding","0px")},function(g){b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-titlebar-close").removeClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-titlebar-close").attr("style","")}).insertAfter("#ui-dialog-title-"+d[0].id);b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-titlebar-close").hover(function(){f.css("text-decoration","none")},function(){f.css("text-decoration","")})},_addStyles:function(e,f,g){var h=b("<div>").attr("id","rup_msgDIV_msg_icon").addClass("rup-message_icon-"+f),d=b("<div>").attr("id","rup_msgDIV_msg").addClass("rup-message_msg-"+f).html(g);e.append(h);e.append(d)},_createLinkButton:function(d,h,g){var e=h,f=b("<a href='#'></a>").attr("role","button").attr("id",d[0].id+"_cancel").addClass("rup-enlaceCancelar").html(b.rup.i18nParse(b.rup.i18n.base,(g==null||g==false)?"rup_global.cancel":"rup_message.no")).click(function(j){d.dialog("close");if(e!==undefined){e.call(this,d)}return false});b("div[aria-labelledby=ui-dialog-title-"+d[0].id+"] .ui-dialog-buttonset ").prepend(f)},_dialogInPortal:function(e,d){if(b.rup_utils.aplicatioInPortal()){b(".ui-widget-overlay").css("height",d).css("width",e);b(".r01gContainer").append(b(".ui-dialog [rup_message = 'true']").parent()).append(b(".ui-widget-overlay"));b(".ui-dialog [rup_message = 'true']").parent().css("position","absolute").css("top",(d/2)-(b(".ui-dialog:visible").height()/2))}},_rupProperties:function(d,e){d.autoOpen=false;d.modal=true,d.resizable=false,d.title=(d.title===null||d.title===""?e:d.title);d.closeText=b.rup.i18nParse(b.rup.i18n.base,"rup_message.tituloError.cerrar"),d.close=function(){b(this).remove()}}});b.rup_messages.defaults={minHeight:100}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){var b={};a.extend(a.rup.iniRup,a.rup.rupObjectConstructor("rup_report",b));a.rup_report("extend",{});a.rup_report("extend",{_init:function(l){if(l.length>1){a.rup.errorGestor(a.rup.i18n.base.rup_global.initError+a(this).attr("id"))}else{var r=this,f=a.extend(true,{},a.rup_report.defaults,l[0]),m=f.buttons,p=f.dialog,g=f.customDialog,q=a.find("[id='"+f.appendTo+"']");if(a.isEmptyObject(q)){alert("No existe objeto al que añadir el componente");return false}q=a(q[0]);q.data("report",f);var n=a("<div />").attr("id","reportFileWait").attr("title",p.wait.title).text(p.wait.msg).addClass("rup_report").hide().append(a("<div />").addClass("ui-progressbar ui-progressbar-value ui-corner-left ui-corner-right")),s=a("<div />").attr("id","reportFileError").attr("title",p.error.title).text(p.error.msg).addClass("rup_report").hide(),k=a("<div />").attr("id","rup_report_dialogsContainer").append(n).append(s);q.after(k);p.waitDiv="reportFileWait";p.errorDiv="reportFileError";var e=false,d;if(q.hasClass("rup-toolbar_menuButtonContainer")){d=a("[id='"+q.attr("id").substring("8")+"']");q=d.parents(".rup-toolbar");e=true;if(a.grep(m,function(u,t){return u.buttons!==undefined}).length>0){alert("No se pueden añadir MButtons a un contenedor MButton");return false}}var o=[];a.each(m,function(u,t){if(t.buttons!==undefined){t.click=q.showMButton;d=q.addMButton(t,t.json_i18n);q.addButtonsToMButton(t.buttons,d,t.json_i18n);a.each(t.buttons,function(w,v){r._checkButton(v,o);r._configureButton(v,p,g)})}else{if(!e){q.addButton(t,t.json_i18n);t.id=q.attr("id")+"##"+((t.id)?t.id:t.i18nCaption)}else{q.addButtonsToMButton(new Array(t),d,t.json_i18n);$mbuttonDiv=a("[id='mbutton_"+d.attr("id")+"']");$mbuttonDiv.find("li:first").appendTo($mbuttonDiv.children("ul"))}r._checkButton(t,o);r._configureButton(t,p,g)}});if(o.length>0){var j="";for(var h=0;h<o.length;h++){j+=o[h]+"<br/>"}alert(j)}}},_checkButton:function(e,g){var f=e.id.substring(e.id.lastIndexOf("##")+2);if(e.url===undefined){g.push(f+": no tiene URL asociada")}if(e.columns!==undefined){var d=a.find("#"+e.columns.grid);if(a.isEmptyObject(d)){g.push(f+": no existe el Grid asociado")}}},_configureButton:function(h,e,d){var f=this,g={};a.extend(g,e);h.isInline=(h.isInline===undefined)?false:h.isInline;if(!h.isInline){a("[id='"+h.id+"']").on("click",function(){var r=a(this).parents("div.rup-toolbar_menuButtonContainer");if(r.length>0){r.showMButton();r.removeClass("rup-toolbar_menuButtonSlided")}var l={};if(h.columns!==undefined){var q=a(a.find("#"+h.columns.grid)[0]);l=q.jqGrid("getGridParam","postData");l.columns=a.toJSON(f._getColumns(q,h.columns))}var p=true;if(h.customDialog!==undefined){var j=d[h.customDialog];if(j.waitDiv===undefined){g.wait=j.wait}else{g.waitDiv=j.waitDiv;a("#"+g.waitDiv).addClass("rup_report")}if(j.errorDiv===undefined){g.error=j.error}else{g.errorDiv=j.errorDiv;a("#"+g.errorDiv).addClass("rup_report")}g.successCallback=j.successCallback;g.failCallback=j.failCallback}var n=a("#"+g.waitDiv);n.rup_dialog({type:a.rup.dialog.TEXT,autoOpen:false,modal:true,resizable:false,close:function(s,t){if(a.rup.browser.isIE){document.execCommand("Stop")}else{window.stop()}}});if(p){n.rup_dialog("setOption","title",g.wait.title);var o=n.html().split(n.text()),m="";for(var k=0;k<o.length;k++){if(o[k]===""){m+=g.wait.msg}else{m+=o[k]}}n.html(m)}n.rup_dialog("open");a.fileDownload(a.rup_utils.setNoPortalParam(h.url),{httpMethod:"POST",data:l,successCallback:function(s){if(g.successCallback!==undefined){g.successCallback()}n.rup_dialog("close")},failCallback:function(s,t){n.rup_dialog("close");var u=a("#"+g.errorDiv);u.rup_dialog({type:a.rup.dialog.TEXT,autoOpen:false,modal:true,resizable:false});if(p){u.rup_dialog("setOption","title",g.error.title);u.rup_dialog("setOption","message",g.error.msg)}u.rup_dialog("open");if(g.failCallback!==undefined){g.failCallback()}}});return false})}else{a("[id='"+h.id+"']").on("click",function(){window.open(h.url+"?isInline=true","_blank")})}},_getColumns:function(l,f){var k=l.jqGrid("getGridParam","colModel"),m=l.jqGrid("getGridParam","colNames"),n=m.length,h=[],e=f.customNames,j=f.hidden===true?true:false;if(e===undefined){for(var g=0;g<n;g++){if(m[g].indexOf("type='checkbox'")!==-1){continue}if(j||!j&&k[g].hidden===false){var d=[];d.push(k[g].name);d.push(m[g]);h.push(d)}}}else{for(var g=0;g<n;g++){if(a.inArray(k[g].name,e)!==-1){var d=[];d.push(k[g].name);d.push(m[g]);h.push(d)}}}return h}});a.rup_report.defaults={dialog:{wait:{title:a.rup.i18nParse(a.rup.i18n.base,"rup_report.waitTitle"),msg:a.rup.i18nParse(a.rup.i18n.base,"rup_report.waitMsg")},error:{title:a.rup.i18nParse(a.rup.i18n.base,"rup_report.errorTitle"),msg:a.rup.i18nParse(a.rup.i18n.base,"rup_report.errorMsg")}}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var d={};d.plugins=[];jQuery.rup_table=jQuery.rup_table||{};jQuery.extend(jQuery.rup_table,{registerPlugin:function(e,f){if(jQuery.inArray(e,d.plugins)===-1){d.plugins.push(e);d.plugins[e]=f}}});jQuery.extend(jQuery.rup.iniRup,jQuery.rup.rupSelectorObjectConstructor("rup_table",d));jQuery.extend(jQuery.jgrid,{createModal:function(l,j,e,m,o,n,h){var f=jQuery("<div/>").attr("id",l.themodal).append(b(j));var k=f.find("#"+l.scrollelm);f.insertBefore(b(m));f.rup_dialog({type:b.rup.dialog.DIV,autoOpen:false,modal:true,resizable:e.resize,title:e.caption,width:e.width,buttons:e.buttons});if(jQuery.isFunction(e.onClose)){jQuery(".ui-dialog-titlebar-close, a:has(#closeText_"+f.first()[0].id+")",f.parent()).off("click").on("click",function(p){e.onClose.call(p)})}jQuery("#"+l.scrollelm+"_2").addClass("botoneraModal");jQuery(".fm-button","#"+l.scrollelm+"_2").on({focusin:function(){jQuery(this).addClass("ui-state-focus")},focusout:function(){jQuery(this).removeClass("ui-state-focus")}});if(e.linkStyleButtons!==undefined){for(var g=0;g<e.linkStyleButtons.length;g++){jQuery(e.linkStyleButtons[0]).addClass("botonEnlace")}}},hideModal:function(e,f){jQuery(e).rup_dialog("close")},viewModal:function(e,f){jQuery(e).rup_dialog("open")}});jQuery.extend(jQuery.rup_table,{proxyAjax:function(e,f){jQuery.rup_ajax(e)}});jQuery.fn.rup_table("extend",{preConfigureCore:function(j){var k=this,f,h;j.baseUrl=j.url;if(jQuery.inArray("filter",j.usePlugins)===-1){j.url+="/filter"}j.id=k.attr("id");j.core.tableDiv=j.id+"_div";j.core.$tableDiv=jQuery("#"+j.core.tableDiv);jQuery(document).bind("click",function(l){var m=jQuery(l.target);if(m.parents().index(j.core.$tableDiv)===-1){k.triggerHandler("rupTable_checkOutOfGrid",[l,m])}});if(j.pager!==false){j.pager=b.rup_utils.getJQueryId(j.pager!==null?j.pager:j.id+"_pager");j.$pager=jQuery(j.pager);if(j.$pager.length===0){alert("El identificador "+j.pager+" especificado para el paginador no existe.")}}f=j.colModel;if(j.loadOnStartUp===false){k.data("tmp.loadOnStartUp.datatype",j.datatype);j.datatype="clientSide"}for(var g=0;g<f.length;g++){h=f[g];if(h.rupType!==undefined&&h.rupType!==null){h.edittype="custom";if(!jQuery.isFunction(h.editoptions.custom_element)){h.editoptions.custom_element=function(m,l){return b("<input>").attr({type:"text",id:l.id,name:l.name,"class":"FormElement formulario_linea_input customelement",style:"width:98%",value:m})[0]}}if(!jQuery.isFunction(h.editoptions.custom_value)){h.editoptions.custom_value=function(m,l,o){var n=m.attr("ruptype");if(n!==undefined){if(l==="set"){m["rup_"+n]("setRupValue",o)}else{if(l==="get"){return m["rup_"+n]("getRupValue")}}}}}}}if(j.showGridInfoCol){j.colNames=b.merge([""],j.colNames);j.colModel=b.merge([j.defaultGridInfoCol],j.colModel)}if(j.primaryKey!==undefined&&typeof j.primaryKey==="string"){j.primaryKey=[j.primaryKey]}if(j.primaryKey!==undefined&&typeof j.primaryKey==="object"){if(j.primaryKey.length===1){j.primaryKeyCol=j.primaryKey[0];for(var g=0;g<f.length;g++){if(f[g].name===j.primaryKeyCol){f[g].key=true;break}}}else{if(j.primaryKey.length>1){j.colNames=b.merge([""],j.colNames);var e=b.extend({},j.defaultGridMultiplePkCol,{key:true,formatter:function(l,m,r){var q=b(this),o=q.data("settings"),p="";for(var n=0;n<o.primaryKey.length;n++){p+=r[o.primaryKey[n]]+o.multiplePkToken}p=p.substr(0,p.length-1);return p}});j.primaryKeyCol="pkCol";j.colModel=b.merge([e],j.colModel)}}}for(var g=0;g<f.length;g++){h=f[g];if(h.editable===true){if(h.editableOnAdd===undefined){h.editableOnAdd=true}if(h.editableOnEdit===undefined){if(jQuery.inArray(f[g].name,j.primaryKey)!==-1){h.editableOnEdit=false}else{h.editableOnEdit=true}}}}j.serializeGridData=function(l){var m;jQuery.extend(true,l,{core:{pkToken:j.multiplePkToken,pkNames:j.primaryKey}});m=b.extend({},{filter:{}},l);k.triggerHandler("rupTable_serializeGridData",[m]);return jQuery.toJSON(m)};j.beforeProcessing=function(m,l,n){if(k.triggerHandler("rupTable_beforeProcessing",[m,l,n]===false)){return false}if(j.primaryKey.length>1){b.each(m.rows,function(o,q){var r="";for(var p=0;p<j.primaryKey.length;p++){r+=q[j.primaryKey[p]]+j.multiplePkToken}r=r.substr(0,r.length-1);q.pkCol=r})}return true};j.getSelectedRows=function(){var m=this,l=m.rup_table("getGridParam","selrow");return l===null?[]:[l]};j.getSelectedLines=function(){var m=this,l=m.rup_table("getGridParam","selrow");return l===null?[]:[b.inArray(l,m.jqGrid("getDataIDs"))]};k.on({jqGridBeforeRequest:function(){jQuery.set_uda_ajax_mode_on()},"jqGridLoadComplete.rup_table.tooltip":function(l,m){var n=b(this);jQuery(".pagControls input.ui-pg-input",j.$pager).attr({size:m.total.length,maxlength:m.total.length})},"jqGridGridComplete.rup_table.tooltip":function(){var m=b(this),l;b("#"+b(this).attr("id")+" [title]").each(function(o,p){var n=b(p);n.attr("grid_tooltip",n.attr("title")).removeAttr("title")});l=jQuery("tbody:first",m);l.on("mousestop",{delay:500},function(o,n){var p=b.rup_utils.elementFromPoint(n.clientX,n.clientY,true),q=b(p);if(!q.attr("rup_tooltip")&&q.attr("grid_tooltip")){q.attr("title",q.attr("grid_tooltip"));q.rup_tooltip({show:{delay:0},position:{viewport:b(window),adjust:{method:"flip"}}});q.triggerHandler("mouseenter");q.rup_tooltip("option","show.delay",500)}else{if(q.attr("rup_tooltip")){q.attr("title",q.attr("rup_tooltip"));q.rup_tooltip({show:{delay:0},position:{viewport:b(window),adjust:{method:"flip"}}});q.triggerHandler("mouseenter");q.rup_tooltip("option","show.delay",500)}}})}})},postConfigureCore:function(e){var f=this;if(e.resizable!==false){f.rup_table("gridResize",(jQuery.isPlainObject(e.resizable)?e.resizable:{}))}if(e.pager!==false){f.rup_table("configurePager",e)}b.each(b("#gview_table th:visible"),function(h,j){var g=b(j),k=g.find("div").text();if(k!==""){g.attr("title",k).rup_tooltip({show:{delay:500},position:{viewport:b(window),adjust:{method:"flip"}}})}});jQuery(f.rup_table("getGridParam","colModel")).each(function(g,h){var j;if(h.classes==="ui-ellipsis"){jQuery("[id='jqgh_"+e.id+"_"+h.name+"']").css("display","block").css("text-overflow","ellipsis")}j=jQuery("[id='jqgh_"+e.id+"_"+h.name+"']").children("div");j.replaceWith(jQuery("<span>").text(j.text()).css("cursor","pointer"))});if(e.showGridInfoCol){jQuery("#gview_"+e.id+" table thead th#"+e.id+"_rupInfoCol").css("border-right","0px none")}if(e.loadOnStartUp===false){e.datatype=f.data("tmp.loadOnStartUp.datatype");f.rup_table("setGridParam",{datatype:f.data("tmp.loadOnStartUp.datatype")});f.removeData("tmp.loadOnStartUp.datatype")}}});jQuery.fn.rup_table("extend",{getColModel:function(){return b(this).jqGrid("getGridParam","colModel")},getGridParam:function(e){return b(this).jqGrid("getGridParam",e)},gridResize:function(e){return b(this).jqGrid("gridResize",e)},getSelectedRows:function(){var f=this,e=f.data("settings");return jQuery.proxy(e.getSelectedRows,f)()},getSelectedLines:function(){var f=this,e=f.data("settings");return jQuery.proxy(e.getSelectedLines,f)()},getPkUrl:function(g){var h=this,f=h.data("settings"),e;if(jQuery.isArray(g)){e=g[0]!==undefined?g[0]:""}else{e=g}return e.replace(f.multiplePkToken,"/")},reloadGrid:function(h){var j=$self.rup_table("getGridParam","page");var e=$self.jqGrid("getGridParam","ajaxGridOptions");var f=e.async;e.async=false;var e=$self.jqGrid("setGridParam",{ajaxGridOptions:e});$self.jqGrid("setGridParam",{page:parseInt(j,10)+1});$self.trigger("reloadGrid");e.async=true;var e=$self.jqGrid("setGridParam",{ajaxGridOptions:e});var g=jQuery.proxy(jQuery.jgrid.getCurrPos,$self[0])();$self.jqGrid("setSelection",g[1][0])},resetForm:function(f){var h=this,g=h.data("settings");if(f.data("validator")!=undefined){var e=f.data("validator").settings.errorClass;b("."+e,f).removeClass(e)}jQuery("input[type!='button'][type!='checkbox'][type!='radio'], textarea",f).val("");jQuery("input[type='checkbox']",f).not("[name*='jqg_GRID_']",f).not("[disabled='disabled']",f).removeAttr("checked");jQuery.each(b("select.rup_combo",f),function(j,k){if(g.filter.clearSearchFormMode==="reset"){jQuery(k).rup_combo("reset")}else{jQuery(k).rup_combo("clear")}});b("[ruptype='autocomplete']",f).each(function(j,k){b(k).val("")});if(g.filter.clearSearchFormMode==="reset"){f.resetForm()}else{b("input[type='radio']",f).removeAttr("checked")}return h},setGridParam:function(e){b(this).jqGrid("setGridParam",e);return b(this)},showServerValidationFieldErrors:function(e,g){var f=b(this);if(g.rupErrorFields!==undefined||g.rupFeedback!==undefined){e.validate().submitted=b.extend(true,e.validate().submitted,g.rupErrorFields);e.validate().invalid=g.rupErrorFields;e.validate().showErrors(g.rupErrorFields)}else{if(g.rupFeedback!==undefined){f.rup_table("showFeedback",e.validate().settings.feedback,b.rup_utils.printMsg(g.rupFeedback.message),(g.rupFeedback.imgClass!==undefined?g.rupFeedback.imgClass:null))}}},clearHighlightedRowAsSelected:function(e){var k=this,f=k[0],g=f.p,j=e[0],h=g.frozenColumns===true?g.id+"_frozen":"";if(!e.hasClass("ui-subgrid")&&!e.hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(g.id)+"_"+b.jgrid.jqID(j.id))[g.useProp?"prop":"attr"]("checked",false);e.removeClass("ui-state-highlight").attr("aria-selected","false");if(h){b("#jqg_"+b.jgrid.jqID(g.id)+"_"+b.jgrid.jqID(j.id),f.grid.fbDiv)[g.useProp?"prop":"attr"]("checked",false);b("#"+b.jgrid.jqID(j.id),f.grid.fbDiv).removeClass("ui-state-highlight")}}k.trigger("rupTableClearHighlightedRowAsSelected",[e])},highlightRowAsSelected:function(e){var k=this,f=k[0],g=f.p,j=e[0],h=g.frozenColumns===true?g.id+"_frozen":"";if(e.length>0&&!e.hasClass("ui-subgrid")&&!e.hasClass("jqgroup")&&!e.hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(g.id)+"_"+b.jgrid.jqID(j.id))[g.useProp?"prop":"attr"]("checked",true);e.addClass("ui-state-highlight").attr("aria-selected","true");g.selarrrow.push(j.id);g.selrow=j.id;if(h){b("#jqg_"+b.jgrid.jqID(g.id)+"_"+b.jgrid.jqID(j.id),f.grid.fbDiv)[g.useProp?"prop":"attr"]("checked",true);b("#"+b.jgrid.jqID(j.id),f.grid.fbDiv).addClass("ui-state-highlight")}k.trigger("rupTableHighlightRowAsSelected",[e])}},updateDetailPagination:function(g,e){var l=this,h=l.data("settings"),j=h.id,k,f;k=(g!==undefined?g:b.proxy(h.getDetailCurrentRowCount,l)());f=(e!==undefined?e:b.proxy(h.getDetailTotalRowCount,l)());if(k===1){b("#first_"+j+", #back_"+j,h.$detailFormDiv).addClass("ui-state-disabled")}else{b("#first_"+j+", #back_"+j,h.$detailFormDiv).removeClass("ui-state-disabled")}if(k===f){b("#forward_"+j+", #last_"+j,h.$detailFormDiv).addClass("ui-state-disabled")}else{b("#forward_"+j+", #last_"+j,h.$detailFormDiv).removeClass("ui-state-disabled")}b("#rup_maint_selectedElements_"+l.attr("id")).text(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.defaults.detailForm_pager"),k,f))}});jQuery.fn.rup_table("extend",{configurePager:function(g){var k=this,f,h,j,e;if(g.pager!==undefined&&g.pager!==null){g.$pager=b((g.pager.indexOf("#")===0?g.pager:"#"+g.pager));f=g.$pager.attr("id");g.$pager.css("height","auto");$pagerLeft=b("#"+f+"_left");h=b("#"+f+"_center");$pagerRight=b("#"+f+"_right");$pagerLeft.addClass("pager_left");h.addClass("pager_center");$pagerRight.addClass("pager_right");$pagerLeft.html("");if(g.multiselect===true){$pagerLeft.append(b("<div/>").addClass("ui-paging-selected").html("0 "+jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.selected")))}jQuery(".pager_center table td",g.$pager).addClass("pagControls");jQuery(".pagControls select.ui-pg-selbox",h).attr("title",jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.select")).rup_tooltip();jQuery(".pagControls input.ui-pg-input",h).attr("title",jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.input")).rup_tooltip();jQuery("#first_"+f,h).html(b("<a/>").attr("href","javascript:void(0)").html(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.primPag")).addClass("linkPaginacion")).removeClass("ui-pg-button");jQuery("#prev_"+f,h).html(b("<a/>").attr("href","javascript:void(0)").html(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.anterior")).addClass("linkPaginacion")).removeClass("ui-pg-button");jQuery("#next_"+f,h).html(b("<a/>").attr("href","javascript:void(0)").html(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.siguiente")).addClass("linkPaginacion")).removeClass("ui-pg-button");jQuery("#last_"+f,h).html(b("<a/>").attr("href","javascript:void(0)").html(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.ultiPag")).addClass("linkPaginacion")).removeClass("ui-pg-button")}}});jQuery.fn.rup_table("extend",{_init:function(f){if(f.length>1){jQuery.rup.errorGestor(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var k=this,g={};var j=(jQuery.isArray(f[0].defaultPlugins)?f[0].defaultPlugins:jQuery.fn.rup_table.defaults.defaultPlugins),h=jQuery.merge([],f[0].usePlugins),e=jQuery.merge(jQuery.merge([],j),h);jQuery.rup_utils.sortArray(e,function(m,l){return d.plugins[l].loadOrder-d.plugins[m].loadOrder});g=b.extend(true,{},g,jQuery.fn.rup_table.plugins.core.defaults);b.each(e,function(m,l){if(d.plugins[l]!==undefined&&jQuery.fn.rup_table.plugins[l]!==undefined){g=b.extend(true,{},g,jQuery.fn.rup_table.plugins[l].defaults)}});g=jQuery.extend(true,{},jQuery.fn.rup_table.defaults,g,f[0]);k.rup_table("preConfigureCore",g);b.each(e,function(m,l){if(jQuery.isFunction(d.plugins[l].preConfiguration)){jQuery.proxy(d.plugins[l].preConfiguration,k)(g)}});k.jqGrid(g);k.rup_table("postConfigureCore",g);b.each(e,function(m,l){if(jQuery.isFunction(d.plugins[l].postConfiguration)){jQuery.proxy(d.plugins[l].postConfiguration,k)(g)}});k.data("settings",g)}}});jQuery.fn.rup_table("extend",{addRowData:function(g,h,f,e){var j=b(this);return j.jqGrid("addRowData",g,h,f,e)},delRowData:function(e){var f=b(this);f.jqGrid("delRowData",e);return f},setRowData:function(e,f,h){var g=b(this);g.jqGrid("setRowData",e,f,h);if(g._tooltip){g._tooltip(e)}},getRowData:function(e){var f=b(this);return f.jqGrid("getRowData",e)},getDataIDs:function(){var e=b(this);return e.jqGrid("getDataIDs")},getGridParam:function(e){var f=b(this);return f.jqGrid("getGridParam",e)},setGridParam:function(f){var e=b(this);e.jqGrid("setGridParam",f)},clearGridData:function(e){var f=b(this);f.jqGrid("clearGridData",e)},getColModel:function(){var e=b(this);return e.jqGrid("getGridParam","colModel")},getCol:function(f,e){var g=b(this);return g.jqGrid("getCell",f,e)},getSerializedForm:function(g,f,e){return form2object(g instanceof jQuery?g[0]:g,e?e:null,f?f:false)}});jQuery.fn.rup_table.plugins={};jQuery.fn.rup_table.plugins.core={};jQuery.fn.rup_table.plugins.core.defaults={core:{operations:{},defaultOperations:{}}};jQuery.fn.rup_table.defaults={altRows:true,altclass:"rup-grid_oddRow",datatype:"json",editable:false,height:"auto",jsonReader:{repeatitems:false},pager:null,resizable:false,rowNum:10,rowList:[10,20,30],sortable:true,viewrecords:true,mtype:"POST",loadOnStartUp:true,loadBeforeSend:function a(f,e){f.setRequestHeader("JQGridModel","true");f.setRequestHeader("Content-Type","application/json")},validate:{},defaultPlugins:[],dataProxy:jQuery.rup_table.proxyAjax,defaultGridInfoCol:{name:"rupInfoCol",index:"rupInfoCol",editable:false,fixed:true,sortable:false,width:16,resizable:false,classes:"rupInfoCol",search:false,formatter:function(){return"<span class='ui-icon ui-icon-rupInfoCol'/>"}},defaultGridMultiplePkCol:{name:"pkCol",index:"pkCol",editable:false,fixed:true,sortable:false,width:25,resizable:false,search:false},multiplePkToken:"~",showGridInfoCol:false,tooltipDelay:500}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("contextMenu",{loadOrder:4,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureContextMenu",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigureContextMenu",b)}});jQuery.fn.rup_table("extend",{preConfigureContextMenu:function(b){var d=this},postConfigureContextMenu:function(b){var d=this;d.on({"jqGridLoadComplete.rupTable.contextMenu":function(e){var g=jQuery("tbody:first tr",d),f={};jQuery.each(b.contextMenu.defaultRowOperations,function(j,k){var h;if(k===true){h=b.core.operations[j];if(h!==undefined){f[j]={name:h.name,cssSprite:h.icon,disabled:function(){return !jQuery.proxy(h.enabled,d)()},callback:function(m,l){jQuery.proxy(h.callback,d)(m,l)}}}}});g.rup_contextMenu({items:f})}})}});jQuery.fn.rup_table.plugins.contextMenu={};jQuery.fn.rup_table.plugins.contextMenu.defaults={contextMenu:{defaultRowOperations:{},rowOperations:{}}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, VersiÃ³n 1.1 exclusivamente (la Â«LicenciaÂ»);
 * Solo podrÃ¡ usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislaciÃ³n aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye Â«TAL CUALÂ»,
 * SIN GARANTÃ�AS NI CONDICIONES DE NINGÃšN TIPO, ni expresas ni implÃcitas.
 * VÃ©ase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("filter",{loadOrder:1,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureFilter",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigureFilter",b)}});jQuery.fn.rup_table("extend",{preConfigureFilter:function(k){var m=this,j=k.id,e=k.filter,p,h,n,l,b,g,f,o,d;e.id=(e.id!==undefined?e.id:j+"_filter_form");e.filterToolbarId=(e.filterToolbar!==undefined?e.filterToolbar:j+"_filter_toolbar");e.filterButtonId=(e.filterButtonId!==undefined?e.filterButtonId:j+"_filter_filterButton");e.cleanLinkId=(e.cleanLinkId!==undefined?e.cleanLinkId:j+"_filter_cleanLink");e.collapsableLayerId=(e.collapsableLayerId!==undefined?e.collapsableLayerId:j+"_filter_fieldset");e.toggleIcon1Id=(e.toggleIcon1!==undefined?e.toggleIcon1:j+"_filter_toggle_icon1");e.toggleLabelId=(e.toggleLabelId!==undefined?e.toggleLabelId:j+"_filter_toggle_label");e.filterSummaryId=(e.filterSummaryId!==undefined?e.filterSummaryId:j+"_filter_summary");e.toggleIcon2Id=(e.toggleIcon2!==undefined?e.toggleIcon2:j+"_filter_toggle_icon2");e.$filterContainer=jQuery("#"+e.id);e.$filterToolbar=jQuery("#"+e.filterToolbarId);if(e.$filterContainer.length===0){alert("El identificador especificado para el fomulario de bÃºsqueda no existe.")}else{if(e.$filterToolbar.length===0){alert("El identificador especificado para la barra de controles del formulario de filtrado no existe.")}else{h=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.toggleIcon1");n=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.toggleLabel");l=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.filterSummary");b=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.toggleIcon2");g=a(jQuery.jgrid.format(h,e.toggleIcon1Id));f=a(jQuery.jgrid.format(n,e.toggleLabelId,a.rup.i18n.base.rup_table.plugins.filter.filterCriteria));o=a(jQuery.jgrid.format(l,e.filterSummaryId));d=a(jQuery.jgrid.format(b,e.toggleIcon2Id));e.$filterToolbar.append(g).append(f).append(o).append(d);e.$filterContainer=jQuery("#"+e.id);e.$filterButton=jQuery("#"+e.filterButtonId);e.$cleanLink=jQuery("#"+e.cleanLinkId);e.$collapsableLayer=jQuery("#"+e.collapsableLayerId);e.$toggleIcon1=g;e.$toggleLabel=f;e.$filterSummary=o;e.$toggleIcon2=d;if(e.$filterContainer.prop("tagName")==="FORM"){e.$filterContainer.ajaxForm()}e.$filterContainer.parent().css("width",m.rup_table("getGridParam","width"));if(k.filter.url===null){k.filter.url=k.baseUrl+"/filter"}k.url=k.filter.url;k.searchURL=m.rup_table("getGridParam","url");e.$filterContainer.bind("keydown",function(q){if(q.keyCode==13){m.rup_table("showSearchCriteria");m.rup_table("filter")}});e.$filterButton.bind("click",function(){m.rup_table("showSearchCriteria");m.rup_table("filter")});e.$cleanLink.bind("click",function(){m.rup_table("cleanFilterForm").rup_table("filter");if(e.validate!==undefined){jQuery(".rup-maint_validateIcon",e.$filterContainer).remove()}m.rup_table("showSearchCriteria")});e.$toggleIcon1.add(e.$toggleLabel).add(e.$toggleIcon2).attr("tabindex","0").on({keydown:function(q){if(q.keyCode==13){m.rup_table("toggleFilterForm")}}});e.$filterToolbar.addClass("cursor_pointer").on({click:function(){m.rup_table("toggleFilterForm")}});if(k.filter.showHidden===true){e.$collapsableLayer.hide();e.$toggleIcon1.removeClass("ui-icon-triangle-1-n").addClass("ui-icon-triangle-1-s");e.$filterSummary.parent().addClass("rup-maint_searchCriteria")}if(e.validate!==undefined){e.$filterContainer.rup_validate(e.validate);m.on({"rupTable_beforeFilter.filter.validate":function(){return e.$filterContainer.valid()}})}}}m.on({"rupTable_serializeGridData.filter":function(t,r){var s=form2object(k.filter.$filterContainer[0]),u=jQuery.param(s),q=m.data("tmp.lastFilterParams");jQuery.extend(r,{filter:s});if(q===undefined||q!==u){jQuery.extend(r,{page:"1"});m.data("tmp.lastFilterParams",u)}}})},postConfigureFilter:function(e){var f=this,b,d}});jQuery.fn.rup_table("extend",{cleanFilterForm:function(){var d=this,b=d.data("settings");d.rup_table("resetForm",b.filter.$filterContainer);return d},filter:function(e){var f=this,d=f.data("settings");var b=f.triggerHandler("rupTable_beforeFilter");if(b===false||b==="stop"){return}if(a.isFunction(d.filter.beforeFilter)){b=d.filter.beforeFilter.call(f);if(b===undefined){b=true}if(b===false){return}}f.rup_table("setGridParam",{page:"1"});f.trigger("reloadGrid")},getFilterParams:function(){var d=this,b=d.data("settings");return form2object(b.filter.$filterContainer[0])},hideFilterForm:function(){var e=a(this),d=e.data("settings"),b=d.filter;b.$collapsableLayer.hide(d.filter.transitionConfig);b.$toggleIcon2.removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");b.$toggleIcon1.removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e");b.$filterSummary.parent().addClass("rup-maint_searchCriteria")},showFilterForm:function(){var e=a(this),d=e.data("settings"),b=d.filter;b.$collapsableLayer.show(a.extend(d.filter.transitionConfig,{complete:function(){jQuery("input:first",b.$filterContainer).focus()}}));b.$toggleIcon2.removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");b.$toggleIcon1.removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s");b.$filterSummary.parent().removeClass("rup-maint_searchCriteria")},toggleFilterForm:function(b){var f=a(this),e=f.data("settings"),d=e.filter;if(d.$collapsableLayer.is(":hidden")){f.rup_table("showFilterForm")}else{f.rup_table("hideFilterForm")}return f},showSearchCriteria:function(){var r=this,s=r.data("settings"),h=" ",t="",v,g,b,o,e,k,v=s.filter.$filterContainer.serializeArray();g=s.filter.$filterContainer,filterMulticombo=new Array();for(var q=0;q<v.length;q++){if(v[q].value!==""){b=a("[name='"+v[q].name+"']",g);if(a.inArray(b.attr("id"),s.filter.filterExclude)!==-1){continue}if(b.length>1){b=a("[name='"+v[q].name+"']:checked",g)}if(a(b).attr("type")==="hidden"){continue}o=a(b).attr("id");if(a(b).attr("ruptype")==="combo"){if(b.next(".ui-multiselect").length==0){o+="-button"}}if(a(b).attr("ruptype")==="autocomplete"){o=o.substring(0,o.indexOf("_label"))}label=a("label[for^='"+o+"']",g);if(label.length>0){e=label.html()}else{if(a(b).attr("ruptype")!=="combo"){e=a("[name='"+v[q].name+"']",g).prev("div").find("label").first().html()}else{e=a("[name='"+v[q].name+"']",g).parent().prev("div").find("label").first().html()}}if(e===null||e===undefined){e=""}k=" = ";switch(a(b)[0].tagName){case"INPUT":case"TEXTAREA":k=k+a(b).val();if(a(b)[0].type==="checkbox"||a(b)[0].type==="radio"){k=""}break;case"SELECT":if(b.next(".ui-multiselect").length==0){k=k+a("option[value='"+v[q].value+"']",b).html()}else{if(a.inArray(a(b).attr("id"),filterMulticombo)===-1){numSelected=b.rup_combo("value").length;if(numSelected!==0){var d=b.rup_combo().data("settings").filterMultiple;if(d==null||d==false){k+=numSelected}else{k+="["+b.rup_combo("label").join()+"]"}}else{e="";k=""}filterMulticombo.push(a(b).attr("id"))}else{e="";k=""}}break}var m=new Array(":","=");for(var p=0;p<m.length;p++){if(e!==""&&e.indexOf(m[p])!==-1){e=e.substring(0,e.indexOf(m[p]));break}}while(k.indexOf("&amp;nbsp;")!==-1){k=k.replace("&amp;nbsp;","")}if(e===""&&k.indexOf(" = ")!==-1){k=k.substring(2,k.length)}if(e===""&&a.trim(k)===""){continue}h=h+e+k+", "}}h=h.substring(0,h.length-2);var n=a("#titleSearch_"+s.id.name).css("height"),l,u=h,f=false;while(true){s.filter.$filterSummary.html(" <i>"+u+"</i>");l=a("#titleSearch_"+s.id.name).css("height");if(l===n){break}u=u.substring(0,u.lastIndexOf(","))+" <b>...</b>";f=true}if(f){s.filter.$filterSummary.rup_tooltip({content:{text:h.substring(1)},position:{my:"bottom center",at:"top center"}})}}});jQuery.fn.rup_table("extend",{_getSearchFormFieldLabel:function(h,g){var f=h.attr("id"),d,b="",e=h.attr("ruptype");if(e!=="combo"){d=jQuery("label[for='"+f+"']",g)}else{d=jQuery("label[for='"+f+"-button']",g)}if(d.length>0){b=d.html()}else{if(h.attr("ruptype")!=="combo"){b=a("[name='"+name+"']",g).prev("div").find("label").first().html()}else{b=a("[name='"+name+"']",g).parent().prev("div").find("label").first().html()}}b=b.replace(/[:=]/g,"");return b},_getSearchFormFieldValue:function(d,b){var f=" = ",e=[],g;switch(d.prop("tagName")){case"INPUT":case"TEXTAREA":f=f+d.val();if(d.attr("type")==="checkbox"||d.attr("type")==="radio"){f=""}break;case"SELECT":if(d.next(".ui-multiselect").length==0){f=f+a("option[value='"+d.rup_combo("getRupValue")+"']",d).html()}else{if(a.inArray(d.attr("id"),e)===-1){g=d.rup_combo("value").length;if(g!==0){f+=g}else{fieldName="";f=""}e.push(d.attr("id"))}else{fieldName="";f=""}}break}while(f.indexOf("&amp;nbsp;")!==-1){f=f.replace("&amp;nbsp;","")}return f}});jQuery.fn.rup_table.plugins.filter={};jQuery.fn.rup_table.plugins.filter.defaults={filter:{url:null,showHidden:false,transitionConfig:{duration:"slow",effect:"blind"}}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("search",{loadOrder:9,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureSearch",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigureSearch",b)}});jQuery.fn.rup_table("extend",{preConfigureSearch:function(b){if(b.search.url===null){b.search.url=b.baseUrl+"/search"}},postConfigureSearch:function(b){var d=this;d.rup_table("createSearchRow",b);d._initializeSearchProps(b);d.on({"jqGridLoadComplete.rupTable.search":function(f){var e=parseInt(d.rup_table("getGridParam","page"),10);if(d._hasPageMatchedElements(e)){d.rup_table("highlightMatchedRowsInPage",e)}},"jqGridSelectRow.rupTable.search":function(f,h,e,g){d.rup_table("updateSearchPagination",h)},rupTable_searchAfterCreateToolbar:function(e,g){var j=d[0].p,l=j.colModel,n,f,m,h,k;a("th[role='columnheader']",g).each(function(o){n=l[o];h=(n.searchoptions!==undefined&&n.searchoptions.rupType!==undefined)?n.searchoptions.rupType:n.rupType;colModelName=n.name;f=a("[name='"+colModelName+"']",g);f.attr({title:j.colNames[o],"class":"editable customelement"}).removeAttr("readOnly");if(h!==undefined){k=n.searchoptions||n.editoptions;switch(h){case"combo":m=a.extend({menuWidth:f.width()},k,{width:"auto"});break}f["rup_"+h](m);switch(h){case"date":f.css("width","86%");break}}})}})}});jQuery.fn.rup_table("extend",{toggleSearchForm:function(){var f=this,d=f.data("settings"),g=f[0].p,b,e;if(!d.search.created){f.rup_table("createSearchToolbar");d.search.$collapseIcon.removeClass("ui-icon-triangle-1-e");d.search.$collapseIcon.addClass("ui-icon-triangle-1-s");jQuery("#searchNavLayer_"+d.id).show();d.search.created=true;jQuery("input","table thead tr.ui-search-toolbar").keypress(function(j){var h=j.charCode||j.keyCode||0;if(h==13){f.rup_table("search");return false}return this})}else{b=jQuery("tr.ui-search-toolbar",f[0].grid.hDiv);e=g.frozenColumns===true?jQuery("tr.ui-search-toolbar",f[0].grid.fhDiv):false;if(jQuery("tr.ui-search-toolbar","#gview_"+d.id).is(":visible")){b.hide(d.search.transitionConfig);if(e){e.hide(d.search.transitionConfig)}jQuery("#searchNavLayer_"+d.id).hide(d.search.transitionConfig);d.search.$collapseIcon.removeClass("ui-icon-triangle-1-s");d.search.$collapseIcon.addClass("ui-icon-triangle-1-e")}else{b.show(d.search.transitionConfig);if(e){e.show(d.search.transitionConfig)}jQuery("#searchNavLayer_"+d.id).show(d.search.transitionConfig);d.search.$collapseIcon.removeClass("ui-icon-triangle-1-e");d.search.$collapseIcon.addClass("ui-icon-triangle-1-s")}}},createSearchToolbar:function(){var d=this,b=d.data("settings"),f=d[0].p,e=jQuery("<tr>").attr({"class":"ui-search-toolbar",role:"rowheader"});if(jQuery("table thead tr:first th[id='"+b.id+"_cb']",d[0].grid.hDiv).length!==0){e.append(jQuery("<th>").attr({role:"columnheader","class":"search_row_header ui-th-column ui-th-"+f.direction}))}e.append(jQuery("<th>").attr({role:"columnheader","class":"search_row_header ui-th-column ui-th-"+f.direction}));a.each(f.colModel,function(j,h){var k=jQuery("<th>").attr({role:"columnheader","class":"search_row_header ui-th-column ui-th-"+f.direction}),l,g;if(h.hidden===true){k.css("display","none")}h.search=h.search===false?false:true;if(h.stype===undefined){h.stype=h.edittype!==undefined?h.edittype:"text";if(h.searchoptions!==undefined&&h.searchoptions.rupType==="combo"){h.stype="text"}}soptions=a.extend({},h.searchoptions||h.editoptions||{},{id:h.name,name:h.name});if(h.search){l=a.jgrid.createEl.call(d[0],h.stype!==undefined?h.stype:h.edittype,soptions,"",true,a.extend({},a.jgrid.ajaxOptions,soptions.ajaxSelectOptions||{}));g=jQuery(l);g.css("width","97%");k.append(g);e.append(k)}});a("table thead",d[0].grid.hDiv).append(e);b.search.$searchRowInputs=jQuery("table thead tr.ui-search-toolbar","#gview_"+b.id);b.search.$searchRowInputs.attr({id:b.id+"_search_rowInputs",form:b.id+"_search_rowInputs"});if(b.search.validate!==undefined){b.search.$searchForm.rup_validate(b.search.validate);d.on({"rupTable_beforeSearch.search.validate":function(){return b.search.$searchForm.valid()}})}d.triggerHandler("rupTable_searchAfterCreateToolbar",[e]);d[0].ftoolbar=true},createSearchRow:function(v){var t=this,w=jQuery("table thead","#gview_"+v.id),h,k=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.searchRowHeader"),f=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.collapseLayer"),d=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.collapseIcon"),q=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.collapseLabel"),r=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.matchedLayer"),j=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.matchedLabel"),n=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.navLayer"),l=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.navLink"),b=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.navSearchButton"),s=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.navClearLink"),p=a(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.searchRow")),o=a(jQuery.jgrid.format(k,w.find("th").length)),u=a(jQuery.jgrid.format(f,"searchCollapseLayer_"+v.id)),e=a(jQuery.jgrid.format(d,"searchCollapseIcon_"+v.id)),g=a(jQuery.jgrid.format(q,"searchCollapsLabel_"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.searchCriteria")));$matchedLayer=a(jQuery.jgrid.format(r,"matchedLayer_"+v.id)),$matchedLabel=a(jQuery.jgrid.format(j,"matchedLabel_"+v.id,jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecords"),0))),$navLayer=a(jQuery.jgrid.format(n,"searchNavLayer_"+v.id)),$firstNavLink=a(jQuery.jgrid.format(l,"search_nav_first_"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.first"))),$backNavLink=a(jQuery.jgrid.format(l,"search_nav_back_"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.previous"))),$forwardNavLink=a(jQuery.jgrid.format(l,"search_nav_forward_"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.next"))),$lastNavLink=a(jQuery.jgrid.format(l,"search_nav_last_"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.last"))),$navSearchButton=a(jQuery.jgrid.format(b,"search_nav_button_"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.search.Find")));$navClearLink=a(jQuery.jgrid.format(s,"search_nav_clear_link"+v.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.search.Reset")));u.append(e).append(g);$matchedLayer.append($matchedLabel);$navLayer.append($firstNavLink).append($backNavLink).append($forwardNavLink).append($lastNavLink).append($navSearchButton).append($navClearLink);o.append(u);o.append($matchedLayer);o.append($navLayer);p.append(o);w.append(p);v.search=v.search||{};v.search.created=false;v.search.$collapseIcon=e;v.search.$searchRow=p;v.search.$matchedLabel=$matchedLabel;v.search.$firstNavLink=$firstNavLink;v.search.$backNavLink=$backNavLink;v.search.$forwardNavLink=$forwardNavLink;v.search.$lastNavLink=$lastNavLink;e.add(g).on("click",function(){t.rup_table("toggleSearchForm")});$navSearchButton.on("click",function(){t.rup_table("search")});$navClearLink.on("click",function(){t.rup_table("clearSearch")});$navLayer.hide();function m(x,y){if(!x.hasClass("ui-state-disabled")){t.rup_table("navigateToMatchedRow",y)}}$firstNavLink.on("click",function(){m(jQuery(this),"first")});$backNavLink.on("click",function(){m(jQuery(this),"prev")});$forwardNavLink.on("click",function(){m(jQuery(this),"next")});$lastNavLink.on("click",function(){m(jQuery(this),"last")});$searchForm=jQuery("<form>").attr("id",v.id+"_search_searchForm");v.search.$searchRow.parent().parent().wrap($searchForm);v.search.$searchForm=jQuery("#"+v.id+"_search_searchForm")},navigateToMatchedRow:function(b){var e=this,d=e.rup_table("fncGetSearchNavigationParams",b);e.rup_table("doSearchNavigation",d)},search:function(){var e=this,d=e.data("settings");var b=e.triggerHandler("rupTable_beforeSearch");if(b===false||b==="stop"){return}if(a.isFunction(d.search.beforeSearch)){b=d.search.beforeSearch.call(e);if(b===undefined){b=true}if(b===false){return}}e.rup_table("doSearch")},doSearch:function(){var h=this,f=h.data("settings"),d,e={},g=parseInt(h.rup_table("getGridParam","page"),10),b=h.rup_table("getGridParam","postData");e.filter=h.rup_table("getFilterParams");e.search=form2object(f.search.$searchRowInputs[0]);h._initializeSearchProps(f);d=h.triggerHandler("rupTable_searchBeforeSubmit.rupTable.masterDetail",[b,e]);if(d===false){return false}jQuery.rup_ajax({url:f.search.url,type:"POST",dataType:"json",data:jQuery.toJSON(a.extend(true,{},b,e)),contentType:"application/json",success:function(k,j,l){rowsPerPage=parseInt(h.rup_table("getGridParam","rowNum"),10);if(k.length===0){h._initializeSearchProps(f);h.rup_table("updateSearchPagination");h.rup_table("clearHighlightedMatchedRows")}else{jQuery.each(k,function(m,o){var p="";for(var n=0;n<f.primaryKey.length;n++){p+=o.pk[f.primaryKey[n]]+f.multiplePkToken}o.id=p.substr(0,p.length-1);o.page=Math.ceil(o.tableLine/rowsPerPage);o.pageLine=o.tableLine-((o.page-1)*rowsPerPage);h._processMatchedRow(f,o)});h.trigger("rupTableSearchSuccess");h.rup_table("goToFirstMatched",g)}}})},goToFirstMatched:function(b){var f=this,d=f.data("settings"),e=(typeof b==="string"?parseInt(b,10):b);if(f._hasPageMatchedElements(e)){f.rup_table("highlightMatchedRowsInPage",e);f.jqGrid("setSelection",d.search.matchedRowsPerPage[e][0],false)}else{f.rup_table("navigateToMatchedRow","first")}},fncGetSearchNavigationParams:function(d){var o=this,j=o.data("settings"),n=false,p=false,k=0,h=0,b=jQuery.proxy(jQuery.jgrid.getCurrPos,o[0])(),l=parseInt(o.rup_table("getGridParam","page"),10),g=l,f,m,e;o.trigger("rupTableAfterSearchNav",[d]);b[0]=parseInt(b[0],10);a("#"+j.formEdit.feedbackId,j.$detailForm).hide();switch(d){case"first":n=true;if(j.search.matchedPages[0]!==l){p=true;g=j.search.matchedPages[0]}k=j.search.matchedLinesPerPage[g][0];h=k;break;case"prev":n=true;m=j.search.matchedLinesPerPage[l];f=a.inArray(b[0]+1,m);if(f===-1){f=a.rup_utils.insertSorted(a.merge([],m),b[0]+1);if(f>1){f--}}if(f===0){p=true;e=a.inArray(l,j.search.matchedPages);g=j.search.matchedPages[e-1];m=j.search.matchedLinesPerPage[g];k=m[m.length-1]}else{k=m[f-1]}h=k;break;case"next":n=true;m=j.search.matchedLinesPerPage[l];f=a.inArray(b[0]+1,m);if(f===-1){f=a.rup_utils.insertSorted(a.merge([],m),b[0]+1);f--}if(f===m.length-1){p=true;e=a.inArray(l,j.search.matchedPages);g=j.search.matchedPages[e+1];m=j.search.matchedLinesPerPage[g];k=m[0]}else{k=m[f+1]}h=k;break;case"last":n=true;if(j.search.matchedPages[j.search.matchedPages.length-1]!==l){p=true;g=j.search.matchedPages[j.search.matchedPages.length-1]}k=j.search.matchedLinesPerPage[g][j.search.matchedLinesPerPage[g].length-1];h=k;break}return[d,n,p,k-1,b,g,h-1]},doSearchNavigation:function(m,j,l,g,b,e,d){var k=this,f=k.data("settings"),j,l,g,e,d,h;if(a.isArray(m)){linkType=m[0];j=m[1];l=m[2];g=m[3];b=m[4];e=m[5];d=m[6];if(j){k.rup_table("hideFormErrors",f.$detailForm);pagePos=jQuery.proxy(jQuery.jgrid.getCurrPos,k[0])();if(l){k.trigger("reloadGrid",[{page:e}]);k.on("jqGridAfterLoadComplete.rupTable.serach.pagination",function(n,o){h=jQuery.inArray(d+1,f.search.matchedLinesPerPage[e]);k.jqGrid("setSelection",f.search.matchedRowsPerPage[parseInt(o.page,10)][h],false);k.off("jqGridAfterLoadComplete.rupTable.serach.pagination")})}else{h=jQuery.inArray(g+1,f.search.matchedLinesPerPage[e]);k.jqGrid("setSelection",f.search.matchedRowsPerPage[e][h],false)}}}},clearSearch:function(){var d=this,b=d.data("settings");d._initializeSearchProps(b);d.rup_table("updateSearchPagination");d.rup_table("clearHighlightedMatchedRows");jQuery("input,textarea","#gview_"+b.id+" table thead tr.ui-search-toolbar").val("");jQuery("table thead tr.ui-search-toolbar [ruptype='combo']","#gview_"+b.id).rup_combo("clear")},clearHighlightedMatchedRows:function(){var d=this,b=d.data("settings");d.find("td[aria-describedby='"+b.id+"_rupInfoCol'] span.ui-icon.ui-icon-search").removeClass("ui-icon-search")},highlightMatchedRowsInPage:function(g){var h=this,f=h.data("settings"),e=h[0].p,b;h.rup_table("clearHighlightedMatchedRows");for(var d=0;d<f.search.matchedRowsPerPage[g].length;d++){newIndexPos=f.search.matchedRowsPerPage[g][d];b=a(h.jqGrid("getInd",newIndexPos,true));h.rup_table("highlightMatchedRow",b)}},highlightMatchedRow:function(b){var e=this,d=e.data("settings");b.find("td[aria-describedby='"+d.id+"_rupInfoCol'] span").addClass("ui-icon ui-icon-rupInfoCol ui-icon-search")},updateSearchPagination:function(h){var k=this,f=k.data("settings"),e,l,d,g=parseInt(k.rup_table("getGridParam","page"),10),b,j=a.jgrid.formatter.integer;if(h!==undefined){e=h}else{l=jQuery.proxy(jQuery.jgrid.getCurrPos,k[0])();e=(l[0]!==-1?l[1][l[0]-1]:-1)}if(f.search.numMatched===0){f.search.$firstNavLink.add(f.search.$backNavLink).add(f.search.$forwardNavLink).add(f.search.$lastNavLink).addClass("ui-state-disabled");f.search.$matchedLabel.html(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecords"),"0"))}else{if(e!==-1){if(jQuery.inArray(e,f.search.matchedRowsPerPage[g])!==-1){b=k.rup_table("getSearchCurrentRowCount",e);if(f.search&&f.search.numMatched){f.search.$matchedLabel.html(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecordsCount"),a.fmatter.util.NumberFormat(b,j),a.fmatter.util.NumberFormat(f.search.numMatched,j)))}if(b===1){f.search.$firstNavLink.addClass("ui-state-disabled");f.search.$backNavLink.addClass("ui-state-disabled")}else{f.search.$firstNavLink.removeClass("ui-state-disabled");f.search.$backNavLink.removeClass("ui-state-disabled")}if(b===f.search.numMatched){f.search.$lastNavLink.addClass("ui-state-disabled");f.search.$forwardNavLink.addClass("ui-state-disabled")}else{f.search.$lastNavLink.removeClass("ui-state-disabled");f.search.$forwardNavLink.removeClass("ui-state-disabled")}}else{if(f.search&&f.search.numMatched){f.search.$matchedLabel.html(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecords"),a.fmatter.util.NumberFormat(f.search.numMatched,j)))}f.search.$firstNavLink.removeClass("ui-state-disabled");f.search.$forwardNavLink.removeClass("ui-state-disabled");f.search.$lastNavLink.removeClass("ui-state-disabled");if(jQuery.inArray(f.search.matchedPages,g)>0){f.search.$backNavLink.removeClass("ui-state-disabled")}else{if(jQuery.inArray(g,f.search.matchedPages)===-1&&a.rup_utils.insertSorted(a.merge([],f.search.matchedPages),g)===0){f.search.$backNavLink.addClass("ui-state-disabled")}else{if(jQuery.inArray(g,f.search.matchedPages)===-1&&a.rup_utils.insertSorted(a.merge([],f.search.matchedPages),g)>0){f.search.$backNavLink.removeClass("ui-state-disabled")}else{l=jQuery.proxy(jQuery.jgrid.getCurrPos,k[0])();d=a.rup_utils.insertSorted(a.merge([],f.search.matchedLinesPerPage[g]),l[0]+1);if(d===0){f.search.$backNavLink.addClass("ui-state-disabled")}else{f.search.$backNavLink.removeClass("ui-state-disabled")}}}}}}}},getSearchCurrentRowCount:function(m){var j=this,d=j.data("settings"),g=parseInt(j.rup_table("getGridParam","page"),10),f=jQuery.proxy(jQuery.jgrid.getCurrPos,j[0])(),b=j.rup_table("getSelectedRows"),h,k=jQuery.inArray(m!==undefined?m:b[0],f[1]),l=0;h=jQuery.inArray(g,d.search.matchedPages);for(var e=0;e<h;e++){l+=d.search.matchedLinesPerPage[d.search.matchedPages[e]].length}l+=a.inArray(k+1,d.search.matchedLinesPerPage[d.search.matchedPages[h]])+1;return l}});jQuery.fn.rup_table("extend",{_hasPageMatchedElements:function(b){var f=this,d=f.data("settings"),e=(typeof b==="string"?parseInt(b,10):b);return(jQuery.inArray(e,d.search.matchedPages)!==-1)},_initializeSearchProps:function(b){if(b.search===undefined){b.search={}}b.search.numMatched=0;b.search.matchedRowsPerPage=[];b.search.matchedLinesPerPage=[];b.search.matchedRows=[];b.search.matchedIds=[];b.search.matchedPages=[]},_processMatchedRow:function(d,b){var e;if(d.search.matchedRowsPerPage[b.page]===undefined){d.search.matchedRowsPerPage[b.page]=[];d.search.matchedLinesPerPage[b.page]=[]}if(jQuery.inArray(b.id,d.search.matchedIds)===-1){d.search.matchedIds.push(b.id);d.search.matchedRows.push({id:b.id,page:b.page});e=a.rup_utils.insertSorted(d.search.matchedLinesPerPage[b.page],b.pageLine);d.search.matchedRowsPerPage[b.page].splice(e,0,b.id);if(d.search.matchedRowsPerPage[b.page].length>0&&jQuery.inArray(parseInt(b.page,10),d.search.matchedPages)===-1){a.rup_utils.insertSorted(d.search.matchedPages,parseInt(b.page,10))}d.search.numMatched++}}});jQuery.fn.rup_table.plugins.search={};jQuery.fn.rup_table.plugins.search.defaults={showGridInfoCol:true,search:{url:null,autosearch:false,beforeSearch:function(){return true},defaultSearchInfoCol:{name:"infoSearch",index:"infoSearch",editable:false,width:"15em",search:false},searchOnEnter:false,transitionConfig:{duration:0}}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("toolbar",{loadOrder:3,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureToolbar",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigureToolbar",b)}});jQuery.fn.rup_table("extend",{preConfigureToolbar:function(d){var e=this,b=d.toolbar;b.id=b.id!==null?b.id:d.id+"_toolbar";if(jQuery("#"+b.id).length>0){d.$toolbar=(b.id[0]==="#"?a(b.id):a("#"+b.id));if(!d.$toolbar.hasClass("rup-toolbar")){d.$toolbar.rup_toolbar({width:796})}}else{b={};b.id="rup-maint_toolbar-"+d.id;b.self=a("<div/>").attr("id",b.id);e.prepend(b.self);b.self.rup_toolbar({width:796})}b.$toolbar=d.$toolbar;if(b.autoAjustToolbar){d.$toolbar.css("width",e.rup_table("getGridParam","width")-5)}},postConfigureToolbar:function(e){var f=this,b=e.toolbar,d=1;if(b.createDefaultToolButtons){jQuery.each(e.toolbar.defaultButtons,function(h,j){var g;if(j===true){g=e.core.operations[h];if(g!==undefined){b["btn"+h.capitalize()]=e.$toolbar.addButton({i18nCaption:g.name,css:g.icon,index:d++},jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table")).bind("click",function(k){jQuery.proxy(g.callback,f)(f,k)})}}})}if(b.newButtons!==undefined&&b.newButtons!==null){a.each(b.newButtons,function(j,h){if(h.json_i18n===undefined){h.json_i18n={}}if(h.obj!==undefined&&h.click!==undefined){e.$toolbar.addButton(h.obj,h.json_i18n).bind("click",h.click)}else{if(h.buttons!==undefined){var g=e.$toolbar.addMButton(h,h.json_i18n).bind("click",e.$toolbar.showMButton);e.$toolbar.addButtonsToMButton(h.buttons,g,h.json_i18n)}else{a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_table.toolbarNewButtonError"))}}})}f.on({"jqGridSelectRow.rupTable.toolbar jqGridLoadComplete.rupTable.toolbar jqGridInlineEditRow.rupTable.toolbar jqGridInlineAfterRestoreRow.rupTable.toolbar rupTableHighlightRowAsSelected.rupTable.toolbar rupTableSelectedRowNumberUpdated jqGridInlineAfterSaveRow":function(j,n,g,l){var m=jQuery(this),h=m.data("settings");function k(p,o){if(p!==undefined){if(o){p.button("enable")}else{p.button("disable")}}}jQuery.each(h.toolbar.defaultButtons,function(o,p){if(p===true){operationCfg=h.core.operations[o];if(operationCfg!==undefined){k(h.toolbar["btn"+o.capitalize()],jQuery.proxy(operationCfg.enabled,m)())}}});if(h.toolbar.newButtons!=undefined&&h.toolbar.newButtons!=null){jQuery.each(h.toolbar.newButtons,function(p,q){var o=m.data("settings");if(q.ocultar===true){operationCfg=o.core.operations[q.comportamiento];if(operationCfg!==undefined){k(a("[id='"+o.id+"_toolbar##"+q.id+"']"),jQuery.proxy(operationCfg.enabled,m)())}}})}}})}});jQuery.fn.rup_table.plugins.toolbar={};jQuery.fn.rup_table.plugins.toolbar.defaults={toolbar:{id:null,autoAjustToolbar:true,createDefaultToolButtons:true,defaultAdd:true,defaultEdit:true,defaultSave:true,defaultClone:true,defaultCancel:true,defaultDelete:true,defaultFilter:false}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("feedback",{loadOrder:2,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureFeedback",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigureFeedback",b)}});jQuery.fn.rup_table("extend",{preConfigureFeedback:function(d){var f,b=d.feedback,e;b.id=b.id!==null?b.id:d.id+"_feedback";f=(b.id[0]==="#"?b.id:"#"+b.id);e=jQuery(f);if(e.length===0){alert("El identificador especificado para el feedback no existe.")}else{d.$feedback=e;d.$feedback.rup_feedback(b.config).attr("ruptype","feedback")}},postConfigureFeedback:function(b){b.$internalFeedback=a("<div/>").attr("id","rup_feedback_"+b.id).insertBefore("#gbox_"+b.id);b.$internalFeedback.rup_feedback(b.feedback.internalFeedbackConfig)}});jQuery.fn.rup_table("extend",{showFeedback:function(k,h,f,d){var g=this,e=g.data("settings"),b,j;if(d===false){k.rup_feedback("set",h,f)}else{if(jQuery.isPlainObject(d)){k.rup_feedback("option",d);k.rup_feedback("set",h,f)}else{j=(e.feedback[f+"FeedbackConfig"]!==undefined?e.feedback[f+"FeedbackConfig"]:e.feedback.okFeedbackConfig);k.rup_feedback("option",j);k.rup_feedback("set",h,f)}}}});jQuery.fn.rup_table.plugins.feedback={};jQuery.fn.rup_table.plugins.feedback.defaults={feedback:{okFeedbackConfig:{closeLink:true,gotoTop:false,delay:defaultDelay},errorFeedbackConfig:{closeLink:true,gotoTop:false,delay:null},alertFeedbackConfig:{closeLink:true,gotoTop:false,delay:null},id:null,config:{type:"ok",closeLink:true,gotoTop:false,block:false},internalFeedbackConfig:{type:"ok",closeLink:true,gotoTop:false,block:false}}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("fluid",{loadOrder:5,postConfiguration:function(b){var d=this;return d.rup_table("postConfigureFluid",b)}});jQuery.fn.rup_table("extend",{postConfigureFluid:function(b){var d=this,e;b.fluid.baseLayer=a.rup_utils.getJQueryId(b.fluid.baseLayer!==null?b.fluid.baseLayer:b.id+"_div");b.fluid.$baseLayer=jQuery(b.fluid.baseLayer);if(b.$pager.length===0){alert("El identificador "+b.pager+" especificado para la capa sobre la que se va a aplicar el diseño líquido no existe.");return}e=b.fluid.$baseLayer;d.bind("fluidWidth.resize",function(j,m,g){var l,k,f,h;d.setGridWidth(g);e.children().width(g);l=parseInt(b.$feedback.css("padding-left"));k=parseInt(b.$feedback.css("padding-right"));b.$feedback.width(g-(l+k));f=parseInt(b.$toolbar.css("padding-left"));h=parseInt(b.$toolbar.css("padding-right"));b.$toolbar.width(g-(f+h));b.$toolbar.css("width",g-(f+h))});d.fluidWidth({fluidBaseLayer:b.fluid.baseLayer,minWidth:100,maxWidth:2000,fluidOffset:0})}});jQuery.fn.rup_table.plugins.fluid={};jQuery.fn.rup_table.plugins.fluid.defaults={fluid:{baseLayer:null}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("formEdit",{loadOrder:6,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureFormEdit",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigureFormEdit",b)}});jQuery.fn.rup_table("extend",{preConfigureFormEdit:function(e){var f=this,b=e.colModel;e.formEdit.navigationBarId=e.formEdit.navigationBarId!==undefined?e.formEdit.navigationBarId:e.id+"_detail_navigation";e.formEdit.saveButtonId=e.formEdit.saveButtonId!==undefined?e.formEdit.saveButtonId:e.id+"_detail_button_save";e.formEdit.saveRepeatButtonId=e.formEdit.saveRepeatButtonId!==undefined?e.formEdit.saveRepeatButtonId:e.id+"_detail_button_save_repeat";e.formEdit.cancelLinkId=e.formEdit.cancelLinkId!==undefined?e.formEdit.cancelLinkId:e.id+"_detail_link_cancel";e.formEdit.feedbackId=e.formEdit.feedbackId!==undefined?e.formEdit.feedbackId:e.id+"_detail_feedback";e.formEdit.$navigationBar=jQuery("#"+e.formEdit.navigationBarId);e.formEdit.$saveButton=jQuery("#"+e.formEdit.saveButtonId);e.formEdit.$saveRepeatButton=jQuery("#"+e.formEdit.saveRepeatButtonId);e.formEdit.$cancelLink=jQuery("#"+e.formEdit.cancelLinkId);e.formEdit.$feedback=jQuery("#"+e.formEdit.feedbackId);if(e.formEdit.editurl===undefined){e.formEdit.editurl=e.baseUrl;e.formEdit.editOptions.ajaxEditOptions.url=e.baseUrl;e.formEdit.addOptions.ajaxEditOptions.url=e.baseUrl}if(e.formEdit.detailOptions.ajaxDetailOptions.url===undefined){e.formEdit.detailOptions.ajaxDetailOptions.url=e.baseUrl}e.ondblClickRow=function(h,k,g,j){f.rup_table("editElement",h);return false};e.formEdit.deleteOptions.ajaxDelOptions=jQuery.extend(true,e.formEdit.deleteOptions.ajaxDelOptions,{success:function(h,g,j){f.triggerHandler("rupTableAfterDelete",[h,g,j]);f.rup_table("showFeedback",e.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.deletedOK"),"ok")}});if(e.formEdit.detailForm===undefined){for(var d=0;d<b.length;d++){colModelObj=b[d];colModelObj.id="detailForm_"+e.id+"_"+colModelObj.name.replace(/[.]/g,"_")}}e.core.defaultOperations={add:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.new"),icon:"rup-icon rup-icon-new",enabled:function(){return true},callback:function(h,g){f.rup_table("newElement")}},edit:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.modify"),icon:"rup-icon rup-icon-edit",enabled:function(){var h=this,g=h.data("settings");return jQuery.proxy(g.fncHasSelectedElements,h)()},callback:function(h,g){f.rup_table("editElement")}},clone:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.clone"),icon:"rup-icon rup-icon-clone",enabled:function(){return jQuery.proxy(e.fncHasSelectedElements,f)()},callback:function(h,g){f.rup_table("cloneElement")}},"delete":{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.delete"),icon:"rup-icon rup-icon-delete",enabled:function(){var h=this,g=h.data("settings");return jQuery.proxy(g.fncHasSelectedElements,h)()},callback:function(h,g){f.rup_table("deleteElement")}}};a.extend(true,e.core.operations,e.core.defaultOperations);e.formEdit.addOptions=a.extend(true,{},e.formEdit.addEditOptions,e.formEdit.addOptions);e.formEdit.editOptions=a.extend(true,{},e.formEdit.addEditOptions,e.formEdit.editOptions)},postConfigureFormEdit:function(d){var h=this,g;if(d.formEdit.detailForm){if(jQuery(d.formEdit.detailForm).length===0){alert("El identificador especificado para el fomulario de detalle no existe.")}else{g=a(d.formEdit.detailForm);if(g.is("form")){if(g.parent().is("div")){d.formEdit.$detailFormDiv=g.parent();d.formEdit.$detailForm=g}else{alert("El fomrmulario no está incluido dentro de un div")}}else{if(g.is("div")){var f=g.find("form");if(f.length===1){d.formEdit.$detailFormDiv=g;d.formEdit.$detailForm=f}else{alert("El div indicado no contiene un único formulario")}}}d.formEdit.$detailForm.rup_form(d.formEdit.editOptions);d.formEdit.ownFormEdit=true}}beforeSendUserEvent=d.beforeSend;var b=function(k,j){j.beforeSend=beforeSendUserEvent;j.validate=d.formEdit.validate;j.feedback=d.$detailFeedback;d.formEdit.$detailForm.rup_form("ajaxSubmit",j);rp_ge[d.id].processing=false;return false};d.formEdit.editOptions.ajaxEditOptions.beforeSend=b;d.formEdit.addOptions.ajaxEditOptions.beforeSend=b;d.getDetailTotalRowCount=function(){var j=this;return j.rup_table("getGridParam","records")};d.getDetailCurrentRowCount=function(){var m=this,j,l,k;j=parseInt(m.rup_table("getGridParam","page"),10);k=m.rup_table("getGridParam","selrow");l=m.jqGrid("getInd",k);rowsPerPage=parseInt(m.rup_table("getGridParam","rowNum"),10);cont=(j*rowsPerPage)-rowsPerPage+l;return cont};d.getRowForEditing=function(){var k=this,j=k.jqGrid("getGridParam","selrow");return(j===null?false:j)};d.fncHasSelectedElements=function(){var j=this;return jQuery.proxy(d.getRowForEditing,j)()!==false};d.fncGetNavigationParams=function e(k){var s=this,r=false,t=false,p=0,n=0,m=0,j=jQuery.proxy(jQuery.jgrid.getCurrPos,s[0])(),q=parseInt(s.rup_table("getGridParam","page"),10),l=parseInt(s.rup_table("getGridParam","rowNum"),10),o=parseInt(Math.ceil(s.rup_table("getGridParam","records")/s.rup_table("getGridParam","rowNum")),10);j[0]=parseInt(j[0],10);switch(k){case"first":if(!(q===1&&j[0]===0)){r=true;p=0;if(q>1){t=true;n=1;m=0}}break;case"prev":if(!(q===1&&j[0]===0)){r=true;p=j[0]-1;if(p<0){t=true;n=q-1;m=l}}break;case"next":if(!(q===o&&j[0]===j[1].length-1)){r=true;p=j[0]+1;if(p>j[1].length-1){t=true;n=q+1;m=0}}break;case"last":if(!(q===o&&j[0]===j[1].length-1)){r=true;p=j[1].length-1;if(q<o){t=true;n=o;m=l}}break}return[k,r,t,p,j,n,m]};d.doNavigation=function(t,q,s,o,k,m,l){var r=this,n=r.data("settings"),p=rp_ge[r.attr("id")],j,q,s,o,k,m,l;if(a.isArray(t)){j=t[0];q=t[1];s=t[2];o=t[3];k=t[4];m=t[5];l=t[6];if(q){r.rup_table("hideFormErrors",n.formEdit.$detailForm);r.triggerHandler("jqGridAddEditClickPgButtons",[j,n.formEdit.$detailForm,k[1][k[o]]]);if(s){r.trigger("reloadGrid",[{page:m}]);r.on("jqGridAfterLoadComplete.pagination",function(w,x){var v=jQuery.proxy(jQuery.jgrid.getCurrPos,r[0])(),u=(l<v[1].length?l:v[1].length-1);r.jqGrid("setSelection",v[1][u]);jQuery.proxy(jQuery.jgrid.fillData,r[0])(v[1][u],r[0],n.formEdit.$detailForm.attr("id"),n.opermode);jQuery.proxy(jQuery.jgrid.updateNav,r[0])(v[1][u],k[1].length-1);r.off("jqGridAfterLoadComplete.pagination")})}else{jQuery.proxy(jQuery.jgrid.fillData,r[0])(k[1][o],r[0],n.formEdit.$detailForm.attr("id"),n.opermode);r.jqGrid("setSelection",k[1][o]);jQuery.proxy(jQuery.jgrid.updateNav,r[0])(k[1][o],k[1].length-1)}r.triggerHandler("jqGridAddEditAfterClickPgButtons",[j,n.formEdit.$detailForm,k[1][k[o]]]);if(jQuery.isFunction(p.afterclickPgButtons)){p.afterclickPgButtons.call(r,"next",n.formEdit.$detailForm,k[1][k[o]])}}}};h.on({"jqGridLoadComplete.rupTable.formEditing":function(l){var m=a(this),j=m.data("settings"),k;if(j.formEdit.autoselectFirstRecord){k=jQuery.proxy(jQuery.jgrid.getCurrPos,m[0])();m.jqGrid("setSelection",k[1][0],false)}},"jqGridAddEditInitializeForm.rupTable.formEditing":function(m,j,o){var n=a(this),l=n.data("settings"),k=l.colModel;if(l.formEdit.ownFormEdit===false){jQuery.each(k,function(p,q){if(q.rupType){if(q.editoptions&&q.editoptions.i18nId===undefined){q.editoptions.i18nId=n.attr("id")+"##"+this.name}a("#"+(q.id!==null?q.id:name),j)["rup_"+q.rupType](q.editoptions)}})}l.$detailFeedback=l.formEdit.$feedback.rup_feedback({closeLink:true,gotoTop:false,block:false,fadeSpeed:500}).attr("ruptype","feedback")},"jqGridAddEditAfterSubmit.rupTable.formEditing":function(j,r,l,m){var n=h.data("settings"),p=h.data("tmp.formEditSaveType"),k,o,s=null;h.removeData("tmp.formEditSaveType");jQuery.each(n.colModel,function(t,u){if(u.rupType==="combo"){o=jQuery("[name='"+u.name+"']",n.$detailForm);if(u.editoptions.labelProperty!==undefined){s=u.editoptions.labelProperty}else{if(u.editoptions.sourceParam!==undefined){s=u.name.substring(0,u.name.lastIndexOf(".")+1)+u.editoptions.sourceParam.label}}if(s!==null){l[s]=o.rup_combo("label")}}});if(p==="SAVE"){if(m==="edit"){h.rup_table("showFeedback",n.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.modifyOK"),"ok")}else{h.rup_table("showFeedback",n.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.insertOK"),"ok")}n.formEdit.$detailFormDiv.rup_dialog("close")}else{if(p==="SAVE_REPEAT"){if(m==="edit"){h.rup_table("showFeedback",n.$detailFeedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.modifyOK"),"ok")}else{h.rup_table("showFeedback",n.$detailFeedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.insertOK"),"ok")}}}try{responseJson=a.parseJSON(r.responseText)}catch(q){responseJson=l}k=responseJson[n.primaryKey?n.primaryKey:h[0].p.prmNames.id];return[true,"",k]},"jqGridAddEditErrorTextFormat.rupTable.formEditing":function(j,k,n){var m;if(k.status===406&&k.responseText!==""){try{m=jQuery.parseJSON(k.responseText);if(m.rupErrorFields){h.rup_table("showServerValidationFieldErrors",d.formEdit.$detailForm,m)}}catch(l){h.rup_table("showFeedback",d.$detailFeedback,k.responseText,"error")}}},"jqGridAddEditBeforeShowForm.rupTable.formEditing":function(n,p,k){var o=a(this),l=o.data("settings"),m=jQuery("#ui-dialog-title-"+l.formEdit.$detailFormDiv.attr("id"),l.formEdit.$detailFormDiv.parent()),j=o[0].p.colModel;o.rup_table("hideFormErrors",l.formEdit.$detailForm);if(k==="add"){m.html(rp_ge[o[0].p.id].addCaption);a("#pagination_"+l.id+",#pag_"+l.id).hide()}else{m.html(rp_ge[o[0].p.id].editCaption);a("#pagination_"+l.id+",#pag_"+l.id).show()}},"jqGridAddEditBeforeShowForm.rupTable.formEditing.readOnlyPks":function(n,p,l){var o=a(this),m=o.data("settings"),j=o[0].p.colModel;for(var k=0;k<j.length;k++){if(m.ownFormEdit!==true||(m.ownFormEdit===true&&jQuery.inArray(colmodel[k].name,m.primaryKey))){if(l==="add"){if(j[k].editableOnAdd===false){jQuery("[name='"+j[k].name+"']",m.formEdit.$detailFormDiv).attr("readonly","readonly")}else{jQuery("[name='"+j[k].name+"']",m.formEdit.$detailFormDiv).removeAttr("readonly")}}else{if(j[k].editableOnEdit===false){jQuery("[name='"+j[k].name+"']",m.formEdit.$detailFormDiv).attr("readonly","readonly")}else{jQuery("[name='"+j[k].name+"']",m.formEdit.$detailFormDiv).removeAttr("readonly")}}}}},"jqGridAddEditAfterShowForm.rupTable.formEditing":function(k,l,j){jQuery(":focusable:enabled:not([readonly]):first",l).focus()}})}});jQuery.fn.rup_table("extend",{createDetailNavigation:function(){var q=a(this),h=q.data("settings"),b=q.attr("id"),r=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.paginationBar"),p=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.paginationLink"),o=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.elementCounter"),j=a(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.separator")),k=a(jQuery.jgrid.format(o,b,jQuery.rup.STATICS,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.numResult"))),d=a(jQuery.jgrid.format(r,b)),n=a(jQuery.jgrid.format(p,"first_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.first"))),m=a(jQuery.jgrid.format(p,"back_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.previous"))),f=a(jQuery.jgrid.format(p,"forward_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.next"))),g=a(jQuery.jgrid.format(p,"last_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.last"))),l=undefined;d.append(n).append(m).append(f).append(g);function e(u,s){var t=a.proxy(h.fncGetNavigationParams,q)(u);if(!s.hasClass("ui-state-disabled")){if(a.proxy(a.jgrid.checkUpdates,q[0])(l,function(){a.proxy(h.doNavigation,q)(t)})){a.proxy(h.doNavigation,q)(t)}}}n.on("click",function(){e("first",a(this))});m.on("click",function(){e("prev",a(this))});f.on("click",function(){e("next",a(this))});g.on("click",function(){e("last",a(this))});return k.after(d).after(j)},deleteElement:function(g,b){var h=this,d=h.data("settings"),f=jQuery.extend(true,{},d.formEdit.deleteOptions,b),e=(g===undefined?h.rup_table("getSelectedRows"):g);if(e.length===1){if(f.mtype==="DELETE"){f.url=d.formEdit.editurl+"/"+h.rup_table("getPkUrl",e)}}else{f.mtype="POST";f.ajaxDelOptions.contentType="application/json";f.ajaxDelOptions.type="POST";f.ajaxDelOptions.dataType="json";f.url=d.formEdit.editurl+"/deleteAll";f.serializeDelData=function(k,j){return jQuery.toJSON({core:{pkToken:d.multiplePkToken,pkNames:d.primaryKey},multiselection:h.rup_table("getSelectedIds"),filter:h.rup_table("getFilterParams")})}}f.afterSubmit=function(){h.triggerHandler("rupTable_deleteAfterSubmit");h.rup_table("deselectAllRows");return true};if(h.triggerHandler("rupTable_beforeDeleteRow",[f,e])!==false){h.jqGrid("delGridRow",e,f)}return h},editElement:function(h,d){var j=this,f=j.data("settings"),g=(h===undefined?a.proxy(f.getRowForEditing,j)():h),b=j[0].p.colModel;if(g!==false){for(var e=0;e<b.length;e++){if(b[e].editable===true&&b[e].editableOnEdit===false){if(b[e].editoptions===undefined){b[e].editoptions={}}b[e].editoptions.readonly="readonly"}else{if(b[e].editoptions!==undefined&&b[e].editoptions.readonly!==undefined){delete b[e].editoptions.readonly}}}if(j.triggerHandler("rupTable_beforeEditRow",[f.formEdit.editOptions,g])!==false){j.jqGrid("editGridRow",g,f.formEdit.editOptions)}}return j},newElement:function(g){var h=this,f=h.data("settings"),d=h[0].p.colModel,b;for(var e=0;e<d.length;e++){if(d[e].editable===true&&d[e].editableOnAdd!==false){if(d[e].editable===true&&d[e].editableOnAdd===false){if(d[e].editoptions===undefined){d[e].editoptions={}}d[e].editoptions.readonly="readonly"}else{if(d[e].editoptions!==undefined&&d[e].editoptions.readonly!==undefined){delete d[e].editoptions.readonly}}}}if(g===false||(g!==false&&h.triggerHandler("rupTable_beforeAddRow",[f.formEdit.addOptions])!==false)){h.jqGrid("editGridRow","new",f.formEdit.addOptions)}return h},cloneElement:function(g,d,b){var h=this,e=h.data("settings"),f=(g===undefined?a.proxy(e.getRowForEditing,h)():g);if(b===false||(b!==false&&h.triggerHandler("rupTable_beforeCloneRow",[e,f])!==false)){h.rup_table("newElement",false);jQuery.proxy(jQuery.jgrid.fillData,h[0])(f,h[0]);jQuery("#id_g",e.formEdit.$detailForm).val("_empty")}return h},hideFormErrors:function(b){var e=this,d=e.data("settings");d.formEdit.$feedback.hide();jQuery(".rup-maint_validateIcon",b).remove();jQuery(".rup-maint_validateIcon",b).remove();jQuery("input.error",b).removeClass("error")}});a.extend(a.jgrid,{createData:function(f,l,j,s){var d=j.parent();var q=this,r=a(q),t=r.data("settings"),k,b,e,n,o=0,v,w,m,u=[],h=false,g="<label class='CaptionTD'></label>",p;for(p=1;p<=s;p++){j.append(a("<div>").attr("id","col_"+parseInt((parseInt(p,10)||1)*2,10)).addClass("floating_left_pad_right").width((100/s)*0.95+"%"))}if(f!="_empty"){h=a(l).jqGrid("getInd",f)}a(l.p.colModel).each(function(B){b=this.name;k=this.id;if(this.editrules&&this.editrules.edithidden===true){e=false}else{e=this.hidden===true?true:false}w=e?"style='display:none'":"";if(b!=="cb"&&b!=="subgrid"&&this.editable===true&&b!=="rn"){if(h===false){v=""}else{if(b==l.p.ExpandColumn&&l.p.treeGrid===true){v=a("td[role='gridcell']:eq("+B+")",l.rows[h]).text()}else{try{v=a.unformat.call(l,a("td[role='gridcell']:eq("+B+")",l.rows[h]),{rowId:f,colModel:this},B)}catch(y){v=(this.edittype&&this.edittype=="textarea")?a("td[role='gridcell']:eq("+B+")",l.rows[h]).text():a("td[role='gridcell']:eq("+B+")",l.rows[h]).html()}if(!v||v=="&nbsp;"||v=="&#160;"||(v.length==1&&v.charCodeAt(0)==160)){v=""}}}var A=a.extend({},this.editoptions||{},{id:k,name:b}),F=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),C=parseInt(F.rowpos,10)||o+1,E=parseInt((parseInt(F.colpos,10)||1)*2,10);if(f=="_empty"&&A.defaultValue){v=a.isFunction(A.defaultValue)?A.defaultValue.call(q):A.defaultValue}if(!this.edittype){this.edittype="text"}if(q.p.autoencode){v=a.jgrid.htmlDecode(v)}m=a.jgrid.createEl.call(q,this.edittype,A,v,false,a.extend({},a.jgrid.ajaxOptions,l.p.ajaxSelectOptions||{}));if(v===""&&this.edittype=="checkbox"){v=a(m).attr("offval")}if(v===""&&this.edittype=="select"){v=a("option:eq(0)",m).text()}if(this.edittype==="custom"){m=a(m).children()[0]}a(m).addClass("FormElement");n=a(j).find("tr[rowpos="+C+"]");if(F.rowabove){var D=a("<div><span class='contentinfo'>"+F.rowcontent+"</span></div>");a(j).append(D);D[0].rp=C}if(n.length===0){n=a("<div "+w+" rowpos='"+C+"'></div>").addClass("FormData floating_left_pad_right one-column").attr("id","tr_"+b);a(n).append(g);a(j).find("#col_"+E).append(n);n[0].rp=C}var z=a("label",n[0]).attr("for",k).html(typeof F.label==="undefined"?l.p.colNames[B]:F.label);z.parent().append(F.elmprefix).append(m).append(F.elmsuffix);u[o]=B;o++}});if(o>0){var x=a("<div class='FormData' style='display:none'><span class='CaptionTD'></span><span class='DataTD '><input class='FormElement' id='id_g' type='text' name='"+l.p.id+"_id' value='"+f+"'/></span></div>");x[0].rp=o+999;a(j).append(x);if(rp_ge[q.p.id].checkOnSubmit||rp_ge[q.p.id].checkOnUpdate){rp_ge[q.p.id]._savedData[l.p.id+"_id"]=f}}return u},fillDataClientSide:function(j,m,e,h){var q=this,r=a(q),t=r.data("settings"),l=q.p.id,u=a.fn.jqGrid.rup.edit.detail.detailFormId+l,g=a.fn.jqGrid.rup.edit.detail.detailBodyId+l,n="#"+a.jgrid.jqID(g),f,o,p=0,w,b,d,v,x;if(rp_ge[q.p.id].checkOnSubmit||rp_ge[q.p.id].checkOnUpdate){rp_ge[q.p.id]._savedData={};rp_ge[q.p.id]._savedData[m.p.id+"_id"]=j}var k=m.p.colModel;if(j=="_empty"){r.rup_table("resetForm",t.formEdit.$detailForm);a(k).each(function(){f=this.name;o=this.id!==undefined?this.id:f;d=a.extend({},this.editoptions||{});b=a("#"+a.jgrid.jqID(o),t.formEdit.$detailForm);if(b.length===0){b=a("[name='"+o+"']",t.formEdit.$detailForm)}if(b&&b.length&&b[0]!==null){v="";if(d.defaultValue){v=a.isFunction(d.defaultValue)?d.defaultValue.call(q):d.defaultValue;if(b[0].type=="checkbox"){x=v.toLowerCase();if(x.search(/(false|0|no|off|undefined)/i)<0&&x!==""){b[0].checked=true;b[0].defaultChecked=true;b[0].value=v}else{b[0].checked=false;b[0].defaultChecked=false}}else{b.val(v)}}else{if(b[0].type=="checkbox"){b[0].checked=false;b[0].defaultChecked=false;v=a(b).attr("offval")}else{if(b[0].type&&b[0].type.substr(0,6)=="select"){b[0].selectedIndex=0}else{b.val(v)}}}if(rp_ge[q.p.id].checkOnSubmit===true||rp_ge[q.p.id].checkOnUpdate){rp_ge[q.p.id]._savedData[f]=v}}});a("#id_g",t.formEdit.$detailForm).val(j);return}var s=a(m).jqGrid("getInd",j,true);if(!s){return}a('td[role="gridcell"]',s).each(function(B){f=k[B].name;o=this.id!==undefined?this.id:f;if(f!=="cb"&&f!=="subgrid"&&f!=="rn"&&k[B].editable===true){if(f==m.p.ExpandColumn&&m.p.treeGrid===true){w=a(this).text()}else{try{w=a.unformat.call(m,a(this),{rowId:j,colModel:k[B]},B)}catch(A){w=k[B].edittype=="textarea"?a(this).text():a(this).html()}}if(q.p.autoencode){w=a.jgrid.htmlDecode(w)}if(rp_ge[q.p.id].checkOnSubmit===true||rp_ge[q.p.id].checkOnUpdate){rp_ge[q.p.id]._savedData[f]=w}f=a.jgrid.jqID(f);switch(k[B].edittype){case"password":case"text":case"button":case"image":case"textarea":if(w=="&nbsp;"||w=="&#160;"||(w.length==1&&w.charCodeAt(0)==160)){w=""}a("#"+o,"#"+e).val(w);break;case"select":var z=w.split(",");z=a.map(z,function(D){return a.trim(D)});a("#"+o+" option","#"+e).each(function(){if(!k[B].editoptions.multiple&&(a.trim(w)==a.trim(a(this).text())||z[0]==a.trim(a(this).text())||z[0]==a.trim(a(this).val()))){this.selected=true}else{if(k[B].editoptions.multiple){if(a.inArray(a.trim(a(this).text()),z)>-1||a.inArray(a.trim(a(this).val()),z)>-1){this.selected=true}else{this.selected=false}}else{this.selected=false}}});break;case"checkbox":w=String(w);if(k[B].editoptions&&k[B].editoptions.value){var y=k[B].editoptions.value.split(":");if(y[0]==w){a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("checked",true);a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("defaultChecked",true)}else{a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("checked",false);a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("defaultChecked",false)}}else{w=w.toLowerCase();if(w.search(/(false|0|no|off|undefined)/i)<0&&w!==""){a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("checked",true);a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("defaultChecked",true)}else{a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("checked",false);a("#"+o,"#"+e)[q.p.useProp?"prop":"attr"]("defaultChecked",false)}}break;case"custom":try{if(k[B].editoptions&&a.isFunction(k[B].editoptions.custom_value)){k[B].editoptions.custom_value.call(q,a("#"+o,"#"+e),"set",w)}else{throw"e1"}}catch(C){if(C=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,C.message,a.jgrid.edit.bClose)}}break}p++}});if(p>0){a("#id_g",n).val(j)}},fillDataServerSide:function(g,d,e){var k=this,h=a(k),f=h.data("settings"),j=(d!==undefined?d:f.formEdit.$detailForm);var b=a.extend({success:function(n,l){var m;if(n.id&&n.id instanceof Object){if(n.id instanceof Object){n.JPA_ID=n.id;delete n.id}}m=a.rup_utils.jsontoarray(n);a.rup_utils.populateForm(m,j);rp_ge[k.p.id]._savedData=a.rup_utils.unnestjson(n);rp_ge[k.p.id]._savedData[f.id+"_id"]=g;a("#id_g",d).val(g)},error:function(n,l,m){mnt.prop.feedback.rup_feedback("option","delay",null);mnt.prop.feedback.rup_feedback("set",n.responseText,"error");mnt.prop.feedback.rup_feedback("option","delay",defaultDelay)}},f.formEdit.detailOptions.ajaxDetailOptions);b.url+="/"+h.rup_table("getPkUrl",g);a.when(a.rup_ajax(b)).then(function(n,l,m){h.triggerHandler("jqGridAddEditAfterFillData",[d,e])})},fillData:function(f,g,e,b){var j=this,h=a(j),d=h.data("settings");switch((f=="_empty"?"clientSide":d.formEdit.editOptions.fillDataMethod)){case"clientSide":a.proxy(a.jgrid.fillDataClientSide,j)(f,g,e,b);break;case"serverSide":default:a.proxy(a.jgrid.fillDataServerSide,j)(f,d.formEdit.$detailForm,b);break}},getFormData:function(d,h){var g=this,f=a(this),e=f.data("settings"),b;b=form2object(e.formEdit.$detailForm[0],null,false);jQuery.extend(true,d,b);return true},postIt:function(z,p,d){var u=this,q=u,v=jQuery(q),w=v.data("settings"),k=u.p.id,x=a.fn.jqGrid.rup.edit.detail.detailFormId+k,b=a.fn.jqGrid.rup.edit.detail.detailBodyId+k,s="#"+a.jgrid.jqID(b),e,A=[true,"",""],m={},l=u.p.prmNames,o,n,B,h,t;var r=a(u).triggerHandler("jqGridAddEditBeforeCheckValues",[a("#"+x),d]);if(r&&typeof r==="object"){z=r}if(a.isFunction(rp_ge[u.p.id].beforeCheckValues)){r=rp_ge[u.p.id].beforeCheckValues.call(u,z,a("#"+x),z[u.p.id+"_id"]=="_empty"?l.addoper:l.editoper);if(r&&typeof r==="object"){z=r}}for(B in z){if(z.hasOwnProperty(B)){A=a.jgrid.checkValues.call(u,z[B],B,u);if(A[0]===false){break}}}a.proxy(a.jgrid.setNulls,u)();if(A[0]){m=a(u).triggerHandler("jqGridAddEditClickSubmit",[rp_ge[u.p.id],z,d]);if(m===undefined&&a.isFunction(rp_ge[u.p.id].onclickSubmit)){m=rp_ge[u.p.id].onclickSubmit.call(u,rp_ge[u.p.id],z)||{}}A=a(u).triggerHandler("jqGridAddEditBeforeSubmit",[z,a("#"+x),d]);if(A===undefined){A=[true,"",""]}if(A[0]&&a.isFunction(rp_ge[u.p.id].beforeSubmit)){A=rp_ge[u.p.id].beforeSubmit.call(u,z,a("#"+x))}}if(A[0]){rp_ge[u.p.id].processing=true;a("#sData",s+"_2").addClass("ui-state-active");n=l.oper;o=l.id;z[n]=(a.trim(z[u.p.id+"_id"])=="_empty")?l.addoper:l.editoper;if(z[n]!=l.addoper){z[o]=z[u.p.id+"_id"]}else{if(z[o]===undefined){z[o]=z[u.p.id+"_id"]}}delete z[u.p.id+"_id"];z=a.extend(z,rp_ge[u.p.id].editData,m);if(u.p.treeGrid===true){if(z[n]==l.addoper){h=a(u).jqGrid("getGridParam","selrow");var g=u.p.treeGridModel=="adjacency"?u.p.treeReader.parent_id_field:"parent_id";z[g]=h}for(t in u.p.treeReader){if(u.p.treeReader.hasOwnProperty(t)){var f=u.p.treeReader[t];if(z.hasOwnProperty(f)){if(z[n]==l.addoper&&t==="parent_id_field"){continue}delete z[f]}}}}z[o]=a.jgrid.stripPref(u.p.idPrefix,z[o]);var y=a.extend({url:rp_ge[u.p.id].url||a(u).jqGrid("getGridParam","editurl"),type:rp_ge[u.p.id].mtype,data:a.isFunction(rp_ge[u.p.id].serializeEditData)?rp_ge[u.p.id].serializeEditData.call(u,z):z,complete:function(E,C){var D;z[o]=u.p.idPrefix+z[o];if(C!="success"){A[0]=false;A[1]=a(u).triggerHandler("jqGridAddEditErrorTextFormat",[E,d]);if(a.isFunction(rp_ge[u.p.id].errorTextFormat)){A[1]=rp_ge[u.p.id].errorTextFormat.call(u,E)}else{A[1]=C+" Status: '"+E.statusText+"'. Error code: "+E.status}}else{A=a(u).triggerHandler("jqGridAddEditAfterSubmit",[E,z,d]);if(A===undefined){A=[true,"",""]}if(A[0]&&a.isFunction(rp_ge[u.p.id].afterSubmit)){A=rp_ge[u.p.id].afterSubmit.call(u,E,z)}}if(A[0]===false){a("#"+w.formEdit.feedbackId+">td",s).html(A[1]);a("#"+w.formEdit.feedbackId,s).show()}else{a.each(u.p.colModel,function(){if(p[this.name]&&this.formatter&&this.formatter=="select"){try{delete p[this.name]}catch(G){}}});z=a.extend(z,p);if(u.p.autoencode){a.each(z,function(H,G){z[H]=a.jgrid.htmlDecode(G)})}if(z[n]==l.addoper){if(!A[2]){A[2]=a.jgrid.randId()}z[o]=A[2];if(rp_ge[u.p.id].closeAfterAdd){if(rp_ge[u.p.id].reloadAfterSubmit){a(u).trigger("reloadGrid")}else{if(u.p.treeGrid===true){a(u).jqGrid("addChildNode",A[2],h,z)}else{a(u).jqGrid("addRowData",A[2],z,rp_ge[u.p.id].addedrow);a(u).jqGrid("setSelection",A[2])}}a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(k),jqm:rp_ge[u.p.id].jqModal,onClose:rp_ge[u.p.id].onClose})}else{if(rp_ge[u.p.id].clearAfterAdd){if(rp_ge[u.p.id].reloadAfterSubmit){a(u).trigger("reloadGrid")}else{if(u.p.treeGrid===true){a(u).jqGrid("addChildNode",A[2],h,z)}else{a(u).jqGrid("addRowData",A[2],z,rp_ge[u.p.id].addedrow);a(u).jqGrid("setSelection",A[2])}}a.proxy(a.jgrid.fillData,u)("_empty",u,x)}else{if(rp_ge[u.p.id].reloadAfterSubmit){a(u).trigger("reloadGrid")}else{if(u.p.treeGrid===true){a(u).jqGrid("addChildNode",A[2],h,z)}else{a(u).jqGrid("addRowData",A[2],z,rp_ge[u.p.id].addedrow)}}}}}else{if(rp_ge[u.p.id].reloadAfterSubmit){a(u).trigger("reloadGrid");if(!rp_ge[u.p.id].closeAfterEdit){setTimeout(function(){a(u).jqGrid("setSelection",z[o])},1000)}}else{if(u.p.treeGrid===true){a(u).jqGrid("setTreeRow",z[o],z)}else{a(u).jqGrid("setRowData",z[o],z)}}if(rp_ge[u.p.id].closeAfterEdit){a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(k),jqm:rp_ge[u.p.id].jqModal,onClose:rp_ge[u.p.id].onClose})}}if(a.isFunction(rp_ge[u.p.id].afterComplete)){e=E;setTimeout(function(){a(u).triggerHandler("jqGridAddEditAfterComplete",[e,z,a("#"+x),d]);rp_ge[u.p.id].afterComplete.call(u,e,z,a("#"+x));e=null},500)}if(rp_ge[u.p.id].checkOnSubmit||rp_ge[u.p.id].checkOnUpdate){a("#"+x).data("disabled",false);if(rp_ge[u.p.id]._savedData[u.p.id+"_id"]!="_empty"){for(D in rp_ge[u.p.id]._savedData){if(rp_ge[u.p.id]._savedData.hasOwnProperty(D)&&z[D]){rp_ge[u.p.id]._savedData[D]=z[D]}}}}}rp_ge[u.p.id].processing=false;a("#sData",s+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+x)[0].focus()}catch(F){}}},a.jgrid.ajaxOptions,rp_ge[u.p.id].ajaxEditOptions);if(!y.url&&!rp_ge[u.p.id].useDataProxy){if(a.isFunction(u.p.dataProxy)){rp_ge[u.p.id].useDataProxy=true}else{A[0]=false;A[1]+=" "+a.jgrid.errors.nourl}}if(A[0]){if(rp_ge[u.p.id].useDataProxy){var j=u.p.dataProxy.call(u,y,"set_"+u.p.id);if(j===undefined){j=[true,""]}if(j[0]===false){A[0]=false;A[1]=j[1]||"Error deleting the selected row!"}else{if(y.data.oper==l.addoper&&rp_ge[u.p.id].closeAfterAdd){a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(k),jqm:rp_ge[u.p.id].jqModal,onClose:rp_ge[u.p.id].onClose})}if(y.data.oper==l.editoper&&rp_ge[u.p.id].closeAfterEdit){a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(k),jqm:rp_ge[u.p.id].jqModal,onClose:rp_ge[u.p.id].onClose})}}}else{a.ajax(y)}}}if(A[0]===false){a("#"+w.formEdit.feedbackId+">td",s).html(A[1]);a("#"+w.formEdit.feedbackId,s).show()}},setNulls:function(){var b=this;a.each(b.p.colModel,function(d,e){if(e.editoptions&&e.editoptions.NullIfEmpty===true){if(postdata.hasOwnProperty(e.name)&&postdata[e.name]===""){postdata[e.name]="null"}}})},compareData:function(g,b){var e=false,f,d=jQuery.rup_utils.unnestjson(g),h=jQuery.rup_utils.unnestjson(b);for(f in g){if(g.hasOwnProperty(f)&&String(d[f])!==String(h[f])){e=true;break}}return e},checkUpdates:function(g,k){var l=a(this),h=this,b=h.p.id,d=a.fn.jqGrid.rup.edit.detail.detailFormId+b,e=a.fn.jqGrid.rup.edit.detail.detailBodyId+b,j="#"+a.jgrid.jqID(e),f=true;if(rp_ge[h.p.id].checkOnUpdate){postdata={};g={};a.proxy(a.jgrid.getFormData,h)(postdata,g);newData=a.extend({},postdata,g);diff=a.proxy(a.jgrid.compareData,h)(newData,rp_ge[h.p.id]._savedData);if(diff){a.rup_messages("msgConfirm",{message:a.rup.i18nParse(a.rup.i18n.base,"rup_table.saveAndContinue"),title:a.rup.i18nParse(a.rup.i18n.base,"rup_table.changes"),OKFunction:function(){a(this).dialog("destroy").remove();if(jQuery.isFunction(k)){jQuery.proxy(k,l)()}}});f=false}}return f},restoreInline:function(d){var e=this,b;if(d!=="_empty"&&typeof(e.p.savedRow)!=="undefined"&&e.p.savedRow.length>0&&a.isFunction(a.fn.jqGrid.restoreRow)){for(b=0;b<e.p.savedRow.length;b++){if(e.p.savedRow[b].id==d){a(e).jqGrid("restoreRow",d);break}}}},getCurrPos:function(){var k=this,m=a(this),g=m.data("settings"),b=k.p.id,h=a.fn.jqGrid.rup.edit.detail.detailFormId+b,j=a.fn.jqGrid.rup.edit.detail.detailBodyId+b,l="#"+a.jgrid.jqID(j),d=a(k).jqGrid("getDataIDs"),e=a("#id_g",g.formEdit.$detailForm).val(),f=e!==undefined&&e!=="_empty"?e:m.jqGrid("getGridParam","selrow");pos=a.inArray(f,d);return[pos,d]},updateNav:function(d,b){var f=a(this),e;if(b!==undefined&&b[1]!==undefined){e=b[1].length-1;if(d===0){a("#pData",frmtb+"_2").addClass("ui-state-disabled")}else{if(b[1][d-1]!==undefined&&a("#"+a.jgrid.jqID(b[1][d-1])).hasClass("ui-state-disabled")){a("#pData",frmtb+"_2").addClass("ui-state-disabled")}else{a("#pData",frmtb+"_2").removeClass("ui-state-disabled")}}if(d==e){a("#nData",frmtb+"_2").addClass("ui-state-disabled")}else{if(b[1][d+1]!==undefined&&a("#"+a.jgrid.jqID(b[1][d+1])).hasClass("ui-state-disabled")){a("#nData",frmtb+"_2").addClass("ui-state-disabled")}else{a("#nData",frmtb+"_2").removeClass("ui-state-disabled")}}}f.rup_table("updateDetailPagination")}});a.jgrid.extend({editGridRow:function(b,d){d=a.extend({top:0,left:0,width:300,height:"auto",dataheight:"auto",modal:false,overlay:30,drag:true,resize:true,url:null,mtype:"POST",clearAfterAdd:true,closeAfterEdit:false,reloadAfterSubmit:true,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:false,jqModal:true,closeOnEscape:false,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[false,13],navkeys:[false,38,40],checkOnSubmit:false,checkOnUpdate:false,_savedData:{},processing:false,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:true},a.jgrid.edit,d||{});rp_ge[a(this)[0].p.id]=d;return this.each(function(){var e=this,w=a(e),W=w.data("settings");if(!e.grid||!b){return}var C=e.p.id,z=a.fn.jqGrid.rup.edit.detail.detailFormId+C,T=a.fn.jqGrid.rup.edit.detail.detailBodyId+C,x="#"+a.jgrid.jqID(T),k={themodal:a.fn.jqGrid.rup.edit.detail.detailDivId+C,modalhead:"edithd"+C,modalcontent:"editcnt"+C,scrollelm:z},E=a.isFunction(rp_ge[e.p.id].beforeShowForm)?rp_ge[e.p.id].beforeShowForm:false,L=a.isFunction(rp_ge[e.p.id].afterShowForm)?rp_ge[e.p.id].afterShowForm:false,K=a.isFunction(rp_ge[e.p.id].beforeInitData)?rp_ge[e.p.id].beforeInitData:false,p=a.isFunction(rp_ge[e.p.id].onInitializeForm)?rp_ge[e.p.id].onInitializeForm:false,Y=true,J=1,q=0,F,O,G,B,I;z=a.jgrid.jqID(z);if(b==="new"){b="_empty";I="add";d.caption=rp_ge[e.p.id].addCaption}else{d.caption=rp_ge[e.p.id].editCaption;I="edit"}W.opermode=I;if(d.recreateForm===true&&W.formEdit.detailFormCreated===true){W.formEdit.$detailFormDiv.remove()}var l=true;if(d.checkOnUpdate&&d.jqModal&&!d.modal){l=false}if(W.formEdit.detailFormCreated===true){k.themodal=W.formEdit.$detailFormDiv.attr("id");Y=a(e).triggerHandler("jqGridAddEditBeforeInitData",[(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)),I]);if(Y===undefined){Y=true}if(Y&&K){Y=K.call(e,(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)))}if(Y===false){return}a.proxy(a.jgrid.restoreInline,e)(b);a(".ui-jqdialog-title","#"+a.jgrid.jqID(k.modalhead)).html(d.caption);a("#"+W.formEdit.feedbackId,x).hide();if(rp_ge[e.p.id].topinfo){a(".topinfo",x).html(rp_ge[e.p.id].topinfo);a(".tinfo",x).show()}else{a(".tinfo",x).hide()}if(rp_ge[e.p.id].bottominfo){a(".bottominfo",x+"_2").html(rp_ge[e.p.id].bottominfo);a(".binfo",x+"_2").show()}else{a(".binfo",x+"_2").hide()}a.proxy(a.jgrid.fillData,e)(b,e,z,I);if(b=="_empty"||!rp_ge[e.p.id].viewPagerButtons){a("#pData, #nData",x+"_2").hide()}else{a("#pData, #nData",x+"_2").show()}if(rp_ge[e.p.id].processing===true){rp_ge[e.p.id].processing=false;a("#sData",x+"_2").removeClass("ui-state-active")}if((W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)).data("disabled")===true){a(".confirm","#"+a.jgrid.jqID(k.themodal)).hide();(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)).data("disabled",false)}a(e).triggerHandler("jqGridAddEditBeforeShowForm",[(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)),I]);if(E){E.call(e,(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)))}a("#"+a.jgrid.jqID(k.themodal)).data("onClose",rp_ge[e.p.id].onClose);a.jgrid.viewModal("#"+a.jgrid.jqID(k.themodal),{gbox:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,jqM:false,overlay:d.overlay,modal:d.modal});if(!l){a(".jqmOverlay").click(function(){if(!a.proxy(a.jgrid.checkUpdates,e)(O)){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,onClose:rp_ge[e.p.id].onClose});return false})}a(e).triggerHandler("jqGridAddEditAfterShowForm",[(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)),I]);if(L){L.call(e,(W.formEdit.$detailForm?W.formEdit.$detailForm:a("#"+z)))}}else{var r=isNaN(d.dataheight)?d.dataheight:d.dataheight+"px",h=isNaN(d.datawidth)?d.datawidth:d.datawidth+"px",R=a(jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.detailForm.form",z,r)).data("disabled",false),A=a(jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.detailForm.body",T)),Y=a(e).triggerHandler("jqGridAddEditBeforeInitData",[a("#"+z),I]);if(typeof(Y)=="undefined"){Y=true}if(Y&&K){Y=K.call(e,a("#"+z))}if(Y===false){return}a.proxy(a.jgrid.restoreInline,e)(b);a(e.p.colModel).each(function(){var aa=this.formoptions;J=Math.max(J,aa?aa.colpos||0:0);q=Math.max(q,aa?aa.rowpos||0:0)});a(R).append(A);flr=a(jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.detailForm.errorFeedback",W.formEdit.feedbackId));flr[0].rp=0;a(A).append(flr);flr=a("<div class='tinfo' style='display:none'><span class='topinfo'>"+rp_ge[e.p.id].topinfo+"</span></div>");flr[0].rp=0;a(A).append(flr);var f=e.p.direction=="rtl"?true:false,Q=f?"nData":"pData",S=f?"pData":"nData";if(W.formEdit.$detailForm===undefined){W.formEdit.$detailForm=A.parent();a.proxy(a.jgrid.createData,e)(b,e,A,J)}else{W.formEdit.$detailForm.append(a("<div class='FormData' style='display:none'><span class='CaptionTD'></span><span class='DataTD '><input class='FormElement' id='id_g' type='text' name='"+e.p.id+"_id' value='"+b+"'/></span></div>"))}R=W.formEdit.$detailForm[0];if(I==="edit"){a.proxy(a.jgrid.fillData,e)(b,e)}var m="<a href='javascript:void(0)' id='"+Q+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",n="<a href='javascript:void(0)' id='"+S+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",j="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+d.bSubmit+"</a>",u="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+d.bCancel+"</a>";var N="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+T+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(f?n+m:m+n)+"</td><td class='EditButton'>"+j+u+"</td></tr>";N+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+rp_ge[e.p.id].bottominfo+"</td></tr>";N+="</tbody></table>";if(W.formEdit.ownFormEdit===false){if(q>0){for(var U=1;U<=J;U++){var X=A.find("#col_"+parseInt((parseInt(U,10)||1)*2,10));var y=[];a.each(X.find("div"),function(aa,ab){y[aa]=ab});y.sort(function(ab,aa){if(ab.rp>aa.rp){return 1}if(ab.rp<aa.rp){return -1}return 0});a.each(y,function(aa,ab){X.append(ab)})}}}d.gbox="#gbox_"+a.jgrid.jqID(C);var o=false;if(d.closeOnEscape===true){d.closeOnEscape=false;o=true}var g=w.rup_table("createDetailNavigation"),M;function v(){F={};O={};a("#"+W.formEdit.feedbackId,x).hide();a.proxy(a.jgrid.getFormData,e)(F);if(F[e.p.id+"_id"]=="_empty"){a.proxy(a.jgrid.postIt,e)(F,O,W.opermode)}else{if(d.checkOnSubmit===true){G=a.extend({},F,O);B=compareData(G,rp_ge[e.p.id]._savedData);if(B){a("#"+z).data("disabled",true);a(".confirm","#"+a.jgrid.jqID(k.themodal)).show()}else{a.proxy(a.jgrid.postIt,e)(F,O,W.opermode)}}else{a.proxy(a.jgrid.postIt,e)(F,O,W.opermode)}}return false}function V(){w.data("tmp.formEditSaveType","SAVE");if(!v()){return false}}function Z(){w.data("tmp.formEditSaveType","SAVE_REPEAT");if(!v()){return false}}function H(){if(!a.proxy(a.jgrid.checkUpdates,e)(O,function(){a.jgrid.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,onClose:rp_ge[e.p.id].onClose})})){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,onClose:rp_ge[e.p.id].onClose});return false}if(W.formEdit.ownFormEdit===true){if(!W.formEdit.$detailFormDiv.is(":visible")){W.formEdit.$detailFormDiv.show()}W.formEdit.$detailFormDiv.rup_dialog({type:a.rup.dialog.DIV,autoOpen:false,modal:true,resizable:d.resize,title:d.caption,width:d.width});W.formEdit.detailFormCreated=true;W.formEdit.$navigationBar.append(g);if(W.formEdit.$saveButton.length>0){W.formEdit.$saveButton.button().click(function(){jQuery.proxy(V,w)()})}if(W.formEdit.$saveRepeatButton.length>0){W.formEdit.$saveRepeatButton.button().click(function(){jQuery.proxy(Z,w)()})}if(W.formEdit.$cancelLink.length>0){W.formEdit.$cancelLink.on("click",function(){jQuery.proxy(H,w)()})}if(jQuery.isFunction(d.onClose)){jQuery(".ui-dialog-titlebar-close, a:has(#closeText_"+W.formEdit.$detailFormDiv.first()[0].id+")",W.formEdit.$detailFormDiv.parent()).off("click").on("click",function(aa){d.onClose.call(aa)})}k.themodal=W.formEdit.$detailFormDiv.attr("id")}else{var M=g.after(R);var D={text:a.rup.i18nParse(a.rup.i18n.base,"rup_global.save"),click:V};var s={text:a.rup.i18nParse(a.rup.i18n.base,"rup_global.save_repeat"),click:Z};var t={text:a.rup.i18nParse(a.rup.i18n.base,"rup_global.cancel"),btnType:a.rup.dialog.LINK,click:H};d.buttons=[D,s,t];d.onClose=H;a.jgrid.createModal(k,M,d,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0]);W.formEdit.detailFormCreated=true}if(W.formEdit.$detailFormDiv===undefined){W.formEdit.$detailFormDiv=a("#"+a.jgrid.jqID(k.themodal))}if(f){a("#pData, #nData",x+"_2").css("float","right");a(".EditButton",x+"_2").css("text-align","left")}if(rp_ge[e.p.id].topinfo){a(".tinfo",x).show()}if(rp_ge[e.p.id].bottominfo){a(".binfo",x+"_2").show()}M=null;N=null;a("#"+a.jgrid.jqID(k.themodal)).keydown(function(aa){var ab=aa.target;if(a("#"+z).data("disabled")===true){return false}if(rp_ge[e.p.id].savekey[0]===true&&aa.which==rp_ge[e.p.id].savekey[1]){if(ab.tagName!="TEXTAREA"){a("#sData",x+"_2").trigger("click");return false}}if(aa.which===27){if(!a.proxy(a.jgrid.checkUpdates,e)(O)){return false}if(o){a.jgrid.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:d.gbox,jqm:d.jqModal,onClose:rp_ge[e.p.id].onClose})}return false}if(rp_ge[e.p.id].navkeys[0]===true){if(a("#id_g",x).val()=="_empty"){return true}if(aa.which==rp_ge[e.p.id].navkeys[1]){a("#pData",x+"_2").trigger("click");return false}if(aa.which==rp_ge[e.p.id].navkeys[2]){a("#nData",x+"_2").trigger("click");return false}}});if(d.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+a.jgrid.jqID(k.themodal)).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+a.jgrid.jqID(k.themodal)).unbind("click").click(function(){if(!a.proxy(a.jgrid.checkUpdates,e)(O)){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,onClose:rp_ge[e.p.id].onClose});return false})}d.saveicon=a.extend([true,"left","ui-icon-disk"],d.saveicon);d.closeicon=a.extend([true,"left","ui-icon-close"],d.closeicon);if(d.saveicon[0]===true){a("#sData",x+"_2").addClass(d.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.saveicon[2]+"'></span>")}if(d.closeicon[0]===true){a("#cData",x+"_2").addClass(d.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.closeicon[2]+"'></span>")}a(e).triggerHandler("jqGridAddEditInitializeForm",[W.formEdit.$detailForm,I]);if(p){p.call(e,W.formEdit.$detailForm)}if(b=="_empty"||!rp_ge[e.p.id].viewPagerButtons){a("#pData,#nData",x+"_2").hide()}else{a("#pData,#nData",x+"_2").show()}a(e).triggerHandler("jqGridAddEditBeforeShowForm",[W.formEdit.$detailForm,I]);if(E){E.call(e,W.formEdit.$detailForm)}a("#"+a.jgrid.jqID(k.themodal)).data("onClose",rp_ge[e.p.id].onClose);a.jgrid.viewModal("#"+a.jgrid.jqID(k.themodal),{gbox:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,overlay:d.overlay,modal:d.modal});if(!l){a(".jqmOverlay").click(function(){if(!a.proxy(a.jgrid.checkUpdates,e)(O)){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(k.themodal),{gb:"#gbox_"+a.jgrid.jqID(C),jqm:d.jqModal,onClose:rp_ge[e.p.id].onClose});return false})}a(e).triggerHandler("jqGridAddEditAfterShowForm",[W.formEdit.$detailForm,I]);if(L){L.call(e,W.formEdit.$detailForm)}a(".fm-button","#"+a.jgrid.jqID(k.themodal)).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}var P=a.proxy(a.jgrid.getCurrPos,e)();w.rup_table("updateDetailPagination");a.proxy(a.jgrid.updateNav,e)(P[0],P[1].length-1)})}});a.fn.jqGrid.rup={};a.fn.jqGrid.rup.edit={detail:{detailDivId:"detailDiv_",detailBodyId:"detailBody_",detailFormId:"detailForm_"},navigation:{forward:{id:"#nData"},back:{id:"#pData"}}};jQuery.fn.rup_table.plugins.formEdit={};jQuery.fn.rup_table.plugins.formEdit.defaults={toolbar:{defaultButtons:{add:true,edit:true,cancel:false,save:false,clone:true,"delete":true,filter:false}},contextMenu:{defaultRowOperations:{add:true,edit:true,cancel:false,save:false,clone:true,"delete":true,filter:false}},formEdit:{autoselectFirstRecord:true,ownFormEdit:false,detailFormCreated:false}};jQuery.fn.rup_table.plugins.formEdit.defaults.formEdit.deleteOptions={bSubmit:jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_message.aceptar"),cancelicon:[true,"left","icono_cancelar"],delicon:[false],linkStyleButtons:["#eData"],msg:'<div id="rup_msgDIV_msg_icon" class="rup-message_icon-confirm"></div><div id="rup_msgDIV_msg" class="rup-message_msg-confirm white-space-normal">'+jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.deleteAll")+"</div>",mtype:"DELETE",width:320,reloadAfterSubmit:false,resize:false,useDataProxy:true};jQuery.fn.rup_table.plugins.formEdit.defaults.formEdit.addEditOptions={bSubmit:jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_message.aceptar"),closeicon:[false],checkOnUpdate:false,fillDataMethod:"serverSide",saveicon:[false],linkStyleButtons:["#cData"],msg:'<div id="rup_msgDIV_msg_icon" class="rup-message_icon-confirm"></div><div id="rup_msgDIV_msg" class="rup-message_msg-confirm white-space-normal">'+jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.deleteAll")+"</div>",mtype:"PUT",reloadAfterSubmit:false,resize:false,viewPagerButtons:false,width:569,ajaxEditOptions:{contentType:"application/json",type:"PUT",dataType:"json",processData:false}};jQuery.fn.rup_table.plugins.formEdit.defaults.formEdit.addOptions={mtype:"POST",ajaxEditOptions:{type:"POST"}};jQuery.fn.rup_table.plugins.formEdit.defaults.formEdit.editOptions={mtype:"PUT",ajaxEditOptions:{type:"PUT"}};jQuery.fn.rup_table.plugins.formEdit.defaults.formEdit.detailOptions={ajaxDetailOptions:{dataType:"json",type:"GET",async:false,contentType:"application/json"}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("inlineEdit",{loadOrder:7,preConfiguration:function(b){var d=this;d.rup_table("preConfigureInlineEdit",b)},postConfiguration:function(b){var d=this;d.rup_table("postConfigureInlineEdit",b)}});jQuery.fn.rup_table("extend",{preConfigureInlineEdit:function(d){var f=a(this),e;d.editable=true;if(d.inlineEdit.addEditOptions.url===undefined){d.inlineEdit.addEditOptions.url=d.baseUrl}d.inlineEdit.deleteOptions.ajaxDelOptions=a.extend(true,d.inlineEdit.deleteOptions.ajaxDelOptions,{success:function(h,g,j){f.triggerHandler("rupTableAfterDelete",[h,g,j]);f.rup_table("showFeedback",d.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.deletedOK"),"ok")}});e=d.inlineEdit.beforeSend;d.inlineEdit.addEditOptions.restoreAfterError=false;d.inlineEdit.addEditOptions.errorfunc=function(j,k,g,h,m){var n;if(k.status===406&&k.responseText!==""){try{n=jQuery.parseJSON(k.responseText);if(n.rupErrorFields){f.rup_table("showServerValidationFieldErrors",d.inlineEdit.$inlineForm,n)}}catch(l){f.rup_table("showFeedback",d.$feedback,k.responseText,"error")}}};d.inlineEdit.addEditOptions.ajaxRowOptions.beforeSend=function(h,g){jQuery.extend(true,g,{validate:d.validate,beforeSend:(jQuery.isFunction(e)?e:null),feedback:d.$feedback});d.inlineEdit.$inlineForm.on("rupValidate_formValidationError.inlineEditing",function(j,k){f.off("rupValidate_formValidationError.inlineEditing");a("#lui_"+a.jgrid.jqID(d.id)).hide()});d.inlineEdit.$inlineForm.rup_form("ajaxSubmit",g);return false};d.inlineEdit.addOptions=a.extend(true,{},d.inlineEdit.addEditOptions,d.inlineEdit.addOptions);d.inlineEdit.editOptions=a.extend(true,{},d.inlineEdit.addEditOptions,d.inlineEdit.editOptions);d.multiboxonly=true;d.getRowForEditing=function(){var h=this,g=h.jqGrid("getGridParam","selrow");return(g===null?false:g)};d.core.operations={add:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.new"),icon:"rup-icon rup-icon-new",enabled:function(){var g=this;return jQuery("tr[editable='1']",g).length===0},callback:function(h,g){var j=this;j.rup_table("addRow")}},edit:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.modify"),icon:"rup-icon rup-icon-edit",enabled:function(){var j=this,g=j.jqGrid("getGridParam","selrow"),h;g=(g===null?false:g);g=g&&(g.indexOf("jqg")===-1);h=jQuery("tr[editable='1'].jqgrid-new-row",j).length===0;return g&&h},callback:function(h,g){f.rup_table("editRow",jQuery.proxy(d.getRowForEditing,f)())}},save:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.modify"),icon:"rup-icon rup-icon-save",enabled:function(){var g=this;return jQuery("tr[editable='1']",g).length>0},callback:function(h,g){f.rup_table("saveRow")}},clone:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.clone"),icon:"rup-icon rup-icon-clone",enabled:function(){var j=this,g=j.jqGrid("getGridParam","selrow"),h;g=(g===null?false:g);g=g&&(g.indexOf("jqg")===-1);h=jQuery("tr[editable='1'].jqgrid-new-row",j).length===0;return g&&h},callback:function(h,g){if(jQuery("tr[editable='1']",f).length>0){f.rup_table("restoreRow")}f.rup_table("cloneRow")}},cancel:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.cancel"),icon:"rup-icon rup-icon-cancel",enabled:function(){var g=this;return jQuery("tr[editable='1']",g).length>0},callback:function(h,g){f.rup_table("restoreRow")}},"delete":{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.delete"),icon:"rup-icon rup-icon-delete",enabled:function(){var h=this,g=h.jqGrid("getGridParam","selrow");g=(g===null?false:g);return jQuery("tr[editable='1']",h).length>0||g},callback:function(h,g){f.rup_table("deleteRow")}}};f.on({"jqGridInlineErrorSaveRow.rupTable.inlineEditing":function(h,g,j){jQuery(f.getInd(g,true)).attr("id",d.inlineEditingRow);f.rup_table("setSelection",d.inlineEditingRow)},"jqGridInlineAfterSaveRow.rupTable.inlineEditing":function(l,k,j,h,g){jQuery("#"+jQuery.jgrid.jqID(k)+".jqgrid-new-row",f).removeClass("jqgrid-new-row");if(g.oper==="edit"){f.rup_table("showFeedback",d.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.modifyOK"),"ok")}else{f.rup_table("showFeedback",d.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.insertOK"),"ok")}},"jqGridInlineEditRow.rupTable.inlineEditing":function b(g,k){var u=this,r=a(u),l=r.data("settings"),p=u.p.colModel,j=r.jqGrid("getInd",k,true),t,n,s,h;a("td[role='gridcell']",j).each(function(v){t=p[v];if(t.editable===true){n=t.name;h=a("[name='"+n+"']",j);h.attr({title:u.p.colNames[v],"class":"editable customelement"});if(t.rupType!==undefined){s=t.editoptions;switch(t.rupType){case"combo":s=a.extend({menuWidth:h.width()},s,{width:"auto"});break}h["rup_"+t.rupType](s);switch(t.rupType){case"date":h.css("width","88%");break}}}});l.inlineEditingRow=k;function o(w,v){r.on("jqGridInlineAfterSaveRow.inlineEditing.addNextRow",function(x){r.rup_table("addRow");jQuery(r.getInd(r[0].p.selrow,true)).find(":not([readonly]):focusable:first").focus();r.off("jqGridInlineAfterSaveRow.inlineEditing.addNextRow")});r.rup_table("saveRow",w);return true}function q(B,v){var w,C,y,A,z,x;w=r.getDataIDs();C=r.getInd(B)-1;y=parseInt(r.rup_table("getGridParam","rowNum"),10);if(C===y-1){A=parseInt(r.rup_table("getGridParam","page"),10);z=parseInt(Math.ceil(r.rup_table("getGridParam","records")/r.rup_table("getGridParam","rowNum")),10);if(A<z){r.trigger("reloadGrid",[{page:A+1}]);r.on("jqGridAfterLoadComplete.rupTable.inlineEdit",function(D,E){w=r.getDataIDs();r.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(F,G){if(v===undefined||v===-1){x=jQuery(r.jqGrid("getInd",G,true)).find("td :not([readonly]):focusable:first")}else{x=jQuery(r.jqGrid("getInd",G,true)).find("td:eq("+v+") :not([readonly]):focusable:first")}x.trigger("focus");r.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(r.getInd(w[0],true)).trigger("click");r.off("jqGridAfterLoadComplete.rupTable.inlineEdit")});return false}}else{r.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(D,E){if(v===undefined||v===-1){x=jQuery(r.jqGrid("getInd",E,true)).find("td :not([readonly]):focusable:first")}else{x=jQuery(r.jqGrid("getInd",E,true)).find("td:eq("+v+") :not([readonly]):focusable:first")}x.trigger("focus");r.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(r.getInd(w[C+1],true)).trigger("click");return false}return true}function m(z,v){var w,A,y,x;w=r.getDataIDs();A=r.getInd(z)-1;if(A===0){y=parseInt(r.rup_table("getGridParam","page"),10);if(y>1){r.trigger("reloadGrid",[{page:y-1}]);r.on("jqGridAfterLoadComplete.rupTable.inlineEdit",function(B,C){w=r.getDataIDs();r.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(D,E){if(v===undefined||v===-1){x=jQuery(r.jqGrid("getInd",E,true)).find("td :not([readonly]):focusable:last")}else{x=jQuery(r.jqGrid("getInd",E,true)).find("td:eq("+v+") :not([readonly]):focusable:last")}x.trigger("focus");r.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(r.getInd(w[w.length-1],true)).trigger("click");r.off("jqGridAfterLoadComplete.rupTable.inlineEdit")});return false}}else{r.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(B,C){if(v===undefined||v===-1){x=jQuery(r.jqGrid("getInd",C,true)).find("td :not([readonly]):focusable:last")}else{x=jQuery(r.jqGrid("getInd",C,true)).find("td:eq("+v+") :not([readonly]):focusable:last")}x.trigger("focus");r.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(r.getInd(w[A-1],true)).trigger("click");return false}}r.data("initialFormData",l.inlineEdit.$inlineForm.rup_form("formSerialize"));jQuery(j).on({keydown:function(w){if(w.keyCode===27){r.jqGrid("restoreRow",a(this).attr("id"),l.afterrestorefunc);return false}if(w.keyCode===13){var v=w.target;if(v.tagName=="TEXTAREA"){return true}r.rup_table("saveRow");return false}}});jQuery("td",jQuery(j)).on({keydown:function(x){var w,v;if(x.keyCode===38){v=a.map(r.rup_table("getColModel"),function(z,y){return z.name});w=jQuery.inArray(a(this).attr("aria-describedby").split(l.id+"_")[1],v);m(a(j).attr("id"),w);return false}if(x.keyCode===40){v=a.map(r.rup_table("getColModel"),function(z,y){return z.name});w=jQuery.inArray(a(this).attr("aria-describedby").split(l.id+"_")[1],v);q(a(j).attr("id"),w);return false}}});jQuery("input,select",jQuery(j)).on({focus:function(v){}});jQuery("input, textarea, select,a.rup_combo",jQuery(j)).filter(".editable:visible:last").on({keydown:function(v){if(v.keyCode==9&&!v.shiftKey){if(jQuery(j).attr("id").indexOf("jqg")!==-1){if(o(jQuery(j).attr("id"))===false){return false}}else{if(q(jQuery(j).attr("id"))===false){return false}}}}});jQuery("input, textarea, select,a.rup_combo",jQuery(j)).filter(".editable:visible:first").on({keydown:function(w){var v,y,x;if(w.keyCode==9){if(w.shiftKey){v=r.getDataIDs();y=r.getInd(k)-1;if(y===0){x=parseInt(r.rup_table("getGridParam","page"),10);if(x>1){r.trigger("reloadGrid",[{page:x-1}]);r.on("jqGridAfterLoadComplete.rupTable.inlineEdit",function(z,A){v=r.getDataIDs();r.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(B,C){jQuery(r.jqGrid("getInd",C,true)).find("td :focusable:last").trigger("focus");r.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(r.getInd(v[v.length-1],true)).trigger("click");r.off("jqGridAfterLoadComplete.rupTable.inlineEdit")});return false}}else{r.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(z,A){jQuery(r.jqGrid("getInd",A,true)).find("td :focusable:last").trigger("focus");r.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(r.getInd(v[y-1],true)).trigger("click");return false}}}}})},"jqGridDblClickRow.rupTable.inlineEdit":function(h,k,g,j){if(!d.inlineEdit.autoEditRow){f.rup_table("editRow",k)}else{return false}},"jqGridBeforeSelectRow.rupTable.inlineEditing":function(l,k,m){var n=a(this),j=n.data("settings"),g=a("tr[editable=1]",n);if(g.length>0&&(j.inlineEditingRow!==undefined&&j.inlineEditingRow!==k)){if(n.data("initialFormData")!==j.inlineEdit.$inlineForm.rup_form("formSerialize")){n.on("jqGridInlineSuccessSaveRow.inlineEditing_beforeSelectRow",function(o){n.rup_table("setSelection",k);n.off("jqGridInlineSuccessSaveRow.inlineEditing_beforeSelectRow")});for(var h=0;h<g.length;h++){n.rup_table("saveRow",g[0].id)}return false}}return true},"jqGridSelectRow.rupTable.inlineEditing":function(k,j,g,l){var m=a(this),h;h=a("tr[editable=1]",m);if(h.length>0){jQuery.each(a("tr[editable=1]",m),function(n,o){if(a(o).attr("id")!==j){m.jqGrid("restoreRow",a(o).attr("id"))}})}if(d.inlineEdit.autoEditRow){m.rup_table("editRow",j)}},"rupTable_checkOutOfGrid.rupTable.inlineEditing":function(k,g){var l=a(this),j=l.data("settings"),h=j.core.operations.save;if(jQuery.proxy(h.enabled,l)()){console.log("borrar");jQuery.proxy(h.callback,l)(l,k)}}});if(d.inlineEdit.autoEditRow){f.on({"jqGridCellSelect.rupTable.inlineEditing":function(j,h,g,k,l){var m=a(this);if(g!==-1){m.on("jqGridInlineEditRow.rupTable.inlineEditing.cellSelected",function(n,o){jQuery(m.jqGrid("getInd",h,true)).find("td:eq("+g+") :focusable:first").trigger("focus");m.off("jqGridInlineEditRow.rupTable.inlineEditing.cellSelected")})}}})}},postConfigureInlineEdit:function(b){var f=this,e="inlineForm_"+b.id,d=a("<form>").attr({id:"inlineForm_"+b.id});f.wrap(d);b.inlineEdit.$inlineForm=a("#"+e);b.inlineEdit.$inlineForm.on("rupValidate_formValidationError.inlineEditing",function(h,j){var g=f.jqGrid("getGridParam","selrow");jQuery(f.getInd(g,true)).attr("id",b.inlineEditingRow);f.rup_table("setSelection",b.inlineEditingRow)});f.on({"jqGridLoadComplete.rupTable.formEditing":function(j){var k=a(this),g=k.data("settings"),h;if(g.inlineEdit.autoselectFirstRecord){h=jQuery.proxy(jQuery.jgrid.getCurrPos,k[0])();k.rup_table("highlightRowAsSelected",jQuery(k.jqGrid("getInd",h[1][0],true)))}}})}});jQuery.fn.rup_table("extend",{addRow:function(d){var g=this,f=g.data("settings"),b=g[0].p.colModel;var h={addRowParams:a.extend({},f.inlineEdit.addOptions,d)};for(var e=0;e<b.length;e++){if(b[e].editable===true&&b[e].editableOnAdd!==false){if(b[e].editable===true&&b[e].editableOnAdd===false){if(b[e].editoptions===undefined){b[e].editoptions={}}b[e].editoptions.readonly="readonly"}else{if(b[e].editoptions!==undefined&&b[e].editoptions.readonly!==undefined){delete b[e].editoptions.readonly}}}}if(g.triggerHandler("rupTable_beforeAddRow",[h])!==false){g.jqGrid("addRow",a.extend({},h))}return g},cloneRow:function(b,l){var j=this,e=j.data("settings"),g=(b===undefined?j.jqGrid("getGridParam","selrow"):b),h=j[0].p.colModel,k,d;if(j.triggerHandler("rupTable_beforeCloneRow",[e,b])!==false){k=j.jqGrid("getRowData",g);j.rup_table("addRow");d=jQuery("tbody:first tr[id*='jqg']",j).attr("id");j.jqGrid("setRowData",d,k);jQuery(j.jqGrid("getInd",d,true)).attr("editable","0");for(var f=0;f<h.length;f++){if(h[f].editable===true&&h[f].editableOnAdd!==false){if(h[f].editable===true&&h[f].editableOnAdd===false){if(h[f].editoptions===undefined){h[f].editoptions={}}h[f].editoptions.readonly="readonly"}else{if(h[f].editoptions!==undefined&&h[f].editoptions.readonly!==undefined){delete h[f].editoptions.readonly}}}}j.rup_table("editRow",d,{},true)}},editRow:function(j,d,g){var k=this,f=k.data("settings"),h=(j===undefined?k.jqGrid("getGridParam","selrow"):j),b=k[0].p.colModel;if(g!==true){for(var e=0;e<b.length;e++){if(b[e].editable===true&&b[e].editableOnEdit===false){if(b[e].editoptions===undefined){b[e].editoptions={}}b[e].editoptions.readonly="readonly"}else{if(b[e].editoptions!==undefined&&b[e].editoptions.readonly!==undefined){delete b[e].editoptions.readonly}}}}if(k.triggerHandler("rupTable_beforeEditRow",[f.inlineEdit.editOptions,h])!==false){k.jqGrid("editRow",h,a.extend({},f.inlineEdit.editOptions,d))}return k},deleteRow:function(g,b){var h=this,d=h.data("settings"),f=jQuery.extend(true,{},d.inlineEdit.deleteOptions,b),e=(g===undefined?h.rup_table("getSelectedRows"):g);if(e.length===1){if(f.mtype==="DELETE"){f.url=d.baseUrl+"/"+h.rup_table("getPkUrl",e)}}else{f.mtype="POST";f.ajaxDelOptions.contentType="application/json";f.ajaxDelOptions.type="POST";f.ajaxDelOptions.dataType="json";f.url=d.baseUrl+"/deleteAll";f.serializeDelData=function(k,j){return jQuery.toJSON({core:{pkToken:d.multiplePkToken,pkNames:d.primaryKey},multiselection:h.rup_table("getSelectedIds")})}}f.afterSubmit=function(){h.triggerHandler("rupTable_deleteAfterSubmit");return true};if(h.triggerHandler("rupTable_beforeDeleteRow",[f,e])!==false){h.jqGrid("delGridRow",e,f)}return h},saveRow:function(f,b){var g=this,d=g.data("settings"),e=(f===undefined?g.jqGrid("getGridParam","selrow"):f);if(e.indexOf("jqg")!==-1){g[0].p.ajaxRowOptions=d.inlineEdit.addOptions.ajaxRowOptions;g.jqGrid("saveRow",e,d.inlineEdit.addOptions)}else{g[0].p.ajaxRowOptions=d.inlineEdit.editOptions.ajaxRowOptions;g.jqGrid("saveRow",e,d.inlineEdit.editOptions)}return g},restoreRow:function(d){var e=this,b=(d===undefined?e.jqGrid("getGridParam","selrow"):d);e.jqGrid("restoreRow",b)}});jQuery.fn.rup_table.plugins.inlineEdit={};jQuery.fn.rup_table.plugins.inlineEdit.defaults={toolbar:{defaultButtons:{add:true,edit:true,cancel:true,save:true,clone:true,"delete":true,filter:false}},contextMenu:{defaultRowOperations:{add:true,edit:true,cancel:true,save:true,clone:true,"delete":true,filter:false}},inlineEdit:{autoselectFirstRecord:true,autoEditRow:false},formEdit:{}};jQuery.fn.rup_table.plugins.inlineEdit.defaults.inlineEdit.addEditOptions={contentType:"application/json",type:"PUT",dataType:"json",ajaxRowOptions:{contentType:"application/json",dataType:"json",processData:false}};jQuery.fn.rup_table.plugins.inlineEdit.defaults.inlineEdit.addOptions={mtype:"POST",ajaxRowOptions:{type:"POST"}};jQuery.fn.rup_table.plugins.inlineEdit.defaults.inlineEdit.editOptions={mtype:"PUT",ajaxRowOptions:{type:"PUT"}};jQuery.fn.rup_table.plugins.inlineEdit.defaults.inlineEdit.deleteOptions={bSubmit:jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_message.aceptar"),cancelicon:[true,"left","icono_cancelar"],delicon:[false],linkStyleButtons:["#eData"],msg:'<div id="rup_msgDIV_msg_icon" class="rup-message_icon-confirm"></div><div id="rup_msgDIV_msg" class="rup-message_msg-confirm white-space-normal">'+jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.deleteAll")+"</div>",mtype:"DELETE",width:320,reloadAfterSubmit:false,resize:false};jQuery.jgrid.inlineEdit={keys:false}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){jQuery.rup_table.registerPlugin("multiselection",{loadOrder:8,preConfiguration:function(d){var e=this;e.rup_table("preConfigureMultiselection",d)},postConfiguration:function(d){var e=this;if(d.multiselect===true){e.rup_table("postConfigureMultiselection",d)}}});jQuery.fn.rup_table("extend",{preConfigureMultiselection:function(d){var e=this;d.multiselect=true;d.multiselectWidth=40;if(d.core.operations.clone){d.core.operations.clone.enabled=function(){return d.multiselection.numSelected===1}}d.getSelectedRows=function(){var g=this,f=g.data("settings");if(f.multiselection.selectedAll!==true){return f.multiselection.selectedIds}else{return f.multiselection.deselectedIds}};d.getSelectedLines=function(){var h=this,f=h.data("settings"),g=parseInt(h.rup_table("getGridParam","page"),10);if(f.multiselection.selectedAll!==true){return f.multiselection.selectedLinesPerPage[g]}else{return f.multiselection.deselectedLinesPerPage[g]}};e.on({"rupTable_serializeGridData.multiselection":function(j,f){var h={},g;function k(l){return l.rows+l.sidx+l.sord+l.filter!==undefined?jQuery.param(l.filter):""}g=e.data("tmp.lastSearch");if(g!==undefined&&g!==k(f)){if(d&&d.multiselection&&d.multiselection.numSelected>0){h=e.rup_table("getSelectedIds");jQuery.extend(true,f,{multiselection:h})}}e.data("tmp.lastSearch",k(f))}})},postConfigureMultiselection:function(d){var f=this;f._initializeMultiselectionProps(d);d.$selectAllCheck=jQuery("#cb_"+d.id);d.fncHasSelectedElements=function(){return d.multiselection.numSelected>0};d.getRowForEditing=function(){var m=this,h=m.data("settings"),l=parseInt(m.rup_table("getGridParam","page"),10),j=jQuery.proxy(jQuery.jgrid.getCurrPos,m[0])(),g,k;if(m._hasPageSelectedElements(l)){if(h.multiselection.rowForEditing!==undefined){return h.multiselection.rowForEditing}g=m._getSelectedLinesOfPage(l)[0];return j[1][g-1]}else{k=jQuery.proxy(h.fncGetNavigationParams,m)("first");execute=k[1];newPage=k[5];newPageIndex=k[6];if(execute){m.trigger("reloadGrid",[{page:newPage}]);m.on("jqGridAfterLoadComplete.multiselection.editRow",function(p,q){var o=jQuery.proxy(jQuery.jgrid.getCurrPos,m[0])(),n=o[1][m._getSelectedLinesOfPage(newPage)[0]-1];m.jqGrid("editGridRow",n,h.editOptions);m.off("jqGridAfterLoadComplete.multiselection.editRow")})}return false}};d.getDetailTotalRowCount=function(){var h=this,g=h.data("settings");return g.multiselection.numSelected};d.getDetailCurrentRowCount=function(){var n=this,j=n.data("settings"),l=parseInt(n.rup_table("getGridParam","page"),10),o=jQuery.proxy(jQuery.jgrid.getCurrPos,n[0])(),h=parseInt(n.rup_table("getGridParam","rowNum"),10),m,g,p=0;if(!j.multiselection.selectedAll){m=jQuery.inArray(l,j.multiselection.selectedPages);g=j.multiselection.selectedPages[m];for(var k=1;k<g;k++){if(j.multiselection.selectedLinesPerPage[k]!==undefined){p+=j.multiselection.selectedLinesPerPage[k].length}}p+=jQuery.inArray(o[0]+1,j.multiselection.selectedLinesPerPage[g])+1}else{p=(l>1?((l-1)-j.multiselection.deselectedPages.length)*h:0);for(var k=0;k<j.multiselection.deselectedPages.length&&j.multiselection.deselectedPages[k]!==l;k++){p+=h-j.multiselection.deselectedLinesPerPage[j.multiselection.deselectedPages[k]].length}p+=jQuery.inArray(o[0]+1,n._getSelectedLinesOfPage(l))+1}return p};d.fncGetNavigationParams=function e(h){var t=this,m=t.data("settings"),s=false,u=false,p=0,l=0,g=jQuery.proxy(jQuery.jgrid.getCurrPos,t[0])(),q=parseInt(t.rup_table("getGridParam","page"),10),k=q,o=parseInt(Math.ceil(t.rup_table("getGridParam","records")/t.rup_table("getGridParam","rowNum")),10),j,r;g[0]=parseInt(g[0],10);b("#"+m.formEdit.feedbackId,m.formEdit.$detailForm).hide();switch(h){case"first":s=true;if(!m.multiselection.selectedAll){if(m.multiselection.selectedPages[0]!==q){u=true;k=m.multiselection.selectedPages[0]}}else{for(var n=1;n<=o;n++){if(t._hasPageSelectedElements(n)){if(n!==q){k=n;u=true}break}}}p=t._getFirstSelectedElementOfPage(k);l=p;break;case"prev":s=true;r=t._getSelectedLinesOfPage(q);j=jQuery.inArray(g[0]+1,r);if(j===0){u=true;for(var n=q-1;n>=0;n--){if(t._hasPageSelectedElements(n)){k=n;r=t._getSelectedLinesOfPage(n);p=r[r.length-1];break}}}else{p=r[j-1]}l=p;break;case"next":s=true;r=t._getSelectedLinesOfPage(q);j=jQuery.inArray(g[0]+1,r);if(j===r.length-1){u=true;for(var n=q+1;n<=o;n++){if(t._hasPageSelectedElements(n)){k=n;r=t._getSelectedLinesOfPage(n);p=r[0];break}}}else{p=r[j+1]}l=p;break;case"last":s=true;if(!m.multiselection.selectedAll){if(m.multiselection.selectedPages[m.multiselection.selectedPages.length-1]!==q){u=true;k=m.multiselection.selectedPages[m.multiselection.selectedPages.length-1]}}else{for(var n=o;n>0;n--){if(t._hasPageSelectedElements(n)){if(n!==q){k=n;u=true}break}}}r=t._getSelectedLinesOfPage(k);p=r[r.length-1];l=p}return[h,s,u,p-1,g,k,l-1]};d.doNavigation=function(s,p,r,n,h,l,k){var q=this,m=q.data("settings"),o=rp_ge[q.attr("id")],g,p,r,n,h,l,k,j;if(jQuery.isArray(s)){g=s[0];p=s[1];r=s[2];n=s[3];h=s[4];l=s[5];k=s[6];if(p){q.rup_table("hideFormErrors",m.formEdit.$detailForm);q.triggerHandler("jqGridAddEditClickPgButtons",[g,m.formEdit.$detailForm,h[1][h[n]]]);if(r){q.trigger("reloadGrid",[{page:l}]);q.on("jqGridAfterLoadComplete.pagination",function(v,w){var u=jQuery.proxy(jQuery.jgrid.getCurrPos,q[0])(),t=u[1][k];jQuery.proxy(jQuery.jgrid.fillData,q[0])(t,q[0],m.formEdit.$detailForm.attr("id"),m.opermode);jQuery.proxy(jQuery.jgrid.updateNav,q[0])();m.multiselection.rowForEditing=t;q.rup_table("clearHighlightedEditableRows");q.rup_table("highlightEditableRow",q.jqGrid("getInd",t,true));q.off("jqGridAfterLoadComplete.pagination")})}else{jQuery.proxy(jQuery.jgrid.fillData,q[0])(h[1][n],q[0],m.formEdit.$detailForm.attr("id"),m.opermode);jQuery.proxy(jQuery.jgrid.updateNav,q[0])();m.multiselection.rowForEditing=h[1][n];q.rup_table("clearHighlightedEditableRows");q.rup_table("highlightEditableRow",q.jqGrid("getInd",h[1][n],true))}q.triggerHandler("jqGridAddEditAfterClickPgButtons",[g,m.formEdit.$detailForm,h[1][h[n]]]);j=(o!==undefined?o.afterclickPgButtons:m.afterclickPgButtons);if(jQuery.isFunction(j)){o.fncAfterclickPgButtons.call(q,g,m.formEdit.$detailForm,h[1][h[n]])}}}};f.on({"jqGridSelectRow.rupTable.multiselection":function(h,n,g,l){var k,m,j;if(l!==false){if(l!==undefined&&jQuery(l.target).hasClass("treeclick")){return false}if(d.multiboxonly===true&&l!==undefined&&!(l.originalEvent!==undefined&&jQuery(l.originalEvent.target).is(":checkbox")&&jQuery(l.originalEvent.target).attr("id").indexOf("jqg_")!==-1)){f.rup_table("deselectRemainingRows")}f._processSelectedRow(d,n,g);f.rup_table("updateSelectedRowNumber");d.$internalFeedback.rup_feedback("close");f.rup_table("clearHighlightedEditableRows");if(g){d.multiselection.rowForEditing=n;f.rup_table("highlightEditableRow",f.jqGrid("getInd",n,true))}else{k=parseInt(f.rup_table("getGridParam","page"),10);if(f._hasPageSelectedElements(k)){f.rup_table("highlightFirstEditableRow")}}}},"jqGridLoadComplete.rupTable.multiselection":function(H,o){var s=f[0],k=s.p,l=f.rup_table("getGridParam","page"),E=f.rup_table("getGridParam","rowNum"),p,t=d.multiselection.selectedRowsPerPage[l],y=d.multiselection.deselectedRowsPerPage[l]||[],I,B,g,m,F,r,h,v,C,w,q,G;if(o.reorderedSelection!==undefined&&o.reorderedSelection!==null){f._initializeMultiselectionProps(d);d.multiselection.selectedAll=o.selectedAll;if(d.multiselection.selectedAll===true){F=d.multiselection.deselectedRowsPerPage;r=d.multiselection.deselectedLinesPerPage;h=d.multiselection.deselectedIds;v=d.multiselection.deselectedRows;C=d.multiselection.deselectedPages;d.multiselection.numSelected=o.records-o.reorderedSelection.length}else{F=d.multiselection.selectedRowsPerPage;r=d.multiselection.selectedLinesPerPage;h=d.multiselection.selectedIds;v=d.multiselection.selectedRows;C=d.multiselection.selectedPages;d.multiselection.numSelected=o.reorderedSelection.length}for(var A=0;A<o.reorderedSelection.length;A++){I=o.reorderedSelection[A];B=I.page;g=I.pageLine;var u="";for(var x=0;x<d.primaryKey.length;x++){u+=I.pk[d.primaryKey[x]]+d.multiplePkToken}m=u.substr(0,u.length-1);if(F[B]===undefined){F[B]=[];r[B]=[]}if(jQuery.inArray(m,h)===-1){h.push(m);v.push({id:m,page:B});F[B].push(m);r[B].push(g);if(F[B].length>0&&jQuery.inArray(B,C)===-1){jQuery.rup_utils.insertSorted(C,B)}}}}f.triggerHandler("rupTable_multiselectionUpdated");d.$internalFeedback.rup_feedback("close");if(f._hasPageSelectedElements(l)){f.rup_table("highlightFirstEditableRow")}var z=jQuery("[id='"+d.id+"_cb']");if(d.multiselection.headerContextMenu_enabled&&z.find("a").length===0){z.find("input").css("margin-right","1em");f._addArrow(z.find("input"))}f.find(".cbox").css("margin-right","1em");if(d.multiselection.rowContextMenu_enabled){var n=d.jerarquia!==undefined?true:false,D=jQuery.isEmptyObject(d.multiselection.rowContextMenu.items);b.each(f.find(".cbox"),function(j,J){f._addArrow(jQuery(J));if(n&&D&&b(J).parents("tr").find(".treeclick").hasClass("tree-leaf")){jQuery(this).next("a").addClass("ui-state-disabled").off("click")}})}},"jqGridSelectAll.rupTable.multiselection":function(g,j,k){var m=f.rup_table("getGridParam","page"),n,r,h,q,p,o;for(var l=0;l<j.length;l++){f._processSelectedRow(d,j[l],k)}n=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_grid.selectMsg","<b>"+j.length+"</b>","<b>"+m+"</b>");r=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_grid.deselectMsg","<b>"+j.length+"</b>","<b>"+m+"</b>");if(k){h=f._getRemainingRecordNum(d,j);if(h!==0){q=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.selectRestMsg",h);p=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.multiselection.selectRemainingRecords",f[0].id,q,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.selectAll"));f.rup_table("showFeedback",d.$internalFeedback,n+p,"alert")}else{f.rup_table("showFeedback",d.$internalFeedback,n,"alert")}b("#rup_grid_"+f[0].id+"_selectAll").on("click",function(s){f.rup_table("selectRemainingRows")});f.rup_table("highlightFirstEditableRow")}else{f.rup_table("clearHighlightedEditableRows");if(d.multiselection.numSelected>0){q=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.deselectRestMsg",d.multiselection.numSelected);o=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.multiselection.deselectRemainingRecords",f[0].id,q,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.deSelectAll"));f.rup_table("showFeedback",d.$internalFeedback,r+o,"alert")}b("#rup_grid_"+f[0].id+"_deselectAll").on("click",function(s){f.rup_table("deselectRemainingRows")})}f.rup_table("updateSelectedRowNumber")},"rupTableAfterSearchNav.rupTable.multiselection rupTableSearchSuccess.rupTable.multiselection rupTableAfterDelete.rupTable.multiselection":function(){var g=b(this);g.rup_table("resetSelection")},"rupTable_multiselectionUpdated.multiselection":function(){var n=b(this),p=n[0],k=n.rup_table("getGridParam","page"),h=n.data("settings"),l=p.p,m=n.rup_table("getGridParam","rowNum"),q,g=h.multiselection.selectedRowsPerPage[k],o=h.multiselection.deselectedRowsPerPage[k]||[];if(h.multiselection.selectedAll){l.selarrrow=[];q=p.rows;for(var j=0;j<q.length;j++){if(jQuery.inArray(q[j].id,o)===-1){n.rup_table("highlightRowAsSelected",b(q[j]))}else{n.rup_table("clearHighlightedRowAsSelected",b(q[j]))}}if(o.length===0){h.$selectAllCheck[l.useProp?"prop":"attr"]("checked",true)}}else{if(g){q=p.rows;l.selarrrow=[];for(var j=0;j<q.length;j++){if(jQuery.inArray(q[j].id,g)!==-1){n.rup_table("highlightRowAsSelected",b(q[j]))}else{n.rup_table("clearHighlightedRowAsSelected",b(q[j]))}}if(g.length===m){h.$selectAllCheck[l.useProp?"prop":"attr"]("checked",true)}}}n.rup_table("updateSelectedRowNumber")},"rupTable_beforeAddRow.multiselection":function(g,h){f._checkSelectedElements(function(){f.jqGrid("editGridRow","new",h);f.rup_table("resetSelection");f.rup_table("clearHighlightedEditableRows")});return false},"jqGridAddEditAfterSubmit.rupTable.formEditing":function(j,h,g,k){if(k!=="edit"){f.rup_table("resetSelection");f.rup_table("clearHighlightedEditableRows")}}});jQuery("[id='"+d.id+"_cb']").rup_contextMenu({trigger:"none",callback:d.multiselection.headerContextMenu.callback,items:f._headerContextMenuItems(d.multiselection.headerContextMenu,d),position:function(h,g,k){var j=this.offset();h.$menu.css({top:j.top+this.height(),left:j.left})}});if(d.multiselection.rowContextMenu_enabled){jQuery("td[aria-describedby='"+d.id+"_cb']").rup_contextMenu({trigger:"none",callback:d.multiselection.rowContextMenu.callback,items:f._rowContextMenuItems(d.multiselection.rowContextMenu,d),position:function(h,g,k){var j=this.offset();h.$menu.css({top:j.top+this.height(),left:j.left})}})}}});jQuery.fn.rup_table("extend",{getSelectedIds:function(){var f=this,e=f.data("settings"),d={};if(!e.multiselection.selectedAll){if(e.multiselection.selectedIds.length>0){jQuery.extend(true,d,{selectedIds:e.multiselection.selectedIds})}jQuery.extend(true,d,{selectedAll:false})}else{if(e.multiselection.deselectedIds.length>0){jQuery.extend(true,d,{selectedIds:e.multiselection.deselectedIds})}jQuery.extend(true,d,{selectedAll:true})}return d},setSelection:function(g,d){var h=this,f=h.data("settings");if(jQuery.isArray(g)){for(var e=0;e<g.length;e++){h._processSelectedRow(f,g[e],d)}}else{h._processSelectedRow(f,g,d)}h.triggerHandler("rupTable_multiselectionUpdated")},clearHighlightedEditableRows:function(){var e=this,d=e.data("settings");e.find("td[aria-describedby='"+d.id+"_rupInfoCol'] span.ui-icon.ui-icon-pencil").removeClass("ui-icon-pencil")},highlightFirstEditableRow:function(){var h=this,d=h.data("settings"),f=parseInt(h.rup_table("getGridParam","page"),10),e,g;h.rup_table("clearHighlightedEditableRows");if(h._hasPageSelectedElements(f)){e=h._getFirstSelectedElementOfPage(f);g=h.jqGrid("getDataIDs")[e-1];d.multiselection.rowForEditing=g;h.rup_table("highlightEditableRow",h.jqGrid("getInd",g,true))}},highlightEditableRow:function(d){var f=this,e=f.data("settings");d=jQuery(d);d.find("td[aria-describedby='"+e.id+"_rupInfoCol'] span").addClass("ui-icon ui-icon-rupInfoCol ui-icon-pencil")},refreshSelection:function(){var d=this;d.triggerHandler("rupTable_multiselectionUpdated")},resetSelection:function(){var e=this,d=e.data("settings");e.jqGrid("resetSelection");e._initializeMultiselectionProps(d);e.triggerHandler("rupTable_multiselectionUpdated")},selectAllRows:function(h){var j=this,g=j.data("settings"),e,d;j.rup_table("selectRemainingRows");jQuery("#cb_"+g.id).attr("checked","checked");e=j.jqGrid("getDataIDs");for(var f=0;f<e.length;f++){d=jQuery(j.jqGrid("getInd",e[f],true));j.rup_table("highlightRowAsSelected",d)}j.rup_table("highlightFirstEditableRow")},selectRemainingRows:function(e){var f=this,d=f.data("settings");f._initializeMultiselectionProps(d);d.multiselection.selectedAll=true;d.multiselection.numSelected=f.rup_table("getGridParam","records");f.rup_table("updateSelectedRowNumber");d.$internalFeedback.rup_feedback("close")},deselectAllRows:function(j){var k=this,h=k.data("settings"),e,d,g=k[0].p;k.rup_table("deselectRemainingRows");k.rup_table("clearHighlightedEditableRows");jQuery("#cb_"+h.id).removeAttr("checked");e=k.jqGrid("getDataIDs");g.selarrrow=[];for(var f=0;f<e.length;f++){d=jQuery(k.jqGrid("getInd",e[f],true));k.rup_table("clearHighlightedRowAsSelected",d)}},deselectRemainingRows:function(e){var f=this,d=f.data("settings");f._initializeMultiselectionProps(d);f.rup_table("updateSelectedRowNumber");d.$internalFeedback.rup_feedback("close")},updateSelectedRowNumber:function(){var e=b(this),d=e.data("settings");b("div .ui-paging-selected",d.$pager).html(d.multiselection.numSelected+" "+jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.selected"));e.triggerHandler("rupTableSelectedRowNumberUpdated")}});jQuery.fn.rup_table("extend",{_addArrow:function(d){jQuery(d).after(jQuery("<a />").attr("href","javascript:void(0)").addClass("ui-icon rup-jerarquia_checkmenu_arrow").on("click",function(f){b(this).parents("th, td").contextMenu()}))},_checkSelectedElements:function(g){var h=b(this),d=h[0],f=h.rup_table("getGridParam","page"),e=h.data("settings");if(e.multiselection.numSelected>0){b.rup_messages("msgConfirm",{message:b.rup.i18nParse(b.rup.i18n.base,"rup_maint.checkSelectedElems"),title:b.rup.i18nParse(b.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){g.call()}})}else{g.call()}},_headerContextMenuItems:function(e,f){var g=this,d={};if(e.selectAllPage){jQuery.extend(d,{selectAllPage:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.selectAllPage"),icon:"check",disabled:function(j,h){return g._getSelectedLinesOfPage(parseInt(g.rup_table("getGridParam","page"))).length===g.jqGrid("getGridParam","reccount")},callback:function(j,h){b("[id='cb_"+f.id+"']").attr("checked","checked").click().attr("checked","checked")}}})}if(e.deselectAllPage){jQuery.extend(d,{deselectAllPage:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.deselectAllPage"),icon:"uncheck",disabled:function(j,h){return g._getSelectedLinesOfPage(parseInt(g.rup_table("getGridParam","page"))).length===0},callback:function(j,h){b("[id='cb_"+f.id+"']").removeAttr("checked").click().removeAttr("checked")}}})}if(e.separator){jQuery.extend(d,{separator:""})}if(e.selectAll){jQuery.extend(d,{selectAll:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.selectAll"),icon:"check_all",disabled:function(j,h){return f.multiselection.numSelected===g.rup_table("getGridParam","records")},callback:function(j,h){g.rup_table("selectAllRows")}}})}if(e.deselectAll){jQuery.extend(d,{deselectAll:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.deselectAll"),icon:"uncheck_all",disabled:function(j,h){return f.multiselection.numSelected===0},callback:function(j,h){g.rup_table("deselectAllRows")}}})}if(!jQuery.isEmptyObject(e.items)){jQuery.extend(d,e.items)}return d},_rowContextMenuItems:function(e,f){var g=this,d={};if(f.jerarquia!==undefined&&f.jerarquia.contextMenu){if(e.selectChild){jQuery.extend(d,{selectChild:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.selectChild"),icon:"child",callback:function(j,h){g._getJerarquiaChildren(this,j,h)}}})}if(e.selectDescendent){jQuery.extend(d,{selectDescendent:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.selectDescendent"),icon:"descendent",callback:function(j,h){g._getJerarquiaChildren(this,j,h)}}})}if(e.separator){jQuery.extend(d,{separator:""})}if(e.deselectChild){jQuery.extend(d,{deselectChild:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.deselectChild"),icon:"uncheck",callback:function(j,h){g._getJerarquiaChildren(this,j,h)}}})}if(e.deselectDescendent){jQuery.extend(d,{deselectDescendent:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.deselectDescendent"),icon:"uncheck",callback:function(j,h){g._getJerarquiaChildren(this,j,h)}}})}}if(!jQuery.isEmptyObject(e.items)){jQuery.extend(d,e.items)}return d},_refreshSelectedElements:function(k,l,n,e){var f,m,d,o,j;if(k.multiselection.selectedAll!==true){f=k.multiselection.selectedRowsPerPage;m=k.multiselection.selectedLinesPerPage;d=k.multiselection.selectedIds;o=k.multiselection.selectedRows;j=k.multiselection.selectedPages}else{f=k.multiselection.deselectedRowsPerPage;m=k.multiselection.deselectedLinesPerPage;d=k.multiselection.deselectedIds;o=k.multiselection.deselectedRows;j=k.multiselection.deselectedPages;l=!l}if(l){if(jQuery.inArray(n,d)===-1){if(k.multiselection.selectedAll!==true){k.multiselection.numSelected++}else{k.multiselection.numSelected--}if(f[e.page]===undefined){f[e.page]=[];m[e.page]=[]}d.push(n);jQuery.rup_utils.insertSorted(m[e.page],e.pageLine);o.push({id:n,page:e.page});f[e.page].splice(e.pageLine,0,n);if(f[e.page].length>0&&jQuery.inArray(e.page,j)===-1){jQuery.rup_utils.insertSorted(j,e.page)}}}else{if(jQuery.inArray(n,d)!==-1){if(k.multiselection.selectedAll!==true){k.multiselection.numSelected--}else{k.multiselection.numSelected++}d.splice(jQuery.inArray(n,d),1);m[e.page].splice(jQuery.inArray(e.pageLine,m[e.page]),1);var h=JSON.stringify({id:n,page:e.page}),g=null;jQuery.grep(o,function(q,p){if(JSON.stringify(q)===h){g=p}});o.splice(g,1);f[e.page].splice(jQuery.inArray(n,f[e.page]),1);if(f[e.page].length==0&&jQuery.inArray(e.page,j)!==-1){j.splice(jQuery.inArray(e.page,j),1)}}}},_hasPageSelectedElements:function(d){var h=this,e=h.data("settings"),f,g=(typeof d==="string"?parseInt(d,10):d);if(!e.multiselection.selectedAll){return(jQuery.inArray(g,e.multiselection.selectedPages)!==-1)}else{f=parseInt(h.rup_table("getGridParam","rowNum"),10);if(jQuery.inArray(g,e.multiselection.deselectedPages)!==-1&&e.multiselection.deselectedLinesPerPage[g].length===f){return false}return true}},_initializeMultiselectionProps:function(d){if(d.multiselection===undefined){d.multiselection={}}d.multiselection.selectedAll=false;d.multiselection.numSelected=0;d.multiselection.selectedRowsPerPage=[];d.multiselection.selectedLinesPerPage=[];d.multiselection.selectedRows=[];d.multiselection.selectedIds=[];d.multiselection.selectedPages=[];d.multiselection.deselectedRowsPerPage=[];d.multiselection.deselectedLinesPerPage=[];d.multiselection.deselectedRows=[];d.multiselection.deselectedIds=[];d.multiselection.deselectedPages=[]},_getFirstSelectedElementOfPage:function(d){var j=this,f=j.data("settings"),g,h=(typeof d==="string"?parseInt(d,10):d);if(!f.multiselection.selectedAll){if(jQuery.inArray(h,f.multiselection.selectedPages)===-1){return false}return f.multiselection.selectedLinesPerPage[h][0]}else{if(jQuery.inArray(h,f.multiselection.deselectedPages)===-1){return 1}g=parseInt(j.rup_table("getGridParam","rowNum"),10);if(f.multiselection.deselectedLinesPerPage[h].length===g){return false}for(var e=1;e<=g;e++){if(jQuery.inArray(e,f.multiselection.deselectedLinesPerPage[h])===-1){return e}}}},_getRemainingRecordNum:function(g,k){var l=this,j=l.rup_table("getGridParam","records"),f=l.rup_table("getGridParam","reccount"),h=k.length,d=g.multiselection.numSelected,e=((j-f)!==0)?j-f-(d-h):0;return e},_getSelectedLinesOfPage:function(k){var l=this,g=l.data("settings"),h,e,j,d=[];if(!g.multiselection.selectedAll){if(jQuery.inArray(k,g.multiselection.selectedPages)===-1){return[]}return g.multiselection.selectedLinesPerPage[k]}else{h=parseInt(l.rup_table("getGridParam","rowNum"),10);e=l.rup_table("getGridParam","records");j=parseInt(Math.ceil(e/h,10));if(k===j){h=e-((j-1)*h)}for(var f=1;f<=h;f++){d[f-1]=f}if(jQuery.inArray(k,g.multiselection.deselectedPages)===-1){return d}if(g.multiselection.deselectedLinesPerPage[k].length===h){return[]}return jQuery.grep(d,function(m){return(jQuery.inArray(m,g.multiselection.deselectedLinesPerPage[k])===-1)})}},_processSelectedRow:function(f,e,g){var m=this,j=m.rup_table("getGridParam","page"),k=parseInt(j),n,d,l,h;if(g){if(f.multiselection.selectedAll){d=jQuery.inArray(e,f.multiselection.deselectedIds);if(d!=-1){f.multiselection.deselectedIds.splice(d,1);f.multiselection.deselectedRows.splice(d,1);l=jQuery.inArray(e,f.multiselection.deselectedRowsPerPage[j]);f.multiselection.deselectedRowsPerPage[j].splice(l,1);f.multiselection.deselectedLinesPerPage[j].splice(l,1);if(f.multiselection.deselectedRowsPerPage[j].length===0){h=jQuery.inArray(k,f.multiselection.deselectedPages);if(h!==-1){f.multiselection.deselectedPages.splice(h,1)}}f.multiselection.numSelected++}}else{if(f.multiselection.selectedRowsPerPage[j]===undefined){f.multiselection.selectedRowsPerPage[j]=[];f.multiselection.selectedLinesPerPage[j]=[]}if(jQuery.inArray(e,f.multiselection.selectedIds)===-1){f.multiselection.selectedIds.push(e);f.multiselection.selectedRows.push({id:e,page:j});n=jQuery.rup_utils.insertSorted(f.multiselection.selectedLinesPerPage[j],m.jqGrid("getInd",e));f.multiselection.selectedRowsPerPage[j].splice(n,0,e);if(f.multiselection.selectedRowsPerPage[j].length>0&&jQuery.inArray(k,f.multiselection.selectedPages)===-1){jQuery.rup_utils.insertSorted(f.multiselection.selectedPages,k)}f.multiselection.numSelected++}}}else{if(f.multiselection.selectedAll){if(f.multiselection.deselectedRowsPerPage[j]===undefined){f.multiselection.deselectedRowsPerPage[j]=[];f.multiselection.deselectedLinesPerPage[j]=[]}if(jQuery.inArray(e,f.multiselection.deselectedIds)===-1){f.multiselection.deselectedIds.push(e);f.multiselection.deselectedRows.push({id:e,page:j});n=jQuery.rup_utils.insertSorted(f.multiselection.deselectedLinesPerPage[j],m.jqGrid("getInd",e));f.multiselection.deselectedRowsPerPage[j].splice(n,0,e);if(f.multiselection.deselectedRowsPerPage[j].length>0&&jQuery.inArray(k,f.multiselection.deselectedPages)===-1){jQuery.rup_utils.insertSorted(f.multiselection.deselectedPages,k)}f.multiselection.numSelected--}}else{index=jQuery.inArray(e,f.multiselection.selectedIds);if(index!=-1){f.multiselection.selectedIds.splice(index,1);f.multiselection.selectedRows.splice(index,1);l=jQuery.inArray(e,f.multiselection.selectedRowsPerPage[j]);f.multiselection.selectedRowsPerPage[j].splice(l,1);f.multiselection.selectedLinesPerPage[j].splice(l,1);if(f.multiselection.selectedRowsPerPage[j].length===0){h=jQuery.inArray(k,f.multiselection.selectedPages);if(h!==-1){f.multiselection.selectedPages.splice(h,1)}}f.multiselection.numSelected--}}}m.rup_table("updateSelectedRowNumber")}});jQuery.fn.rup_table("extend",{});jQuery.fn.rup_table.plugins.multiselection=jQuery.fn.rup_table.plugins.multiselection||{};jQuery.fn.rup_table.plugins.multiselection.defaults={showGridInfoCol:true,formEdit:{autoselectFirstRecord:false},inlineEdit:{autoselectFirstRecord:false},multiselection:{defaultEditableInfoCol:{name:"infoEditable",index:"infoEditable",editable:false,width:"15em",search:false},headerContextMenu_enabled:true,headerContextMenu:{selectAllPage:true,deselectAllPage:true,separator:true,selectAll:true,deselectAll:true,items:{}},rowContextMenu_enabled:false,rowContextMenu:{selectChild:true,selectDescendent:true,separator:true,deselectChild:true,deselectDescendent:true,items:{}}}};jQuery.fn.rup_table.defaults.multiselection={loadBeforeSend:function a(e,d){e.setRequestHeader("JQGridModel","true");e.setRequestHeader("Content-Type","application/json")}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){a.rup_table.registerPlugin("jerarquia",{loadOrder:11,preConfiguration:function(b){var d=this;return d.rup_table("preConfigurejerarquia",b)},postConfiguration:function(b){var d=this;return d.rup_table("postConfigurejerarquia",b)}});a.fn.rup_table("extend",{preConfigurejerarquia:function(e){var f=this,b=e.jerarquia;f.jqGrid("setGridParam",{postData:{jerarquia:{}}});e.treeGrid=true;e.rowTotal=0;e.treeGridModel="adjacency";e.treeIcons=b.icons;var d=f.jqGrid.setTreeGrid;a.jgrid.extend({setTreeGrid:function(){d.call(f);f[0].p.altRows=true;f[0].p.pgbuttons=true;f[0].p.pginput=true;f[0].p.rowList=e.rowList;if(e.multiselect){f[0].p.multiselect=true}}});if(e.filter.childrenUrl===null){e.filter.childrenUrl=e.baseUrl+"Children"}e.ExpandColumn=b.column;if(e.multiselect){for(key in e.colModel){if(e.colModel[key].name===e.ExpandColumn){key=parseInt(key)+1;if(e.colModel[key]===undefined){e.colNames[key]="jerarquia_multiselect";e.colModel[key]={name:"jerarquia_multiselect",hidden:true}}e.ExpandColumn=e.colModel[key].name;break}}}e.colNames=a.merge(["level"],e.colNames);e.colModel=a.merge([{name:"level",hidden:true}],e.colModel);e.colNames=a.merge(["isLeaf"],e.colNames);e.colModel=a.merge([{name:"isLeaf",hidden:true}],e.colModel);e.colNames=a.merge(["parentNodes"],e.colNames);e.colModel=a.merge([{name:"parentNodes",hidden:true}],e.colModel);e.colNames=a.merge(["filter"],e.colNames);e.colModel=a.merge([{name:"filter",hidden:true}],e.colModel);a(f).data("tree",[]);f.on({"rupTable_serializeGridData.multiselection":function(h,g){a.extend(true,g,{jerarquia:{token:b.token}});if(a.isArray(g.jerarquia.tree)&&g.jerarquia.tree.length===0){g.jerarquia.tree=""}},"jqGridAddEditAfterComplete.rupTable.jerarquia":function(){f[0].p.treeGrid=false},"jqGridAddEditBeforeSubmit.rupTable.jerarquia jqGridBeforeRequest.rupTable.jerarquia":function(){f[0].p.treeGrid=true},"jqGridLoadComplete.rupTable.jerarquia":function(k){var n=a(f).data("tree"),o=n.length;for(var l=0;l<o;l++){a("[id='"+n[l]+"'] .tree-wrap > div").removeClass("tree-leaf "+e.treeIcons.leaf).addClass("tree-minus "+e.treeIcons.minus)}var p=f.rup_table("getGridParam","data"),j=p.length,m=a("<div />").addClass("rup-jerarquia_filter ui-icon").addClass(b.icons["filter"]).text(a.rup.i18nParse(a.rup.i18n.base,"rup_grid_jerarquia.icons.filtered"));for(var l=0;l<j;l++){var h=a.jgrid.getAccessor(p[l],f.rup_table("getGridParam","localReader").id),g=a("tr[id='"+h+"'] > td .tree-wrap");if(p[l].filter){g.prepend(m.clone())}if(b.parentNodesTooltip){g.parent().rup_tooltip({content:{text:f._parseParentNodes(p[l].parentNodes)}})}}a(".tree-plus, .tree-minus").off("click");a(".tree-plus, .tree-minus").on("click",function(q){var u=a(this),s=f.rup_table("getGridParam","_index")[u.closest("tr.jqgrow")[0].id],r=f.rup_table("getGridParam","data")[s],t=a.jgrid.getAccessor(r,f.rup_table("getGridParam","localReader").id);if(u.hasClass(e.treeIcons.plus)){n.push(t)}else{n.splice(a.inArray(t,n),1)}a(f).data("tree",n);f.jqGrid("setGridParam",{postData:{jerarquia:{tree:n.toString()}}});f.trigger("reloadGrid")});f[0].p.treeGrid=false}});a.each(b.resetEvents,function(h,g){var l=a.isFunction(g[0])?g.shift():null,k="[id='"+g.join("'], [id='")+"']";a(k).on(h,function(m){if(l===null||l.call(f,m)===false){f.reset()}});for(var j=0;j<g.length;j++){a._data(a("#"+g[j])[0],"events")[h]=a._data(a("#"+g[j])[0],"events")[h].reverse()}});e.multiselection.rowContextMenu_enabled=e.jerarquia.contextMenu},postConfigurejerarquia:function(d){var e=this,b=d.jerarquia}});a.fn.rup_table("extend",{reset:function(){a(this).data("tree",[]);a(this).jqGrid("setGridParam",{postData:{jerarquia:{tree:[]}}})}});a.fn.rup_table("extend",{_parseParentNodes:function(d){var f=this.data("settings")["jerarquia"]["parentNodesTooltipFnc"],b=d.split(this.data("settings")["jerarquia"]["token"]).slice(1);if(f===null){var h="",g="&nbsp;&nbsp;";for(var e=0;e<b.length;e++){if(e!==(b.length-1)){h+=b[e]+"<br/>"+g+"└&nbsp;";g+="&nbsp;&nbsp;&nbsp;"}else{h+="<b>"+b[e]+"</b>"}}return h}else{return f.call(this,b)}},_getJerarquiaChildren:function(d,g,f){var k=this,h=k.data("settings"),j=k.rup_table("getGridParam","data")[d.parent().index()-1],b={jerarquia:{parentId:a.jgrid.getAccessor(j,k.rup_table("getGridParam","localReader").id),child:g.toLowerCase().indexOf("child")!=-1},filter:{}};a.extend(true,b,k.rup_table("getGridParam","postData"));var e=a.isArray(h.primaryKey)?h.primaryKey[0]:h.primaryKey;a.rup_ajax({url:h.filter.childrenUrl,dataType:"json",data:a.toJSON(b),type:"POST",async:false,contentType:"application/json",beforeSend:function(l){l.setRequestHeader("JQGridModel",true);l.setRequestHeader("RUP",a.toJSON({primaryKey:e}))},success:function(r,n){var p=r.children,q=p.length,m=g.indexOf("deselect")!=-1?false:true;for(var o=0;o<q;o++){var l=p[o];rowPK=l.pk[e];k._refreshSelectedElements(h,m,rowPK,l)}k.triggerHandler("rupTable_multiselectionUpdated")},error:function(n,l,m){},complete:function(l,m){}})}});a.fn.rup_table.plugins.jerarquia={};a.fn.rup_table.plugins.jerarquia.defaults={formEdit:{addEditOptions:{reloadAfterSubmit:true}},jerarquia:{token:"/",icons:{plus:"ui-icon-triangle-1-se",minus:"ui-icon-triangle-1-e",leaf:"ui-icon-none",filter:"ui-icon-star"},parentNodesTooltip:true,parentNodesTooltipFnc:null,contextMenu:true}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){jQuery.rup_table.registerPlugin("masterDetail",{loadOrder:10,preConfiguration:function(b){var d=this;return d.rup_table("preConfigureMasterDetail",b)}});jQuery.fn.rup_table("extend",{preConfigureMasterDetail:function(b){var e=this,d;d=jQuery(b.masterDetail.master);b.masterDetail.$master=d;e.on({"rupTable_serializeGridData.rupTable.masterDetail":function(h,g){var f=e.rup_table("getMasterTablePkObject");if(f!==null){jsonParam={filter:f};jQuery.extend(true,g,jsonParam)}},"jqGridAddEditBeforeSubmit.rupTable.masterDetail":function(j,g,h){var f=e.rup_table("getMasterTablePkObject");if(f!==null){jQuery.extend(g,f)}},"rupTable_searchBeforeSubmit.rupTable.masterDetail":function(j,g,h){var f=e.rup_table("getMasterTablePkObject");if(f!==null){jsonParam={filter:f};jQuery.extend(true,h,jsonParam)}}});d.on({"jqGridSelectRow.rupTable.masterDetail":function(j,h,f){var g=e.data("tmp.masterDetail.lastRowid");if(g===undefined||g!==h){e.data("tmp.masterDetail.lastRowid",h);e.rup_table("showSearchCriteria");e.rup_table("filter")}},"jqGridAfterLoadComplete.multiselection.editRow":function(f,g){if(g.rows.length===0){e.removeData("tmp.masterDetail.lastRowid");e.jqGrid("clearGridData")}}})}});jQuery.fn.rup_table("extend",{getMasterTablePkObject:function(){var h=this,e=h.data("settings"),g=e.masterDetail.$master,d=g.rup_table("getSelectedRows"),f=e.masterDetail.masterPrimaryKey;function b(k,m){var l={};var j=k.split(".");if(j.length===1){l[k]=m;return l}else{l[j[0]]=b(k.substr(k.indexOf(".")+1),m);return l}}if(d.length===1){return b(f,d[0])}else{if(d.length===0){return null}}}});jQuery.fn.rup_table.plugins.masterDetail={};jQuery.fn.rup_table.plugins.masterDetail.defaults={}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_tabs",a));b.fn.rup_tabs("extend",{disableTabs:function(d){if(typeof d.position==="number"){b("#"+d.idTab).tabs("disable",d.position)}else{if(typeof d.position==="object"){for(var e in d.position){b("#"+d.idTab).tabs("disable",d.position[e])}}else{if(typeof d.position==="undefined"){b("#"+d.idTab).tabs("disable")}}}},enableTabs:function(d){if(typeof d.position==="number"){b("#"+d.idTab).tabs("enable",d.position)}else{if(typeof d.position==="object"){for(var e in d.position){b("#"+d.idTab).tabs("enable",d.position[e])}}else{if(typeof d.position==="undefined"){b("#"+d.idTab).tabs("enable")}}}},loadTab:function(d){b("#"+d.idTab).tabs("load",d.position)},changeUrlTab:function(d){b("#"+d.idTab).tabs("url",d.position,b.rup_utils.setNoPortalParam(d.url))},changeLayerTab:function(d){this._includeLayer(b("#"+d.idTab+" ul:first-child"),d.layer,b(b("#"+d.idTab+" ul li a").get(d.position)))},selectTab:function(d){b("#"+d.idTab).tabs("select",d.position)},addTab:function(f){var h,e,g="rup-tabs-",d=0;if(f.tabs!==undefined){if((f.idNewTab!==undefined)&&(b("#"+f.idNewTab).length===0)){h=b("<div>").attr("id",f.idNewTab);h.appendTo("body");e=this._includeLayer(b("#"+f.idTab+" > ul:first-child"),"#"+f.idNewTab,null);h.rup_tabs(f);b("#"+f.idTab).tabs("add","#"+f.idNewTab,f.label,f.position);b(e).remove()}else{b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.parameterError"));return false}}else{b("#"+f.idTab).tabs("add",b.rup_utils.setNoPortalParam(f.url),f.label,f.position);b.each(b("#"+f.idTab+" div[id*='"+g+"']"),function(k,j){if(d<parseFloat(j.id.split(g)[1])){d=j.id.split(g)[1]}});b("#"+f.idTab+" div[id='rup-tabs-"+d+"']").addClass("ui-tabs-hide")}loadSpan=b("#"+f.idTab+" ul li a span").not(".rup-tabs_loading");loadSpan.parent().append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(b.rup.i18n.app[b(this).attr("id")],f.label))).append(b("<span>").addClass("rup-tabs_loading"));loadSpan.remove()},removeTab:function(d){b("#"+d.idTab).tabs("remove",d.position)}});b.fn.rup_tabs("extend",{_init:function(f){if(f.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var h=b.extend({},b.fn.rup_tabs.defaults,f[0]),j;h.id=b(this).attr("id");h.iniLoad=false;if(undefined!==h.width){b("#"+h.id).css("width",h.width).addClass("rup-tabs_overflow")}if(undefined!==h.height){b("#"+h.id).css("height",h.height).addClass("rup-tabs_overflow")}var e=h.tabs,d=0;while(e!==undefined){d=d+1;e=e[0].tabs}h.profun=d;this._parseJSON(h.tabs,b.rup.i18n.app[h.id],b("#"+h.id),"",1,h);h.iniLoad=true;this._tabify(b("#"+h.id),h);if(h.disabled!==undefined){for(var g in h.disabled){b("#"+h.id).rup_tabs("disableTabs",{idTab:g,position:h.disabled[g]})}}}},_tabify:function(g,f){g.addClass("rup-tabs_container");g.data("settings",f);var d=function(h,j){if(b(j.panel).data("cargado")!==undefined&&b(j.panel).data("cargado")===false&&b(j.panel).length>0){b(j.panel).tabs("load",0);b(j.panel).data("cargado",true)}if(f.select!==undefined&&f.select!==null&&typeof f.select==="function"){f.select(h,j)}};var e=b.extend({},f.ajaxOptions);e.beforeSend=function(j,h){if(f.ajaxOptions.beforeSend!==undefined&&f.ajaxOptions.beforeSend!==null&&typeof f.ajaxOptions.beforeSend==="function"){f.ajaxOptions.beforeSend.call()}if(!f.iniLoad){g.data("cargado",false);return(false)}};e.complete=function(h,j){g.find("span.rup-tabs_loading_img").remove();if(f.ajaxOptions.complete!==undefined&&f.ajaxOptions.complete!==null&&typeof f.ajaxOptions.complete==="function"){f.ajaxOptions.complete(h,j)}};e.success=function(j,k,h){if(f.ajaxOptions.success!==undefined&&f.ajaxOptions.success!==null&&typeof f.ajaxOptions.success==="function"){f.ajaxOptions.success(j,k,h)}};e.error=function(l,k,j){var h;if(f.ajaxOptions.error!==undefined&&f.ajaxOptions.error!==null&&typeof f.ajaxOptions.error==="function"){h=function(){f.ajaxOptions.error(l,k,j)}}b.rup_messages("msgError",{title:b.rup.i18nParse(b.rup.i18n.base,"rup_global.developerError"),message:"<p>"+b.rup.i18nParse(b.rup.i18n.base,"rup_tabs.serverError")+"<b> "+k+":  "+l.status+" - "+l.statusText+".</b></p>",width:"40%",beforeClose:h})};b(g).tabs({ajaxOptions:e,cache:f.cache,cookie:null,fx:f.fx,idPrefix:"rup-tabs-",panelTemplate:f.panelTemplate,selected:0,spinner:"<span class='rup-tabs_loading_img' />",create:f.create,select:d,load:f.load,show:f.show,add:f.add,remove:f.remove,enable:f.enable,disable:f.disable})},_parseJSON:function(o,n,m,l,f,h){var k,g;m.append(b("<ul>"));m=b(m).children("ul");for(var j=o.length;j--;){g=l+j;k=o[j];if(j===0&&f===h.profun){h.iniLoad=true}else{h.iniLoad=false}if(k.layer!==undefined){k.layer=this._includeLayer(m,k.layer,null);m.prepend(b("<li>").append(b("<a>").attr("href",k.layer).attr("rupLevel",g).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(n,k.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading"))))}else{if(k.url!==undefined){m.prepend(b("<li>").append(b("<a>").attr("href",b.rup_utils.setNoPortalParam(k.url)).attr("rupLevel",g).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(n,k.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading"))))}else{if(k.tabs!==undefined){m.prepend(b("<li>").append(b("<a>").attr("id","#"+k.i18nCaption).attr("href","#"+k.i18nCaption).attr("rupLevel",g).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(n,k.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading"))));m=b(m).parent();var e=b("<div>"),d=b.rup_utils.randomIdGenerator(e);m.append(e);m=b(m).children("#"+d);m.prepend(b("<div>").attr("id",k.i18nCaption).attr("actualTab",true));m=b(m).children("div:first-child");m.append(this._parseJSON(k.tabs,n,m,g,f+1,h));this._tabify(m,h);m=b(m).parents("div[actualTab=true]").find("ul").first();if(m.length===0){m=b("#"+h.id).find("ul").first()}}}}}b(m).parents("div[actualTab=true]").first().removeAttr("actualTab");delete m},_includeLayer:function(d,f,h){var e,g;if(b(f).length>0){if(b(f).length===1){g=b(f).css("display","")}else{g=b("<div>").append(b(f).css("display",""))}if(h===null){e=b("<div>").append(g);d.parent().append(e);f="#"+b.rup_utils.randomIdGenerator(e)}else{f=h.attr("href");e=b(h.attr("href"));e.children().remove();e.append(g)}}else{f="#load-tab-error";if(h===null){d.parent().append(b("<div>").attr("id","load-tab-error").append(b("<div>").addClass("rup-loading_tab_error").append(b.rup.i18nParse(b.rup.i18n.base,"rup_global.selectorError"))))}else{f=h.attr("href");e=b(h.attr("href"));e.children().remove();e.append(b("<div>").attr("id","load-tab-error").append(b("<div>").addClass("rup-loading_tab_error").append(b.rup.i18nParse(b.rup.i18n.base,"rup_global.selectorError"))))}}return f}});b.fn.rup_tabs.defaults={ajaxOptions:{},cache:true,cookie:null,fx:null,panelTemplate:"<div></div>",profun:0,create:null,select:null,load:null,show:null,add:null,remove:null,enable:null,disable:null}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){var b={};a.extend(a.rup.iniRup,a.rup.rupSelectorObjectConstructor("rup_time",b));a.fn.rup_time("extend",{getRupValue:function(){var d,e;d=a(this).data("datepicker").settings.timeFormat;e=a.datepicker.parseTime(d,a(this).rup_time("getTime"));return e?a.timepicker._formatTime(e,"hh:mm:ss"):""},setRupValue:function(g){var d,e,f;d=a(this).data("datepicker").settings.timeFormat;e=a.datepicker.parseTime("hh:mm:ss",g);f=e?a.timepicker._formatTime(e,d):"";a(this).val(f)},destroy:function(){var d=a(this).data("datepicker").settings.labelMaskId;if(d){a("#"+d).text("")}delete d;a(this).next("img").remove();a(this).timepicker("destroy")},disable:function(){a(this).timepicker("disable")},enable:function(){a(this).timepicker("enable")},isDisabled:function(){return a(this).timepicker("isDisabled")},hide:function(){a(this).timepicker("hide")},show:function(){a(this).timepicker("show")},getTime:function(){return a(this).val()},setTime:function(d){a(this).timepicker("refresh");a.datepicker._setTime(a.datepicker._getInst(a("#"+a(this).data("datepicker").settings.id)[0]),d)},refresh:function(){a(this).timepicker("refresh")},option:function(d,e){a(this).timepicker("option",d,e)}});a.fn.rup_time("extend",{_init:function(d){if(d.length>1){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_global.initError")+a(this).attr("id"))}else{var f=a.extend({},a.fn.rup_time.defaults,d[0]);f.id=a(this).attr("id");(this).attr("ruptype","time");var g=a.rup.i18n.base.rup_time;for(var e in g){a.timepicker._defaults[e]=g[e]}if(f.labelMaskId){a("#"+f.labelMaskId).text(a.rup.i18nParse(a.rup.i18n.base,"rup_time.mask")+" ")}f.buttonImage=a.rup.STATICS+(f.buttonImage?f.buttonImage:"/rup/basic-theme/images/clock.png");a("#"+f.id).timepicker(f);if(!a("#"+f.id).is("div")){a("<img>").addClass("ui-timepicker-trigger").attr({src:f.buttonImage,alt:a.rup.i18nParse(a.rup.i18n.base,"rup_time.buttonText"),title:a.rup.i18nParse(a.rup.i18n.base,"rup_time.buttonText")}).click(function(){if(a("#ui-datepicker-div").css("display")==="none"){a("#"+f.id).timepicker("show")}else{a("#"+f.id).timepicker("hide")}}).insertAfter(a("#"+f.id))}if(a.rup_utils.aplicatioInPortal()&&!a("#"+f.id).is("div")){a(".r01gContainer").append(a(".ui-datepicker:not(.r01gContainer .ui-datepicker)"))}if(f.disabled){a("#"+f.id).rup_time("disable")}a(this).parent().find("[title]").rup_tooltip({applyToPortal:true})}}});a.fn.rup_time.defaults={stepHour:1,stepMinute:1,stepSecond:1,showButtonPanel:false,timeOnly:true};a.datepicker._timepicker_doKeyPress=a.datepicker._doKeyPress;a.datepicker._doKeyPress=function(e){var d=a.datepicker._get(a.datepicker._getInst(e.target),"timepicker");switch(e.keyCode){case 37:if(e.ctrlKey&&!(e.altKey||e.shiftKey)){d.hour_slider.slider("option","value",d.hour_slider.slider("option","value")-d._defaults.stepHour)}else{if(e.ctrlKey&&e.shiftKey&&!e.altKey){d.minute_slider.slider("option","value",d.minute_slider.slider("option","value")-d._defaults.stepMinute)}else{if(e.ctrlKey&&e.shiftKey&&e.altKey){d.second_slider.slider("option","value",d.second_slider.slider("option","value")-d._defaults.stepSecond)}}}break;case 39:if(e.ctrlKey&&!(e.altKey||e.shiftKey)){d.hour_slider.slider("option","value",d.hour_slider.slider("option","value")+d._defaults.stepHour)}else{if(e.ctrlKey&&e.shiftKey&&!e.altKey){d.minute_slider.slider("option","value",d.minute_slider.slider("option","value")+d._defaults.stepMinute)}else{if(e.ctrlKey&&e.shiftKey&&e.altKey){d.second_slider.slider("option","value",d.second_slider.slider("option","value")+d._defaults.stepSecond)}}}break}if(d){d._onTimeChange()}return a.datepicker._timepicker_doKeyPress(e)}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(a){a.rup_toolbar=a.rup_toolbar||{};a.extend(a.rup_toolbar,{extend:function(b){a.fn.extend(b)}});a.rup_toolbar.showingMB=null;a.rup_toolbar.extend({addButton:function(h,f){var e,d;if(h.id){e=h.id}else{e=h.i18nCaption}if(e.indexOf(a(this).attr("id"))!==0){e=a(this).attr("id")+"##"+e}var b=a("<button/>").text(a.rup.i18nParse(f,h.i18nCaption)).addClass("rup-toolbar_button").attr("id",e);b.button().button("option","icons",{primary:h.css,secondary:null});if(h.right!==undefined&&h.right===true){var g=this.children("div");if(g.length===0){g=a("<div />").attr("id",this.attr("id")+"-rightButtons").css("float","right");this.append(g)}b.prependTo(g)}else{a(this).append(b)}this._setKeyDown(b);if(h.click){b.click({i18nCaption:h.i18nCaption},h.click)}b.bind("focusout",function(){a(this).removeClass("ui-state-focus")});return b},addMButton:function(g,e){var b="",d;if(g.id===undefined){alert("El atributo ID es obligatorio en los MButtons.");b=null}else{d=g.id;if(d.indexOf(a(this).attr("id"))!==0){d=a(this).attr("id")+"##"+g.id}b=a("<a/>").attr("id",d).text(a.rup.i18nParse(e,g.i18nCaption)).addClass("rup-toolbar_menuButton");if(g.css===undefined){g.css="rup-toolbar_menuButtonIcon"}b.button().button("option","icons",{primary:null,secondary:g.css})}if(g.right!==undefined&&g.right===true){var f=this.children("div");if(f.length===0){f=a("<div />").attr("id",this.attr("id")+"-rightButtons").css("float","right");this.append(f)}b.prependTo(f)}else{a(this).append(b)}this._setKeyDown(b);if(g.click){b.click({i18nCaption:g.i18nCaption},g.click)}return b},addButtonsToMButton:function(j,k,l){var b,h,d=j.length,e,g;if(a("[id='mbutton_"+k.attr("id")+"']").length===0){b=a("<div>").addClass("ui-widget ui-widget-content rup-toolbar_menuButtonContainer").attr("id","mbutton_"+k[0].id).css("display","none");h=a("<ul>").attr("role","menu").attr("aria-activedescendant","active-menuitem").attr("aria-labelledby","active-menuitem")}else{b=a("[id='mbutton_"+k.attr("id")+"']");h=b.children("ul")}k.attr("href","#");for(var f=d;f--;){e=j[f];if(e.id){g=k.attr("id")+"##"+e.id}else{g=k.attr("id")+"##"+e.i18nCaption}j[f].id=g;h.prepend(a("<li>").css("display","block").append(this.addButton(j[f],l).addClass("rup-toolbar_menuButtonElement")))}if(!a.rup_utils.aplicatioInPortal()){b.appendTo("body");b.append(h)}else{b.append(h);a(".r01gContainer").append(b)}delete h;delete b},showMButton:function(){var d=a(this),e=d.offset().top+d.getTotalHeight(),b=a.rup_toolbar.showingMB,f=this.id;if(b===f){a("[id='mbutton_"+f+"']").slideUp("fast");d.removeClass("rup-toolbar_menuButtonSlided");b=null}else{a("[id='mbutton_"+b+"']").slideUp("fast");a("[id='mbutton_"+f+"']").css("position","absolute").css("top",e).css("left",d.offset().left).slideDown("fast");a("[id='"+b+"']").removeClass("rup-toolbar_menuButtonSlided");d.addClass("rup-toolbar_menuButtonSlided");b=f}a.rup_toolbar.showingMB=b;delete f;delete b;delete e;delete d;return false},disableButton:function(b){if(b.indexOf(this.attr("id"))===-1){b=this.attr("id")+"##"+b}a("[id='"+b+"']").button("disable")},enableButton:function(b){if(b.indexOf(this.attr("id"))===-1){b=this.attr("id")+"##"+b}a("[id='"+b+"']").button("enable")},pressButton:function(d,b){if(d.indexOf(this.attr("id"))===-1){d=this.attr("id")+"##"+d}a("[id='"+d+"']").addClass(b)},unpressButton:function(d,b){if(d.indexOf(this.attr("id"))===-1){d=this.attr("id")+"##"+d}a("[id='"+d+"']").removeClass(b)},tooglePressButton:function(d,b){if(d.indexOf(this.attr("id"))===-1){d=this.attr("id")+"##"+d}a("[id='"+d+"']").toggleClass(b)},refreshButton:function(b){if(b.indexOf(this.attr("id"))===-1){b=this.attr("id")+"##"+b}a("[id='"+b+"']").button("refresh")},_setKeyDown:function(b){b.bind("keydown",function(f){var d=a(f.currentTarget),e=d.parent(),g;switch(f.keyCode){case a.ui.keyCode.TAB:if(!f.shiftKey){if(d.next().attr("id")!==e.attr("id")+"-rightButtons"){g=d.next(":focusable")}else{g=d.next().children(":focusable:first")}if(g.size()===1){g.focus();a.rup_toolbar.focusedExternally[e.attr("id")]=true;return false}}}})}});a.rup_toolbar.hideMButtons=function(){var b=a.rup_toolbar.showingMB;a("[id='mbutton_"+b+"']").slideUp("fast");a("[id='"+b+"']").removeClass("rup-toolbar_menuButtonSlided");b=null;a.rup_toolbar.showingMB=b;delete b};a.fn.getTotalHeight=function(){return a(this).height()+parseInt(a(this).css("paddingTop"))+parseInt(a(this).css("paddingBottom"))+parseInt(a(this).css("borderTopWidth"))+parseInt(a(this).css("borderBottomWidth"))};a.fn.rup_toolbar=function(b){return this.each(function(){var h=a.extend({},a.fn.rup_toolbar.defaults,b),g=a(this),j,d=[];if(a.rup_toolbar.focusedExternally===undefined){a.rup_toolbar.focusedExternally={}}a.rup_toolbar.focusedExternally[this.id]=false;h.id=this.id;j=a.rup.i18n.app[h.id];g.addClass("rup-toolbar ui-widget-header ui-widget ui-widget-content");if(h.width!=null){g.width(h.width)}a(document).click(a.rup_toolbar.hideMButtons);for(var f=0;f<h.buttons.length;f+=1){var k=h.buttons[f];if(!(k.right!==undefined&&k.right===true)){if(k.buttons){mbutton=g.addMButton({id:k.id,i18nCaption:k.i18nCaption,css:k.css,click:g.showMButton},j);if(mbutton!==null){g.addButtonsToMButton(k.buttons,mbutton,j)}}else{g.addButton(k,j)}}else{d.push(k)}}for(var f=0;f<d.length;f+=1){var e=d[f];if(e.buttons){mbutton=g.addMButton({id:e.id,i18nCaption:e.i18nCaption,css:e.css,click:g.showMButton,right:e.right},j);if(mbutton!==null){g.addButtonsToMButton(e.buttons,mbutton,j)}}else{g.addButton(e,j)}}})};a.fn.rup_toolbar.defaults={width:null,buttons:[],mbuttons:null}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_tooltip",a));b.fn.rup_tooltip("extend",{open:function(){b(this).qtip("show",true)},close:function(){b(this).qtip("hide",true)},enable:function(){b(this).qtip("enable",true)},disable:function(){b(this).rup_tooltip("close");b(this).qtip("disable",true)},destroy:function(){b(this).rup_tooltip("disable");b(this).qtip("destroy")},option:function(d,e){return b(this).qtip("option",d,e)}});b.fn.rup_tooltip("extend",{_init:function(f){if(f.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{if(b(this).size()>0){var h=b.extend({},b.fn.rup_tooltip.defaults,f[0]),g=this[0].className.indexOf("rup-grid")!==-1,e;if(h.id===undefined){h.id=b(this).attr("id")}if(g){var d=b(this).each(function(k,l){b.attr(this,"rup_tooltip",b.attr(this,"title"));if(l.localName==="img"){b(l).parents("td").attr("rup_tooltip",b(l).attr("rup_tooltip"))}}).removeAttr("title");h={content:" ",position:{target:"event",effect:false},show:{delay:h.show.delay},hide:{delay:0},events:{show:function(l,k){var m=b(l.originalEvent.target);if(m.length){while(m.attr("rup_tooltip")===undefined&&m[0].nodeName!=="TD"){m=b(m).parent()}k.set("content.text",(m.attr("rup_tooltip")==="")?" ":m.attr("rup_tooltip"));if(m.attr("rup_tooltip")===""||m.attr("rup_tooltip")===" "){m.qtip("destroy")}if(m[0].nodeName!=="TD"){m=b(m).parents("td")}if(m.nextAll("td:visible").length==0){k.set("position.my.x","right")}else{k.set("position.my.x","left")}k.set("position.target",m)}},render:function(l,k){if(b.rup_utils.aplicatioInPortal()){b("div.r01gContainer").append(b(this));if(!(b("#qtip-overlay").size()===0)){b("div.r01gContainer").append(b("#qtip-overlay"))}}}}};b(this).qtip(h)}else{var j;if((b.rup_utils.aplicatioInPortal())&&(!h.applyToPortal)){j=b("div.r01gContainer "+b(this).selector)}else{j=this}if(h.open!==undefined){h.events.show=h.open}if(h.close!==undefined){h.events.hide=h.close}h.events.render=function(l,k){if(b.rup_utils.aplicatioInPortal()){b("div.r01gContainer").append(b(this));if(!(b("#qtip-overlay").size()===0)){b("div.r01gContainer").append(b("#qtip-overlay"))}k.set("position.my.x",k.get("position.my.x"))}};b(j).qtip(h);if(h.disabled){b(j).qtip("disable")}}}}}});b.fn.rup_tooltip.defaults={disabled:false,applyToPortal:false,show:{delay:0},position:{my:"top left",at:"bottom right",target:"event",effect:false},events:{}}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(d){d.widget("blueimpUIX.fileupload",d.blueimpUI.fileupload,{options:{errorMessages:{maxFileSize:d.rup.i18nParse(d.rup.i18n.base,"rup_upload.maxFileSizeError"),minFileSize:d.rup.i18nParse(d.rup.i18n.base,"rup_upload.minFileSizeError"),acceptFileTypes:d.rup.i18nParse(d.rup.i18n.base,"rup_upload.acceptFileTypesError"),maxNumberOfFiles:d.rup.i18nParse(d.rup.i18n.base,"rup_upload.maxNumberOfFilesError")}},_renderUpload:function(k){var j=this,g=this.options,f=this._renderUploadTemplate(k),e=this._validate(k);if(!(f instanceof d)){return d()}var h=d.data(this.element[0],"settings");f.css("display","none");f.find(".progress div").slice(e?1:0).remove().end().first().progressbar();f.find(".start button").slice(this.options.autoUpload||!e?0:1).remove().end().first().button({text:true,icons:{primary:"ui-icon-circle-arrow-e"}});var l=f.find(".cancel button").slice(1).remove().end().first().button({text:true,icons:{primary:"ui-icon-cancel"}});if(h.submitInForm){l.bind("click",function(n){var m;n.preventDefault();j.options.fileInput.attr("value","");m=j.options.fileInput.clone(true).attr("value","").insertAfter(j.options.fileInput);j.options.fileInput.remove();j.options.fileInput=m})}f.find(".preview").each(function(m,n){j._loadImage(k[m],function(o){d(o).hide().appendTo(n).fadeIn()},{maxWidth:g.previewMaxWidth,maxHeight:g.previewMaxHeight,fileTypes:g.previewFileTypes,canvas:g.previewAsCanvas})});return f},_renderDownload:function(f){var e=this._renderDownloadTemplate(f);if(!(e instanceof d)){return d()}e.css("display","none");e.find(".delete button").button({text:true,icons:{primary:"ui-icon-trash"}});e.find("a").each(this._enableDragToDesktop);return e},_renderUploadTemplate:function(g){var f=this,h=d();var e=d.data(this.element[0],"settings");d.each(g,function(j,k){k=f._uploadTemplateHelper(k);var l=d('<tr class="template-upload"><td><div class="formulario_columna_cnt"><span class="izq_float file_icon">&nbsp;</span><div class="izq_float name"><b></b></div><div class="formulario_columna_cnt"><div class="izq_float type"></div><div class="izq_float size"></div>'+(e.submitInForm?'<div class="izq_float cancel" style><button>'+d.rup.i18nParse(d.rup.i18n.base,"rup_upload.cancelUpload")+"</button></div>":"")+"</div>"+(!e.submitInForm?'<div class="formulario_columna_cnt">'+(k.error?'<div class="izq_float error" ></div>':'<div class="izq_float progress"><div></div></div><div class="izq_float start fileupload-buttonbar ui-button"><button>'+d.rup.i18nParse(d.rup.i18n.base,"rup_upload.startUpload")+"</button></div>")+'<div class="izq_float cancel"><button>'+d.rup.i18nParse(d.rup.i18n.base,"rup_upload.cancelUpload")+"</button></div></div>":'<div class="izq_float start fileupload-buttonbar ui-button" style="display:none"><button>'+d.rup.i18nParse(d.rup.i18n.base,"rup_upload.startUpload")+"</button></div>")+"</td></tr>");l.find(".name b").text(k.name);l.find(".size").text(k.sizef);l.find(".type").text(k.type);if(k.error){l.addClass("ui-state-error");l.find(".error").text(f.options.errorMessages[k.error]||k.error)}h=h.add(l)});return h},_renderDownloadTemplate:function(f){var e=this,g=d();d.each(f,function(h,j){j=e._downloadTemplateHelper(j);var k=d('<tr class="template-download"><td>'+(j.error?'<td class="file_icon"></td><td class="name"></td><td class="size"></td><td class="error" colspan="2"></td>':'<div class="formulario_columna_cnt"><span class="izq_float file_icon">&nbsp;</span><div class="izq_float name"><a></a></div></div><div class="formulario_columna_cnt"><div class="izq_float type"></div><div class="izq_float size"></div></div><div class="formulario_columna_cnt"><a><div class="izq_float"><div class="file_download" ><span class="file_download_icon">&nbsp;</span><span class="file_download_text">'+d.rup.i18nParse(d.rup.i18n.base,"rup_upload.openUploaded")+'</span></div></div></a><div class="izq_float delete"><button>'+d.rup.i18nParse(d.rup.i18n.base,"rup_upload.deleteUploaded")+"</button></div></div>")+"</td></tr>");k.find(".size").text(j.sizef);k.find(".type").text(j.type);if(j.error){k.find(".name").text(j.name);k.addClass("ui-state-error");k.find(".error").text(e.options.errorMessages[j.error]||j.error)}else{k.find(".name a").text(j.name);if(j.thumbnail_url){k.find(".preview").append("<a><img></a>").find("img").prop("src",j.thumbnail_url);k.find("a").prop("target","_blank")}k.find("a").prop("href",d.rup_utils.setNoPortalParam(j.url));k.find(".delete button").attr("data-type",j.delete_type).attr("data-url",d.rup_utils.setNoPortalParam(j.delete_url))}g=g.add(k)});return g},_initFileUploadButtonBar:function(){var f=this.element.find(".fileupload-buttonbar"),g=this.element.find(".files"),e=this.options.namespace;f.find(".start").button({icons:{primary:"ui-icon-circle-arrow-e"}}).bind("click."+e,function(h){h.preventDefault();g.find(".start button").click()});f.find(".cancel").button({icons:{primary:"ui-icon-cancel"}}).bind("click."+e,function(h){h.preventDefault();g.find(".cancel button").click()});f.find(".delete").button({icons:{primary:"ui-icon-trash"}}).bind("click."+e,function(h){h.preventDefault();g.find(".delete button").click()});f.find(".toggle").bind("change."+e,function(h){g.find(".delete input").prop("checked",d(this).is(":checked"))})}});var a={};d.extend(d.rup.iniRup,d.rup.rupSelectorObjectConstructor("rup_upload",a));d.fn.rup_upload("extend",{option:function(e){d(this).fileupload("option",e)},destroy:function(){d(this).fileupload("destroy")},enable:function(){d(this).fileupload("enable")},disable:function(){d(this).fileupload("disable")},add:function(e){d(this).fileupload("add",e)},send:function(e){d(this).fileupload("send",e)}});function b(){var k=d(this),g=d("#fileupload-progressbar").fadeIn(),e=500,o=0,h=0,n=0,l,p=function(u,t){h=t.loaded;o=t.total},s=function(){k.unbind("fileuploadprogressall",p).unbind("fileuploadstop",s);window.clearInterval(l);g.fadeOut(function(){g.html("")})},r=function(u){var t=new Date(u*1000);return("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)},m=function(t){if(t>=1000000000){return(t/1000000000).toFixed(2)+" GB"}if(t>=1000000){return(t/1000000).toFixed(2)+" MB"}if(t>=1000){return(t/1000).toFixed(2)+" KB"}return t+" B"},j=function(t){return(t*100).toFixed(2)+" %"},q=function(u,v,t){g.html(m(t)+"ps | "+r((v-u)/t)+" | "+j(u/v)+" | "+m(u)+" / "+m(v))},f=function(){var t=h-n;if(!t){return}n=h;q(h,o,t*(1000/e))};k.bind("fileuploadprogressall",p).bind("fileuploadstop",s);l=window.setInterval(f,e)}d.fn.rup_upload("extend",{_init:function(f){var g=d.extend({},d.fn.rup_upload.defaults,f[0]),e=this;d.data(this[0],"settings",g);d(this).fileupload(g);if(g.submitInForm){d(this).rup_upload("option",{singleFileUploads:false,maxNumberOfFiles:1,replaceFileInput:false})}d(this).bind("fileuploadadd",function(j,h){if(g.submitInForm){d(this).find(".template-upload").hide();d(this).find(".template-upload .cancel button").unbind("click");d(this).find(".template-upload .cancel button").click()}});d(this).bind("fileuploadsend",function(j,h){h.url=d.rup_utils.setNoPortalParam(h.url);if(d.rup.browser.isIE||g.forceIframeTransport===true){h.url=h.url+(h.url.match("\\?")===null?"?":"&")+"_emulate_iframe_http_status=true"}})},_private:function(e){}});d.fn.rup_upload.defaults={label:null,fileInput:null,submitInForm:false,submitFormButton:undefined}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(g){var d={};g.rup_validate={};g.extend(g.rup.iniRup,g.rup.rupSelectorObjectConstructor("rup_validate",d));var f={};var a=new RegExp("\\{\\d\\}");g.each(g.rup.i18n.base.rup_validate.messages,function(k,l){if(l.match(a)!==null){f[k]=jQuery.validator.format(l)}else{f[k]=l}});var e=new RegExp(g.rup.i18n.base.rup_validate.regexp.decimal);g.extend(g.validator.messages,f);jQuery.validator.addMethod("dni",function(l,k){return this.optional(k)||euroNif(l)});function h(l){if(l.length===9){var m=l.substr(0,8);var n=typeof m;var o=typeof l.substr(l.length-1,l.length);m=m%23;var k="TRWAGMYFPDXBNJZSQVHLCKET";k=k.substring(m,m+1);if(k!=(l.substr(l.length-1,l.length)).toUpperCase()){return false}else{return true}}else{return false}}function j(k){return k.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,"")}jQuery.validator.addMethod("dni",function(l,k){return this.optional(k)||h(l)});jQuery.validator.addMethod("maxWords",function(l,k,m){return this.optional(k)||j(l).match(/\b\w+\b/g).length<m});jQuery.validator.addMethod("minWords",function(l,k,m){return this.optional(k)||j(l).match(/\b\w+\b/g).length>=m});jQuery.validator.addMethod("rangeWords",function(l,k,m){return this.optional(k)||j(l).match(/\b\w+\b/g).length>=m[0]&&l.match(/bw+b/g).length<m[1]});jQuery.validator.addMethod("letterswithbasicpunc",function(l,k){return this.optional(k)||/^[a-z-.,()'\"\s]+$/i.test(l)});jQuery.validator.addMethod("alphanumeric",function(l,k){return this.optional(k)||/^\w+$/i.test(l)});jQuery.validator.addMethod("lettersonly",function(l,k){return this.optional(k)||/^[a-z]+$/i.test(l)});jQuery.validator.addMethod("nowhitespace",function(l,k){return this.optional(k)||/^\S+$/i.test(l)});jQuery.validator.addMethod("integer",function(l,k){return this.optional(k)||/^-?\d+$/.test(l)});jQuery.validator.addMethod("pattern",function(l,k,m){return this.optional(k)||m.test(l)});jQuery.validator.addMethod("number",function(l,k){var m=new RegExp(g.rup.i18n.base.rup_validate.regexp.decimal);return this.optional(k)||m.test(l)});jQuery.validator.addMethod("date",function(l,k,n){var m;if(typeof n==="boolean"){if(n===true){m=g.rup.i18n.base.rup_validate.format.date}else{return true}}else{m=n}return this.optional(k)||g.rup_validate.checkDate(m,l)});g.extend(g.rup_validate,{checkDate:function(v,m){var t=function(y){return(((y%4===0)&&(y%100!==0||(y%400===0)))?29:28)},s=function(z){for(var y=1;y<=z;y++){this[y]=31;if(y==4||y==6||y==9||y==11){this[y]=30}if(y==2){this[y]=29}}return this};var o={},x;v=v.toLowerCase();if(v.indexOf("/")!=-1){x="/"}else{if(v.indexOf("-")!=-1){x="-"}else{if(v.indexOf(".")!=-1){x="."}else{x="/"}}}v=v.split(x);m=m.split(x);if(m.length!=3){return false}var q=-1,w,p=-1,n=-1;for(var r=0;r<v.length;r++){var l=isNaN(m[r])?0:parseInt(m[r],10);o[v[r]]=l;w=v[r];if(w.indexOf("y")!=-1){q=r}if(w.indexOf("m")!=-1){n=r}if(w.indexOf("d")!=-1){p=r}}if(v[q]=="y"||v[q]=="yyyy"){w=4}else{if(v[q]=="yy"){w=2}else{w=-1}}var k=s(12),u;if(q===-1){return false}else{u=o[v[q]].toString();if(w==2&&u.length==1){w=1}if(u.length!=w||(o[v[q]]===0&&m[q]!="00")){return false}}if(n===-1){return false}else{u=o[v[n]].toString();if(u.length<1||o[v[n]]<1||o[v[n]]>12){return false}}if(p===-1){return false}else{u=o[v[p]].toString();if(u.length<1||o[v[p]]<1||o[v[p]]>31||(o[v[n]]==2&&o[v[p]]>t(o[v[q]]))||o[v[p]]>k[o[v[n]]]){return false}}return true}});g.fn.rup_validate("extend",{destroy:function(){var k=this;k.rup_validate("resetForm");g.removeData(k[0]);k.unbind()},resetForm:function(){var k=this,l=k.data("settings");if(l!=null&&l.feedback!==undefined&&l.showErrorsInFeedback){l.feedback.rup_feedback("hide")}k.validate().resetForm()}});g.fn.rup_validate("extend",{});var b={defaultPresetSettings:{showErrors:function(v){var w=this,r,p,l,u,m,x,q,s,t;if(w.currentElements.length===1){if(g.isEmptyObject(v)){delete w.invalid[w.currentElements.attr("name")]}}l=w.settings.feedback;if(w.settings.showErrorsInFeedback&&l!==undefined&&l!==null){p=g("<ul>").addClass("rup-maint_feedbackUL").prepend(w.settings.feedbackErrorConfig.errorMsg);if(jQuery.isEmptyObject(w.invalid)){l.rup_feedback("close")}else{if(w.settings.showFieldErrorsInFeedback){g.each((!jQuery.isEmptyObject(w.submitted)?w.submitted:w.invalid),function(y,z){if(w.invalid[y]!==undefined){u=w.settings.feedbackErrorConfig.getField(w,w.currentForm,y);m=w.settings.feedbackErrorConfig.getFieldName(w,w.currentForm,u);x=w.settings.feedbackErrorConfig.getFieldErrorLabel(w,w.currentForm,u,m);q=w.settings.feedbackErrorConfig.getFieldErrorMsg(w,w.currentForm,u,z);x.append(q);p.append(x)}})}l.rup_feedback("option",w.settings.feedbackOptions);l.rup_feedback("set",p,"error")}}if(w.settings.showFieldErrorAsDefault){for(var o=0;w.errorList[o];o++){s=w.errorList[o];if(s.element!==undefined){t=w.errorsFor(s.element);if(t.length){t.remove()}}}}for(var o=0;o<w.errorList.length;o++){if(w.errorList[o].element===undefined){alert("El campo validado no existe en el formulario")}if(g.isArray(w.errorList[o].message)){var k="";for(var n=0;n<w.errorList[o].message.length;n++){k+=w.errorList[o].message[n];if(n!==w.errorList[o].message.length-1){k+=", "}}w.errorList[o].message=k}}g("."+w.settings.errorClass+":not(.rup-maint_validateIcon)",w.currentForm).removeClass(w.settings.errorClass);w.defaultShowErrors()},showErrorsInFeedback:function(k){},errorPlacement:function(l,m){if(m.attr("ruptype")==="combo"){var k=g("#"+m.attr("id")+"-button");if(k){l.insertAfter(k)}}else{l.insertAfter(m)}}},showFieldErrorAsDefault:{errorElement:"img",errorPlacement:function(l,m){var n=l.attr("src",this.errorImage).addClass("rup-maint_validateIcon").html("").rup_tooltip({applyToPortal:true});if(m.attr("ruptype")==="combo"){var k=g("#"+m.attr("id")+"-button");if(k){n.insertAfter(k)}}else{n.insertAfter(m)}}}};g.fn.rup_validate("extend",{_init:function(l){var k=this,m=g.extend(true,{},g.fn.rup_validate.defaults,b.defaultPresetSettings,l[0]);k.addClass("rup_validate");k.attr("ruptype","validate");if(m.showFieldErrorAsDefault){m=g.extend(true,m,b.showFieldErrorAsDefault)}m=g.extend(true,{},m,l[0]);k.validate(m);if(m.showFieldErrorAsDefault){k.validate().showLabel=function(o,p){var n=this.errorsFor(o);if(n.length){n.removeClass(this.settings.validClass).addClass(this.settings.errorClass);n.attr("generated")&&n.html(p)}else{if(m.showFieldErrorAsDefault){n=g("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(o),generated:true}).addClass(this.settings.errorClass).attr("title",p||"")}else{n=g("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(o),generated:true}).addClass(this.settings.errorClass).html(p||"")}if(this.settings.wrapper){n=n.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(n).length){this.settings.errorPlacement?this.settings.errorPlacement(n,g(o)):n.insertAfter(o)}}if(!p&&this.settings.success){n.text("");typeof this.settings.success=="string"?n.addClass(this.settings.success):this.settings.success(n)}this.toShow=this.toShow.add(n)}}if(!m.liveCheckingErrors){k.unbind("click").unbind("focusin").unbind("focusout").unbind("keyup")}k.on("invalid-form.rupValidate_formValidationError",function(n){k.off("invalid-form.rupValidate_formValidationError");k.triggerHandler("rupValidate_formValidationError",[this])});k.data("settings",m)}});g.fn.rup_validate.defaults={ignore:":hidden[ruptype!='autocomplete'][ruptype!='combo']",feedbackOptions:{gotoTop:false,fadeSpeed:null,delay:null},feedbackErrorConfig:{errorMsg:g.rup.i18nParse(g.rup.i18n.base,"rup_maint.validateError"),getField:function(k,l,m){return g("[name='"+m+"']",l)},getFieldName:function(k,o,p){var n=p.attr("ruptype"),m,l;if(n!==undefined&&n==="combo"){m=p.attr("id")+"-button"}else{m=p.attr("id")}l=p.parent().find("label[for='"+m+"']:not(."+k.settings.errorClass+")");if(l.length>0){return l.text()}return p.attr("title")},getFieldErrorLabel:function(k,l,n,m){errorLable=m.trim();if(m.indexOf(" * ")==0){m=m.substr(3,m.length)}if(m[m.length-1]==":"){m=m.substr(0,m.length-1)}return g("<li>").append("<b>"+m+":</b>")},getFieldErrorMsg:function(k,n,p,m){if(g.isArray(m)){var o=g("<ul>");for(var l=0;l<m.length;l++){o.append(g("<li>").append(m[l]))}return o}else{return g("<ul>").append(g("<li>").append(m))}}},liveCheckingErrors:false,showErrorsInFeedback:true,showFieldErrorAsDefault:true,showFieldErrorsInFeedback:true,errorImage:g.rup.STATICS+"/rup/basic-theme/images/exclamation.png"}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_wizard",a));b.fn.rup_wizard("extend",{step:function(e){if(b("#stepDesc"+e).hasClass("disabled")){return false}var d=b("#steps li.current").attr("id");b("#steps li").removeClass("current");b("#stepDesc"+e).addClass("current");b("#steps li").removeClass("visited");if(e!=0){b("#stepDesc"+(e-1)).addClass("visited")}b("#step"+d.substring(8)).hide();b("#step"+e).show();if(!this.rup_wizard("isCurrentStepLast")){b(".rup-wizard_submitButton").hide()}else{b(".rup-wizard_submitButton").show();if(!this.rup_wizard("isCurrentStepSummary")){b("#step"+e).find("p[id$='commands']").append(b(".rup-wizard_submitButton"))}}},first:function(){this.rup_wizard("step",0)},last:function(){this.rup_wizard("step",b("#steps").children().size()-1)},getCurrentStep:function(){return parseInt(b("#steps li.current").attr("id").substring(8))},isCurrentStep:function(d){return(this.rup_wizard("getCurrentStep")===d)},isCurrentStepFirst:function(){return this.rup_wizard("isCurrentStep",0)},isCurrentStepLast:function(){return(b("#steps").children().size()-1===this.rup_wizard("getCurrentStep"))},isCurrentStepSummary:function(){return b("#stepDesc"+this.rup_wizard("getCurrentStep")).hasClass("rup-wizard_summary")},enableStep:function(d){b("#stepDesc"+d).removeClass("disabled")},disableStep:function(d){b("#stepDesc"+d).addClass("disabled")},isStepDisabled:function(d){return b("#stepDesc"+d).hasClass("disabled")}});b.fn.rup_wizard("extend",{_init:function(f){if(f.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var h=b.extend({},b.fn.rup_wizard.defaults,f[0]),e=this;this._formToWizard(h);b("#steps").addClass("rup-wizard_stepsDescContainer");b("#steps").children().each(function(k,l){b(l).addClass("rup-wizard_stepDesc").click(function(o){var n=b(this).attr("id").substring(8);if(!e.isStepDisabled(n)){if(h.stepFnc[n]!==undefined){if(h.stepFnc[n].call()===false){o.stopImmediatePropagation();return false}}b(this).rup_wizard("step",n)}});var m=b(l).children();b(m).text((k+1)+". "+b(m).text());b(l).text("").append(m)});b("p[id$='commands'] .prev").removeClass("prev").addClass("rup-wizard_prev").text(b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.prev")).unbind("click").click(function(k){e._gotoPrevStep(e,h,k)});b("p[id$='commands'] .next").removeClass("next").addClass("rup-wizard_next").text(b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.next")).unbind("click").click(function(k){e._gotoNextStep(e,h,k)});b("#"+h.submitButton).addClass("rup-wizard_submitButton");if(h.submitFnc){b("#"+h.submitButton).click(h.submitFnc)}b("#steps li:first").addClass("rup-wizard_firstStepDesc");b("#steps li:last").addClass("rup-wizard_lastStepDesc");if(h.summary){b("#steps li:last").removeClass("rup-wizard_lastStepDesc");var d=b("#steps").children().size(),g=b("<li>").attr("id","stepDesc"+d).addClass("rup-wizard_stepDesc rup-wizard_summary rup-wizard_lastStepDesc").append("<a href='#'>"+(d+1)+". "+b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.summary")+"</a>").click(function(){b(this).rup_wizard("step",b(this).attr("id").substring(8));e._generateSummary(d,e,h)});b("#steps").append(g);b("div[id='step"+(d-1)+"']").after("<div id='step"+d+"' style='display: none;'/>");var j=b("<a>").attr("id","step"+(d-1)+"Next").html(b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.next")).addClass("rup-wizard_next").unbind("click").click(function(k){e._gotoNextStep(e,h,k);e._generateSummary(d,e,h)});b("#step"+(d-1)+"commands").append(j)}if(h.disabled!==undefined){b.each(h.disabled,function(l,n){if(typeof n==="number"){b(this).rup_wizard("disableStep",n)}else{if(typeof n==="string"){var o=parseInt(n.substring(0,n.indexOf("-"))),k=parseInt(n.substring(n.indexOf("-")+1,n.length));for(var m=o;m<=k;m++){b(this).rup_wizard("disableStep",m)}}}})}}this.rup_wizard("step",0)},_gotoNextStep:function(e,f,g){var d=parseInt(b("#steps li.current").attr("id").substring(8))+1;if(e.isStepDisabled(d)){d=b("#stepDesc"+(d-1)).nextAll("li:not(.disabled)").first().attr("id");if(d!==undefined){d=parseInt(d.substring(8))}else{return false}}if(f.stepFnc[d]!==undefined){if(b("#stepDesc"+d).not(".rup-wizard_summary").length>0){if(f.stepFnc[d].call()===false){g.stopImmediatePropagation();return false}}}b("#stepDesc"+d).rup_wizard("step",d)},_gotoPrevStep:function(e,f,g){var d=parseInt(b("#steps li.current").attr("id").substring(8))-1;if(e.isStepDisabled(d)){d=b("#stepDesc"+(d+1)).prevAll("li:not(.disabled)").first().attr("id");if(d!==undefined){d=parseInt(d.substring(8))}else{return false}}if(f.stepFnc[d]!==undefined){if(f.stepFnc[d].call()===false){g.stopImmediatePropagation();return false}}b("#stepDesc"+d).rup_wizard("step",d)},_generateSummary:function(e,f,j){if(b("#stepDesc"+e).hasClass("disabled")){return false}b("#step"+e).parent().append(b(".rup-wizard_submitButton"));if(j.summaryFnc_PRE&&j.summaryFnc_PRE.call()===false){return false}b("#step"+e).remove();b("div[id='step"+(e-1)+"']").after("<div id='step"+e+"' style='display: none;'/>");for(var h=0;h<e;h++){if(!f.isStepDisabled(h)){b("#step"+e).append(b("#step"+h).children().clone())}}b("#step"+e+" p[id$='commands']").remove();b("div[id='step"+(e)+"'] fieldset:last").append("<p id='step"+e+"commands'></p>");var g=b("<a>").attr("id","step"+e+"Prev").html(b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.prev")).addClass("rup-wizard_prev").unbind("click").click(function(k){f._gotoPrevStep(f,j,k)});b("#step"+e+"commands").append(g);if(j.summaryFnc_INTER&&j.summaryFnc_INTER.call()===false){return false}b("#step"+e+" .ui-multiselect").each(function(){var n=b("#"+b(this).prev().attr("id"));if(n.data("settings")!==undefined){var m=n.rup_combo("label");if(m.length>0){if(n.data("settings")["summaryInline"]==undefined){var l=b("<div />").addClass("rup-wizard_summaryMultivalue").insertAfter(this);for(var k=0;k<m.length;k++){b(j.labelElement,{text:"- "+m[k],"class":"rup-wizard_summaryValue"}).appendTo(l);b("<br/>").appendTo(l)}}else{b(j.labelElement,{text:m.toString().replace(/,/g,", "),"class":"rup-wizard_summaryValue"}).insertAfter(this)}}else{b(j.labelElement,{html:"&nbsp;","class":"rup-wizard_summaryValue"}).insertAfter(this)}b(this).prev().remove();b(this).remove()}});b("#step"+e+" input").each(function(){if(this.type==="text"){b(j.labelElement,{text:this.value,"class":"rup-wizard_summaryValue"}).insertAfter(this)}else{if(this.type==="password"){b(j.labelElement,{text:f._hidePassword(this.value),"class":"rup-wizard_summaryValue"}).insertAfter(this)}else{if(this.type==="radio"){if(this.checked){b(j.labelElement,{text:b("#step"+e+" label[for='"+this.id+"']").text(),"class":"rup-wizard_summaryValue"}).insertAfter(this);b("#"+this.id).attr("checked","checked")}b("#step"+e+" label[for='"+this.id+"']").remove()}else{if(this.type==="checkbox"){if(this.checked){b(j.labelElement,{text:"[X] "+b("#step"+e+" label[for='"+this.id+"']").text(),"class":"rup-wizard_summaryValue"}).insertAfter(this)}else{b(j.labelElement,{text:"[ ] "+b("#step"+e+" label[for='"+this.id+"']").text(),"class":"rup-wizard_summaryValue"}).insertAfter(this)}b("#step"+e+" label[for='"+this.id+"']").remove()}}}}b(this).remove()});b("#step"+e+" textarea").each(function(){b(j.textareaElement,{text:b("#"+b(this).attr("id")).val(),"class":"rup-wizard_summaryParagraph"}).insertAfter(this);b(this).remove()});b("#step"+e+" select").each(function(){b(j.labelElement,{text:(b("#"+this.id+" option:selected").text()!=="&nbsp;")?b("#"+this.id+" option:selected").text():"","class":"rup-wizard_summaryValue"}).insertAfter(this);b(this).remove()});b("#step"+e+" label").each(function(){b(j.labelSeparatorElement,{html:j.labelSeparatorText,"class":"rup-wizard_separator"}).insertAfter(this);b(j.labelElement,{text:this.innerHTML,"class":"rup-wizard_summaryLabel"}).insertAfter(this);b(this).remove()});b("#step"+e+" .ui-accordion").each(function(){b(this).attr("id",b(this).attr("id")+"_summary");b(this).removeAttr("class");b(this).children("h1").removeAttr("class");b(this).children("div").removeAttr("class");if(b.isEmptyObject(j.rupAccordion)){b(this).rup_accordion(j.accordion)}else{b(this).rup_accordion(j.rupAccordion)}});b("#step"+e+" .rup_combo").each(function(){b(this).remove()});b("#step"+e+" img.ui-datepicker-trigger").each(function(){b(this).remove()});b("#step"+e+" img.ui-timepicker-trigger").each(function(){b(this).remove()});var d=0;if(j.summaryTabs2Accordion){j.rupTabsElement="<a />"}b("#step"+e+" > fieldset").children(".rup-tabs_container").each(function(){var l=new Array(),m=new Array(),k=b(this).parent().attr("accordionable",true),p=new Array();f._getRupTabs(f,b(this),l,m);var o=null,q=b(k);for(var n=0;n<l.length;n++){o=b(j.rupTabsElement).text(l[n]);if(m[n].indexOf("rupRandomLayerId")!==-1){o=b(o).wrap("<div class='IE8_fix'>");o=b(o).parent().append(b(this).find(m[n]).html());b(o).children("div").addClass("rup-wizard_tabLevel-"+p.length);o=b(o).children().unwrap()}else{o=b(o).attr("tabContainer",true);o=b(o).wrap("<div class='IE8_fix'>");o=b(o).parent().append(b("<div>").attr("id","subtab_"+l[n]).attr("accordionable",true).addClass("rup-wizard_tabContainerLevel-"+p.length));o=b(o).children().unwrap();p.push(l[n]);d++;b(q).append(o);q=b("#subtab_"+l[n]);continue}if(b("#"+p[p.length-1]).find(m[n]).length===0){q=b(k);do{p.pop();if(b("#"+p[p.length-1]).find(m[n]).length>0){q=b("#subtab_"+p[p.length-1]);break}else{b(b(o).get(1)).removeAttr("class").addClass("rup-wizard_tabLevel-"+p.length)}}while(p.length>0)}b(q).append(o)}if(j.summaryTabs2Accordion){b(k).find("a").each(function(){if(!b(this).hasClass("rup-wizard_prev")&&!b(this).hasClass("rup-wizard_next")){b(this).wrap("<h1>")}})}b(this).remove()});if(j.summaryWithAccordion){b("#step"+e).find("legend").each(function(k,l){b("<a />").text(l.innerHTML).insertBefore(b(l).parent()).wrap("<h1 />");b(l).parent().replaceWith(b("<div />").attr("accordionable",b(l).parent().attr("accordionable")===undefined?false:true).append(b(l).parent().children()));b(l).remove()});if(b.isEmptyObject(j.summaryAccordion)){b("#step"+e).rup_accordion(j.accordion)}else{b("#step"+e).rup_accordion(j.summaryAccordion)}b("<fieldset />").attr("id","commands_fieldset").append(b("#step"+e).find("p[id='step"+(e)+"commands']")).appendTo(b("#step"+e));if(j.summaryWithAccordionSpaceBefore){b("#step"+e).prepend("</br>")}if(j.summaryWithAccordionSpaceAfter){b("#commands_fieldset").prepend("</br>")}}if(j.summaryTabs2Accordion){for(var h=0;h<=d;h++){b(".rup-wizard_tabLevel-"+h).removeClass("rup-wizard_tabLevel-"+h);b(".rup-wizard_tabContainerLevel-"+h).removeClass("rup-wizard_tabContainerLevel-"+h)}b("[accordionable=true]").each(function(l,m){if(m.nodeName==="FIELDSET"){var n=b(m).find("legend")[0],o=b(m).find("p[id='step"+(e)+"commands']"),k=b("<div />").attr("accordionable",b(m).attr("accordionable")===undefined?false:true).append(b(m).children());b(m).replaceWith(k);b(n).remove();b(o).remove();if(b.isEmptyObject(j.tabAccordion)){b(k).rup_accordion(j.accordion)}else{b(k).rup_accordion(j.tabAccordion)}b(k).prepend(n);b(k).append(b("<fieldset />").append(o))}else{if(b.isEmptyObject(j.tabAccordion)){b(m).rup_accordion(j.accordion)}else{b(m).rup_accordion(j.tabAccordion)}}})}b("[accordionable]").removeAttr("accordionable");b("#step"+e).find("p[id$='commands']").append(b(".rup-wizard_submitButton"));b("#step"+e).show();if(j.summaryFnc_POST){j.summaryFnc_POST.call()}},_getRupTabs:function(e,g,d,f){b(g).find(".rup-tabs_title").each(function(h,j){if(b.inArray(j.innerHTML,d)!==-1){return}f.push(b(j).parent().attr("href"));d.push(j.innerHTML);if(f[f.length-1].substring(1)===d[d.length-1]){e._getRupTabs(e,b("#"+d[d.length-1]),d,f)}})},_hidePassword:function(d){var f="";for(var e=0;e<d.length;e++){f+="*"}return f},_formToWizard:function(g){g=b.extend({submitButton:""},g);var j=this;var e=b(j).find("fieldset");var k=e.size();var d="#"+g.submitButton;b(d).hide();b(j).before("<ul id='steps'></ul>");e.each(function(n){b(this).wrap("<div id='step"+n+"'></div>");b(this).append("<p id='step"+n+"commands'></p>");var m=b(this).find("legend").html();b("#steps").append("<li id='stepDesc"+n+"'>Step "+(n+1)+"<a href='#'>"+m+"</a></li>");if(n==0){l(n);f(n)}else{if(n==k-1){b("#step"+n).hide();h(n)}else{b("#step"+n).hide();h(n);l(n)}}});function h(m){var n="step"+m;b("#"+n+"commands").append("<a href='#' id='"+n+"Prev' class='prev'>< Back</a>");b("#"+n+"Prev").bind("click",function(o){b("#"+n).hide();b("#step"+(m-1)).show();b(d).hide();f(m-1)})}function l(m){var n="step"+m;b("#"+n+"commands").append("<a href='#' id='"+n+"Next' class='next'>Next ></a>");b("#"+n+"Next").bind("click",function(o){b("#"+n).hide();b("#step"+(m+1)).show();if(m+2==k){b(d).show()}f(m+1)})}function f(m){b("#steps li").removeClass("current");b("#stepDesc"+m).addClass("current")}}});b.fn.rup_wizard.defaults={summary:true,summaryWithAccordion:false,summaryWithAccordionSpaceBefore:true,summaryWithAccordionSpaceAfter:true,summaryTabs2Accordion:false,stepFnc:{},accordion:{animated:"bounceslide",active:false,autoHeight:false,collapsible:true},rupAccordion:{},summaryAccordion:{},tabAccordion:{},rupTabsElement:"<h4 />",labelElement:"<span />",labelSeparatorElement:"<span />",labelSeparatorText:"&nbsp;&nbsp;&nbsp;",textareaElement:"<p />"}})(jQuery);
/*
 * Copyright 2013 E.J.I.E., S.A.
 *
 * Licencia con arreglo a la EUPL, Versión 1.1 exclusivamente (la «Licencia»);
 * Solo podrá usarse esta obra si se respeta la Licencia.
 * Puede obtenerse una copia de la Licencia en
 *
 *      http://ec.europa.eu/idabc/eupl.html
 *
 * Salvo cuando lo exija la legislación aplicable o se acuerde por escrito, 
 * el programa distribuido con arreglo a la Licencia se distribuye «TAL CUAL»,
 * SIN GARANTÍAS NI CONDICIONES DE NINGÚN TIPO, ni expresas ni implícitas.
 * Véase la Licencia en el idioma concreto que rige los permisos y limitaciones
 * que establece la Licencia.
 */
(function(b){var a={};b.extend($.rup.iniRup,$.rup.rupSelectorObjectConstructor("rup_tree",a));b.fn.rup_tree("extend",{rollback:function(d){b.jstree.rollback(d)},get_container:function(){return($(this).jstree("get_container"))},get_container_ul:function(){return($(this).jstree("get_container_ul"))},destroy:function(){$(this).jstree("destroy")},refresh:function(d){$(this).jstree("refresh",d)},set_focus:function(){$(this).jstree("set_focus")},unset_focus:function(){$(this).jstree("unset_focus")},is_focused:function(){return($(this).jstree("is_focused"))},lock:function(){$(this).jstree("lock")},unlock:function(){$(this).jstree("unlock")},is_locked:function(){return($(this).jstree("is_locked"))},get_path:function(d,e){return($(this).jstree("get_path",d,e))},open_node:function(e,f,d){$(this).jstree("open_node",e,f,d)},close_node:function(e,d){$(this).jstree("close_node",e,d)},toggle_node:function(d){return($(this).jstree("toggle_node",d))},open_all:function(d,e){$(this).jstree("open_all",d,e)},close_all:function(d,e){$(this).jstree("close_all",d,e)},is_open:function(d){return($(this).jstree("is_open",d))},is_closed:function(d){return($(this).jstree("is_closed",d))},is_leaf:function(d){return($(this).jstree("is_leaf",d))},get_rollback:function(){return($(this).jstree("get_rollback"))},create_node:function(e,d,f,g){return($(this).jstree("create_node",e,d,f,g))},get_text:function(d){return($(this).jstree("get_text",d))},rename_node:function(d,e){$(this).jstree("rename_node",d,e)},delete_node:function(d){$(this).jstree("delete_node",d)},check_move:function(){return($(this).jstree("check_move"))},move_node:function(j,g,d,f,e,h){return($(this).jstree("move_node",j,g,d,f,e,h))},get_theme:function(){var d=$(this).jstree("get_theme");if(typeof d!=="string"){return"rup-default"}else{return d}},set_theme:function(e,d){if(e!=="rup-default"){if($(this).rup_tree("get_theme")==="rup-default"){$(this).removeClass("jstree-rup-default")}var f=this.data("settings");f.actualThemeUrl=d;this.data("settings",f);$(this).jstree("set_theme",e,d)}else{$(this).jstree("set_theme","rup-default",this.data("settings").actualThemeUrl)}},show_dots:function(){$(this).jstree("show_dots")},hide_dots:function(){$(this).jstree("hide_dots")},toggle_dots:function(){$(this).jstree("toggle_dots")},show_icons:function(){$(this).jstree("show_icons")},hide_icons:function(){$(this).jstree("hide_icons")},toggle_icons:function(){$(this).jstree("toggle_icons")},save_selected:function(){$(this).jstree("save_selected")},reselect:function(){$(this).jstree("reselect")},refresh:function(d){return($(this).jstree("refresh",d))},hover_node:function(d){$(this).jstree("hover_node",d)},dehover_node:function(){$(this).jstree("dehover_node")},select_node:function(f,d,e){$(this).jstree("select_node",f,d,e)},deselect_node:function(d){$(this).jstree("deselect_node",d)},toggle_select:function(d){$(this).jstree("toggle_select",d)},deselect_all:function(d){$(this).jstree("deselect_all",d)},get_selected:function(d){return($(this).jstree("get_selected",d))},is_selected:function(d){return($(this).jstree("is_selected",d))},enable_hotkeys:function(){$(this).jstree("enable_hotkeys")},disable_hotkeys:function(){$(this).jstree("disable_hotkeys")},change_state:function(e,d){$(this).jstree("change_state",e,d)},check_node:function(d){$(this).jstree("check_node",d)},uncheck_node:function(d){$(this).jstree("uncheck_node",d)},check_all:function(){$(this).jstree("check_all")},uncheck_all:function(){$(this).jstree("uncheck_all")},is_checked:function(d){return($(this).jstree("is_checked",d))},get_checked:function(e,d){return($(this).jstree("get_checked",e,d))},get_unchecked:function(e,d){return($(this).jstree("is_checked",e,d))},show_checkboxes:function(){$(this).jstree("show_checkboxes")},hide_checkboxes:function(){$(this).jstree("hide_checkboxes")},rename:function(d){$(this).jstree("rename",d)},create:function(f,e,g,h,d){return($(this).jstree("create",f,e,g,h,d))},remove:function(d){$(this).jstree("remove",d)},cut:function(d){$(this).jstree("cut",d)},copy:function(d){$(this).jstree("copy",d)},paste:function(d){$(this).jstree("paste",d)},show_contextmenu:function(e,d,f){$(this).jstree("show_contextmenu",e,d,f)},set_type:function(d,e){$(this).jstree("set_type",d,e)}});b.fn.rup_tree("extend",{_init:function(g){if(g.length>1){b.rup.errorGestor(b.rup.i18n.base.rup_global.initError+b(this).attr("id"))}else{if(g.length>0){if(g[0].select){g[0].ui=g[0].select;delete g[0].select}if(g[0].jQueryUIStyles){g[0].themeroller=g[0].jQueryUIStyles;delete g[0].jQueryUIStyles}}var j=b.extend(true,{},b.fn.rup_tree.defaults,g[0]),f=this[0],d=this;if(j.ui===undefined||j.ui.enable!==false){j.plugins[j.plugins.length]="ui"}if(j.crrm===undefined||j.crrm.enable!==false){j.plugins[j.plugins.length]="crrm";d.bind("cut.jstree",$.proxy(function(m,l){$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled");l.args[0].children("a").addClass("rup_tree_cutNode ui-state-disabled")},this));d.bind("copy.jstree",$.proxy(function(m,l){$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled")},this));d.bind("paste.jstree",$.proxy(function(m,l){$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled")},this))}if(j.hotkeys===undefined||j.hotkeys.enable!==false){j.plugins[j.plugins.length]="hotkeys";if(j.crrm===undefined||j.crrm.enable!==false){b.jstree.defaults.hotkeys.esc=$.proxy(function(l){if(l.target.tagName==="BODY"){$(this).jstree("cleanCut");$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled")}},this)}}d._eventRecollector(j,d);d.addClass("rup_tree");if(j.xml_data!==undefined){j.plugins[j.plugins.length]="xml_data"}else{if(j.json_data!==undefined){j.plugins[j.plugins.length]="json_data"}else{j.plugins[j.plugins.length]="html_data"}}if(j.contextmenu!==undefined&&j.contextmenu.enable===true){j.plugins[j.plugins.length]="contextmenu"}else{delete j.contextmenu}if(j.sort!==undefined){if(j.sort.enable===true){j.plugins[j.plugins.length]="sort";if(j.sort.sortFunction!==undefined){j.sort=j.sort.sortFunction}else{delete j.sort}}else{delete j.sort}}if(j.checkbox!==undefined&&j.checkbox.enable===true){j.plugins[j.plugins.length]="checkbox";delete j.checkbox.enable}else{delete j.checkbox}if(j.wholerow!==undefined&&j.wholerow===true){j.plugins[j.plugins.length]="wholerow"}if(j.unique!==undefined&&j.unique.enable===true){j.plugins[j.plugins.length]="unique";delete j.unique.enable}else{delete j.unique}if(j.types!==undefined){j.plugins[j.plugins.length]="types";if($.rup_utils.aplicatioInPortal()){this.get_container().bind("loaded.jstree",$.proxy(function(){$(this).jstree("types_portal_css")},this))}}if(j.dnd!==undefined&&j.dnd.enable===true){j.plugins[j.plugins.length]="dnd";delete j.dnd.enable}else{delete j.dnd}if(j.themeroller!==undefined){if(j.themeroller.enable===true){j.plugins[j.plugins.length]="themeroller";delete j.themeroller.enable}else{j.plugins[j.plugins.length]="themes";delete j.themeroller}}else{j.plugins[j.plugins.length]="themes"}d.data("settings",j);d.jstree(j);d.bind("loaded.jstree",$.proxy(function(){this.removeClass("rup_tree")},this));if(j.themeroller===undefined&&!j.themes.theme){d.addClass("jstree-rup-default");$(this).jstree("set_theme_data","rup-default")}if(j.contextmenu!==undefined&&j.contextmenu.enable===true){delete j.contextmenu.enable;if(j.contextmenu.defaultOptions!==undefined){var k=this.jstree("get_settings").contextmenu.items;var e=j.contextmenu.defaultOptions;for(option in e){if(e[option]===false){k[option]=null}else{if(option==="ccp"){var h=e.ccp;for(ccpOption in h){if(h[ccpOption]===false){k.ccp.submenu[ccpOption]=null}}}}}$(this).jstree("set_contextmenu_items",k);delete j.contextmenu.defaultOptions}}else{delete j.contextmenu}}},_eventRecollector:function(g,e){var d;for(var f in g){d=f.split("_event");if(d.length>1){this.bind(d[0]+".jstree",g[f])}}}});b.fn.rup_tree.defaults={plugins:["rup_extend"],actualThemeUrl:"",core:{strings:{loading:$.rup.i18nParse($.rup.i18n.base,"rup_tree.loading"),new_node:$.rup.i18nParse($.rup.i18n.base,"rup_tree.new_node")}},themes:{theme:""},checkbox:{override_ui:true},crrm:{input_width_limit:200}};b.jstree.defaults.contextmenu.items.create.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.create");b.jstree.defaults.contextmenu.items.rename.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.rename");b.jstree.defaults.contextmenu.items.remove.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.remove");b.jstree.defaults.contextmenu.items.ccp.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.ccp.label");b.jstree.defaults.contextmenu.items.ccp.submenu.cut.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.ccp.cut");b.jstree.defaults.contextmenu.items.ccp.submenu.copy.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.ccp.copy");b.jstree.defaults.contextmenu.items.ccp.submenu.paste.label=$.rup.i18nParse($.rup.i18n.base,"rup_tree.ccp.paste");b.extend(b.jstree.defaults.hotkeys,$.rup.compatibility.jstree.hotkeys);$.jstree.plugin("rup_extend",$.rup.compatibility.jstree.rup_extend)})(jQuery);
/*
 * jQuery JavaScript Library v1.7.2
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Mar 21 12:46:34 2012 -0700
 */
(function(bf,N){var ax=bf.document,bw=bf.navigator,bo=bf.location;var b=(function(){var bH=function(b2,b3){return new bH.fn.init(b2,b3,bF)},bW=bf.jQuery,bJ=bf.$,bF,b0=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bO=/\S/,bK=/^\s+/,bG=/\s+$/,bC=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bP=/^[\],:{}\s]*$/,bY=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bR=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bL=/(?:^|:|,)(?:\s*\[)+/g,bA=/(webkit)[ \/]([\w.]+)/,bT=/(opera)(?:.*version)?[ \/]([\w.]+)/,bS=/(msie) ([\w.]+)/,bU=/(mozilla)(?:.*? rv:([\w.]+))?/,bD=/-([a-z]|[0-9])/ig,b1=/^-ms-/,bV=function(b2,b3){return(b3+"").toUpperCase()},bZ=bw.userAgent,bX,bE,e,bN=Object.prototype.toString,bI=Object.prototype.hasOwnProperty,bB=Array.prototype.push,bM=Array.prototype.slice,bQ=String.prototype.trim,bx=Array.prototype.indexOf,bz={};bH.fn=bH.prototype={constructor:bH,init:function(b2,b6,b5){var b4,b7,b3,b8;if(!b2){return this}if(b2.nodeType){this.context=this[0]=b2;this.length=1;return this}if(b2==="body"&&!b6&&ax.body){this.context=ax;this[0]=ax.body;this.selector=b2;this.length=1;return this}if(typeof b2==="string"){if(b2.charAt(0)==="<"&&b2.charAt(b2.length-1)===">"&&b2.length>=3){b4=[null,b2,null]}else{b4=b0.exec(b2)}if(b4&&(b4[1]||!b6)){if(b4[1]){b6=b6 instanceof bH?b6[0]:b6;b8=(b6?b6.ownerDocument||b6:ax);b3=bC.exec(b2);if(b3){if(bH.isPlainObject(b6)){b2=[ax.createElement(b3[1])];bH.fn.attr.call(b2,b6,true)}else{b2=[b8.createElement(b3[1])]}}else{b3=bH.buildFragment([b4[1]],[b8]);b2=(b3.cacheable?bH.clone(b3.fragment):b3.fragment).childNodes}return bH.merge(this,b2)}else{b7=ax.getElementById(b4[2]);if(b7&&b7.parentNode){if(b7.id!==b4[2]){return b5.find(b2)}this.length=1;this[0]=b7}this.context=ax;this.selector=b2;return this}}else{if(!b6||b6.jquery){return(b6||b5).find(b2)}else{return this.constructor(b6).find(b2)}}}else{if(bH.isFunction(b2)){return b5.ready(b2)}}if(b2.selector!==N){this.selector=b2.selector;this.context=b2.context}return bH.makeArray(b2,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return bM.call(this,0)},get:function(b2){return b2==null?this.toArray():(b2<0?this[this.length+b2]:this[b2])},pushStack:function(b3,b5,b2){var b4=this.constructor();if(bH.isArray(b3)){bB.apply(b4,b3)}else{bH.merge(b4,b3)}b4.prevObject=this;b4.context=this.context;if(b5==="find"){b4.selector=this.selector+(this.selector?" ":"")+b2}else{if(b5){b4.selector=this.selector+"."+b5+"("+b2+")"}}return b4},each:function(b3,b2){return bH.each(this,b3,b2)},ready:function(b2){bH.bindReady();bE.add(b2);return this},eq:function(b2){b2=+b2;return b2===-1?this.slice(b2):this.slice(b2,b2+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bM.apply(this,arguments),"slice",bM.call(arguments).join(","))},map:function(b2){return this.pushStack(bH.map(this,function(b4,b3){return b2.call(b4,b3,b4)}))},end:function(){return this.prevObject||this.constructor(null)},push:bB,sort:[].sort,splice:[].splice};bH.fn.init.prototype=bH.fn;bH.extend=bH.fn.extend=function(){var cb,b4,b2,b3,b8,b9,b7=arguments[0]||{},b6=1,b5=arguments.length,ca=false;if(typeof b7==="boolean"){ca=b7;b7=arguments[1]||{};b6=2}if(typeof b7!=="object"&&!bH.isFunction(b7)){b7={}}if(b5===b6){b7=this;--b6}for(;b6<b5;b6++){if((cb=arguments[b6])!=null){for(b4 in cb){b2=b7[b4];b3=cb[b4];if(b7===b3){continue}if(ca&&b3&&(bH.isPlainObject(b3)||(b8=bH.isArray(b3)))){if(b8){b8=false;b9=b2&&bH.isArray(b2)?b2:[]}else{b9=b2&&bH.isPlainObject(b2)?b2:{}}b7[b4]=bH.extend(ca,b9,b3)}else{if(b3!==N){b7[b4]=b3}}}}}return b7};bH.extend({noConflict:function(b2){if(bf.$===bH){bf.$=bJ}if(b2&&bf.jQuery===bH){bf.jQuery=bW}return bH},isReady:false,readyWait:1,holdReady:function(b2){if(b2){bH.readyWait++}else{bH.ready(true)}},ready:function(b2){if((b2===true&&!--bH.readyWait)||(b2!==true&&!bH.isReady)){if(!ax.body){return setTimeout(bH.ready,1)}bH.isReady=true;if(b2!==true&&--bH.readyWait>0){return}bE.fireWith(ax,[bH]);if(bH.fn.trigger){bH(ax).trigger("ready").off("ready")}}},bindReady:function(){if(bE){return}bE=bH.Callbacks("once memory");if(ax.readyState==="complete"){return setTimeout(bH.ready,1)}if(ax.addEventListener){ax.addEventListener("DOMContentLoaded",e,false);bf.addEventListener("load",bH.ready,false)}else{if(ax.attachEvent){ax.attachEvent("onreadystatechange",e);bf.attachEvent("onload",bH.ready);var b2=false;try{b2=bf.frameElement==null}catch(b3){}if(ax.documentElement.doScroll&&b2){by()}}}},isFunction:function(b2){return bH.type(b2)==="function"},isArray:Array.isArray||function(b2){return bH.type(b2)==="array"},isWindow:function(b2){return b2!=null&&b2==b2.window},isNumeric:function(b2){return !isNaN(parseFloat(b2))&&isFinite(b2)},type:function(b2){return b2==null?String(b2):bz[bN.call(b2)]||"object"},isPlainObject:function(b4){if(!b4||bH.type(b4)!=="object"||b4.nodeType||bH.isWindow(b4)){return false}try{if(b4.constructor&&!bI.call(b4,"constructor")&&!bI.call(b4.constructor.prototype,"isPrototypeOf")){return false}}catch(b3){return false}var b2;for(b2 in b4){}return b2===N||bI.call(b4,b2)},isEmptyObject:function(b3){for(var b2 in b3){return false}return true},error:function(b2){throw new Error(b2)},parseJSON:function(b2){if(typeof b2!=="string"||!b2){return null}b2=bH.trim(b2);if(bf.JSON&&bf.JSON.parse){return bf.JSON.parse(b2)}if(bP.test(b2.replace(bY,"@").replace(bR,"]").replace(bL,""))){return(new Function("return "+b2))()}bH.error("Invalid JSON: "+b2)},parseXML:function(b4){if(typeof b4!=="string"||!b4){return null}var b2,b3;try{if(bf.DOMParser){b3=new DOMParser();b2=b3.parseFromString(b4,"text/xml")}else{b2=new ActiveXObject("Microsoft.XMLDOM");b2.async="false";b2.loadXML(b4)}}catch(b5){b2=N}if(!b2||!b2.documentElement||b2.getElementsByTagName("parsererror").length){bH.error("Invalid XML: "+b4)}return b2},noop:function(){},globalEval:function(b2){if(b2&&bO.test(b2)){(bf.execScript||function(b3){bf["eval"].call(bf,b3)})(b2)}},camelCase:function(b2){return b2.replace(b1,"ms-").replace(bD,bV)},nodeName:function(b3,b2){return b3.nodeName&&b3.nodeName.toUpperCase()===b2.toUpperCase()},each:function(b5,b8,b4){var b3,b6=0,b7=b5.length,b2=b7===N||bH.isFunction(b5);if(b4){if(b2){for(b3 in b5){if(b8.apply(b5[b3],b4)===false){break}}}else{for(;b6<b7;){if(b8.apply(b5[b6++],b4)===false){break}}}}else{if(b2){for(b3 in b5){if(b8.call(b5[b3],b3,b5[b3])===false){break}}}else{for(;b6<b7;){if(b8.call(b5[b6],b6,b5[b6++])===false){break}}}}return b5},trim:bQ?function(b2){return b2==null?"":bQ.call(b2)}:function(b2){return b2==null?"":b2.toString().replace(bK,"").replace(bG,"")},makeArray:function(b5,b3){var b2=b3||[];if(b5!=null){var b4=bH.type(b5);if(b5.length==null||b4==="string"||b4==="function"||b4==="regexp"||bH.isWindow(b5)){bB.call(b2,b5)}else{bH.merge(b2,b5)}}return b2},inArray:function(b4,b5,b3){var b2;if(b5){if(bx){return bx.call(b5,b4,b3)}b2=b5.length;b3=b3?b3<0?Math.max(0,b2+b3):b3:0;for(;b3<b2;b3++){if(b3 in b5&&b5[b3]===b4){return b3}}}return -1},merge:function(b6,b4){var b5=b6.length,b3=0;if(typeof b4.length==="number"){for(var b2=b4.length;b3<b2;b3++){b6[b5++]=b4[b3]}}else{while(b4[b3]!==N){b6[b5++]=b4[b3++]}}b6.length=b5;return b6},grep:function(b3,b8,b2){var b4=[],b7;b2=!!b2;for(var b5=0,b6=b3.length;b5<b6;b5++){b7=!!b8(b3[b5],b5);if(b2!==b7){b4.push(b3[b5])}}return b4},map:function(b2,b9,ca){var b7,b8,b6=[],b4=0,b3=b2.length,b5=b2 instanceof bH||b3!==N&&typeof b3==="number"&&((b3>0&&b2[0]&&b2[b3-1])||b3===0||bH.isArray(b2));if(b5){for(;b4<b3;b4++){b7=b9(b2[b4],b4,ca);if(b7!=null){b6[b6.length]=b7}}}else{for(b8 in b2){b7=b9(b2[b8],b8,ca);if(b7!=null){b6[b6.length]=b7}}}return b6.concat.apply([],b6)},guid:1,proxy:function(b6,b5){if(typeof b5==="string"){var b4=b6[b5];b5=b6;b6=b4}if(!bH.isFunction(b6)){return N}var b2=bM.call(arguments,2),b3=function(){return b6.apply(b5,b2.concat(bM.call(arguments)))};b3.guid=b6.guid=b6.guid||b3.guid||bH.guid++;return b3},access:function(b2,b8,cb,b9,b6,cc,ca){var b4,b7=cb==null,b5=0,b3=b2.length;if(cb&&typeof cb==="object"){for(b5 in cb){bH.access(b2,b8,b5,cb[b5],1,cc,b9)}b6=1}else{if(b9!==N){b4=ca===N&&bH.isFunction(b9);if(b7){if(b4){b4=b8;b8=function(ce,cd,cf){return b4.call(bH(ce),cf)}}else{b8.call(b2,b9);b8=null}}if(b8){for(;b5<b3;b5++){b8(b2[b5],cb,b4?b9.call(b2[b5],b5,b8(b2[b5],cb)):b9,ca)}}b6=1}}return b6?b2:b7?b8.call(b2):b3?b8(b2[0],cb):cc},now:function(){return(new Date()).getTime()},uaMatch:function(b3){b3=b3.toLowerCase();var b2=bA.exec(b3)||bT.exec(b3)||bS.exec(b3)||b3.indexOf("compatible")<0&&bU.exec(b3)||[];return{browser:b2[1]||"",version:b2[2]||"0"}},sub:function(){function b2(b5,b6){return new b2.fn.init(b5,b6)}bH.extend(true,b2,this);b2.superclass=this;b2.fn=b2.prototype=this();b2.fn.constructor=b2;b2.sub=this.sub;b2.fn.init=function b4(b5,b6){if(b6&&b6 instanceof bH&&!(b6 instanceof b2)){b6=b2(b6)}return bH.fn.init.call(this,b5,b6,b3)};b2.fn.init.prototype=b2.fn;var b3=b2(ax);return b2},browser:{}});bH.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(b3,b2){bz["[object "+b2+"]"]=b2.toLowerCase()});bX=bH.uaMatch(bZ);if(bX.browser){bH.browser[bX.browser]=true;bH.browser.version=bX.version}if(bH.browser.webkit){bH.browser.safari=true}if(bO.test("\xA0")){bK=/^[\s\xA0]+/;bG=/[\s\xA0]+$/}bF=bH(ax);if(ax.addEventListener){e=function(){ax.removeEventListener("DOMContentLoaded",e,false);bH.ready()}}else{if(ax.attachEvent){e=function(){if(ax.readyState==="complete"){ax.detachEvent("onreadystatechange",e);bH.ready()}}}}function by(){if(bH.isReady){return}try{ax.documentElement.doScroll("left")}catch(b2){setTimeout(by,1);return}bH.ready()}return bH})();var a5={};function Z(e){var bx=a5[e]={},by,bz;e=e.split(/\s+/);for(by=0,bz=e.length;by<bz;by++){bx[e[by]]=true}return bx}b.Callbacks=function(bz){bz=bz?(a5[bz]||Z(bz)):{};var bE=[],bF=[],bA,e,bB,by,bC,bD,bH=function(bI){var bJ,bM,bL,bK,bN;for(bJ=0,bM=bI.length;bJ<bM;bJ++){bL=bI[bJ];bK=b.type(bL);if(bK==="array"){bH(bL)}else{if(bK==="function"){if(!bz.unique||!bG.has(bL)){bE.push(bL)}}}}},bx=function(bJ,bI){bI=bI||[];bA=!bz.memory||[bJ,bI];e=true;bB=true;bD=by||0;by=0;bC=bE.length;for(;bE&&bD<bC;bD++){if(bE[bD].apply(bJ,bI)===false&&bz.stopOnFalse){bA=true;break}}bB=false;if(bE){if(!bz.once){if(bF&&bF.length){bA=bF.shift();bG.fireWith(bA[0],bA[1])}}else{if(bA===true){bG.disable()}else{bE=[]}}}},bG={add:function(){if(bE){var bI=bE.length;bH(arguments);if(bB){bC=bE.length}else{if(bA&&bA!==true){by=bI;bx(bA[0],bA[1])}}}return this},remove:function(){if(bE){var bI=arguments,bK=0,bL=bI.length;for(;bK<bL;bK++){for(var bJ=0;bJ<bE.length;bJ++){if(bI[bK]===bE[bJ]){if(bB){if(bJ<=bC){bC--;if(bJ<=bD){bD--}}}bE.splice(bJ--,1);if(bz.unique){break}}}}}return this},has:function(bJ){if(bE){var bI=0,bK=bE.length;for(;bI<bK;bI++){if(bJ===bE[bI]){return true}}}return false},empty:function(){bE=[];return this},disable:function(){bE=bF=bA=N;return this},disabled:function(){return !bE},lock:function(){bF=N;if(!bA||bA===true){bG.disable()}return this},locked:function(){return !bF},fireWith:function(bJ,bI){if(bF){if(bB){if(!bz.once){bF.push([bJ,bI])}}else{if(!(bz.once&&bA)){bx(bJ,bI)}}}return this},fire:function(){bG.fireWith(this,arguments);return this},fired:function(){return !!e}};return bG};var aM=[].slice;b.extend({Deferred:function(bA){var bz=b.Callbacks("once memory"),by=b.Callbacks("once memory"),bx=b.Callbacks("memory"),e="pending",bC={resolve:bz,reject:by,notify:bx},bE={done:bz.add,fail:by.add,progress:bx.add,state:function(){return e},isResolved:bz.fired,isRejected:by.fired,then:function(bG,bF,bH){bD.done(bG).fail(bF).progress(bH);return this},always:function(){bD.done.apply(bD,arguments).fail.apply(bD,arguments);return this},pipe:function(bH,bG,bF){return b.Deferred(function(bI){b.each({done:[bH,"resolve"],fail:[bG,"reject"],progress:[bF,"notify"]},function(bK,bN){var bJ=bN[0],bM=bN[1],bL;if(b.isFunction(bJ)){bD[bK](function(){bL=bJ.apply(this,arguments);if(bL&&b.isFunction(bL.promise)){bL.promise().then(bI.resolve,bI.reject,bI.notify)}else{bI[bM+"With"](this===bD?bI:this,[bL])}})}else{bD[bK](bI[bM])}})}).promise()},promise:function(bG){if(bG==null){bG=bE}else{for(var bF in bE){bG[bF]=bE[bF]}}return bG}},bD=bE.promise({}),bB;for(bB in bC){bD[bB]=bC[bB].fire;bD[bB+"With"]=bC[bB].fireWith}bD.done(function(){e="resolved"},by.disable,bx.lock).fail(function(){e="rejected"},bz.disable,bx.lock);if(bA){bA.call(bD,bD)}return bD},when:function(bC){var bz=aM.call(arguments,0),bx=0,e=bz.length,bD=new Array(e),by=e,bA=e,bE=e<=1&&bC&&b.isFunction(bC.promise)?bC:b.Deferred(),bG=bE.promise();function bF(bH){return function(bI){bz[bH]=arguments.length>1?aM.call(arguments,0):bI;if(!(--by)){bE.resolveWith(bE,bz)}}}function bB(bH){return function(bI){bD[bH]=arguments.length>1?aM.call(arguments,0):bI;bE.notifyWith(bG,bD)}}if(e>1){for(;bx<e;bx++){if(bz[bx]&&bz[bx].promise&&b.isFunction(bz[bx].promise)){bz[bx].promise().then(bF(bx),bE.reject,bB(bx))}else{--by}}if(!by){bE.resolveWith(bE,bz)}}else{if(bE!==bC){bE.resolveWith(bE,e?[bC]:[])}}return bG}});b.support=(function(){var bK,bJ,bG,bH,bz,bF,bE,bB,bL,bC,bA,by,bx=ax.createElement("div"),bI=ax.documentElement;bx.setAttribute("className","t");bx.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";bJ=bx.getElementsByTagName("*");bG=bx.getElementsByTagName("a")[0];if(!bJ||!bJ.length||!bG){return{}}bH=ax.createElement("select");bz=bH.appendChild(ax.createElement("option"));bF=bx.getElementsByTagName("input")[0];bK={leadingWhitespace:(bx.firstChild.nodeType===3),tbody:!bx.getElementsByTagName("tbody").length,htmlSerialize:!!bx.getElementsByTagName("link").length,style:/top/.test(bG.getAttribute("style")),hrefNormalized:(bG.getAttribute("href")==="/a"),opacity:/^0.55/.test(bG.style.opacity),cssFloat:!!bG.style.cssFloat,checkOn:(bF.value==="on"),optSelected:bz.selected,getSetAttribute:bx.className!=="t",enctype:!!ax.createElement("form").enctype,html5Clone:ax.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true,pixelMargin:true};b.boxModel=bK.boxModel=(ax.compatMode==="CSS1Compat");bF.checked=true;bK.noCloneChecked=bF.cloneNode(true).checked;bH.disabled=true;bK.optDisabled=!bz.disabled;try{delete bx.test}catch(bD){bK.deleteExpando=false}if(!bx.addEventListener&&bx.attachEvent&&bx.fireEvent){bx.attachEvent("onclick",function(){bK.noCloneEvent=false});bx.cloneNode(true).fireEvent("onclick")}bF=ax.createElement("input");bF.value="t";bF.setAttribute("type","radio");bK.radioValue=bF.value==="t";bF.setAttribute("checked","checked");bF.setAttribute("name","t");bx.appendChild(bF);bE=ax.createDocumentFragment();bE.appendChild(bx.lastChild);bK.checkClone=bE.cloneNode(true).cloneNode(true).lastChild.checked;bK.appendChecked=bF.checked;bE.removeChild(bF);bE.appendChild(bx);if(bx.attachEvent){for(bA in {submit:1,change:1,focusin:1}){bC="on"+bA;by=(bC in bx);if(!by){bx.setAttribute(bC,"return;");by=(typeof bx[bC]==="function")}bK[bA+"Bubbles"]=by}}bE.removeChild(bx);bE=bH=bz=bx=bF=null;b(function(){var bO,bX,bY,bW,bQ,bR,bT,bN,bM,bS,bP,e,bV,bU=ax.getElementsByTagName("body")[0];if(!bU){return}bN=1;bV="padding:0;margin:0;border:";bP="position:absolute;top:0;left:0;width:1px;height:1px;";e=bV+"0;visibility:hidden;";bM="style='"+bP+bV+"5px solid #000;";bS="<div "+bM+"display:block;'><div style='"+bV+"0;display:block;overflow:hidden;'></div></div><table "+bM+"' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";bO=ax.createElement("div");bO.style.cssText=e+"width:0;height:0;position:static;top:0;margin-top:"+bN+"px";bU.insertBefore(bO,bU.firstChild);bx=ax.createElement("div");bO.appendChild(bx);bx.innerHTML="<table><tr><td style='"+bV+"0;display:none'></td><td>t</td></tr></table>";bB=bx.getElementsByTagName("td");by=(bB[0].offsetHeight===0);bB[0].style.display="";bB[1].style.display="none";bK.reliableHiddenOffsets=by&&(bB[0].offsetHeight===0);if(bf.getComputedStyle){bx.innerHTML="";bT=ax.createElement("div");bT.style.width="0";bT.style.marginRight="0";bx.style.width="2px";bx.appendChild(bT);bK.reliableMarginRight=(parseInt((bf.getComputedStyle(bT,null)||{marginRight:0}).marginRight,10)||0)===0}if(typeof bx.style.zoom!=="undefined"){bx.innerHTML="";bx.style.width=bx.style.padding="1px";bx.style.border=0;bx.style.overflow="hidden";bx.style.display="inline";bx.style.zoom=1;bK.inlineBlockNeedsLayout=(bx.offsetWidth===3);bx.style.display="block";bx.style.overflow="visible";bx.innerHTML="<div style='width:5px;'></div>";bK.shrinkWrapBlocks=(bx.offsetWidth!==3)}bx.style.cssText=bP+e;bx.innerHTML=bS;bX=bx.firstChild;bY=bX.firstChild;bQ=bX.nextSibling.firstChild.firstChild;bR={doesNotAddBorder:(bY.offsetTop!==5),doesAddBorderForTableAndCells:(bQ.offsetTop===5)};bY.style.position="fixed";bY.style.top="20px";bR.fixedPosition=(bY.offsetTop===20||bY.offsetTop===15);bY.style.position=bY.style.top="";bX.style.overflow="hidden";bX.style.position="relative";bR.subtractsBorderForOverflowNotVisible=(bY.offsetTop===-5);bR.doesNotIncludeMarginInBodyOffset=(bU.offsetTop!==bN);if(bf.getComputedStyle){bx.style.marginTop="1%";bK.pixelMargin=(bf.getComputedStyle(bx,null)||{marginTop:0}).marginTop!=="1%"}if(typeof bO.style.zoom!=="undefined"){bO.style.zoom=1}bU.removeChild(bO);bT=bx=bO=null;b.extend(bK,bR)});return bK})();var aV=/^(?:\{.*\}|\[.*\])$/,aC=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!U(e)},data:function(bz,bx,bB,bA){if(!b.acceptData(bz)){return}var bI,bC,bF,bG=b.expando,bE=typeof bx==="string",bH=bz.nodeType,e=bH?b.cache:bz,by=bH?bz[bG]:bz[bG]&&bG,bD=bx==="events";if((!by||!e[by]||(!bD&&!bA&&!e[by].data))&&bE&&bB===N){return}if(!by){if(bH){bz[bG]=by=++b.uuid}else{by=bG}}if(!e[by]){e[by]={};if(!bH){e[by].toJSON=b.noop}}if(typeof bx==="object"||typeof bx==="function"){if(bA){e[by]=b.extend(e[by],bx)}else{e[by].data=b.extend(e[by].data,bx)}}bI=bC=e[by];if(!bA){if(!bC.data){bC.data={}}bC=bC.data}if(bB!==N){bC[b.camelCase(bx)]=bB}if(bD&&!bC[bx]){return bI.events}if(bE){bF=bC[bx];if(bF==null){bF=bC[b.camelCase(bx)]}}else{bF=bC}return bF},removeData:function(bz,bx,bA){if(!b.acceptData(bz)){return}var bD,bC,bB,bE=b.expando,bF=bz.nodeType,e=bF?b.cache:bz,by=bF?bz[bE]:bE;if(!e[by]){return}if(bx){bD=bA?e[by]:e[by].data;if(bD){if(!b.isArray(bx)){if(bx in bD){bx=[bx]}else{bx=b.camelCase(bx);if(bx in bD){bx=[bx]}else{bx=bx.split(" ")}}}for(bC=0,bB=bx.length;bC<bB;bC++){delete bD[bx[bC]]}if(!(bA?U:b.isEmptyObject)(bD)){return}}}if(!bA){delete e[by].data;if(!U(e[by])){return}}if(b.support.deleteExpando||!e.setInterval){delete e[by]}else{e[by]=null}if(bF){if(b.support.deleteExpando){delete bz[bE]}else{if(bz.removeAttribute){bz.removeAttribute(bE)}else{bz[bE]=null}}}},_data:function(bx,e,by){return b.data(bx,e,by,true)},acceptData:function(bx){if(bx.nodeName){var e=b.noData[bx.nodeName.toLowerCase()];if(e){return !(e===true||bx.getAttribute("classid")!==e)}}return true}});b.fn.extend({data:function(bF,bE){var bA,bx,bD,e,bz,by=this[0],bC=0,bB=null;if(bF===N){if(this.length){bB=b.data(by);if(by.nodeType===1&&!b._data(by,"parsedAttrs")){bD=by.attributes;for(bz=bD.length;bC<bz;bC++){e=bD[bC].name;if(e.indexOf("data-")===0){e=b.camelCase(e.substring(5));a8(by,e,bB[e])}}b._data(by,"parsedAttrs",true)}}return bB}if(typeof bF==="object"){return this.each(function(){b.data(this,bF)})}bA=bF.split(".",2);bA[1]=bA[1]?"."+bA[1]:"";bx=bA[1]+"!";return b.access(this,function(bG){if(bG===N){bB=this.triggerHandler("getData"+bx,[bA[0]]);if(bB===N&&by){bB=b.data(by,bF);bB=a8(by,bF,bB)}return bB===N&&bA[1]?this.data(bA[0]):bB}bA[1]=bG;this.each(function(){var bH=b(this);bH.triggerHandler("setData"+bx,bA);b.data(this,bF,bG);bH.triggerHandler("changeData"+bx,bA)})},null,bE,arguments.length>1,null,false)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function a8(bz,by,bA){if(bA===N&&bz.nodeType===1){var bx="data-"+by.replace(aC,"-$1").toLowerCase();bA=bz.getAttribute(bx);if(typeof bA==="string"){try{bA=bA==="true"?true:bA==="false"?false:bA==="null"?null:b.isNumeric(bA)?+bA:aV.test(bA)?b.parseJSON(bA):bA}catch(bB){}b.data(bz,by,bA)}else{bA=N}}return bA}function U(bx){for(var e in bx){if(e==="data"&&b.isEmptyObject(bx[e])){continue}if(e!=="toJSON"){return false}}return true}function bl(bA,bz,bC){var by=bz+"defer",bx=bz+"queue",e=bz+"mark",bB=b._data(bA,by);if(bB&&(bC==="queue"||!b._data(bA,bx))&&(bC==="mark"||!b._data(bA,e))){setTimeout(function(){if(!b._data(bA,bx)&&!b._data(bA,e)){b.removeData(bA,by,true);bB.fire()}},0)}}b.extend({_mark:function(bx,e){if(bx){e=(e||"fx")+"mark";b._data(bx,e,(b._data(bx,e)||0)+1)}},_unmark:function(bA,bz,bx){if(bA!==true){bx=bz;bz=bA;bA=false}if(bz){bx=bx||"fx";var e=bx+"mark",by=bA?0:((b._data(bz,e)||1)-1);if(by){b._data(bz,e,by)}else{b.removeData(bz,e,true);bl(bz,bx,"mark")}}},queue:function(bx,e,bz){var by;if(bx){e=(e||"fx")+"queue";by=b._data(bx,e);if(bz){if(!by||b.isArray(bz)){by=b._data(bx,e,b.makeArray(bz))}else{by.push(bz)}}return by||[]}},dequeue:function(bA,bz){bz=bz||"fx";var bx=b.queue(bA,bz),by=bx.shift(),e={};if(by==="inprogress"){by=bx.shift()}if(by){if(bz==="fx"){bx.unshift("inprogress")}b._data(bA,bz+".run",e);by.call(bA,function(){b.dequeue(bA,bz)},e)}if(!bx.length){b.removeData(bA,bz+"queue "+bz+".run",true);bl(bA,bz,"queue")}}});b.fn.extend({queue:function(e,bx){var by=2;if(typeof e!=="string"){bx=e;e="fx";by--}if(arguments.length<by){return b.queue(this[0],e)}return bx===N?this:this.each(function(){var bz=b.queue(this,e,bx);if(e==="fx"&&bz[0]!=="inprogress"){b.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(bx,e){bx=b.fx?b.fx.speeds[bx]||bx:bx;e=e||"fx";return this.queue(e,function(bz,by){var bA=setTimeout(bz,bx);by.stop=function(){clearTimeout(bA)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(bF,by){if(typeof bF!=="string"){by=bF;bF=N}bF=bF||"fx";var e=b.Deferred(),bx=this,bA=bx.length,bD=1,bB=bF+"defer",bC=bF+"queue",bE=bF+"mark",bz;function bG(){if(!(--bD)){e.resolveWith(bx,[bx])}}while(bA--){if((bz=b.data(bx[bA],bB,N,true)||(b.data(bx[bA],bC,N,true)||b.data(bx[bA],bE,N,true))&&b.data(bx[bA],bB,b.Callbacks("once memory"),true))){bD++;bz.add(bG)}}bG();return e.promise(by)}});var aS=/[\n\t\r]/g,ai=/\s+/,aX=/\r/g,h=/^(?:button|input)$/i,E=/^(?:button|input|object|select|textarea)$/i,n=/^a(?:rea)?$/i,aq=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,G=b.support.getSetAttribute,bh,a1,aI;b.fn.extend({attr:function(e,bx){return b.access(this,b.attr,e,bx,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,bx){return b.access(this,b.prop,e,bx,arguments.length>1)},removeProp:function(e){e=b.propFix[e]||e;return this.each(function(){try{this[e]=N;delete this[e]}catch(bx){}})},addClass:function(bA){var bC,by,bx,bz,bB,bD,e;if(b.isFunction(bA)){return this.each(function(bE){b(this).addClass(bA.call(this,bE,this.className))})}if(bA&&typeof bA==="string"){bC=bA.split(ai);for(by=0,bx=this.length;by<bx;by++){bz=this[by];if(bz.nodeType===1){if(!bz.className&&bC.length===1){bz.className=bA}else{bB=" "+bz.className+" ";for(bD=0,e=bC.length;bD<e;bD++){if(!~bB.indexOf(" "+bC[bD]+" ")){bB+=bC[bD]+" "}}bz.className=b.trim(bB)}}}}return this},removeClass:function(bB){var bC,by,bx,bA,bz,bD,e;if(b.isFunction(bB)){return this.each(function(bE){b(this).removeClass(bB.call(this,bE,this.className))})}if((bB&&typeof bB==="string")||bB===N){bC=(bB||"").split(ai);for(by=0,bx=this.length;by<bx;by++){bA=this[by];if(bA.nodeType===1&&bA.className){if(bB){bz=(" "+bA.className+" ").replace(aS," ");for(bD=0,e=bC.length;bD<e;bD++){bz=bz.replace(" "+bC[bD]+" "," ")}bA.className=b.trim(bz)}else{bA.className=""}}}}return this},toggleClass:function(bz,bx){var by=typeof bz,e=typeof bx==="boolean";if(b.isFunction(bz)){return this.each(function(bA){b(this).toggleClass(bz.call(this,bA,this.className,bx),bx)})}return this.each(function(){if(by==="string"){var bC,bB=0,bA=b(this),bD=bx,bE=bz.split(ai);while((bC=bE[bB++])){bD=e?bD:!bA.hasClass(bC);bA[bD?"addClass":"removeClass"](bC)}}else{if(by==="undefined"||by==="boolean"){if(this.className){b._data(this,"__className__",this.className)}this.className=this.className||bz===false?"":b._data(this,"__className__")||""}}})},hasClass:function(e){var bz=" "+e+" ",by=0,bx=this.length;for(;by<bx;by++){if(this[by].nodeType===1&&(" "+this[by].className+" ").replace(aS," ").indexOf(bz)>-1){return true}}return false},val:function(bz){var e,bx,bA,by=this[0];if(!arguments.length){if(by){e=b.valHooks[by.type]||b.valHooks[by.nodeName.toLowerCase()];if(e&&"get" in e&&(bx=e.get(by,"value"))!==N){return bx}bx=by.value;return typeof bx==="string"?bx.replace(aX,""):bx==null?"":bx}return}bA=b.isFunction(bz);return this.each(function(bC){var bB=b(this),bD;if(this.nodeType!==1){return}if(bA){bD=bz.call(this,bC,bB.val())}else{bD=bz}if(bD==null){bD=""}else{if(typeof bD==="number"){bD+=""}else{if(b.isArray(bD)){bD=b.map(bD,function(bE){return bE==null?"":bE+""})}}}e=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()];if(!e||!("set" in e)||e.set(this,bD,"value")===N){this.value=bD}})}});b.extend({valHooks:{option:{get:function(e){var bx=e.attributes.value;return !bx||bx.specified?e.value:e.text}},select:{get:function(e){var bC,bx,bB,bz,bA=e.selectedIndex,bD=[],bE=e.options,by=e.type==="select-one";if(bA<0){return null}bx=by?bA:0;bB=by?bA+1:bE.length;for(;bx<bB;bx++){bz=bE[bx];if(bz.selected&&(b.support.optDisabled?!bz.disabled:bz.getAttribute("disabled")===null)&&(!bz.parentNode.disabled||!b.nodeName(bz.parentNode,"optgroup"))){bC=b(bz).val();if(by){return bC}bD.push(bC)}}if(by&&!bD.length&&bE.length){return b(bE[bA]).val()}return bD},set:function(bx,by){var e=b.makeArray(by);b(bx).find("option").each(function(){this.selected=b.inArray(b(this).val(),e)>=0});if(!e.length){bx.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bC,bz,bD,bB){var by,e,bA,bx=bC.nodeType;if(!bC||bx===3||bx===8||bx===2){return}if(bB&&bz in b.attrFn){return b(bC)[bz](bD)}if(typeof bC.getAttribute==="undefined"){return b.prop(bC,bz,bD)}bA=bx!==1||!b.isXMLDoc(bC);if(bA){bz=bz.toLowerCase();e=b.attrHooks[bz]||(aq.test(bz)?a1:bh)}if(bD!==N){if(bD===null){b.removeAttr(bC,bz);return}else{if(e&&"set" in e&&bA&&(by=e.set(bC,bD,bz))!==N){return by}else{bC.setAttribute(bz,""+bD);return bD}}}else{if(e&&"get" in e&&bA&&(by=e.get(bC,bz))!==null){return by}else{by=bC.getAttribute(bz);return by===null?N:by}}},removeAttr:function(bA,bC){var bB,bD,by,e,bx,bz=0;if(bC&&bA.nodeType===1){bD=bC.toLowerCase().split(ai);e=bD.length;for(;bz<e;bz++){by=bD[bz];if(by){bB=b.propFix[by]||by;bx=aq.test(by);if(!bx){b.attr(bA,by,"")}bA.removeAttribute(G?by:bB);if(bx&&bB in bA){bA[bB]=false}}}}},attrHooks:{type:{set:function(e,bx){if(h.test(e.nodeName)&&e.parentNode){b.error("type property can't be changed")}else{if(!b.support.radioValue&&bx==="radio"&&b.nodeName(e,"input")){var by=e.value;e.setAttribute("type",bx);if(by){e.value=by}return bx}}}},value:{get:function(bx,e){if(bh&&b.nodeName(bx,"button")){return bh.get(bx,e)}return e in bx?bx.value:null},set:function(bx,by,e){if(bh&&b.nodeName(bx,"button")){return bh.set(bx,by,e)}bx.value=by}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(bB,bz,bC){var by,e,bA,bx=bB.nodeType;if(!bB||bx===3||bx===8||bx===2){return}bA=bx!==1||!b.isXMLDoc(bB);if(bA){bz=b.propFix[bz]||bz;e=b.propHooks[bz]}if(bC!==N){if(e&&"set" in e&&(by=e.set(bB,bC,bz))!==N){return by}else{return(bB[bz]=bC)}}else{if(e&&"get" in e&&(by=e.get(bB,bz))!==null){return by}else{return bB[bz]}}},propHooks:{tabIndex:{get:function(bx){var e=bx.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):E.test(bx.nodeName)||n.test(bx.nodeName)&&bx.href?0:N}}}});b.attrHooks.tabindex=b.propHooks.tabIndex;a1={get:function(bx,e){var bz,by=b.prop(bx,e);return by===true||typeof by!=="boolean"&&(bz=bx.getAttributeNode(e))&&bz.nodeValue!==false?e.toLowerCase():N},set:function(bx,bz,e){var by;if(bz===false){b.removeAttr(bx,e)}else{by=b.propFix[e]||e;if(by in bx){bx[by]=true}bx.setAttribute(e,e.toLowerCase())}return e}};if(!G){aI={name:true,id:true,coords:true};bh=b.valHooks.button={get:function(by,bx){var e;e=by.getAttributeNode(bx);return e&&(aI[bx]?e.nodeValue!=="":e.specified)?e.nodeValue:N},set:function(by,bz,bx){var e=by.getAttributeNode(bx);if(!e){e=ax.createAttribute(bx);by.setAttributeNode(e)}return(e.nodeValue=bz+"")}};b.attrHooks.tabindex.set=bh.set;b.each(["width","height"],function(bx,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{set:function(by,bz){if(bz===""){by.setAttribute(e,"auto");return bz}}})});b.attrHooks.contenteditable={get:bh.get,set:function(bx,by,e){if(by===""){by="false"}bh.set(bx,by,e)}}}if(!b.support.hrefNormalized){b.each(["href","src","width","height"],function(bx,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{get:function(bz){var by=bz.getAttribute(e,2);return by===null?N:by}})})}if(!b.support.style){b.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||N},set:function(e,bx){return(e.style.cssText=""+bx)}}}if(!b.support.optSelected){b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(bx){var e=bx.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null}})}if(!b.support.enctype){b.propFix.enctype="encoding"}if(!b.support.checkOn){b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}})}b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,bx){if(b.isArray(bx)){return(e.checked=b.inArray(b(e).val(),bx)>=0)}}})});var bg=/^(?:textarea|input|select)$/i,p=/^([^\.]*)?(?:\.(.+))?$/,L=/(?:^|\s)hover(\.\S+)?\b/,aR=/^key/,bi=/^(?:mouse|contextmenu)|click/,V=/^(?:focusinfocus|focusoutblur)$/,W=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,aa=function(e){var bx=W.exec(e);if(bx){bx[1]=(bx[1]||"").toLowerCase();bx[3]=bx[3]&&new RegExp("(?:^|\\s)"+bx[3]+"(?:\\s|$)")}return bx},l=function(by,e){var bx=by.attributes||{};return((!e[1]||by.nodeName.toLowerCase()===e[1])&&(!e[2]||(bx.id||{}).value===e[2])&&(!e[3]||e[3].test((bx["class"]||{}).value)))},bv=function(e){return b.event.special.hover?e:e.replace(L,"mouseenter$1 mouseleave$1")};b.event={add:function(bz,bE,bL,bC,bA){var bF,bD,bM,bK,bJ,bH,e,bI,bx,bB,by,bG;if(bz.nodeType===3||bz.nodeType===8||!bE||!bL||!(bF=b._data(bz))){return}if(bL.handler){bx=bL;bL=bx.handler;bA=bx.selector}if(!bL.guid){bL.guid=b.guid++}bM=bF.events;if(!bM){bF.events=bM={}}bD=bF.handle;if(!bD){bF.handle=bD=function(bN){return typeof b!=="undefined"&&(!bN||b.event.triggered!==bN.type)?b.event.dispatch.apply(bD.elem,arguments):N};bD.elem=bz}bE=b.trim(bv(bE)).split(" ");for(bK=0;bK<bE.length;bK++){bJ=p.exec(bE[bK])||[];bH=bJ[1];e=(bJ[2]||"").split(".").sort();bG=b.event.special[bH]||{};bH=(bA?bG.delegateType:bG.bindType)||bH;bG=b.event.special[bH]||{};bI=b.extend({type:bH,origType:bJ[1],data:bC,handler:bL,guid:bL.guid,selector:bA,quick:bA&&aa(bA),namespace:e.join(".")},bx);by=bM[bH];if(!by){by=bM[bH]=[];by.delegateCount=0;if(!bG.setup||bG.setup.call(bz,bC,e,bD)===false){if(bz.addEventListener){bz.addEventListener(bH,bD,false)}else{if(bz.attachEvent){bz.attachEvent("on"+bH,bD)}}}}if(bG.add){bG.add.call(bz,bI);if(!bI.handler.guid){bI.handler.guid=bL.guid}}if(bA){by.splice(by.delegateCount++,0,bI)}else{by.push(bI)}b.event.global[bH]=true}bz=null},global:{},remove:function(bL,bG,bx,bJ,bD){var bK=b.hasData(bL)&&b._data(bL),bH,bz,bB,bN,bE,bC,bI,by,bA,bM,bF,e;if(!bK||!(by=bK.events)){return}bG=b.trim(bv(bG||"")).split(" ");for(bH=0;bH<bG.length;bH++){bz=p.exec(bG[bH])||[];bB=bN=bz[1];bE=bz[2];if(!bB){for(bB in by){b.event.remove(bL,bB+bG[bH],bx,bJ,true)}continue}bA=b.event.special[bB]||{};bB=(bJ?bA.delegateType:bA.bindType)||bB;bF=by[bB]||[];bC=bF.length;bE=bE?new RegExp("(^|\\.)"+bE.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(bI=0;bI<bF.length;bI++){e=bF[bI];if((bD||bN===e.origType)&&(!bx||bx.guid===e.guid)&&(!bE||bE.test(e.namespace))&&(!bJ||bJ===e.selector||bJ==="**"&&e.selector)){bF.splice(bI--,1);if(e.selector){bF.delegateCount--}if(bA.remove){bA.remove.call(bL,e)}}}if(bF.length===0&&bC!==bF.length){if(!bA.teardown||bA.teardown.call(bL,bE)===false){b.removeEvent(bL,bB,bK.handle)}delete by[bB]}}if(b.isEmptyObject(by)){bM=bK.handle;if(bM){bM.elem=null}b.removeData(bL,["events","handle"],true)}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(bx,bF,bC,bL){if(bC&&(bC.nodeType===3||bC.nodeType===8)){return}var bI=bx.type||bx,bz=[],e,by,bE,bJ,bB,bA,bH,bG,bD,bK;if(V.test(bI+b.event.triggered)){return}if(bI.indexOf("!")>=0){bI=bI.slice(0,-1);by=true}if(bI.indexOf(".")>=0){bz=bI.split(".");bI=bz.shift();bz.sort()}if((!bC||b.event.customEvent[bI])&&!b.event.global[bI]){return}bx=typeof bx==="object"?bx[b.expando]?bx:new b.Event(bI,bx):new b.Event(bI);bx.type=bI;bx.isTrigger=true;bx.exclusive=by;bx.namespace=bz.join(".");bx.namespace_re=bx.namespace?new RegExp("(^|\\.)"+bz.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;bA=bI.indexOf(":")<0?"on"+bI:"";if(!bC){e=b.cache;for(bE in e){if(e[bE].events&&e[bE].events[bI]){b.event.trigger(bx,bF,e[bE].handle.elem,true)}}return}bx.result=N;if(!bx.target){bx.target=bC}bF=bF!=null?b.makeArray(bF):[];bF.unshift(bx);bH=b.event.special[bI]||{};if(bH.trigger&&bH.trigger.apply(bC,bF)===false){return}bD=[[bC,bH.bindType||bI]];if(!bL&&!bH.noBubble&&!b.isWindow(bC)){bK=bH.delegateType||bI;bJ=V.test(bK+bI)?bC:bC.parentNode;bB=null;for(;bJ;bJ=bJ.parentNode){bD.push([bJ,bK]);bB=bJ}if(bB&&bB===bC.ownerDocument){bD.push([bB.defaultView||bB.parentWindow||bf,bK])}}for(bE=0;bE<bD.length&&!bx.isPropagationStopped();bE++){bJ=bD[bE][0];bx.type=bD[bE][1];bG=(b._data(bJ,"events")||{})[bx.type]&&b._data(bJ,"handle");if(bG){bG.apply(bJ,bF)}bG=bA&&bJ[bA];if(bG&&b.acceptData(bJ)&&bG.apply(bJ,bF)===false){bx.preventDefault()}}bx.type=bI;if(!bL&&!bx.isDefaultPrevented()){if((!bH._default||bH._default.apply(bC.ownerDocument,bF)===false)&&!(bI==="click"&&b.nodeName(bC,"a"))&&b.acceptData(bC)){if(bA&&bC[bI]&&((bI!=="focus"&&bI!=="blur")||bx.target.offsetWidth!==0)&&!b.isWindow(bC)){bB=bC[bA];if(bB){bC[bA]=null}b.event.triggered=bI;bC[bI]();b.event.triggered=N;if(bB){bC[bA]=bB}}}}return bx.result},dispatch:function(bJ){bJ=b.event.fix(bJ||bf.event);var bF=((b._data(this,"events")||{})[bJ.type]||[]),bE=bF.delegateCount,bz=[].slice.call(arguments,0),bG=!bJ.exclusive&&!bJ.namespace,bB=b.event.special[bJ.type]||{},bx=[],bL,bI,bA,bC,bM,bK,bD,by,e,bH,bN;bz[0]=bJ;bJ.delegateTarget=this;if(bB.preDispatch&&bB.preDispatch.call(this,bJ)===false){return}if(bE&&!(bJ.button&&bJ.type==="click")){bC=b(this);bC.context=this.ownerDocument||this;for(bA=bJ.target;bA!=this;bA=bA.parentNode||this){if(bA.disabled!==true){bK={};by=[];bC[0]=bA;for(bL=0;bL<bE;bL++){e=bF[bL];bH=e.selector;if(bK[bH]===N){bK[bH]=(e.quick?l(bA,e.quick):bC.is(bH))}if(bK[bH]){by.push(e)}}if(by.length){bx.push({elem:bA,matches:by})}}}}if(bF.length>bE){bx.push({elem:this,matches:bF.slice(bE)})}for(bL=0;bL<bx.length&&!bJ.isPropagationStopped();bL++){bD=bx[bL];bJ.currentTarget=bD.elem;for(bI=0;bI<bD.matches.length&&!bJ.isImmediatePropagationStopped();bI++){e=bD.matches[bI];if(bG||(!bJ.namespace&&!e.namespace)||bJ.namespace_re&&bJ.namespace_re.test(e.namespace)){bJ.data=e.data;bJ.handleObj=e;bM=((b.event.special[e.origType]||{}).handle||e.handler).apply(bD.elem,bz);if(bM!==N){bJ.result=bM;if(bM===false){bJ.preventDefault();bJ.stopPropagation()}}}}}if(bB.postDispatch){bB.postDispatch.call(this,bJ)}return bJ.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(bx,e){if(bx.which==null){bx.which=e.charCode!=null?e.charCode:e.keyCode}return bx}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(bz,by){var bA,bB,e,bx=by.button,bC=by.fromElement;if(bz.pageX==null&&by.clientX!=null){bA=bz.target.ownerDocument||ax;bB=bA.documentElement;e=bA.body;bz.pageX=by.clientX+(bB&&bB.scrollLeft||e&&e.scrollLeft||0)-(bB&&bB.clientLeft||e&&e.clientLeft||0);bz.pageY=by.clientY+(bB&&bB.scrollTop||e&&e.scrollTop||0)-(bB&&bB.clientTop||e&&e.clientTop||0)}if(!bz.relatedTarget&&bC){bz.relatedTarget=bC===bz.target?by.toElement:bC}if(!bz.which&&bx!==N){bz.which=(bx&1?1:(bx&2?3:(bx&4?2:0)))}return bz}},fix:function(by){if(by[b.expando]){return by}var bx,bB,e=by,bz=b.event.fixHooks[by.type]||{},bA=bz.props?this.props.concat(bz.props):this.props;by=b.Event(e);for(bx=bA.length;bx;){bB=bA[--bx];by[bB]=e[bB]}if(!by.target){by.target=e.srcElement||ax}if(by.target.nodeType===3){by.target=by.target.parentNode}if(by.metaKey===N){by.metaKey=by.ctrlKey}return bz.filter?bz.filter(by,e):by},special:{ready:{setup:b.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(by,bx,e){if(b.isWindow(this)){this.onbeforeunload=e}},teardown:function(bx,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}},simulate:function(by,bA,bz,bx){var bB=b.extend(new b.Event(),bz,{type:by,isSimulated:true,originalEvent:{}});if(bx){b.event.trigger(bB,null,bA)}else{b.event.dispatch.call(bA,bB)}if(bB.isDefaultPrevented()){bz.preventDefault()}}};b.event.handle=b.event.dispatch;b.removeEvent=ax.removeEventListener?function(bx,e,by){if(bx.removeEventListener){bx.removeEventListener(e,by,false)}}:function(bx,e,by){if(bx.detachEvent){bx.detachEvent("on"+e,by)}};b.Event=function(bx,e){if(!(this instanceof b.Event)){return new b.Event(bx,e)}if(bx&&bx.type){this.originalEvent=bx;this.type=bx.type;this.isDefaultPrevented=(bx.defaultPrevented||bx.returnValue===false||bx.getPreventDefault&&bx.getPreventDefault())?k:bn}else{this.type=bx}if(e){b.extend(this,e)}this.timeStamp=bx&&bx.timeStamp||b.now();this[b.expando]=true};function bn(){return false}function k(){return true}b.Event.prototype={preventDefault:function(){this.isDefaultPrevented=k;var bx=this.originalEvent;if(!bx){return}if(bx.preventDefault){bx.preventDefault()}else{bx.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=k;var bx=this.originalEvent;if(!bx){return}if(bx.stopPropagation){bx.stopPropagation()}bx.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()},isDefaultPrevented:bn,isPropagationStopped:bn,isImmediatePropagationStopped:bn};b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bx,e){b.event.special[bx]={delegateType:e,bindType:e,handle:function(bB){var bD=this,bC=bB.relatedTarget,bA=bB.handleObj,by=bA.selector,bz;if(!bC||(bC!==bD&&!b.contains(bD,bC))){bB.type=bA.origType;bz=bA.handler.apply(this,arguments);bB.type=e}return bz}}});if(!b.support.submitBubbles){b.event.special.submit={setup:function(){if(b.nodeName(this,"form")){return false}b.event.add(this,"click._submit keypress._submit",function(bz){var by=bz.target,bx=b.nodeName(by,"input")||b.nodeName(by,"button")?by.form:N;if(bx&&!bx._submit_attached){b.event.add(bx,"submit._submit",function(e){e._submit_bubble=true});bx._submit_attached=true}})},postDispatch:function(e){if(e._submit_bubble){delete e._submit_bubble;if(this.parentNode&&!e.isTrigger){b.event.simulate("submit",this.parentNode,e,true)}}},teardown:function(){if(b.nodeName(this,"form")){return false}b.event.remove(this,"._submit")}}}if(!b.support.changeBubbles){b.event.special.change={setup:function(){if(bg.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){b.event.add(this,"propertychange._change",function(e){if(e.originalEvent.propertyName==="checked"){this._just_changed=true}});b.event.add(this,"click._change",function(e){if(this._just_changed&&!e.isTrigger){this._just_changed=false;b.event.simulate("change",this,e,true)}})}return false}b.event.add(this,"beforeactivate._change",function(by){var bx=by.target;if(bg.test(bx.nodeName)&&!bx._change_attached){b.event.add(bx,"change._change",function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){b.event.simulate("change",this.parentNode,e,true)}});bx._change_attached=true}})},handle:function(bx){var e=bx.target;if(this!==e||bx.isSimulated||bx.isTrigger||(e.type!=="radio"&&e.type!=="checkbox")){return bx.handleObj.handler.apply(this,arguments)}},teardown:function(){b.event.remove(this,"._change");return bg.test(this.nodeName)}}}if(!b.support.focusinBubbles){b.each({focus:"focusin",blur:"focusout"},function(bz,e){var bx=0,by=function(bA){b.event.simulate(e,bA.target,b.event.fix(bA),true)};b.event.special[e]={setup:function(){if(bx++===0){ax.addEventListener(bz,by,true)}},teardown:function(){if(--bx===0){ax.removeEventListener(bz,by,true)}}}})}b.fn.extend({on:function(by,e,bB,bA,bx){var bC,bz;if(typeof by==="object"){if(typeof e!=="string"){bB=bB||e;e=N}for(bz in by){this.on(bz,e,bB,by[bz],bx)}return this}if(bB==null&&bA==null){bA=e;bB=e=N}else{if(bA==null){if(typeof e==="string"){bA=bB;bB=N}else{bA=bB;bB=e;e=N}}}if(bA===false){bA=bn}else{if(!bA){return this}}if(bx===1){bC=bA;bA=function(bD){b().off(bD);return bC.apply(this,arguments)};bA.guid=bC.guid||(bC.guid=b.guid++)}return this.each(function(){b.event.add(this,by,bA,bB,e)})},one:function(bx,e,bz,by){return this.on(bx,e,bz,by,1)},off:function(by,e,bA){if(by&&by.preventDefault&&by.handleObj){var bx=by.handleObj;b(by.delegateTarget).off(bx.namespace?bx.origType+"."+bx.namespace:bx.origType,bx.selector,bx.handler);return this}if(typeof by==="object"){for(var bz in by){this.off(bz,e,by[bz])}return this}if(e===false||typeof e==="function"){bA=e;e=N}if(bA===false){bA=bn}return this.each(function(){b.event.remove(this,by,bA,e)})},bind:function(e,by,bx){return this.on(e,null,by,bx)},unbind:function(e,bx){return this.off(e,null,bx)},live:function(e,by,bx){b(this.context).on(e,this.selector,by,bx);return this},die:function(e,bx){b(this.context).off(e,this.selector||"**",bx);return this},delegate:function(e,bx,bz,by){return this.on(bx,e,bz,by)},undelegate:function(e,bx,by){return arguments.length==1?this.off(e,"**"):this.off(bx,e,by)},trigger:function(e,bx){return this.each(function(){b.event.trigger(e,bx,this)})},triggerHandler:function(e,bx){if(this[0]){return b.event.trigger(e,bx,this[0],true)}},toggle:function(bz){var bx=arguments,e=bz.guid||b.guid++,by=0,bA=function(bB){var bC=(b._data(this,"lastToggle"+bz.guid)||0)%by;b._data(this,"lastToggle"+bz.guid,bC+1);bB.preventDefault();return bx[bC].apply(this,arguments)||false};bA.guid=e;while(by<bx.length){bx[by++].guid=e}return this.click(bA)},hover:function(e,bx){return this.mouseenter(e).mouseleave(bx||e)}});b.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu").split(" "),function(bx,e){b.fn[e]=function(bz,by){if(by==null){by=bz;bz=null}return arguments.length>0?this.on(e,null,bz,by):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aR.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bi.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}});
/*
 * Sizzle CSS Selector Engine
 *  Copyright 2011, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var bJ=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bE="sizcache"+(Math.random()+"").replace(".",""),bK=0,bN=Object.prototype.toString,bD=false,bC=true,bM=/\\/g,bQ=/\r\n/g,bS=/\W/;[0,0].sort(function(){bC=false;return 0});var bA=function(bX,e,b0,b1){b0=b0||[];e=e||ax;var b3=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bX||typeof bX!=="string"){return b0}var bU,b5,b8,bT,b4,b7,b6,bZ,bW=true,bV=bA.isXML(e),bY=[],b2=bX;do{bJ.exec("");bU=bJ.exec(b2);if(bU){b2=bU[3];bY.push(bU[1]);if(bU[2]){bT=bU[3];break}}}while(bU);if(bY.length>1&&bF.exec(bX)){if(bY.length===2&&bG.relative[bY[0]]){b5=bO(bY[0]+bY[1],e,b1)}else{b5=bG.relative[bY[0]]?[e]:bA(bY.shift(),e);while(bY.length){bX=bY.shift();if(bG.relative[bX]){bX+=bY.shift()}b5=bO(bX,b5,b1)}}}else{if(!b1&&bY.length>1&&e.nodeType===9&&!bV&&bG.match.ID.test(bY[0])&&!bG.match.ID.test(bY[bY.length-1])){b4=bA.find(bY.shift(),e,bV);e=b4.expr?bA.filter(b4.expr,b4.set)[0]:b4.set[0]}if(e){b4=b1?{expr:bY.pop(),set:bH(b1)}:bA.find(bY.pop(),bY.length===1&&(bY[0]==="~"||bY[0]==="+")&&e.parentNode?e.parentNode:e,bV);b5=b4.expr?bA.filter(b4.expr,b4.set):b4.set;if(bY.length>0){b8=bH(b5)}else{bW=false}while(bY.length){b7=bY.pop();b6=b7;if(!bG.relative[b7]){b7=""}else{b6=bY.pop()}if(b6==null){b6=e}bG.relative[b7](b8,b6,bV)}}else{b8=bY=[]}}if(!b8){b8=b5}if(!b8){bA.error(b7||bX)}if(bN.call(b8)==="[object Array]"){if(!bW){b0.push.apply(b0,b8)}else{if(e&&e.nodeType===1){for(bZ=0;b8[bZ]!=null;bZ++){if(b8[bZ]&&(b8[bZ]===true||b8[bZ].nodeType===1&&bA.contains(e,b8[bZ]))){b0.push(b5[bZ])}}}else{for(bZ=0;b8[bZ]!=null;bZ++){if(b8[bZ]&&b8[bZ].nodeType===1){b0.push(b5[bZ])}}}}}else{bH(b8,b0)}if(bT){bA(bT,b3,b0,b1);bA.uniqueSort(b0)}return b0};bA.uniqueSort=function(bT){if(bL){bD=bC;bT.sort(bL);if(bD){for(var e=1;e<bT.length;e++){if(bT[e]===bT[e-1]){bT.splice(e--,1)}}}}return bT};bA.matches=function(e,bT){return bA(e,null,null,bT)};bA.matchesSelector=function(e,bT){return bA(bT,null,null,[e]).length>0};bA.find=function(bZ,e,b0){var bY,bU,bW,bV,bX,bT;if(!bZ){return[]}for(bU=0,bW=bG.order.length;bU<bW;bU++){bX=bG.order[bU];if((bV=bG.leftMatch[bX].exec(bZ))){bT=bV[1];bV.splice(1,1);if(bT.substr(bT.length-1)!=="\\"){bV[1]=(bV[1]||"").replace(bM,"");bY=bG.find[bX](bV,e,b0);if(bY!=null){bZ=bZ.replace(bG.match[bX],"");break}}}}if(!bY){bY=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:bY,expr:bZ}};bA.filter=function(b3,b2,b6,bW){var bY,e,b1,b8,b5,bT,bV,bX,b4,bU=b3,b7=[],b0=b2,bZ=b2&&b2[0]&&bA.isXML(b2[0]);while(b3&&b2.length){for(b1 in bG.filter){if((bY=bG.leftMatch[b1].exec(b3))!=null&&bY[2]){bT=bG.filter[b1];bV=bY[1];e=false;bY.splice(1,1);if(bV.substr(bV.length-1)==="\\"){continue}if(b0===b7){b7=[]}if(bG.preFilter[b1]){bY=bG.preFilter[b1](bY,b0,b6,b7,bW,bZ);if(!bY){e=b8=true}else{if(bY===true){continue}}}if(bY){for(bX=0;(b5=b0[bX])!=null;bX++){if(b5){b8=bT(b5,bY,bX,b0);b4=bW^b8;if(b6&&b8!=null){if(b4){e=true}else{b0[bX]=false}}else{if(b4){b7.push(b5);e=true}}}}}if(b8!==N){if(!b6){b0=b7}b3=b3.replace(bG.match[b1],"");if(!e){return[]}break}}}if(b3===bU){if(e==null){bA.error(b3)}else{break}}bU=b3}return b0};bA.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var by=bA.getText=function(bW){var bU,bV,e=bW.nodeType,bT="";if(e){if(e===1||e===9||e===11){if(typeof bW.textContent==="string"){return bW.textContent}else{if(typeof bW.innerText==="string"){return bW.innerText.replace(bQ,"")}else{for(bW=bW.firstChild;bW;bW=bW.nextSibling){bT+=by(bW)}}}}else{if(e===3||e===4){return bW.nodeValue}}}else{for(bU=0;(bV=bW[bU]);bU++){if(bV.nodeType!==8){bT+=by(bV)}}}return bT};var bG=bA.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(bY,bT){var bV=typeof bT==="string",bX=bV&&!bS.test(bT),bZ=bV&&!bX;if(bX){bT=bT.toLowerCase()}for(var bU=0,e=bY.length,bW;bU<e;bU++){if((bW=bY[bU])){while((bW=bW.previousSibling)&&bW.nodeType!==1){}bY[bU]=bZ||bW&&bW.nodeName.toLowerCase()===bT?bW||false:bW===bT}}if(bZ){bA.filter(bT,bY,true)}},">":function(bY,bT){var bX,bW=typeof bT==="string",bU=0,e=bY.length;if(bW&&!bS.test(bT)){bT=bT.toLowerCase();for(;bU<e;bU++){bX=bY[bU];if(bX){var bV=bX.parentNode;bY[bU]=bV.nodeName.toLowerCase()===bT?bV:false}}}else{for(;bU<e;bU++){bX=bY[bU];if(bX){bY[bU]=bW?bX.parentNode:bX.parentNode===bT}}if(bW){bA.filter(bT,bY,true)}}},"":function(bV,bT,bX){var bW,bU=bK++,e=bP;if(typeof bT==="string"&&!bS.test(bT)){bT=bT.toLowerCase();bW=bT;e=bx}e("parentNode",bT,bU,bV,bW,bX)},"~":function(bV,bT,bX){var bW,bU=bK++,e=bP;if(typeof bT==="string"&&!bS.test(bT)){bT=bT.toLowerCase();bW=bT;e=bx}e("previousSibling",bT,bU,bV,bW,bX)}},find:{ID:function(bT,bU,bV){if(typeof bU.getElementById!=="undefined"&&!bV){var e=bU.getElementById(bT[1]);return e&&e.parentNode?[e]:[]}},NAME:function(bU,bX){if(typeof bX.getElementsByName!=="undefined"){var bT=[],bW=bX.getElementsByName(bU[1]);for(var bV=0,e=bW.length;bV<e;bV++){if(bW[bV].getAttribute("name")===bU[1]){bT.push(bW[bV])}}return bT.length===0?null:bT}},TAG:function(e,bT){if(typeof bT.getElementsByTagName!=="undefined"){return bT.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(bV,bT,bU,e,bY,bZ){bV=" "+bV[1].replace(bM,"")+" ";if(bZ){return bV}for(var bW=0,bX;(bX=bT[bW])!=null;bW++){if(bX){if(bY^(bX.className&&(" "+bX.className+" ").replace(/[\t\n\r]/g," ").indexOf(bV)>=0)){if(!bU){e.push(bX)}}else{if(bU){bT[bW]=false}}}}return false},ID:function(e){return e[1].replace(bM,"")},TAG:function(bT,e){return bT[1].replace(bM,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){bA.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bT=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bT[1]+(bT[2]||1))-0;e[3]=bT[3]-0}else{if(e[2]){bA.error(e[0])}}e[0]=bK++;return e},ATTR:function(bW,bT,bU,e,bX,bY){var bV=bW[1]=bW[1].replace(bM,"");if(!bY&&bG.attrMap[bV]){bW[1]=bG.attrMap[bV]}bW[4]=(bW[4]||bW[5]||"").replace(bM,"");if(bW[2]==="~="){bW[4]=" "+bW[4]+" "}return bW},PSEUDO:function(bW,bT,bU,e,bX){if(bW[1]==="not"){if((bJ.exec(bW[3])||"").length>1||/^\w/.test(bW[3])){bW[3]=bA(bW[3],null,null,bT)}else{var bV=bA.filter(bW[3],bT,bU,true^bX);if(!bU){e.push.apply(e,bV)}return false}}else{if(bG.match.POS.test(bW[0])||bG.match.CHILD.test(bW[0])){return true}}return bW},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bU,bT,e){return !!bA(e[3],bU).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bU){var e=bU.getAttribute("type"),bT=bU.type;return bU.nodeName.toLowerCase()==="input"&&"text"===bT&&(e===bT||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bT){var e=bT.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bT.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bT){var e=bT.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bT.type},button:function(bT){var e=bT.nodeName.toLowerCase();return e==="input"&&"button"===bT.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bT,e){return e===0},last:function(bU,bT,e,bV){return bT===bV.length-1},even:function(bT,e){return e%2===0},odd:function(bT,e){return e%2===1},lt:function(bU,bT,e){return bT<e[3]-0},gt:function(bU,bT,e){return bT>e[3]-0},nth:function(bU,bT,e){return e[3]-0===bT},eq:function(bU,bT,e){return e[3]-0===bT}},filter:{PSEUDO:function(bU,bZ,bY,b0){var e=bZ[1],bT=bG.filters[e];if(bT){return bT(bU,bY,bZ,b0)}else{if(e==="contains"){return(bU.textContent||bU.innerText||by([bU])||"").indexOf(bZ[3])>=0}else{if(e==="not"){var bV=bZ[3];for(var bX=0,bW=bV.length;bX<bW;bX++){if(bV[bX]===bU){return false}}return true}else{bA.error(e)}}}},CHILD:function(bU,bW){var bV,b2,bY,b1,e,bX,b0,bZ=bW[1],bT=bU;switch(bZ){case"only":case"first":while((bT=bT.previousSibling)){if(bT.nodeType===1){return false}}if(bZ==="first"){return true}bT=bU;case"last":while((bT=bT.nextSibling)){if(bT.nodeType===1){return false}}return true;case"nth":bV=bW[2];b2=bW[3];if(bV===1&&b2===0){return true}bY=bW[0];b1=bU.parentNode;if(b1&&(b1[bE]!==bY||!bU.nodeIndex)){bX=0;for(bT=b1.firstChild;bT;bT=bT.nextSibling){if(bT.nodeType===1){bT.nodeIndex=++bX}}b1[bE]=bY}b0=bU.nodeIndex-b2;if(bV===0){return b0===0}else{return(b0%bV===0&&b0/bV>=0)}}},ID:function(bT,e){return bT.nodeType===1&&bT.getAttribute("id")===e},TAG:function(bT,e){return(e==="*"&&bT.nodeType===1)||!!bT.nodeName&&bT.nodeName.toLowerCase()===e},CLASS:function(bT,e){return(" "+(bT.className||bT.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bX,bV){var bU=bV[1],e=bA.attr?bA.attr(bX,bU):bG.attrHandle[bU]?bG.attrHandle[bU](bX):bX[bU]!=null?bX[bU]:bX.getAttribute(bU),bY=e+"",bW=bV[2],bT=bV[4];return e==null?bW==="!=":!bW&&bA.attr?e!=null:bW==="="?bY===bT:bW==="*="?bY.indexOf(bT)>=0:bW==="~="?(" "+bY+" ").indexOf(bT)>=0:!bT?bY&&e!==false:bW==="!="?bY!==bT:bW==="^="?bY.indexOf(bT)===0:bW==="$="?bY.substr(bY.length-bT.length)===bT:bW==="|="?bY===bT||bY.substr(0,bT.length+1)===bT+"-":false},POS:function(bW,bT,bU,bX){var e=bT[2],bV=bG.setFilters[e];if(bV){return bV(bW,bU,bT,bX)}}}};var bF=bG.match.POS,bz=function(bT,e){return"\\"+(e-0+1)};for(var bB in bG.match){bG.match[bB]=new RegExp(bG.match[bB].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bG.leftMatch[bB]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bG.match[bB].source.replace(/\\(\d+)/g,bz))}bG.match.globalPOS=bF;var bH=function(bT,e){bT=Array.prototype.slice.call(bT,0);if(e){e.push.apply(e,bT);return e}return bT};try{Array.prototype.slice.call(ax.documentElement.childNodes,0)[0].nodeType}catch(bR){bH=function(bW,bV){var bU=0,bT=bV||[];if(bN.call(bW)==="[object Array]"){Array.prototype.push.apply(bT,bW)}else{if(typeof bW.length==="number"){for(var e=bW.length;bU<e;bU++){bT.push(bW[bU])}}else{for(;bW[bU];bU++){bT.push(bW[bU])}}}return bT}}var bL,bI;if(ax.documentElement.compareDocumentPosition){bL=function(bT,e){if(bT===e){bD=true;return 0}if(!bT.compareDocumentPosition||!e.compareDocumentPosition){return bT.compareDocumentPosition?-1:1}return bT.compareDocumentPosition(e)&4?-1:1}}else{bL=function(b0,bZ){if(b0===bZ){bD=true;return 0}else{if(b0.sourceIndex&&bZ.sourceIndex){return b0.sourceIndex-bZ.sourceIndex}}var bX,bT,bU=[],e=[],bW=b0.parentNode,bY=bZ.parentNode,b1=bW;if(bW===bY){return bI(b0,bZ)}else{if(!bW){return -1}else{if(!bY){return 1}}}while(b1){bU.unshift(b1);b1=b1.parentNode}b1=bY;while(b1){e.unshift(b1);b1=b1.parentNode}bX=bU.length;bT=e.length;for(var bV=0;bV<bX&&bV<bT;bV++){if(bU[bV]!==e[bV]){return bI(bU[bV],e[bV])}}return bV===bX?bI(b0,e[bV],-1):bI(bU[bV],bZ,1)};bI=function(bT,e,bU){if(bT===e){return bU}var bV=bT.nextSibling;while(bV){if(bV===e){return -1}bV=bV.nextSibling}return 1}}(function(){var bT=ax.createElement("div"),bU="script"+(new Date()).getTime(),e=ax.documentElement;bT.innerHTML="<a name='"+bU+"'/>";e.insertBefore(bT,e.firstChild);if(ax.getElementById(bU)){bG.find.ID=function(bW,bX,bY){if(typeof bX.getElementById!=="undefined"&&!bY){var bV=bX.getElementById(bW[1]);return bV?bV.id===bW[1]||typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id").nodeValue===bW[1]?[bV]:N:[]}};bG.filter.ID=function(bX,bV){var bW=typeof bX.getAttributeNode!=="undefined"&&bX.getAttributeNode("id");return bX.nodeType===1&&bW&&bW.nodeValue===bV}}e.removeChild(bT);e=bT=null})();(function(){var e=ax.createElement("div");e.appendChild(ax.createComment(""));if(e.getElementsByTagName("*").length>0){bG.find.TAG=function(bT,bX){var bW=bX.getElementsByTagName(bT[1]);if(bT[1]==="*"){var bV=[];for(var bU=0;bW[bU];bU++){if(bW[bU].nodeType===1){bV.push(bW[bU])}}bW=bV}return bW}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bG.attrHandle.href=function(bT){return bT.getAttribute("href",2)}}e=null})();if(ax.querySelectorAll){(function(){var e=bA,bV=ax.createElement("div"),bU="__sizzle__";bV.innerHTML="<p class='TEST'></p>";if(bV.querySelectorAll&&bV.querySelectorAll(".TEST").length===0){return}bA=function(b6,bX,b1,b5){bX=bX||ax;if(!b5&&!bA.isXML(bX)){var b4=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b6);if(b4&&(bX.nodeType===1||bX.nodeType===9)){if(b4[1]){return bH(bX.getElementsByTagName(b6),b1)}else{if(b4[2]&&bG.find.CLASS&&bX.getElementsByClassName){return bH(bX.getElementsByClassName(b4[2]),b1)}}}if(bX.nodeType===9){if(b6==="body"&&bX.body){return bH([bX.body],b1)}else{if(b4&&b4[3]){var b0=bX.getElementById(b4[3]);if(b0&&b0.parentNode){if(b0.id===b4[3]){return bH([b0],b1)}}else{return bH([],b1)}}}try{return bH(bX.querySelectorAll(b6),b1)}catch(b2){}}else{if(bX.nodeType===1&&bX.nodeName.toLowerCase()!=="object"){var bY=bX,bZ=bX.getAttribute("id"),bW=bZ||bU,b8=bX.parentNode,b7=/^\s*[+~]/.test(b6);if(!bZ){bX.setAttribute("id",bW)}else{bW=bW.replace(/'/g,"\\$&")}if(b7&&b8){bX=bX.parentNode}try{if(!b7||b8){return bH(bX.querySelectorAll("[id='"+bW+"'] "+b6),b1)}}catch(b3){}finally{if(!bZ){bY.removeAttribute("id")}}}}}return e(b6,bX,b1,b5)};for(var bT in e){bA[bT]=e[bT]}bV=null})()}(function(){var e=ax.documentElement,bU=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bU){var bW=!bU.call(ax.createElement("div"),"div"),bT=false;try{bU.call(ax.documentElement,"[test!='']:sizzle")}catch(bV){bT=true}bA.matchesSelector=function(bY,b0){b0=b0.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!bA.isXML(bY)){try{if(bT||!bG.match.PSEUDO.test(b0)&&!/!=/.test(b0)){var bX=bU.call(bY,b0);if(bX||!bW||bY.document&&bY.document.nodeType!==11){return bX}}}catch(bZ){}}return bA(b0,null,null,[bY]).length>0}}})();(function(){var e=ax.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bG.order.splice(1,0,"CLASS");bG.find.CLASS=function(bT,bU,bV){if(typeof bU.getElementsByClassName!=="undefined"&&!bV){return bU.getElementsByClassName(bT[1])}};e=null})();function bx(bT,bY,bX,b1,bZ,b0){for(var bV=0,bU=b1.length;bV<bU;bV++){var e=b1[bV];if(e){var bW=false;e=e[bT];while(e){if(e[bE]===bX){bW=b1[e.sizset];break}if(e.nodeType===1&&!b0){e[bE]=bX;e.sizset=bV}if(e.nodeName.toLowerCase()===bY){bW=e;break}e=e[bT]}b1[bV]=bW}}}function bP(bT,bY,bX,b1,bZ,b0){for(var bV=0,bU=b1.length;bV<bU;bV++){var e=b1[bV];if(e){var bW=false;e=e[bT];while(e){if(e[bE]===bX){bW=b1[e.sizset];break}if(e.nodeType===1){if(!b0){e[bE]=bX;e.sizset=bV}if(typeof bY!=="string"){if(e===bY){bW=true;break}}else{if(bA.filter(bY,[e]).length>0){bW=e;break}}}e=e[bT]}b1[bV]=bW}}}if(ax.documentElement.contains){bA.contains=function(bT,e){return bT!==e&&(bT.contains?bT.contains(e):true)}}else{if(ax.documentElement.compareDocumentPosition){bA.contains=function(bT,e){return !!(bT.compareDocumentPosition(e)&16)}}else{bA.contains=function(){return false}}}bA.isXML=function(e){var bT=(e?e.ownerDocument||e:0).documentElement;return bT?bT.nodeName!=="HTML":false};var bO=function(bU,e,bY){var bX,bZ=[],bW="",b0=e.nodeType?[e]:e;while((bX=bG.match.PSEUDO.exec(bU))){bW+=bX[0];bU=bU.replace(bG.match.PSEUDO,"")}bU=bG.relative[bU]?bU+"*":bU;for(var bV=0,bT=b0.length;bV<bT;bV++){bA(bU,b0[bV],bZ,bY)}return bA.filter(bW,bZ)};bA.attr=b.attr;bA.selectors.attrMap={};b.find=bA;b.expr=bA.selectors;b.expr[":"]=b.expr.filters;b.unique=bA.uniqueSort;b.text=bA.getText;b.isXMLDoc=bA.isXML;b.contains=bA.contains})();var ad=/Until$/,at=/^(?:parents|prevUntil|prevAll)/,bd=/,/,br=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,J=b.expr.match.globalPOS,aA={children:true,contents:true,next:true,prev:true};b.fn.extend({find:function(e){var by=this,bA,bx;if(typeof e!=="string"){return b(e).filter(function(){for(bA=0,bx=by.length;bA<bx;bA++){if(b.contains(by[bA],this)){return true}}})}var bz=this.pushStack("","find",e),bC,bD,bB;for(bA=0,bx=this.length;bA<bx;bA++){bC=bz.length;b.find(e,this[bA],bz);if(bA>0){for(bD=bC;bD<bz.length;bD++){for(bB=0;bB<bC;bB++){if(bz[bB]===bz[bD]){bz.splice(bD--,1);break}}}}}return bz},has:function(bx){var e=b(bx);return this.filter(function(){for(var bz=0,by=e.length;bz<by;bz++){if(b.contains(this,e[bz])){return true}}})},not:function(e){return this.pushStack(aJ(this,e,false),"not",e)},filter:function(e){return this.pushStack(aJ(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?J.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(bA,bz){var bx=[],by,e,bB=this[0];if(b.isArray(bA)){var bD=1;while(bB&&bB.ownerDocument&&bB!==bz){for(by=0;by<bA.length;by++){if(b(bB).is(bA[by])){bx.push({selector:bA[by],elem:bB,level:bD})}}bB=bB.parentNode;bD++}return bx}var bC=J.test(bA)||typeof bA!=="string"?b(bA,bz||this.context):0;for(by=0,e=this.length;by<e;by++){bB=this[by];while(bB){if(bC?bC.index(bB)>-1:b.find.matchesSelector(bB,bA)){bx.push(bB);break}else{bB=bB.parentNode;if(!bB||!bB.ownerDocument||bB===bz||bB.nodeType===11){break}}}}bx=bx.length>1?b.unique(bx):bx;return this.pushStack(bx,"closest",bA)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bx){var bz=typeof e==="string"?b(e,bx):b.makeArray(e&&e.nodeType?[e]:e),by=b.merge(this.get(),bz);return this.pushStack(D(bz[0])||D(by[0])?by:b.unique(by))},andSelf:function(){return this.add(this.prevObject)}});function D(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bx){var e=bx.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bx,e,by){return b.dir(bx,"parentNode",by)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bx,e,by){return b.dir(bx,"nextSibling",by)},prevUntil:function(bx,e,by){return b.dir(bx,"previousSibling",by)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bx){b.fn[e]=function(bA,by){var bz=b.map(this,bx,bA);if(!ad.test(e)){by=bA}if(by&&typeof by==="string"){bz=b.filter(by,bz)}bz=this.length>1&&!aA[e]?b.unique(bz):bz;if((this.length>1||bd.test(by))&&at.test(e)){bz=bz.reverse()}return this.pushStack(bz,e,R.call(arguments).join(","))}});b.extend({filter:function(by,e,bx){if(bx){by=":not("+by+")"}return e.length===1?b.find.matchesSelector(e[0],by)?[e[0]]:[]:b.find.matches(by,e)},dir:function(by,bx,bA){var e=[],bz=by[bx];while(bz&&bz.nodeType!==9&&(bA===N||bz.nodeType!==1||!b(bz).is(bA))){if(bz.nodeType===1){e.push(bz)}bz=bz[bx]}return e},nth:function(bA,e,by,bz){e=e||1;var bx=0;for(;bA;bA=bA[by]){if(bA.nodeType===1&&++bx===e){break}}return bA},sibling:function(by,bx){var e=[];for(;by;by=by.nextSibling){if(by.nodeType===1&&by!==bx){e.push(by)}}return e}});function aJ(bz,by,e){by=by||0;if(b.isFunction(by)){return b.grep(bz,function(bB,bA){var bC=!!by.call(bB,bA,bB);return bC===e})}else{if(by.nodeType){return b.grep(bz,function(bB,bA){return(bB===by)===e})}else{if(typeof by==="string"){var bx=b.grep(bz,function(bA){return bA.nodeType===1});if(br.test(by)){return b.filter(by,bx,!e)}else{by=b.filter(by,bx)}}}}return b.grep(bz,function(bB,bA){return(b.inArray(bB,by)>=0)===e})}function a(e){var by=aU.split("|"),bx=e.createDocumentFragment();if(bx.createElement){while(by.length){bx.createElement(by.pop())}}return bx}var aU="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",aj=/ jQuery\d+="(?:\d+|null)"/g,au=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,f=/<([\w:]+)/,x=/<tbody/i,Y=/<|&#?\w+;/,ag=/<(?:script|style)/i,Q=/<(?:script|object|embed|option|style)/i,ak=new RegExp("<(?:"+aU+")[\\s/>]","i"),q=/checked\s*(?:[^=]|=\s*.checked.)/i,bp=/\/(java|ecma)script/i,aQ=/^\s*<!(?:\[CDATA\[|\-\-)/,az={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},ae=a(ax);az.optgroup=az.option;az.tbody=az.tfoot=az.colgroup=az.caption=az.thead;az.th=az.td;if(!b.support.htmlSerialize){az._default=[1,"div<div>","</div>"]}b.fn.extend({text:function(e){return b.access(this,function(bx){return bx===N?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ax).createTextNode(bx))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(by){b(this).wrapAll(e.call(this,by))})}if(this[0]){var bx=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bx.insertBefore(this[0])}bx.map(function(){var by=this;while(by.firstChild&&by.firstChild.nodeType===1){by=by.firstChild}return by}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bx){b(this).wrapInner(e.call(this,bx))})}return this.each(function(){var bx=b(this),by=bx.contents();if(by.length){by.wrapAll(e)}else{bx.append(e)}})},wrap:function(e){var bx=b.isFunction(e);return this.each(function(by){b(this).wrapAll(bx?e.call(this,by):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bx){this.parentNode.insertBefore(bx,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bx){this.parentNode.insertBefore(bx,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bz){for(var bx=0,by;(by=this[bx])!=null;bx++){if(!e||b.filter(e,[by]).length){if(!bz&&by.nodeType===1){b.cleanData(by.getElementsByTagName("*"));b.cleanData([by])}if(by.parentNode){by.parentNode.removeChild(by)}}}return this},empty:function(){for(var e=0,bx;(bx=this[e])!=null;e++){if(bx.nodeType===1){b.cleanData(bx.getElementsByTagName("*"))}while(bx.firstChild){bx.removeChild(bx.firstChild)}}return this},clone:function(bx,e){bx=bx==null?false:bx;e=e==null?bx:e;return this.map(function(){return b.clone(this,bx,e)})},html:function(e){return b.access(this,function(bA){var bz=this[0]||{},by=0,bx=this.length;if(bA===N){return bz.nodeType===1?bz.innerHTML.replace(aj,""):null}if(typeof bA==="string"&&!ag.test(bA)&&(b.support.leadingWhitespace||!au.test(bA))&&!az[(f.exec(bA)||["",""])[1].toLowerCase()]){bA=bA.replace(T,"<$1></$2>");try{for(;by<bx;by++){bz=this[by]||{};if(bz.nodeType===1){b.cleanData(bz.getElementsByTagName("*"));bz.innerHTML=bA}}bz=0}catch(bB){}}if(bz){this.empty().append(bA)}},null,e,arguments.length)},replaceWith:function(e){if(this[0]&&this[0].parentNode){if(b.isFunction(e)){return this.each(function(bz){var by=b(this),bx=by.html();by.replaceWith(e.call(this,bz,bx))})}if(typeof e!=="string"){e=b(e).detach()}return this.each(function(){var by=this.nextSibling,bx=this.parentNode;b(this).remove();if(by){b(by).before(e)}else{b(bx).append(e)}})}else{return this.length?this.pushStack(b(b.isFunction(e)?e():e),"replaceWith",e):this}},detach:function(e){return this.remove(e,true)},domManip:function(bD,bH,bG){var bz,bA,bC,bF,bE=bD[0],bx=[];if(!b.support.checkClone&&arguments.length===3&&typeof bE==="string"&&q.test(bE)){return this.each(function(){b(this).domManip(bD,bH,bG,true)})}if(b.isFunction(bE)){return this.each(function(bJ){var bI=b(this);bD[0]=bE.call(this,bJ,bH?bI.html():N);bI.domManip(bD,bH,bG)})}if(this[0]){bF=bE&&bE.parentNode;if(b.support.parentNode&&bF&&bF.nodeType===11&&bF.childNodes.length===this.length){bz={fragment:bF}}else{bz=b.buildFragment(bD,this,bx)}bC=bz.fragment;if(bC.childNodes.length===1){bA=bC=bC.firstChild}else{bA=bC.firstChild}if(bA){bH=bH&&b.nodeName(bA,"tr");for(var by=0,e=this.length,bB=e-1;by<e;by++){bG.call(bH?be(this[by],bA):this[by],bz.cacheable||(e>1&&by<bB)?b.clone(bC,true,true):bC)}}if(bx.length){b.each(bx,function(bI,bJ){if(bJ.src){b.ajax({type:"GET",global:false,url:bJ.src,async:false,dataType:"script"})}else{b.globalEval((bJ.text||bJ.textContent||bJ.innerHTML||"").replace(aQ,"/*$0*/"))}if(bJ.parentNode){bJ.parentNode.removeChild(bJ)}})}}return this}});function be(e,bx){return b.nodeName(e,"table")?(e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody"))):e}function u(bD,bx){if(bx.nodeType!==1||!b.hasData(bD)){return}var bA,bz,e,bC=b._data(bD),bB=b._data(bx,bC),by=bC.events;if(by){delete bB.handle;bB.events={};for(bA in by){for(bz=0,e=by[bA].length;bz<e;bz++){b.event.add(bx,bA,by[bA][bz])}}}if(bB.data){bB.data=b.extend({},bB.data)}}function al(bx,e){var by;if(e.nodeType!==1){return}if(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(bx)}by=e.nodeName.toLowerCase();if(by==="object"){e.outerHTML=bx.outerHTML}else{if(by==="input"&&(bx.type==="checkbox"||bx.type==="radio")){if(bx.checked){e.defaultChecked=e.checked=bx.checked}if(e.value!==bx.value){e.value=bx.value}}else{if(by==="option"){e.selected=bx.defaultSelected}else{if(by==="input"||by==="textarea"){e.defaultValue=bx.defaultValue}else{if(by==="script"&&e.text!==bx.text){e.text=bx.text}}}}}e.removeAttribute(b.expando);e.removeAttribute("_submit_attached");e.removeAttribute("_change_attached")}b.buildFragment=function(bB,bz,bx){var bA,e,by,bC,bD=bB[0];if(bz&&bz[0]){bC=bz[0].ownerDocument||bz[0]}if(!bC.createDocumentFragment){bC=ax}if(bB.length===1&&typeof bD==="string"&&bD.length<512&&bC===ax&&bD.charAt(0)==="<"&&!Q.test(bD)&&(b.support.checkClone||!q.test(bD))&&(b.support.html5Clone||!ak.test(bD))){e=true;by=b.fragments[bD];if(by&&by!==1){bA=by}}if(!bA){bA=bC.createDocumentFragment();b.clean(bB,bC,bA,bx)}if(e){b.fragments[bD]=by?bA:1}return{fragment:bA,cacheable:e}};b.fragments={};b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bx){b.fn[e]=function(by){var bB=[],bE=b(by),bD=this.length===1&&this[0].parentNode;if(bD&&bD.nodeType===11&&bD.childNodes.length===1&&bE.length===1){bE[bx](this[0]);return this}else{for(var bC=0,bz=bE.length;bC<bz;bC++){var bA=(bC>0?this.clone(true):this).get();b(bE[bC])[bx](bA);bB=bB.concat(bA)}return this.pushStack(bB,e,bE.selector)}}});function bj(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function aB(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function F(e){var bx=(e.nodeName||"").toLowerCase();if(bx==="input"){aB(e)}else{if(bx!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),aB)}}}function ao(e){var bx=ax.createElement("div");ae.appendChild(bx);bx.innerHTML=e.outerHTML;return bx.firstChild}b.extend({clone:function(bA,bC,by){var e,bx,bz,bB=b.support.html5Clone||b.isXMLDoc(bA)||!ak.test("<"+bA.nodeName+">")?bA.cloneNode(true):ao(bA);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(bA.nodeType===1||bA.nodeType===11)&&!b.isXMLDoc(bA)){al(bA,bB);e=bj(bA);bx=bj(bB);for(bz=0;e[bz];++bz){if(bx[bz]){al(e[bz],bx[bz])}}}if(bC){u(bA,bB);if(by){e=bj(bA);bx=bj(bB);for(bz=0;e[bz];++bz){u(e[bz],bx[bz])}}}e=bx=null;return bB},clean:function(bK,by,bx,bz){var bC,bJ,bF,bL=[];by=by||ax;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||ax}for(var bG=0,bI;(bI=bK[bG])!=null;bG++){if(typeof bI==="number"){bI+=""}if(!bI){continue}if(typeof bI==="string"){if(!Y.test(bI)){bI=by.createTextNode(bI)}else{bI=bI.replace(T,"<$1></$2>");var bP=(f.exec(bI)||["",""])[1].toLowerCase(),bB=az[bP]||az._default,bM=bB[0],bD=by.createElement("div"),bN=ae.childNodes,bO;if(by===ax){ae.appendChild(bD)}else{a(by).appendChild(bD)}bD.innerHTML=bB[1]+bI+bB[2];while(bM--){bD=bD.lastChild}if(!b.support.tbody){var bA=x.test(bI),e=bP==="table"&&!bA?bD.firstChild&&bD.firstChild.childNodes:bB[1]==="<table>"&&!bA?bD.childNodes:[];for(bF=e.length-1;bF>=0;--bF){if(b.nodeName(e[bF],"tbody")&&!e[bF].childNodes.length){e[bF].parentNode.removeChild(e[bF])}}}if(!b.support.leadingWhitespace&&au.test(bI)){bD.insertBefore(by.createTextNode(au.exec(bI)[0]),bD.firstChild)}bI=bD.childNodes;if(bD){bD.parentNode.removeChild(bD);if(bN.length>0){bO=bN[bN.length-1];if(bO&&bO.parentNode){bO.parentNode.removeChild(bO)}}}}}var bH;if(!b.support.appendChecked){if(bI[0]&&typeof(bH=bI.length)==="number"){for(bF=0;bF<bH;bF++){F(bI[bF])}}else{F(bI)}}if(bI.nodeType){bL.push(bI)}else{bL=b.merge(bL,bI)}}if(bx){bC=function(bQ){return !bQ.type||bp.test(bQ.type)};for(bG=0;bL[bG];bG++){bJ=bL[bG];if(bz&&b.nodeName(bJ,"script")&&(!bJ.type||bp.test(bJ.type))){bz.push(bJ.parentNode?bJ.parentNode.removeChild(bJ):bJ)}else{if(bJ.nodeType===1){var bE=b.grep(bJ.getElementsByTagName("script"),bC);bL.splice.apply(bL,[bG+1,0].concat(bE))}bx.appendChild(bJ)}}}return bL},cleanData:function(bx){var bA,by,e=b.cache,bD=b.event.special,bC=b.support.deleteExpando;for(var bB=0,bz;(bz=bx[bB])!=null;bB++){if(bz.nodeName&&b.noData[bz.nodeName.toLowerCase()]){continue}by=bz[b.expando];if(by){bA=e[by];if(bA&&bA.events){for(var bE in bA.events){if(bD[bE]){b.event.remove(bz,bE)}else{b.removeEvent(bz,bE,bA.handle)}}if(bA.handle){bA.handle.elem=null}}if(bC){delete bz[b.expando]}else{if(bz.removeAttribute){bz.removeAttribute(b.expando)}}delete e[by]}}}});var an=/alpha\([^)]*\)/i,aw=/opacity=([^)]*)/,A=/([A-Z]|^ms)/g,bq=/^[\-+]?(?:\d*\.)?\d+$/i,a3=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,K=/^([\-+])=([\-+.\de]+)/,aG=/^margin/,bb={position:"absolute",visibility:"hidden",display:"block"},I=["Top","Right","Bottom","Left"],ab,aL,a0;b.fn.css=function(e,bx){return b.access(this,function(bz,by,bA){return bA!==N?b.style(bz,by,bA):b.css(bz,by)},e,bx,arguments.length>1)};b.extend({cssHooks:{opacity:{get:function(by,bx){if(bx){var e=ab(by,"opacity");return e===""?"1":e}else{return by.style.opacity}}}},cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(bz,by,bF,bA){if(!bz||bz.nodeType===3||bz.nodeType===8||!bz.style){return}var bD,bE,bB=b.camelCase(by),bx=bz.style,bG=b.cssHooks[bB];by=b.cssProps[bB]||bB;if(bF!==N){bE=typeof bF;if(bE==="string"&&(bD=K.exec(bF))){bF=(+(bD[1]+1)*+bD[2])+parseFloat(b.css(bz,by));bE="number"}if(bF==null||bE==="number"&&isNaN(bF)){return}if(bE==="number"&&!b.cssNumber[bB]){bF+="px"}if(!bG||!("set" in bG)||(bF=bG.set(bz,bF))!==N){try{bx[by]=bF}catch(bC){}}}else{if(bG&&"get" in bG&&(bD=bG.get(bz,false,bA))!==N){return bD}return bx[by]}},css:function(bA,bz,bx){var by,e;bz=b.camelCase(bz);e=b.cssHooks[bz];bz=b.cssProps[bz]||bz;if(bz==="cssFloat"){bz="float"}if(e&&"get" in e&&(by=e.get(bA,true,bx))!==N){return by}else{if(ab){return ab(bA,bz)}}},swap:function(bA,bz,bB){var e={},by,bx;for(bx in bz){e[bx]=bA.style[bx];bA.style[bx]=bz[bx]}by=bB.call(bA);for(bx in bz){bA.style[bx]=e[bx]}return by}});b.curCSS=b.css;if(ax.defaultView&&ax.defaultView.getComputedStyle){aL=function(bC,by){var bx,bB,e,bA,bz=bC.style;by=by.replace(A,"-$1").toLowerCase();if((bB=bC.ownerDocument.defaultView)&&(e=bB.getComputedStyle(bC,null))){bx=e.getPropertyValue(by);if(bx===""&&!b.contains(bC.ownerDocument.documentElement,bC)){bx=b.style(bC,by)}}if(!b.support.pixelMargin&&e&&aG.test(by)&&a3.test(bx)){bA=bz.width;bz.width=bx;bx=e.width;bz.width=bA}return bx}}if(ax.documentElement.currentStyle){a0=function(bB,by){var bC,e,bA,bx=bB.currentStyle&&bB.currentStyle[by],bz=bB.style;if(bx==null&&bz&&(bA=bz[by])){bx=bA}if(a3.test(bx)){bC=bz.left;e=bB.runtimeStyle&&bB.runtimeStyle.left;if(e){bB.runtimeStyle.left=bB.currentStyle.left}bz.left=by==="fontSize"?"1em":bx;bx=bz.pixelLeft+"px";bz.left=bC;if(e){bB.runtimeStyle.left=e}}return bx===""?"auto":bx}}ab=aL||a0;function ah(bA,by,bx){var bB=by==="width"?bA.offsetWidth:bA.offsetHeight,bz=by==="width"?1:0,e=4;if(bB>0){if(bx!=="border"){for(;bz<e;bz+=2){if(!bx){bB-=parseFloat(b.css(bA,"padding"+I[bz]))||0}if(bx==="margin"){bB+=parseFloat(b.css(bA,bx+I[bz]))||0}else{bB-=parseFloat(b.css(bA,"border"+I[bz]+"Width"))||0}}}return bB+"px"}bB=ab(bA,by);if(bB<0||bB==null){bB=bA.style[by]}if(a3.test(bB)){return bB}bB=parseFloat(bB)||0;if(bx){for(;bz<e;bz+=2){bB+=parseFloat(b.css(bA,"padding"+I[bz]))||0;if(bx!=="padding"){bB+=parseFloat(b.css(bA,"border"+I[bz]+"Width"))||0}if(bx==="margin"){bB+=parseFloat(b.css(bA,bx+I[bz]))||0}}}return bB+"px"}b.each(["height","width"],function(bx,e){b.cssHooks[e]={get:function(bA,bz,by){if(bz){if(bA.offsetWidth!==0){return ah(bA,e,by)}else{return b.swap(bA,bb,function(){return ah(bA,e,by)})}}},set:function(by,bz){return bq.test(bz)?bz+"px":bz}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bx,e){return aw.test((e&&bx.currentStyle?bx.currentStyle.filter:bx.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(bA,bB){var bz=bA.style,bx=bA.currentStyle,e=b.isNumeric(bB)?"alpha(opacity="+bB*100+")":"",by=bx&&bx.filter||bz.filter||"";bz.zoom=1;if(bB>=1&&b.trim(by.replace(an,""))===""){bz.removeAttribute("filter");if(bx&&!bx.filter){return}}bz.filter=an.test(by)?by.replace(an,e):by+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bx,e){return b.swap(bx,{display:"inline-block"},function(){if(e){return ab(bx,"margin-right")}else{return bx.style.marginRight}})}}}});if(b.expr&&b.expr.filters){b.expr.filters.hidden=function(by){var bx=by.offsetWidth,e=by.offsetHeight;return(bx===0&&e===0)||(!b.support.reliableHiddenOffsets&&((by.style&&by.style.display)||b.css(by,"display"))==="none")};b.expr.filters.visible=function(e){return !b.expr.filters.hidden(e)}}b.each({margin:"",padding:"",border:"Width"},function(e,bx){b.cssHooks[e+bx]={expand:function(bA){var bz,bB=typeof bA==="string"?bA.split(" "):[bA],by={};for(bz=0;bz<4;bz++){by[e+I[bz]+bx]=bB[bz]||bB[bz-2]||bB[0]}return by}}});var m=/%20/g,ar=/\[\]$/,bu=/\r?\n/g,bs=/#.*$/,aF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,a2=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aP=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,aT=/^(?:GET|HEAD)$/,d=/^\/\//,O=/\?/,a9=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,r=/^(?:select|textarea)/i,j=/\s+/,bt=/([?&])_=[^&]*/,M=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,B=b.fn.load,ac={},s={},aH,t,aY=["*/"]+["*"];try{aH=bo.href}catch(ay){aH=ax.createElement("a");aH.href="";aH=aH.href}t=M.exec(aH.toLowerCase())||[];function g(e){return function(bA,bC){if(typeof bA!=="string"){bC=bA;bA="*"}if(b.isFunction(bC)){var bz=bA.toLowerCase().split(j),by=0,bB=bz.length,bx,bD,bE;for(;by<bB;by++){bx=bz[by];bE=/^\+/.test(bx);if(bE){bx=bx.substr(1)||"*"}bD=e[bx]=e[bx]||[];bD[bE?"unshift":"push"](bC)}}}}function aZ(bx,bG,bB,bF,bD,bz){bD=bD||bG.dataTypes[0];bz=bz||{};bz[bD]=true;var bC=bx[bD],by=0,e=bC?bC.length:0,bA=(bx===ac),bE;for(;by<e&&(bA||!bE);by++){bE=bC[by](bG,bB,bF);if(typeof bE==="string"){if(!bA||bz[bE]){bE=N}else{bG.dataTypes.unshift(bE);bE=aZ(bx,bG,bB,bF,bE,bz)}}}if((bA||!bE)&&!bz["*"]){bE=aZ(bx,bG,bB,bF,"*",bz)}return bE}function ap(by,bz){var bx,e,bA=b.ajaxSettings.flatOptions||{};for(bx in bz){if(bz[bx]!==N){(bA[bx]?by:(e||(e={})))[bx]=bz[bx]}}if(e){b.extend(true,by,e)}}b.fn.extend({load:function(by,bB,bC){if(typeof by!=="string"&&B){return B.apply(this,arguments)}else{if(!this.length){return this}}var bA=by.indexOf(" ");if(bA>=0){var e=by.slice(bA,by.length);by=by.slice(0,bA)}var bz="GET";if(bB){if(b.isFunction(bB)){bC=bB;bB=N}else{if(typeof bB==="object"){bB=b.param(bB,b.ajaxSettings.traditional);bz="POST"}}}var bx=this;b.ajax({url:by,type:bz,dataType:"html",data:bB,complete:function(bE,bD,bF){bF=bE.responseText;if(bE.isResolved()){bE.done(function(bG){bF=bG});bx.html(e?b("<div>").append(bF.replace(a9,"")).find(e):bF)}if(bC){bx.each(bC,[bF,bD,bE])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||r.test(this.nodeName)||a2.test(this.type))}).map(function(e,bx){var by=b(this).val();return by==null?null:b.isArray(by)?b.map(by,function(bA,bz){return{name:bx.name,value:bA.replace(bu,"\r\n")}}):{name:bx.name,value:by.replace(bu,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bx){b.fn[bx]=function(by){return this.on(bx,by)}});b.each(["get","post"],function(e,bx){b[bx]=function(by,bA,bB,bz){if(b.isFunction(bA)){bz=bz||bB;bB=bA;bA=N}return b.ajax({type:bx,url:by,data:bA,success:bB,dataType:bz})}});b.extend({getScript:function(e,bx){return b.get(e,N,bx,"script")},getJSON:function(e,bx,by){return b.get(e,bx,by,"json")},ajaxSetup:function(bx,e){if(e){ap(bx,b.ajaxSettings)}else{e=bx;bx=b.ajaxSettings}ap(bx,e);return bx},ajaxSettings:{url:aH,isLocal:aP.test(t[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aY},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bf.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:g(ac),ajaxTransport:g(s),ajax:function(bB,bz){if(typeof bB==="object"){bz=bB;bB=N}bz=bz||{};var bF=b.ajaxSetup({},bz),bU=bF.context||bF,bI=bU!==bF&&(bU.nodeType||bU instanceof b)?b(bU):b.event,bT=b.Deferred(),bP=b.Callbacks("once memory"),bD=bF.statusCode||{},bE,bJ={},bQ={},bS,bA,bN,bG,bK,bC=0,by,bM,bL={readyState:0,setRequestHeader:function(bV,bW){if(!bC){var e=bV.toLowerCase();bV=bQ[e]=bQ[e]||bV;bJ[bV]=bW}return this},getAllResponseHeaders:function(){return bC===2?bS:null},getResponseHeader:function(bV){var e;if(bC===2){if(!bA){bA={};while((e=aF.exec(bS))){bA[e[1].toLowerCase()]=e[2]}}e=bA[bV.toLowerCase()]}return e===N?null:e},overrideMimeType:function(e){if(!bC){bF.mimeType=e}return this},abort:function(e){e=e||"abort";if(bN){bN.abort(e)}bH(0,e);return this}};function bH(b1,bW,b2,bY){if(bC===2){return}bC=2;if(bG){clearTimeout(bG)}bN=N;bS=bY||"";bL.readyState=b1>0?4:0;var bV,b6,b5,bZ=bW,b0=b2?bm(bF,bL,b2):N,bX,b4;if(b1>=200&&b1<300||b1===304){if(bF.ifModified){if((bX=bL.getResponseHeader("Last-Modified"))){b.lastModified[bE]=bX}if((b4=bL.getResponseHeader("Etag"))){b.etag[bE]=b4}}if(b1===304){bZ="notmodified";bV=true}else{try{b6=H(bF,b0);bZ="success";bV=true}catch(b3){bZ="parsererror";b5=b3}}}else{b5=bZ;if(!bZ||b1){bZ="error";if(b1<0){b1=0}}}bL.status=b1;bL.statusText=""+(bW||bZ);if(bV){bT.resolveWith(bU,[b6,bZ,bL])}else{bT.rejectWith(bU,[bL,bZ,b5])}bL.statusCode(bD);bD=N;if(by){bI.trigger("ajax"+(bV?"Success":"Error"),[bL,bF,bV?b6:b5])}bP.fireWith(bU,[bL,bZ]);if(by){bI.trigger("ajaxComplete",[bL,bF]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bT.promise(bL);bL.success=bL.done;bL.error=bL.fail;bL.complete=bP.add;bL.statusCode=function(bV){if(bV){var e;if(bC<2){for(e in bV){bD[e]=[bD[e],bV[e]]}}else{e=bV[bL.status];bL.then(e,e)}}return this};bF.url=((bB||bF.url)+"").replace(bs,"").replace(d,t[1]+"//");bF.dataTypes=b.trim(bF.dataType||"*").toLowerCase().split(j);if(bF.crossDomain==null){bK=M.exec(bF.url.toLowerCase());bF.crossDomain=!!(bK&&(bK[1]!=t[1]||bK[2]!=t[2]||(bK[3]||(bK[1]==="http:"?80:443))!=(t[3]||(t[1]==="http:"?80:443))))}if(bF.data&&bF.processData&&typeof bF.data!=="string"){bF.data=b.param(bF.data,bF.traditional)}aZ(ac,bF,bz,bL);if(bC===2){return false}by=bF.global;bF.type=bF.type.toUpperCase();bF.hasContent=!aT.test(bF.type);if(by&&b.active++===0){b.event.trigger("ajaxStart")}if(!bF.hasContent){if(bF.data){bF.url+=(O.test(bF.url)?"&":"?")+bF.data;delete bF.data}bE=bF.url;if(bF.cache===false){var bx=b.now(),bR=bF.url.replace(bt,"$1_="+bx);bF.url=bR+((bR===bF.url)?(O.test(bF.url)?"&":"?")+"_="+bx:"")}}if(bF.data&&bF.hasContent&&bF.contentType!==false||bz.contentType){bL.setRequestHeader("Content-Type",bF.contentType)}if(bF.ifModified){bE=bE||bF.url;if(b.lastModified[bE]){bL.setRequestHeader("If-Modified-Since",b.lastModified[bE])}if(b.etag[bE]){bL.setRequestHeader("If-None-Match",b.etag[bE])}}bL.setRequestHeader("Accept",bF.dataTypes[0]&&bF.accepts[bF.dataTypes[0]]?bF.accepts[bF.dataTypes[0]]+(bF.dataTypes[0]!=="*"?", "+aY+"; q=0.01":""):bF.accepts["*"]);for(bM in bF.headers){bL.setRequestHeader(bM,bF.headers[bM])}if(bF.beforeSend&&(bF.beforeSend.call(bU,bL,bF)===false||bC===2)){bL.abort();return false}for(bM in {success:1,error:1,complete:1}){bL[bM](bF[bM])}bN=aZ(s,bF,bz,bL);if(!bN){bH(-1,"No Transport")}else{bL.readyState=1;if(by){bI.trigger("ajaxSend",[bL,bF])}if(bF.async&&bF.timeout>0){bG=setTimeout(function(){bL.abort("timeout")},bF.timeout)}try{bC=1;bN.send(bJ,bH)}catch(bO){if(bC<2){bH(-1,bO)}else{throw bO}}}return bL},param:function(e,by){var bx=[],bA=function(bB,bC){bC=b.isFunction(bC)?bC():bC;bx[bx.length]=encodeURIComponent(bB)+"="+encodeURIComponent(bC)};if(by===N){by=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){bA(this.name,this.value)})}else{for(var bz in e){w(bz,e[bz],by,bA)}}return bx.join("&").replace(m,"+")}});function w(by,bA,bx,bz){if(b.isArray(bA)){b.each(bA,function(bC,bB){if(bx||ar.test(by)){bz(by,bB)}else{w(by+"["+(typeof bB==="object"?bC:"")+"]",bB,bx,bz)}})}else{if(!bx&&b.type(bA)==="object"){for(var e in bA){w(by+"["+e+"]",bA[e],bx,bz)}}else{bz(by,bA)}}}b.extend({active:0,lastModified:{},etag:{}});function bm(bF,bE,bB){var bx=bF.contents,bD=bF.dataTypes,by=bF.responseFields,bA,bC,bz,e;for(bC in by){if(bC in bB){bE[by[bC]]=bB[bC]}}while(bD[0]==="*"){bD.shift();if(bA===N){bA=bF.mimeType||bE.getResponseHeader("content-type")}}if(bA){for(bC in bx){if(bx[bC]&&bx[bC].test(bA)){bD.unshift(bC);break}}}if(bD[0] in bB){bz=bD[0]}else{for(bC in bB){if(!bD[0]||bF.converters[bC+" "+bD[0]]){bz=bC;break}if(!e){e=bC}}bz=bz||e}if(bz){if(bz!==bD[0]){bD.unshift(bz)}return bB[bz]}}function H(bJ,bB){if(bJ.dataFilter){bB=bJ.dataFilter(bB,bJ.dataType)}var bF=bJ.dataTypes,bI={},bC,bG,by=bF.length,bD,bE=bF[0],bz,bA,bH,bx,e;for(bC=1;bC<by;bC++){if(bC===1){for(bG in bJ.converters){if(typeof bG==="string"){bI[bG.toLowerCase()]=bJ.converters[bG]}}}bz=bE;bE=bF[bC];if(bE==="*"){bE=bz}else{if(bz!=="*"&&bz!==bE){bA=bz+" "+bE;bH=bI[bA]||bI["* "+bE];if(!bH){e=N;for(bx in bI){bD=bx.split(" ");if(bD[0]===bz||bD[0]==="*"){e=bI[bD[1]+" "+bE];if(e){bx=bI[bx];if(bx===true){bH=e}else{if(e===true){bH=bx}}break}}}}if(!(bH||e)){b.error("No conversion from "+bA.replace(" "," to "))}if(bH!==true){bB=bH?bH(bB):e(bx(bB))}}}}return bB}var aE=b.now(),v=/(\=)\?(&|$)|\?\?/i;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return b.expando+"_"+(aE++)}});b.ajaxPrefilter("json jsonp",function(bF,bC,bE){var bz=(typeof bF.data==="string")&&/^application\/x\-www\-form\-urlencoded/.test(bF.contentType);if(bF.dataTypes[0]==="jsonp"||bF.jsonp!==false&&(v.test(bF.url)||bz&&v.test(bF.data))){var bD,by=bF.jsonpCallback=b.isFunction(bF.jsonpCallback)?bF.jsonpCallback():bF.jsonpCallback,bB=bf[by],e=bF.url,bA=bF.data,bx="$1"+by+"$2";if(bF.jsonp!==false){e=e.replace(v,bx);if(bF.url===e){if(bz){bA=bA.replace(v,bx)}if(bF.data===bA){e+=(/\?/.test(e)?"&":"?")+bF.jsonp+"="+by}}}bF.url=e;bF.data=bA;bf[by]=function(bG){bD=[bG]};bE.always(function(){bf[by]=bB;if(bD&&b.isFunction(bB)){bf[by](bD[0])}});bF.converters["script json"]=function(){if(!bD){b.error(by+" was not called")}return bD[0]};bF.dataTypes[0]="json";return"script"}});b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){b.globalEval(e);return e}}});b.ajaxPrefilter("script",function(e){if(e.cache===N){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});b.ajaxTransport("script",function(by){if(by.crossDomain){var e,bx=ax.head||ax.getElementsByTagName("head")[0]||ax.documentElement;return{send:function(bz,bA){e=ax.createElement("script");e.async="async";if(by.scriptCharset){e.charset=by.scriptCharset}e.src=by.url;e.onload=e.onreadystatechange=function(bC,bB){if(bB||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(bx&&e.parentNode){bx.removeChild(e)}e=N;if(!bB){bA(200,"success")}}};bx.insertBefore(e,bx.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var C=bf.ActiveXObject?function(){for(var e in P){P[e](0,1)}}:false,z=0,P;function aO(){try{return new bf.XMLHttpRequest()}catch(bx){}}function am(){try{return new bf.ActiveXObject("Microsoft.XMLHTTP")}catch(bx){}}b.ajaxSettings.xhr=bf.ActiveXObject?function(){return !this.isLocal&&aO()||am()}:aO;(function(e){b.extend(b.support,{ajax:!!e,cors:!!e&&("withCredentials" in e)})})(b.ajaxSettings.xhr());if(b.support.ajax){b.ajaxTransport(function(e){if(!e.crossDomain||b.support.cors){var bx;return{send:function(bD,by){var bC=e.xhr(),bB,bA;if(e.username){bC.open(e.type,e.url,e.async,e.username,e.password)}else{bC.open(e.type,e.url,e.async)}if(e.xhrFields){for(bA in e.xhrFields){bC[bA]=e.xhrFields[bA]}}if(e.mimeType&&bC.overrideMimeType){bC.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!bD["X-Requested-With"]){bD["X-Requested-With"]="XMLHttpRequest"}try{for(bA in bD){bC.setRequestHeader(bA,bD[bA])}}catch(bz){}bC.send((e.hasContent&&e.data)||null);bx=function(bM,bG){var bH,bF,bE,bK,bJ;try{if(bx&&(bG||bC.readyState===4)){bx=N;if(bB){bC.onreadystatechange=b.noop;if(C){delete P[bB]}}if(bG){if(bC.readyState!==4){bC.abort()}}else{bH=bC.status;bE=bC.getAllResponseHeaders();bK={};bJ=bC.responseXML;if(bJ&&bJ.documentElement){bK.xml=bJ}try{bK.text=bC.responseText}catch(bM){}try{bF=bC.statusText}catch(bL){bF=""}if(!bH&&e.isLocal&&!e.crossDomain){bH=bK.text?200:404}else{if(bH===1223){bH=204}}}}}catch(bI){if(!bG){by(-1,bI)}}if(bK){by(bH,bF,bK,bE)}};if(!e.async||bC.readyState===4){bx()}else{bB=++z;if(C){if(!P){P={};b(bf).unload(C)}P[bB]=bx}bC.onreadystatechange=bx}},abort:function(){if(bx){bx(0,1)}}}}})}var S={},bc,o,aD=/^(?:toggle|show|hide)$/,aW=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,a6,aK=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],a7;b.fn.extend({show:function(bz,bC,bB){var by,bA;if(bz||bz===0){return this.animate(a4("show",3),bz,bC,bB)}else{for(var bx=0,e=this.length;bx<e;bx++){by=this[bx];if(by.style){bA=by.style.display;if(!b._data(by,"olddisplay")&&bA==="none"){bA=by.style.display=""}if((bA===""&&b.css(by,"display")==="none")||!b.contains(by.ownerDocument.documentElement,by)){b._data(by,"olddisplay",y(by.nodeName))}}}for(bx=0;bx<e;bx++){by=this[bx];if(by.style){bA=by.style.display;if(bA===""||bA==="none"){by.style.display=b._data(by,"olddisplay")||""}}}return this}},hide:function(bz,bC,bB){if(bz||bz===0){return this.animate(a4("hide",3),bz,bC,bB)}else{var by,bA,bx=0,e=this.length;for(;bx<e;bx++){by=this[bx];if(by.style){bA=b.css(by,"display");if(bA!=="none"&&!b._data(by,"olddisplay")){b._data(by,"olddisplay",bA)}}}for(bx=0;bx<e;bx++){if(this[bx].style){this[bx].style.display="none"}}return this}},_toggle:b.fn.toggle,toggle:function(by,bx,bz){var e=typeof by==="boolean";if(b.isFunction(by)&&b.isFunction(bx)){this._toggle.apply(this,arguments)}else{if(by==null||e){this.each(function(){var bA=e?by:b(this).is(":hidden");b(this)[bA?"show":"hide"]()})}else{this.animate(a4("toggle",3),by,bx,bz)}}return this},fadeTo:function(e,bz,by,bx){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:bz},e,by,bx)},animate:function(bB,by,bA,bz){var e=b.speed(by,bA,bz);if(b.isEmptyObject(bB)){return this.each(e.complete,[false])}bB=b.extend({},bB);function bx(){if(e.queue===false){b._mark(this)}var bG=b.extend({},e),bN=this.nodeType===1,bL=bN&&b(this).is(":hidden"),bD,bI,bF,bM,bP,bH,bK,bE,bJ,bO,bC;bG.animatedProperties={};for(bF in bB){bD=b.camelCase(bF);if(bF!==bD){bB[bD]=bB[bF];delete bB[bF]}if((bP=b.cssHooks[bD])&&"expand" in bP){bH=bP.expand(bB[bD]);delete bB[bD];for(bF in bH){if(!(bF in bB)){bB[bF]=bH[bF]}}}}for(bD in bB){bI=bB[bD];if(b.isArray(bI)){bG.animatedProperties[bD]=bI[1];bI=bB[bD]=bI[0]}else{bG.animatedProperties[bD]=bG.specialEasing&&bG.specialEasing[bD]||bG.easing||"swing"}if(bI==="hide"&&bL||bI==="show"&&!bL){return bG.complete.call(this)}if(bN&&(bD==="height"||bD==="width")){bG.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(b.css(this,"display")==="inline"&&b.css(this,"float")==="none"){if(!b.support.inlineBlockNeedsLayout||y(this.nodeName)==="inline"){this.style.display="inline-block"}else{this.style.zoom=1}}}}if(bG.overflow!=null){this.style.overflow="hidden"}for(bF in bB){bM=new b.fx(this,bG,bF);bI=bB[bF];if(aD.test(bI)){bC=b._data(this,"toggle"+bF)||(bI==="toggle"?bL?"show":"hide":0);if(bC){b._data(this,"toggle"+bF,bC==="show"?"hide":"show");bM[bC]()}else{bM[bI]()}}else{bK=aW.exec(bI);bE=bM.cur();if(bK){bJ=parseFloat(bK[2]);bO=bK[3]||(b.cssNumber[bF]?"":"px");if(bO!=="px"){b.style(this,bF,(bJ||1)+bO);bE=((bJ||1)/bM.cur())*bE;b.style(this,bF,bE+bO)}if(bK[1]){bJ=((bK[1]==="-="?-1:1)*bJ)+bE}bM.custom(bE,bJ,bO)}else{bM.custom(bE,bI,"")}}}return true}return e.queue===false?this.each(bx):this.queue(e.queue,bx)},stop:function(by,bx,e){if(typeof by!=="string"){e=bx;bx=by;by=N}if(bx&&by!==false){this.queue(by||"fx",[])}return this.each(function(){var bz,bA=false,bC=b.timers,bB=b._data(this);if(!e){b._unmark(true,this)}function bD(bG,bH,bF){var bE=bH[bF];b.removeData(bG,bF,true);bE.stop(e)}if(by==null){for(bz in bB){if(bB[bz]&&bB[bz].stop&&bz.indexOf(".run")===bz.length-4){bD(this,bB,bz)}}}else{if(bB[bz=by+".run"]&&bB[bz].stop){bD(this,bB,bz)}}for(bz=bC.length;bz--;){if(bC[bz].elem===this&&(by==null||bC[bz].queue===by)){if(e){bC[bz](true)}else{bC[bz].saveState()}bA=true;bC.splice(bz,1)}}if(!(e&&bA)){b.dequeue(this,by)}})}});function bk(){setTimeout(av,0);return(a7=b.now())}function av(){a7=N}function a4(bx,e){var by={};b.each(aK.concat.apply([],aK.slice(0,e)),function(){by[this]=bx});return by}b.each({slideDown:a4("show",1),slideUp:a4("hide",1),slideToggle:a4("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bx){b.fn[e]=function(by,bA,bz){return this.animate(bx,by,bA,bz)}});b.extend({speed:function(by,bz,bx){var e=by&&typeof by==="object"?b.extend({},by):{complete:bx||!bx&&bz||b.isFunction(by)&&by,duration:by,easing:bx&&bz||bz&&!b.isFunction(bz)&&bz};e.duration=b.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in b.fx.speeds?b.fx.speeds[e.duration]:b.fx.speeds._default;if(e.queue==null||e.queue===true){e.queue="fx"}e.old=e.complete;e.complete=function(bA){if(b.isFunction(e.old)){e.old.call(this)}if(e.queue){b.dequeue(this,e.queue)}else{if(bA!==false){b._unmark(this)}}};return e},easing:{linear:function(e){return e},swing:function(e){return(-Math.cos(e*Math.PI)/2)+0.5}},timers:[],fx:function(bx,e,by){this.options=e;this.elem=bx;this.prop=by;e.orig=e.orig||{}}});b.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(b.fx.step[this.prop]||b.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var e,bx=b.css(this.elem,this.prop);return isNaN(e=parseFloat(bx))?!bx||bx==="auto"?0:bx:e},custom:function(bB,bA,bz){var e=this,by=b.fx;this.startTime=a7||bk();this.end=bA;this.now=this.start=bB;this.pos=this.state=0;this.unit=bz||this.unit||(b.cssNumber[this.prop]?"":"px");function bx(bC){return e.step(bC)}bx.queue=this.options.queue;bx.elem=this.elem;bx.saveState=function(){if(b._data(e.elem,"fxshow"+e.prop)===N){if(e.options.hide){b._data(e.elem,"fxshow"+e.prop,e.start)}else{if(e.options.show){b._data(e.elem,"fxshow"+e.prop,e.end)}}}};if(bx()&&b.timers.push(bx)&&!a6){a6=setInterval(by.tick,by.interval)}},show:function(){var e=b._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=e||b.style(this.elem,this.prop);this.options.show=true;if(e!==N){this.custom(this.cur(),e)}else{this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur())}b(this.elem).show()},hide:function(){this.options.orig[this.prop]=b._data(this.elem,"fxshow"+this.prop)||b.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(bA){var bC,bD,bx,bz=a7||bk(),e=true,bB=this.elem,by=this.options;if(bA||bz>=by.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();by.animatedProperties[this.prop]=true;for(bC in by.animatedProperties){if(by.animatedProperties[bC]!==true){e=false}}if(e){if(by.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bE,bF){bB.style["overflow"+bF]=by.overflow[bE]})}if(by.hide){b(bB).hide()}if(by.hide||by.show){for(bC in by.animatedProperties){b.style(bB,bC,by.orig[bC]);b.removeData(bB,"fxshow"+bC,true);b.removeData(bB,"toggle"+bC,true)}}bx=by.complete;if(bx){by.complete=false;bx.call(bB)}}return false}else{if(by.duration==Infinity){this.now=bz}else{bD=bz-this.startTime;this.state=bD/by.duration;this.pos=b.easing[by.animatedProperties[this.prop]](this.state,bD,0,1,by.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var by,bx=b.timers,e=0;for(;e<bx.length;e++){by=bx[e];if(!by()&&bx[e]===by){bx.splice(e--,1)}}if(!bx.length){b.fx.stop()}},interval:13,stop:function(){clearInterval(a6);a6=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){b.style(e.elem,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=e.now+e.unit}else{e.elem[e.prop]=e.now}}}});b.each(aK.concat.apply([],aK),function(e,bx){if(bx.indexOf("margin")){b.fx.step[bx]=function(by){b.style(by.elem,bx,Math.max(0,by.now)+by.unit)}}});if(b.expr&&b.expr.filters){b.expr.filters.animated=function(e){return b.grep(b.timers,function(bx){return e===bx.elem}).length}}function y(bz){if(!S[bz]){var e=ax.body,bx=b("<"+bz+">").appendTo(e),by=bx.css("display");bx.remove();if(by==="none"||by===""){if(!bc){bc=ax.createElement("iframe");bc.frameBorder=bc.width=bc.height=0}e.appendChild(bc);if(!o||!bc.createElement){o=(bc.contentWindow||bc.contentDocument).document;o.write((b.support.boxModel?"<!doctype html>":"")+"<html><body>");o.close()}bx=o.createElement(bz);o.body.appendChild(bx);by=b.css(bx,"display");e.removeChild(bc)}S[bz]=by}return S[bz]}var ba,X=/^t(?:able|d|h)$/i,af=/^(?:body|html)$/i;if("getBoundingClientRect" in ax.documentElement){ba=function(bA,bJ,by,bD){try{bD=bA.getBoundingClientRect()}catch(bH){}if(!bD||!b.contains(by,bA)){return bD?{top:bD.top,left:bD.left}:{top:0,left:0}}var bE=bJ.body,bF=aN(bJ),bC=by.clientTop||bE.clientTop||0,bG=by.clientLeft||bE.clientLeft||0,bx=bF.pageYOffset||b.support.boxModel&&by.scrollTop||bE.scrollTop,bB=bF.pageXOffset||b.support.boxModel&&by.scrollLeft||bE.scrollLeft,bI=bD.top+bx-bC,bz=bD.left+bB-bG;return{top:bI,left:bz}}}else{ba=function(bB,bG,bz){var bE,by=bB.offsetParent,bx=bB,bC=bG.body,bD=bG.defaultView,e=bD?bD.getComputedStyle(bB,null):bB.currentStyle,bF=bB.offsetTop,bA=bB.offsetLeft;while((bB=bB.parentNode)&&bB!==bC&&bB!==bz){if(b.support.fixedPosition&&e.position==="fixed"){break}bE=bD?bD.getComputedStyle(bB,null):bB.currentStyle;bF-=bB.scrollTop;bA-=bB.scrollLeft;if(bB===by){bF+=bB.offsetTop;bA+=bB.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&X.test(bB.nodeName))){bF+=parseFloat(bE.borderTopWidth)||0;bA+=parseFloat(bE.borderLeftWidth)||0}bx=by;by=bB.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bE.overflow!=="visible"){bF+=parseFloat(bE.borderTopWidth)||0;bA+=parseFloat(bE.borderLeftWidth)||0}e=bE}if(e.position==="relative"||e.position==="static"){bF+=bC.offsetTop;bA+=bC.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bF+=Math.max(bz.scrollTop,bC.scrollTop);bA+=Math.max(bz.scrollLeft,bC.scrollLeft)}return{top:bF,left:bA}}}b.fn.offset=function(e){if(arguments.length){return e===N?this:this.each(function(bz){b.offset.setOffset(this,e,bz)})}var bx=this[0],by=bx&&bx.ownerDocument;if(!by){return null}if(bx===by.body){return b.offset.bodyOffset(bx)}return ba(bx,by,by.documentElement)};b.offset={bodyOffset:function(e){var by=e.offsetTop,bx=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){by+=parseFloat(b.css(e,"marginTop"))||0;bx+=parseFloat(b.css(e,"marginLeft"))||0}return{top:by,left:bx}},setOffset:function(bz,bI,bC){var bD=b.css(bz,"position");if(bD==="static"){bz.style.position="relative"}var bB=b(bz),bx=bB.offset(),e=b.css(bz,"top"),bG=b.css(bz,"left"),bH=(bD==="absolute"||bD==="fixed")&&b.inArray("auto",[e,bG])>-1,bF={},bE={},by,bA;if(bH){bE=bB.position();by=bE.top;bA=bE.left}else{by=parseFloat(e)||0;bA=parseFloat(bG)||0}if(b.isFunction(bI)){bI=bI.call(bz,bC,bx)}if(bI.top!=null){bF.top=(bI.top-bx.top)+by}if(bI.left!=null){bF.left=(bI.left-bx.left)+bA}if("using" in bI){bI.using.call(bz,bF)}else{bB.css(bF)}}};b.fn.extend({position:function(){if(!this[0]){return null}var by=this[0],bx=this.offsetParent(),bz=this.offset(),e=af.test(bx[0].nodeName)?{top:0,left:0}:bx.offset();bz.top-=parseFloat(b.css(by,"marginTop"))||0;bz.left-=parseFloat(b.css(by,"marginLeft"))||0;e.top+=parseFloat(b.css(bx[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bx[0],"borderLeftWidth"))||0;return{top:bz.top-e.top,left:bz.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||ax.body;while(e&&(!af.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(by,bx){var e=/Y/.test(bx);b.fn[by]=function(bz){return b.access(this,function(bA,bD,bC){var bB=aN(bA);if(bC===N){return bB?(bx in bB)?bB[bx]:b.support.boxModel&&bB.document.documentElement[bD]||bB.document.body[bD]:bA[bD]}if(bB){bB.scrollTo(!e?bC:b(bB).scrollLeft(),e?bC:b(bB).scrollTop())}else{bA[bD]=bC}},by,bz,arguments.length,null)}});function aN(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each({Height:"height",Width:"width"},function(by,bz){var bx="client"+by,e="scroll"+by,bA="offset"+by;b.fn["inner"+by]=function(){var bB=this[0];return bB?bB.style?parseFloat(b.css(bB,bz,"padding")):this[bz]():null};b.fn["outer"+by]=function(bC){var bB=this[0];return bB?bB.style?parseFloat(b.css(bB,bz,bC?"margin":"border")):this[bz]():null};b.fn[bz]=function(bB){return b.access(this,function(bE,bD,bF){var bH,bG,bI,bC;if(b.isWindow(bE)){bH=bE.document;bG=bH.documentElement[bx];return b.support.boxModel&&bG||bH.body&&bH.body[bx]||bG}if(bE.nodeType===9){bH=bE.documentElement;if(bH[bx]>=bH[e]){return bH[bx]}return Math.max(bE.body[e],bH[e],bE.body[bA],bH[bA])}if(bF===N){bI=b.css(bE,bD);bC=parseFloat(bI);return b.isNumeric(bC)?bC:bI}b(bE).css(bD,bF)},bz,bB,arguments.length,null)}});bf.jQuery=bf.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);
/*
 * jQuery UI @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(a,e){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"@VERSION",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,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,SPACE:32,TAB:9,UP:38}});a.fn.extend({_focus:a.fn.focus,focus:function(f,g){return typeof f==="number"?this.each(function(){var h=this;setTimeout(function(){a(h).focus();if(g){g.call(h)}},f)}):this._focus.apply(this,arguments)},scrollParent:function(){var f;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){f=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.css(this,"position"))&&(/(auto|scroll)/).test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0)}else{f=this.parents().filter(function(){return(/(auto|scroll)/).test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0)}return(/fixed/).test(this.css("position"))||!f.length?a(document):f},zIndex:function(j){if(j!==e){return this.css("zIndex",j)}if(this.length){var g=a(this[0]),f,h;while(g.length&&g[0]!==document){f=g.css("position");if(f==="absolute"||f==="relative"||f==="fixed"){h=parseInt(g.css("zIndex"),10);if(!isNaN(h)&&h!==0){return h}}g=g.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(f){f.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(h,f){var g=f==="Width"?["Left","Right"]:["Top","Bottom"],j=f.toLowerCase(),l={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function k(o,n,m,p){a.each(g,function(){n-=parseFloat(a.css(o,"padding"+this))||0;if(m){n-=parseFloat(a.css(o,"border"+this+"Width"))||0}if(p){n-=parseFloat(a.css(o,"margin"+this))||0}});return n}a.fn["inner"+f]=function(m){if(m===e){return l["inner"+f].call(this)}return this.each(function(){a(this).css(j,k(this,m)+"px")})};a.fn["outer"+f]=function(m,n){if(typeof m!=="number"){return l["outer"+f].call(this,m)}return this.each(function(){a(this).css(j,k(this,m,true,n)+"px")})}});function d(h,f){var k,j,g,l=h.nodeName.toLowerCase();if("area"===l){k=h.parentNode;j=k.name;if(!h.href||!j||k.nodeName.toLowerCase()!=="map"){return false}g=a("img[usemap=#"+j+"]")[0];return !!g&&b(g)}return(/input|select|textarea|button|object/.test(l)?!h.disabled:"a"===l?h.href||f:f)&&b(h)}function b(f){return !a(f).parents().andSelf().filter(function(){return a.css(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(h,g,f){return !!a.data(h,f[3])},focusable:function(f){return d(f,!isNaN(a.attr(f,"tabindex")))},tabbable:function(h){var f=a.attr(h,"tabindex"),g=isNaN(f);return(g||f>=0)&&d(h,!g)}});a(function(){var f=document.body,g=f.appendChild(g=document.createElement("div"));g.offsetHeight;a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart" in g;f.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(g,h,k){var f,j=a.ui[g].prototype;for(f in k){j.plugins[f]=j.plugins[f]||[];j.plugins[f].push([h,k[f]])}},call:function(f,h,g){var j,k=f.plugins[h];if(!k||!f.element[0].parentNode||f.element[0].parentNode.nodeType===11){return}for(j=0;j<k.length;j++){if(f.options[k[j][0]]){k[j][1].apply(f.element,g)}}}},contains:a.contains,hasScroll:function(j,g){if(a(j).css("overflow")==="hidden"){return false}var f=(g&&g==="left")?"scrollLeft":"scrollTop",h=false;if(j[f]>0){return true}j[f]=1;h=(j[f]>0);j[f]=0;return h},isOverAxis:function(g,f,h){return(g>f)&&(g<(f+h))},isOver:function(l,g,k,j,f,h){return a.ui.isOverAxis(l,k,f)&&a.ui.isOverAxis(g,j,h)}})})(jQuery);
/*
 * jQuery UI Widget @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(a,e){var d=Array.prototype.slice,b=a.cleanData;a.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{a(h).triggerHandler("remove")}catch(j){}}b(f)};a.widget=function(g,k,f){var n,m,j,l,h=g.split(".")[0];g=g.split(".")[1];n=h+"-"+g;if(!f){f=k;k=a.Widget}a.expr[":"][n]=function(o){return !!a.data(o,n)};a[h]=a[h]||{};m=a[h][g];j=a[h][g]=function(o,p){if(!this._createWidget){return new j(o,p)}if(arguments.length){this._createWidget(o,p)}};a.extend(j,m,{version:f.version,_proto:a.extend({},f),_childConstructors:[]});l=new k();l.options=a.widget.extend({},l.options);a.each(f,function(p,o){if(a.isFunction(o)){f[p]=(function(){var q=function(){return k.prototype[p].apply(this,arguments)},r=function(s){return k.prototype[p].apply(this,s)};return function(){var u=this._super,s=this._superApply,t;this._super=q;this._superApply=r;t=o.apply(this,arguments);this._super=u;this._superApply=s;return t}})()}});j.prototype=a.widget.extend(l,{widgetEventPrefix:g},f,{constructor:j,namespace:h,widgetName:g,widgetBaseClass:n,widgetFullName:n});if(m){a.each(m._childConstructors,function(p,q){var o=q.prototype;a.widget(o.namespace+"."+o.widgetName,j,q._proto)});delete m._childConstructors}else{k._childConstructors.push(j)}a.widget.bridge(g,j)};a.widget.extend=function(l){var g=d.call(arguments,1),k=0,f=g.length,h,j;for(;k<f;k++){for(h in g[k]){j=g[k][h];if(g[k].hasOwnProperty(h)&&j!==e){l[h]=a.isPlainObject(j)?a.widget.extend({},l[h],j):j}}}return l};a.widget.bridge=function(g,f){var h=f.prototype.widgetFullName;a.fn[g]=function(l){var j=typeof l==="string",k=d.call(arguments,1),m=this;l=!j&&k.length?a.widget.extend.apply(null,[l].concat(k)):l;if(j){this.each(function(){var o,n=a.data(this,h);if(!n){return a.error("cannot call methods on "+g+" prior to initialization; attempted to call method '"+l+"'")}if(!a.isFunction(n[l])||l.charAt(0)==="_"){return a.error("no such method '"+l+"' for "+g+" widget instance")}o=n[l].apply(n,k);if(o!==n&&o!==e){m=o&&o.jquery?m.pushStack(o.get()):o;return false}})}else{this.each(function(){var n=a.data(this,h);if(n){n.option(l||{})._init()}else{new f(l,this)}})}return m}};a.Widget=function(f,g){};a.Widget._childConstructors=[];a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(f,g){g=a(g||this.defaultElement||this)[0];this.element=a(g);this.options=a.widget.extend({},this.options,this._getCreateOptions(),f);this.bindings=a();this.hoverable=a();this.focusable=a();if(g!==this){a.data(g,this.widgetName,this);a.data(g,this.widgetFullName,this);this._bind({remove:"destroy"});this.document=a(g.style?g.ownerDocument:g.document||g);this.window=a(this.document[0].defaultView||this.document[0].parentWindow)}this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy();this.element.unbind("."+this.widgetName).removeData(this.widgetName).removeData(this.widgetFullName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind("."+this.widgetName);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(j,k){var f=j,l,h,g;if(arguments.length===0){return a.widget.extend({},this.options)}if(typeof j==="string"){f={};l=j.split(".");j=l.shift();if(l.length){h=f[j]=a.widget.extend({},this.options[j]);for(g=0;g<l.length-1;g++){h[l[g]]=h[l[g]]||{};h=h[l[g]]}j=l.pop();if(k===e){return h[j]===e?null:h[j]}h[j]=k}else{if(k===e){return this.options[j]===e?null:this.options[j]}f[j]=k}}this._setOptions(f);return this},_setOptions:function(f){var g;for(g in f){this._setOption(g,f[g])}return this},_setOption:function(f,g){this.options[f]=g;if(f==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!g).attr("aria-disabled",g);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_bind:function(h,g){if(!g){g=h;h=this.element}else{h=a(h);this.bindings=this.bindings.add(h)}var f=this;a.each(g,function(o,n){function l(){if(f.options.disabled===true||a(this).hasClass("ui-state-disabled")){return}return(typeof n==="string"?f[n]:n).apply(f,arguments)}if(typeof n!=="string"){l.guid=n.guid=n.guid||l.guid||jQuery.guid++}var m=o.match(/^(\w+)\s*(.*)$/),k=m[1]+"."+f.widgetName,j=m[2];if(j){f.widget().delegate(j,k,l)}else{h.bind(k,l)}})},_delay:function(j,h){function g(){return(typeof j==="string"?f[j]:j).apply(f,arguments)}var f=this;return setTimeout(g,h||0)},_hoverable:function(f){this.hoverable=this.hoverable.add(f);this._bind(f,{mouseenter:function(g){a(g.currentTarget).addClass("ui-state-hover")},mouseleave:function(g){a(g.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(f){this.focusable=this.focusable.add(f);this._bind(f,{focusin:function(g){a(g.currentTarget).addClass("ui-state-focus")},focusout:function(g){a(g.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(f,g,h){var l,k,j=this.options[f];h=h||{};g=a.Event(g);g.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase();g.target=this.element[0];k=g.originalEvent;if(k){for(l in k){if(!(l in g)){g[l]=k[l]}}}this.element.trigger(g,h);return !(a.isFunction(j)&&j.apply(this.element[0],[g].concat(h))===false||g.isDefaultPrevented())}};a.each({show:"fadeIn",hide:"fadeOut"},function(g,f){a.Widget.prototype["_"+g]=function(k,j,m){if(typeof j==="string"){j={effect:j}}var l,h=!j?g:j===true||typeof j==="number"?f:j.effect||f;j=j||{};if(typeof j==="number"){j={duration:j}}l=!a.isEmptyObject(j);j.complete=m;if(j.delay){k.delay(j.delay)}if(l&&a.effects&&(a.effects.effect[h]||a.uiBackCompat!==false&&a.effects[h])){k[g](j)}else{if(h!==g&&k[h]){k[h](j.duration,j.easing,m)}else{k.queue(function(n){a(this)[g]();if(m){m.call(k[0])}n()})}}}});if(a.uiBackCompat!==false){a.Widget.prototype._getCreateOptions=function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]}}})(jQuery);
/*
 * jQuery UI Position @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Position
 */
(function(g,d){g.ui=g.ui||{};var f=/left|center|right/,j=/top|center|bottom/,b=/[\+\-]\d+%?/,k=/^\w+/,e=/%$/,a="center",h=g.fn.position;g.position={scrollbarWidth:function(){var m,l,o=g("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),n=o.children()[0];g("body").append(o);m=n.offsetWidth;o.css("overflow","scroll");l=n.offsetWidth;if(m===l){l=o[0].clientWidth}o.remove();return m-l},getScrollInfo:function(n){var p=n[0]!==window,m=p?n.css("overflow-x"):"",l=p?n.css("overflow-y"):"",o=m==="auto"||m==="scroll"?g.position.scrollbarWidth():0,q=l==="auto"||l==="scroll"?g.position.scrollbarWidth():0;return{height:n.height()<n[0].scrollHeight?q:0,width:n.width()<n[0].scrollWidth?o:0}}};g.fn.position=function(t){if(!t||!t.of){return h.apply(this,arguments)}t=g.extend({},t);var p=g(t.of),m=g(t.within||window),q=p[0],s=(t.collision||"flip").split(" "),l={},u,r,o,n;if(q.nodeType===9){r=p.width();o=p.height();n={top:0,left:0}}else{if(g.isWindow(q)){r=p.width();o=p.height();n={top:p.scrollTop(),left:p.scrollLeft()}}else{if(q.preventDefault){t.at="left top";r=o=0;n={top:t.of.pageY,left:t.of.pageX}}else{r=p.outerWidth();o=p.outerHeight();n=p.offset()}}}g.each(["my","at"],function(){var x=(t[this]||"").split(" "),w,v;if(x.length===1){x=f.test(x[0])?x.concat([a]):j.test(x[0])?[a].concat(x):[a,a]}x[0]=f.test(x[0])?x[0]:a;x[1]=j.test(x[1])?x[1]:a;w=b.exec(x[0]);v=b.exec(x[1]);l[this]=[w?w[0]:0,v?v[0]:0];t[this]=[k.exec(x[0])[0],k.exec(x[1])[0]]});if(s.length===1){s[1]=s[0]}if(t.at[0]==="right"){n.left+=r}else{if(t.at[0]===a){n.left+=r/2}}if(t.at[1]==="bottom"){n.top+=o}else{if(t.at[1]===a){n.top+=o/2}}u=[parseInt(l.at[0],10)*(e.test(l.at[0])?r/100:1),parseInt(l.at[1],10)*(e.test(l.at[1])?o/100:1)];n.left+=u[0];n.top+=u[1];return this.each(function(){var z=g(this),B=z.outerWidth(),x=z.outerHeight(),A=parseInt(g.css(this,"marginLeft"),10)||0,w=parseInt(g.css(this,"marginTop"),10)||0,y=g.position.getScrollInfo(m),E=B+A+(parseInt(g.css(this,"marginRight"),10)||0)+y.width,F=x+w+(parseInt(g.css(this,"marginBottom"),10)||0)+y.height,C=g.extend({},n),D=[parseInt(l.my[0],10)*(e.test(l.my[0])?z.outerWidth()/100:1),parseInt(l.my[1],10)*(e.test(l.my[1])?z.outerHeight()/100:1)],v;if(t.my[0]==="right"){C.left-=B}else{if(t.my[0]===a){C.left-=B/2}}if(t.my[1]==="bottom"){C.top-=x}else{if(t.my[1]===a){C.top-=x/2}}C.left+=D[0];C.top+=D[1];if(!g.support.offsetFractions){C.left=Math.round(C.left);C.top=Math.round(C.top)}v={marginLeft:A,marginTop:w};g.each(["left","top"],function(H,G){if(g.ui.position[s[H]]){g.ui.position[s[H]][G](C,{targetWidth:r,targetHeight:o,elemWidth:B,elemHeight:x,collisionPosition:v,collisionWidth:E,collisionHeight:F,offset:[u[0]+D[0],u[1]+D[1]],my:t.my,at:t.at,within:m,elem:z})}});if(g.fn.bgiframe){z.bgiframe()}z.offset(g.extend(C,{using:t.using}))})};g.ui.position={fit:{left:function(q,p){var o=p.within,s=g(window),n=g.isWindow(p.within[0]),u=n?s.scrollLeft():o.offset().left,w=n?s.width():o.outerWidth(),r=q.left-p.collisionPosition.marginLeft,v=u-r,m=r+p.collisionWidth-w-u,l,t;if(p.collisionWidth>w){if(v>0&&m<=0){l=q.left+v+p.collisionWidth-w-u;q.left+=v-l}else{if(m>0&&v<=0){q.left=u}else{if(v>m){q.left=u+w-p.collisionWidth}else{q.left=u}}}}else{if(v>0){q.left+=v}else{if(m>0){q.left-=m}else{q.left=Math.max(q.left-r,q.left)}}}},top:function(p,o){var n=o.within,s=g(window),m=g.isWindow(o.within[0]),v=m?s.scrollTop():n.offset().top,w=m?s.height():n.outerHeight(),r=p.top-o.collisionPosition.marginTop,t=v-r,q=r+o.collisionHeight-w-v,u,l;if(o.collisionHeight>w){if(t>0&&q<=0){l=p.top+t+o.collisionHeight-w-v;p.top+=t-l}else{if(q>0&&t<=0){p.top=v}else{if(t>q){p.top=v+w-o.collisionHeight}else{p.top=v}}}}else{if(t>0){p.top+=t}else{if(q>0){p.top-=q}else{p.top=Math.max(p.top-r,p.top)}}}}},flip:{left:function(t,s){if(s.at[0]===a){return}s.elem.removeClass("ui-flipped-left ui-flipped-right");var r=s.within,v=g(window),n=g.isWindow(s.within[0]),y=(n?0:r.offset().left)+r.scrollLeft(),B=n?r.width():r.outerWidth(),p=n?0:r.offset().left,u=t.left-s.collisionPosition.marginLeft,z=u-p,m=u+s.collisionWidth-B-p,o=s.my[0]==="left",x=s.my[0]==="left"?-s.elemWidth:s.my[0]==="right"?s.elemWidth:0,A=s.at[0]==="left"?s.targetWidth:-s.targetWidth,q=-2*s.offset[0],l,w;if(z<0){l=t.left+x+A+q+s.collisionWidth-B-y;if(l<0||l<Math.abs(z)){s.elem.addClass("ui-flipped-right");t.left+=x+A+q}}else{if(m>0){w=t.left-s.collisionPosition.marginLeft+x+A+q-p;if(w>0||Math.abs(w)<m){s.elem.addClass("ui-flipped-left");t.left+=x+A+q}}}},top:function(r,q){if(q.at[1]===a){return}q.elem.removeClass("ui-flipped-top ui-flipped-bottom");var p=q.within,u=g(window),n=g.isWindow(q.within[0]),z=(n?0:p.offset().top)+p.scrollTop(),A=n?p.height():p.outerHeight(),l=n?0:p.offset().top,t=r.top-q.collisionPosition.marginTop,w=t-l,s=t+q.collisionHeight-A-l,x=q.my[1]==="top",v=x?-q.elemHeight:q.my[1]==="bottom"?q.elemHeight:0,B=q.at[1]==="top"?q.targetHeight:-q.targetHeight,o=-2*q.offset[1],y,m;if(w<0){m=r.top+v+B+o+q.collisionHeight-A-z;if((r.top+v+B+o)>w&&(m<0||m<Math.abs(w))){q.elem.addClass("ui-flipped-bottom");r.top+=v+B+o}}else{if(s>0){y=r.top-q.collisionPosition.marginTop+v+B+o-l;if((r.top+v+B+o)>s&&(y>0||Math.abs(y)<s)){q.elem.addClass("ui-flipped-top");r.top+=v+B+o}}}}},flipfit:{left:function(){g.ui.position.flip.left.apply(this,arguments);g.ui.position.fit.left.apply(this,arguments)},top:function(){g.ui.position.flip.top.apply(this,arguments);g.ui.position.fit.top.apply(this,arguments)}}};(function(){var p,r,m,o,n,l=document.getElementsByTagName("body")[0],q=document.createElement("div");p=document.createElement(l?"div":"body");m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(l){g.extend(m,{position:"absolute",left:"-1000px",top:"-1000px"})}for(n in m){p.style[n]=m[n]}p.appendChild(q);r=l||document.documentElement;r.insertBefore(p,r.firstChild);q.style.cssText="position: absolute; left: 10.7432222px;";o=g(q).offset().left;g.support.offsetFractions=o>10&&o<11;p.innerHTML="";r.removeChild(p)})();if(g.uiBackCompat!==false){(function(m){var l=m.fn.position;m.fn.position=function(o){if(!o||!o.offset){return l.call(this,o)}var p=o.offset.split(" "),n=o.at.split(" ");if(p.length===1){p[1]=p[0]}if(/^\d/.test(p[0])){p[0]="+"+p[0]}if(/^\d/.test(p[1])){p[1]="+"+p[1]}if(n.length===1){if(/left|center|right/.test(n[0])){n[1]="center"}else{n[1]=n[0];n[0]="center"}}return l.call(this,m.extend(o,{at:n[0]+p[0]+" "+n[1]+p[1],offset:d}))}}(jQuery))}}(jQuery));
/*
 * jQuery UI Menu @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Menu
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(b){var a=0;b.widget("ui.menu",{version:"@VERSION",defaultElement:"<ul>",delay:300,options:{menus:"ul",position:{my:"left top",at:"right top"},blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.menuId=this.element.attr("id")||"ui-menu-"+a++;if(this.element.find(".ui-icon").length){this.element.addClass("ui-menu-icons")}this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({id:this.menuId,role:"menu",tabIndex:0}).bind("click.menu",b.proxy(function(d){if(this.options.disabled){d.preventDefault()}},this));if(this.options.disabled){this.element.addClass("ui-state-disabled")}this._bind({"mousedown .ui-menu-item > a":function(d){d.preventDefault()},"click .ui-state-disabled > a":function(d){d.preventDefault()},"click .ui-menu-item:has(a)":function(d){d.stopImmediatePropagation();if(!b(d.target).closest(".ui-menu-item").is(".ui-state-disabled")){this.select(d);this._delay(function(){if(!this.element.is(":focus")){this.element.focus()}},20)}},"mouseover .ui-menu-item":function(d){d.stopImmediatePropagation();var e=b(d.currentTarget);e.siblings().children(".ui-state-active").removeClass("ui-state-active");this.focus(d,e)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(d){var f=this.element,e=f.children(".ui-menu-item").not(".ui-state-disabled").eq(0);if(this._hasScroll()&&!this.active){f.children().each(function(){var g=b(this);if(g.offset().top-f.offset().top>=0){e=g;return false}})}else{if(this.active){e=this.active}}this.focus(d,e)},blur:function(d){this._delay(function(){if(!b.contains(this.element[0],this.document[0].activeElement)){this.collapseAll(d)}})},keydown:"_keydown"});this.refresh();this._bind(this.document,{click:function(d){if(!b(d.target).closest(".ui-menu").length){this.collapseAll(d)}}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").show();this.element.find(".ui-menu-item").unbind(".menu").removeClass("ui-menu-item").removeAttr("role").children("a").removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").removeAttr("id").children(".ui-icon").remove()},_keydown:function(h){switch(h.keyCode){case b.ui.keyCode.PAGE_UP:this.previousPage(h);h.preventDefault();h.stopImmediatePropagation();break;case b.ui.keyCode.PAGE_DOWN:this.nextPage(h);h.preventDefault();h.stopImmediatePropagation();break;case b.ui.keyCode.HOME:this._move("first","first",h);h.preventDefault();h.stopImmediatePropagation();break;case b.ui.keyCode.END:this._move("last","last",h);h.preventDefault();h.stopImmediatePropagation();break;case b.ui.keyCode.UP:this.previous(h);h.preventDefault();h.stopImmediatePropagation();break;case b.ui.keyCode.DOWN:this.next(h);h.preventDefault();h.stopImmediatePropagation();break;case b.ui.keyCode.LEFT:if(this.collapse(h)){h.stopImmediatePropagation()}h.preventDefault();break;case b.ui.keyCode.RIGHT:if(this.expand(h)){h.stopImmediatePropagation()}h.preventDefault();break;case b.ui.keyCode.ENTER:if(this.active.children("a[aria-haspopup='true']").length){if(this.expand(h)){h.stopImmediatePropagation()}}else{this.select(h);h.stopImmediatePropagation()}h.preventDefault();break;case b.ui.keyCode.ESCAPE:if(this.collapse(h)){h.stopImmediatePropagation()}h.preventDefault();break;default:h.stopPropagation();clearTimeout(this.filterTimer);var d,g=this.previousFilter||"",j=String.fromCharCode(h.keyCode),f=false;if(j===g){f=true}else{j=g+j}function e(k){return k.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}d=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+e(j),"i").test(b(this).children("a").text())});d=f&&d.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):d;if(!d.length){j=String.fromCharCode(h.keyCode);d=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+e(j),"i").test(b(this).children("a").text())})}if(d.length){this.focus(h,d);if(d.length>1){this.previousFilter=j;this.filterTimer=this._delay(function(){delete this.previousFilter},1000)}else{delete this.previousFilter}}else{delete this.previousFilter}}},refresh:function(){var e,f=this.menuId,d=this.element.find(this.options.menus+":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:"menu","aria-hidden":"true","aria-expanded":"false"});e=d.add(this.element);e.children(":not( .ui-menu-item ):has( a )").addClass("ui-menu-item").attr("role","presentation").children("a").addClass("ui-corner-all").attr("tabIndex",-1).attr("role","menuitem").attr("id",function(g){return f+"-"+g});e.children(":not(.ui-menu-item)").each(function(){var g=b(this);if(!/[^\-—–\s]/.test(g.text())){g.addClass("ui-widget-content ui-menu-divider")}});d.each(function(){var h=b(this),g=h.prev("a");g.attr("aria-haspopup","true").prepend('<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>');h.attr("aria-labelledby",g.attr("id"))})},focus:function(d,l){var j,f,m,g,k,h,e;this.blur(d);if(this._hasScroll()){f=parseFloat(b.css(this.activeMenu[0],"borderTopWidth"))||0;m=parseFloat(b.css(this.activeMenu[0],"paddingTop"))||0;g=l.offset().top-this.activeMenu.offset().top-f-m;k=this.activeMenu.scrollTop();h=this.activeMenu.height();e=l.height();if(g<0){this.activeMenu.scrollTop(k+g)}else{if(g+e>h){this.activeMenu.scrollTop(k+g-h+e)}}}this.active=l.first();this.element.attr("aria-activedescendant",this.active.children("a").addClass("ui-state-focus").attr("id"));this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active");this.timer=this._delay(function(){this._close()},this.delay);j=b("> .ui-menu",l);if(j.length&&(/^mouse/.test(d.type))){this._startOpening(j)}this.activeMenu=l.parent();this._trigger("focus",d,{item:l})},blur:function(d){clearTimeout(this.timer);if(!this.active){return}this.active.children("a").removeClass("ui-state-focus");this.active=null;this._trigger("blur",d,{item:this.active})},_startOpening:function(d){clearTimeout(this.timer);if(d.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();this._open(d)},this.delay)},_open:function(e){clearTimeout(this.timer);this.element.find(".ui-menu").not(e.parents()).hide().attr("aria-hidden","true");var d=b.extend({},{of:this.active},b.type(this.options.position)==="function"?this.options.position(this.active):this.options.position);e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(d)},collapseAll:function(e,d){clearTimeout(this.timer);this.timer=this._delay(function(){var f=d?this.element:b(e&&e.target).closest(this.element.find(".ui-menu"));if(!f.length){f=this.element}this._close(f);this.blur(e);this.activeMenu=f},this.delay)},_close:function(d){if(!d){d=this.active?this.active.parent():this.element}d.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var d=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(d&&d.length){this._close();this.focus(e,d);return true}},expand:function(e){var d=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").not(".ui-state-disabled").first();if(d&&d.length){this._open(d.parent());this._delay(function(){this.focus(e,d)},20);return true}},next:function(d){this._move("next","first",d)},previous:function(d){this._move("prev","last",d)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(g,e,f){var d;if(this.active){if(g==="first"||g==="last"){d=this.active[g==="first"?"prevAll":"nextAll"](".ui-menu-item").not(".ui-state-disabled").eq(-1)}else{d=this.active[g+"All"](".ui-menu-item").not(".ui-state-disabled").eq(0)}}if(!d||!d.length||!this.active){d=this.activeMenu.children(".ui-menu-item")[e]()}this.focus(f,d);if(d.is(".ui-state-disabled")){this._move(g,e,f)}},nextPage:function(f){if(!this.active){this._move("next","first",f);return}if(this.isLastItem()){return}if(this._hasScroll()){var g=this.active.offset().top,e=this.element.height(),d;this.active.nextAll(".ui-menu-item").not(".ui-state-disabled").each(function(){d=b(this);return b(this).offset().top-g-e<0});this.focus(f,d)}else{this.focus(f,this.activeMenu.children(".ui-menu-item").not(".ui-state-disabled")[!this.active?"first":"last"]())}},previousPage:function(f){if(!this.active){this._move("next","first",f);return}if(this.isFirstItem()){return}if(this._hasScroll()){var g=this.active.offset().top,e=this.element.height(),d;this.active.prevAll(".ui-menu-item").not(".ui-state-disabled").each(function(){d=b(this);return b(this).offset().top-g+e>0});this.focus(f,d)}else{this.focus(f,this.activeMenu.children(".ui-menu-item").not(".ui-state-disabled").first())}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(d){var e={item:this.active};this.collapseAll(d,true);this._trigger("select",d,e)}})}(jQuery));