/*
 * 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(a2,aB){var x,af,p=a2.document,aI=a2.location,d=a2.navigator,bg=a2.jQuery,I=a2.$,am=Array.prototype.push,a4=Array.prototype.slice,aK=Array.prototype.indexOf,A=Object.prototype.toString,V=Object.prototype.hasOwnProperty,aN=String.prototype.trim,bG=function(e,bZ){return new bG.fn.init(e,bZ,x)},bx=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,aa=/\S/,aV=/\s+/,D=aa.test("\xA0")?(/^[\s\xA0]+|[\s\xA0]+$/g):/^\s+|\s+$/g,bo=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,a=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,bf=/^[\],:{}\s]*$/,bi=/(?:^|:|,)(?:\s*\[)+/g,bD=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,a0=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,bP=/^-ms-/,aU=/-([\da-z])/gi,N=function(e,bZ){return(bZ+"").toUpperCase()},aF=function(){if(p.addEventListener){p.removeEventListener("DOMContentLoaded",aF,false);bG.ready()}else{if(p.readyState==="complete"){p.detachEvent("onreadystatechange",aF);bG.ready()}}},Z={};bG.fn=bG.prototype={constructor:bG,init:function(e,b2,b1){var b0,b3,bZ,b4;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){b0=[null,e,null]}else{b0=bo.exec(e)}if(b0&&(b0[1]||!b2)){if(b0[1]){b2=b2 instanceof bG?b2[0]:b2;b4=(b2&&b2.nodeType?b2.ownerDocument||b2:p);e=bG.parseHTML(b0[1],b4,true);if(a.test(b0[1])&&bG.isPlainObject(b2)){this.attr.call(e,b2,true)}return bG.merge(this,e)}else{b3=p.getElementById(b0[2]);if(b3&&b3.parentNode){if(b3.id!==b0[2]){return b1.find(e)}this.length=1;this[0]=b3}this.context=p;this.selector=e;return this}}else{if(!b2||b2.jquery){return(b2||b1).find(e)}else{return this.constructor(b2).find(e)}}}else{if(bG.isFunction(e)){return b1.ready(e)}}if(e.selector!==aB){this.selector=e.selector;this.context=e.context}return bG.makeArray(e,this)},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return a4.call(this)},get:function(e){return e==null?this.toArray():(e<0?this[this.length+e]:this[e])},pushStack:function(bZ,b1,e){var b0=bG.merge(this.constructor(),bZ);b0.prevObject=this;b0.context=this.context;if(b1==="find"){b0.selector=this.selector+(this.selector?" ":"")+e}else{if(b1){b0.selector=this.selector+"."+b1+"("+e+")"}}return b0},each:function(bZ,e){return bG.each(this,bZ,e)},ready:function(e){bG.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(a4.apply(this,arguments),"slice",a4.call(arguments).join(","))},map:function(e){return this.pushStack(bG.map(this,function(b0,bZ){return e.call(b0,bZ,b0)}))},end:function(){return this.prevObject||this.constructor(null)},push:am,sort:[].sort,splice:[].splice};bG.fn.init.prototype=bG.fn;bG.extend=bG.fn.extend=function(){var b7,b0,e,bZ,b4,b5,b3=arguments[0]||{},b2=1,b1=arguments.length,b6=false;if(typeof b3==="boolean"){b6=b3;b3=arguments[1]||{};b2=2}if(typeof b3!=="object"&&!bG.isFunction(b3)){b3={}}if(b1===b2){b3=this;--b2}for(;b2<b1;b2++){if((b7=arguments[b2])!=null){for(b0 in b7){e=b3[b0];bZ=b7[b0];if(b3===bZ){continue}if(b6&&bZ&&(bG.isPlainObject(bZ)||(b4=bG.isArray(bZ)))){if(b4){b4=false;b5=e&&bG.isArray(e)?e:[]}else{b5=e&&bG.isPlainObject(e)?e:{}}b3[b0]=bG.extend(b6,b5,bZ)}else{if(bZ!==aB){b3[b0]=bZ}}}}}return b3};bG.extend({noConflict:function(e){if(a2.$===bG){a2.$=I}if(e&&a2.jQuery===bG){a2.jQuery=bg}return bG},isReady:false,readyWait:1,holdReady:function(e){if(e){bG.readyWait++}else{bG.ready(true)}},ready:function(e){if(e===true?--bG.readyWait:bG.isReady){return}if(!p.body){return setTimeout(bG.ready,1)}bG.isReady=true;if(e!==true&&--bG.readyWait>0){return}af.resolveWith(p,[bG]);if(bG.fn.trigger){bG(p).trigger("ready").off("ready")}},isFunction:function(e){return bG.type(e)==="function"},isArray:Array.isArray||function(e){return bG.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):Z[A.call(e)]||"object"},isPlainObject:function(b1){if(!b1||bG.type(b1)!=="object"||b1.nodeType||bG.isWindow(b1)){return false}try{if(b1.constructor&&!V.call(b1,"constructor")&&!V.call(b1.constructor.prototype,"isPrototypeOf")){return false}}catch(b0){return false}var bZ;for(bZ in b1){}return bZ===aB||V.call(b1,bZ)},isEmptyObject:function(bZ){var e;for(e in bZ){return false}return true},error:function(e){throw new Error(e)},parseHTML:function(b1,b0,e){var bZ;if(!b1||typeof b1!=="string"){return null}if(typeof b0==="boolean"){e=b0;b0=0}b0=b0||p;if((bZ=a.exec(b1))){return[b0.createElement(bZ[1])]}bZ=bG.buildFragment([b1],b0,e?null:[]);return bG.merge([],(bZ.cacheable?bG.clone(bZ.fragment):bZ.fragment).childNodes)},parseJSON:function(e){if(!e||typeof e!=="string"){return null}e=bG.trim(e);if(a2.JSON&&a2.JSON.parse){return a2.JSON.parse(e)}if(bf.test(e.replace(bD,"@").replace(a0,"]").replace(bi,""))){return(new Function("return "+e))()}bG.error("Invalid JSON: "+e)},parseXML:function(b1){var bZ,b0;if(!b1||typeof b1!=="string"){return null}try{if(a2.DOMParser){b0=new DOMParser();bZ=b0.parseFromString(b1,"text/xml")}else{bZ=new ActiveXObject("Microsoft.XMLDOM");bZ.async="false";bZ.loadXML(b1)}}catch(b2){bZ=aB}if(!bZ||!bZ.documentElement||bZ.getElementsByTagName("parsererror").length){bG.error("Invalid XML: "+b1)}return bZ},noop:function(){},globalEval:function(e){if(e&&aa.test(e)){(a2.execScript||function(bZ){a2["eval"].call(a2,bZ)})(e)}},camelCase:function(e){return e.replace(bP,"ms-").replace(aU,N)},nodeName:function(bZ,e){return bZ.nodeName&&bZ.nodeName.toUpperCase()===e.toUpperCase()},each:function(b3,b4,b0){var bZ,b1=0,b2=b3.length,e=b2===aB||bG.isFunction(b3);if(b0){if(e){for(bZ in b3){if(b4.apply(b3[bZ],b0)===false){break}}}else{for(;b1<b2;){if(b4.apply(b3[b1++],b0)===false){break}}}}else{if(e){for(bZ in b3){if(b4.call(b3[bZ],bZ,b3[bZ])===false){break}}}else{for(;b1<b2;){if(b4.call(b3[b1],b1,b3[b1++])===false){break}}}}return b3},trim:aN?function(e){return e==null?"":aN.call(e)}:function(e){return e==null?"":e.toString().replace(D,"")},makeArray:function(e,b0){var b1,bZ=b0||[];if(e!=null){b1=bG.type(e);if(e.length==null||b1==="string"||b1==="function"||b1==="regexp"||bG.isWindow(e)){am.call(bZ,e)}else{bG.merge(bZ,e)}}return bZ},inArray:function(b1,bZ,b0){var e;if(bZ){if(aK){return aK.call(bZ,b1,b0)}e=bZ.length;b0=b0?b0<0?Math.max(0,e+b0):b0:0;for(;b0<e;b0++){if(b0 in bZ&&bZ[b0]===b1){return b0}}}return -1},merge:function(b2,b0){var e=b0.length,b1=b2.length,bZ=0;if(typeof e==="number"){for(;bZ<e;bZ++){b2[b1++]=b0[bZ]}}else{while(b0[bZ]!==aB){b2[b1++]=b0[bZ++]}}b2.length=b1;return b2},grep:function(bZ,b4,e){var b3,b0=[],b1=0,b2=bZ.length;e=!!e;for(;b1<b2;b1++){b3=!!b4(bZ[b1],b1);if(e!==b3){b0.push(bZ[b1])}}return b0},map:function(e,b5,b6){var b3,b4,b2=[],b0=0,bZ=e.length,b1=e instanceof bG||bZ!==aB&&typeof bZ==="number"&&((bZ>0&&e[0]&&e[bZ-1])||bZ===0||bG.isArray(e));if(b1){for(;b0<bZ;b0++){b3=b5(e[b0],b0,b6);if(b3!=null){b2[b2.length]=b3}}}else{for(b4 in e){b3=b5(e[b4],b4,b6);if(b3!=null){b2[b2.length]=b3}}}return b2.concat.apply([],b2)},guid:1,proxy:function(b2,b1){var b0,e,bZ;if(typeof b1==="string"){b0=b2[b1];b1=b2;b2=b0}if(!bG.isFunction(b2)){return aB}e=a4.call(arguments,2);bZ=function(){return b2.apply(b1,e.concat(a4.call(arguments)))};bZ.guid=b2.guid=b2.guid||bZ.guid||bG.guid++;return bZ},access:function(e,b4,b7,b5,b2,b8,b6){var b0,b3=b7==null,b1=0,bZ=e.length;if(b7&&typeof b7==="object"){for(b1 in b7){bG.access(e,b4,b1,b7[b1],1,b8,b5)}b2=1}else{if(b5!==aB){b0=b6===aB&&bG.isFunction(b5);if(b3){if(b0){b0=b4;b4=function(ca,b9,cb){return b0.call(bG(ca),cb)}}else{b4.call(e,b5);b4=null}}if(b4){for(;b1<bZ;b1++){b4(e[b1],b7,b0?b5.call(e[b1],b1,b4(e[b1],b7)):b5,b6)}}b2=1}}return b2?e:b3?b4.call(e):bZ?b4(e[0],b7):b8},now:function(){return(new Date()).getTime()}});bG.ready.promise=function(b2){if(!af){af=bG.Deferred();if(p.readyState==="complete"||(p.readyState!=="loading"&&p.addEventListener)){setTimeout(bG.ready,1)}else{if(p.addEventListener){p.addEventListener("DOMContentLoaded",aF,false);a2.addEventListener("load",bG.ready,false)}else{p.attachEvent("onreadystatechange",aF);a2.attachEvent("onload",bG.ready);var b1=false;try{b1=a2.frameElement==null&&p.documentElement}catch(b0){}if(b1&&b1.doScroll){(function bZ(){if(!bG.isReady){try{b1.doScroll("left")}catch(b3){return setTimeout(bZ,50)}bG.ready()}})()}}}}return af.promise(b2)};bG.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(bZ,e){Z["[object "+e+"]"]=e.toLowerCase()});x=bG(p);var bU={};function ac(bZ){var e=bU[bZ]={};bG.each(bZ.split(aV),function(b1,b0){e[b0]=true});return e}bG.Callbacks=function(b8){b8=typeof b8==="string"?(bU[b8]||ac(b8)):bG.extend({},b8);var b1,e,b2,b0,b3,b4,b5=[],b6=!b8.once&&[],bZ=function(b9){b1=b8.memory&&b9;e=true;b4=b0||0;b0=0;b3=b5.length;b2=true;for(;b5&&b4<b3;b4++){if(b5[b4].apply(b9[0],b9[1])===false&&b8.stopOnFalse){b1=false;break}}b2=false;if(b5){if(b6){if(b6.length){bZ(b6.shift())}}else{if(b1){b5=[]}else{b7.disable()}}}},b7={add:function(){if(b5){var ca=b5.length;(function b9(cb){bG.each(cb,function(cd,cc){if(bG.isFunction(cc)&&(!b8.unique||!b7.has(cc))){b5.push(cc)}else{if(cc&&cc.length){b9(cc)}}})})(arguments);if(b2){b3=b5.length}else{if(b1){b0=ca;bZ(b1)}}}return this},remove:function(){if(b5){bG.each(arguments,function(cb,b9){var ca;while((ca=bG.inArray(b9,b5,ca))>-1){b5.splice(ca,1);if(b2){if(ca<=b3){b3--}if(ca<=b4){b4--}}}})}return this},has:function(b9){return bG.inArray(b9,b5)>-1},empty:function(){b5=[];return this},disable:function(){b5=b6=b1=aB;return this},disabled:function(){return !b5},lock:function(){b6=aB;if(!b1){b7.disable()}return this},locked:function(){return !b6},fireWith:function(ca,b9){b9=b9||[];b9=[ca,b9.slice?b9.slice():b9];if(b5&&(!e||b6)){if(b2){b6.push(b9)}else{bZ(b9)}}return this},fire:function(){b7.fireWith(this,arguments);return this},fired:function(){return !!e}};return b7};bG.extend({Deferred:function(b0){var bZ=[["resolve","done",bG.Callbacks("once memory"),"resolved"],["reject","fail",bG.Callbacks("once memory"),"rejected"],["notify","progress",bG.Callbacks("memory")]],b1="pending",b2={state:function(){return b1},always:function(){e.done(arguments).fail(arguments);return this},then:function(){var b3=arguments;return bG.Deferred(function(b4){bG.each(bZ,function(b6,b5){var b8=b5[0],b7=b3[b6];e[b5[1]](bG.isFunction(b7)?function(){var b9=b7.apply(this,arguments);if(b9&&bG.isFunction(b9.promise)){b9.promise().done(b4.resolve).fail(b4.reject).progress(b4.notify)}else{b4[b8+"With"](this===e?b4:this,[b9])}}:b4[b8])});b3=null}).promise()},promise:function(b3){return typeof b3==="object"?bG.extend(b3,b2):b2}},e={};b2.pipe=b2.then;bG.each(bZ,function(b4,b3){var b6=b3[2],b5=b3[3];b2[b3[1]]=b6.add;if(b5){b6.add(function(){b1=b5},bZ[b4^1][2].disable,bZ[2][2].lock)}e[b3[0]]=b6.fire;e[b3[0]+"With"]=b6.fireWith});b2.promise(e);if(b0){b0.call(e,e)}return e},when:function(b2){var b0=0,b4=a4.call(arguments),e=b4.length,bZ=e!==1||(b2&&bG.isFunction(b2.promise))?e:0,b7=bZ===1?b2:bG.Deferred(),b1=function(b9,ca,b8){return function(cb){ca[b9]=this;b8[b9]=arguments.length>1?a4.call(arguments):cb;if(b8===b6){b7.notifyWith(ca,b8)}else{if(!(--bZ)){b7.resolveWith(ca,b8)}}}},b6,b3,b5;if(e>1){b6=new Array(e);b3=new Array(e);b5=new Array(e);for(;b0<e;b0++){if(b4[b0]&&bG.isFunction(b4[b0].promise)){b4[b0].promise().done(b1(b0,b5,b4)).fail(b7.reject).progress(b1(b0,b3,b6))}else{--bZ}}}if(!bZ){b7.resolveWith(b5,b4)}return b7.promise()}});bG.support=(function(){var cb,ca,b8,b9,b2,b7,b6,b4,b3,b1,bZ,b0=p.createElement("div");b0.setAttribute("className","t");b0.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";ca=b0.getElementsByTagName("*");b8=b0.getElementsByTagName("a")[0];b8.style.cssText="top:1px;float:left;opacity:.5";if(!ca||!ca.length||!b8){return{}}b9=p.createElement("select");b2=b9.appendChild(p.createElement("option"));b7=b0.getElementsByTagName("input")[0];cb={leadingWhitespace:(b0.firstChild.nodeType===3),tbody:!b0.getElementsByTagName("tbody").length,htmlSerialize:!!b0.getElementsByTagName("link").length,style:/top/.test(b8.getAttribute("style")),hrefNormalized:(b8.getAttribute("href")==="/a"),opacity:/^0.5/.test(b8.style.opacity),cssFloat:!!b8.style.cssFloat,checkOn:(b7.value==="on"),optSelected:b2.selected,getSetAttribute:b0.className!=="t",enctype:!!p.createElement("form").enctype,html5Clone:p.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",boxModel:(p.compatMode==="CSS1Compat"),submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true,boxSizingReliable:true,pixelPosition:false};b7.checked=true;cb.noCloneChecked=b7.cloneNode(true).checked;b9.disabled=true;cb.optDisabled=!b2.disabled;try{delete b0.test}catch(b5){cb.deleteExpando=false}if(!b0.addEventListener&&b0.attachEvent&&b0.fireEvent){b0.attachEvent("onclick",bZ=function(){cb.noCloneEvent=false});b0.cloneNode(true).fireEvent("onclick");b0.detachEvent("onclick",bZ)}b7=p.createElement("input");b7.value="t";b7.setAttribute("type","radio");cb.radioValue=b7.value==="t";b7.setAttribute("checked","checked");b7.setAttribute("name","t");b0.appendChild(b7);b6=p.createDocumentFragment();b6.appendChild(b0.lastChild);cb.checkClone=b6.cloneNode(true).cloneNode(true).lastChild.checked;cb.appendChecked=b7.checked;b6.removeChild(b7);b6.appendChild(b0);if(b0.attachEvent){for(b3 in {submit:true,change:true,focusin:true}){b4="on"+b3;b1=(b4 in b0);if(!b1){b0.setAttribute(b4,"return;");b1=(typeof b0[b4]==="function")}cb[b3+"Bubbles"]=b1}}bG(function(){var cc,cg,ce,cf,cd="padding:0;margin:0;border:0;display:block;overflow:hidden;",e=p.getElementsByTagName("body")[0];if(!e){return}cc=p.createElement("div");cc.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";e.insertBefore(cc,e.firstChild);cg=p.createElement("div");cc.appendChild(cg);cg.innerHTML="<table><tr><td></td><td>t</td></tr></table>";ce=cg.getElementsByTagName("td");ce[0].style.cssText="padding:0;margin:0;border:0;display:none";b1=(ce[0].offsetHeight===0);ce[0].style.display="";ce[1].style.display="none";cb.reliableHiddenOffsets=b1&&(ce[0].offsetHeight===0);cg.innerHTML="";cg.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%;";cb.boxSizing=(cg.offsetWidth===4);cb.doesNotIncludeMarginInBodyOffset=(e.offsetTop!==1);if(a2.getComputedStyle){cb.pixelPosition=(a2.getComputedStyle(cg,null)||{}).top!=="1%";cb.boxSizingReliable=(a2.getComputedStyle(cg,null)||{width:"4px"}).width==="4px";cf=p.createElement("div");cf.style.cssText=cg.style.cssText=cd;cf.style.marginRight=cf.style.width="0";cg.style.width="1px";cg.appendChild(cf);cb.reliableMarginRight=!parseFloat((a2.getComputedStyle(cf,null)||{}).marginRight)}if(typeof cg.style.zoom!=="undefined"){cg.innerHTML="";cg.style.cssText=cd+"width:1px;padding:1px;display:inline;zoom:1";cb.inlineBlockNeedsLayout=(cg.offsetWidth===3);cg.style.display="block";cg.style.overflow="visible";cg.innerHTML="<div></div>";cg.firstChild.style.width="5px";cb.shrinkWrapBlocks=(cg.offsetWidth!==3);cc.style.zoom=1}e.removeChild(cc);cc=cg=ce=cf=null});b6.removeChild(b0);ca=b8=b9=b2=b7=b6=b0=null;return cb})();var bt=/^(?:\{.*\}|\[.*\])$/,aL=/([A-Z])/g;bG.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(bG.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?bG.cache[e[bG.expando]]:e[bG.expando];return !!e&&!O(e)},data:function(b1,bZ,b3,b2){if(!bG.acceptData(b1)){return}var b4,b6,b7=bG.expando,b5=typeof bZ==="string",b8=b1.nodeType,e=b8?bG.cache:b1,b0=b8?b1[b7]:b1[b7]&&b7;if((!b0||!e[b0]||(!b2&&!e[b0].data))&&b5&&b3===aB){return}if(!b0){if(b8){b1[b7]=b0=bG.deletedIds.pop()||++bG.uuid}else{b0=b7}}if(!e[b0]){e[b0]={};if(!b8){e[b0].toJSON=bG.noop}}if(typeof bZ==="object"||typeof bZ==="function"){if(b2){e[b0]=bG.extend(e[b0],bZ)}else{e[b0].data=bG.extend(e[b0].data,bZ)}}b4=e[b0];if(!b2){if(!b4.data){b4.data={}}b4=b4.data}if(b3!==aB){b4[bG.camelCase(bZ)]=b3}if(b5){b6=b4[bZ];if(b6==null){b6=b4[bG.camelCase(bZ)]}}else{b6=b4}return b6},removeData:function(b1,bZ,b2){if(!bG.acceptData(b1)){return}var b5,b4,b3,b6=b1.nodeType,e=b6?bG.cache:b1,b0=b6?b1[bG.expando]:bG.expando;if(!e[b0]){return}if(bZ){b5=b2?e[b0]:e[b0].data;if(b5){if(!bG.isArray(bZ)){if(bZ in b5){bZ=[bZ]}else{bZ=bG.camelCase(bZ);if(bZ in b5){bZ=[bZ]}else{bZ=bZ.split(" ")}}}for(b4=0,b3=bZ.length;b4<b3;b4++){delete b5[bZ[b4]]}if(!(b2?O:bG.isEmptyObject)(b5)){return}}}if(!b2){delete e[b0].data;if(!O(e[b0])){return}}if(b6){bG.cleanData([b1],true)}else{if(bG.support.deleteExpando||e!=e.window){delete e[b0]}else{e[b0]=null}}},_data:function(bZ,e,b0){return bG.data(bZ,e,b0,true)},acceptData:function(bZ){var e=bZ.nodeName&&bG.noData[bZ.nodeName.toLowerCase()];return !e||e!==true&&bZ.getAttribute("classid")===e}});bG.fn.extend({data:function(b7,b6){var b2,bZ,b5,e,b1,b0=this[0],b4=0,b3=null;if(b7===aB){if(this.length){b3=bG.data(b0);if(b0.nodeType===1&&!bG._data(b0,"parsedAttrs")){b5=b0.attributes;for(b1=b5.length;b4<b1;b4++){e=b5[b4].name;if(e.indexOf("data-")===0){e=bG.camelCase(e.substring(5));bv(b0,e,b3[e])}}bG._data(b0,"parsedAttrs",true)}}return b3}if(typeof b7==="object"){return this.each(function(){bG.data(this,b7)})}b2=b7.split(".",2);b2[1]=b2[1]?"."+b2[1]:"";bZ=b2[1]+"!";return bG.access(this,function(b8){if(b8===aB){b3=this.triggerHandler("getData"+bZ,[b2[0]]);if(b3===aB&&b0){b3=bG.data(b0,b7);b3=bv(b0,b7,b3)}return b3===aB&&b2[1]?this.data(b2[0]):b3}b2[1]=b8;this.each(function(){var b9=bG(this);b9.triggerHandler("setData"+bZ,b2);bG.data(this,b7,b8);b9.triggerHandler("changeData"+bZ,b2)})},null,b6,arguments.length>1,null,false)},removeData:function(e){return this.each(function(){bG.removeData(this,e)})}});function bv(b1,b0,b2){if(b2===aB&&b1.nodeType===1){var bZ="data-"+b0.replace(aL,"-$1").toLowerCase();b2=b1.getAttribute(bZ);if(typeof b2==="string"){try{b2=b2==="true"?true:b2==="false"?false:b2==="null"?null:+b2+""===b2?+b2:bt.test(b2)?bG.parseJSON(b2):b2}catch(b3){}bG.data(b1,b0,b2)}else{b2=aB}}return b2}function O(bZ){var e;for(e in bZ){if(e==="data"&&bG.isEmptyObject(bZ[e])){continue}if(e!=="toJSON"){return false}}return true}bG.extend({queue:function(b0,bZ,b1){var e;if(b0){bZ=(bZ||"fx")+"queue";e=bG._data(b0,bZ);if(b1){if(!e||bG.isArray(b1)){e=bG._data(b0,bZ,bG.makeArray(b1))}else{e.push(b1)}}return e||[]}},dequeue:function(b3,b2){b2=b2||"fx";var bZ=bG.queue(b3,b2),b1=bZ.shift(),e=bG._queueHooks(b3,b2),b0=function(){bG.dequeue(b3,b2)};if(b1==="inprogress"){b1=bZ.shift()}if(b1){if(b2==="fx"){bZ.unshift("inprogress")}delete e.stop;b1.call(b3,b0,e)}if(!bZ.length&&e){e.empty.fire()}},_queueHooks:function(b0,bZ){var e=bZ+"queueHooks";return bG._data(b0,e)||bG._data(b0,e,{empty:bG.Callbacks("once memory").add(function(){bG.removeData(b0,bZ+"queue",true);bG.removeData(b0,e,true)})})}});bG.fn.extend({queue:function(e,bZ){var b0=2;if(typeof e!=="string"){bZ=e;e="fx";b0--}if(arguments.length<b0){return bG.queue(this[0],e)}return bZ===aB?this:this.each(function(){var b1=bG.queue(this,e,bZ);bG._queueHooks(this,e);if(e==="fx"&&b1[0]!=="inprogress"){bG.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){bG.dequeue(this,e)})},delay:function(bZ,e){bZ=bG.fx?bG.fx.speeds[bZ]||bZ:bZ;e=e||"fx";return this.queue(e,function(b1,b0){var b2=setTimeout(b1,bZ);b0.stop=function(){clearTimeout(b2)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(b0,b4){var bZ,b1=1,b5=bG.Deferred(),b3=this,e=this.length,b2=function(){if(!(--b1)){b5.resolveWith(b3,[b3])}};if(typeof b0!=="string"){b4=b0;b0=aB}b0=b0||"fx";while(e--){if((bZ=bG._data(b3[e],b0+"queueHooks"))&&bZ.empty){b1++;bZ.empty.add(b2)}}b2();return b5.promise(b4)}});var a7,bV,o,bJ=/[\t\r\n]/g,ai=/\r/g,k=/^(?:button|input)$/i,aA=/^(?:button|input|object|select|textarea)$/i,E=/^a(?:rea|)$/i,M=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,bL=bG.support.getSetAttribute;bG.fn.extend({attr:function(e,bZ){return bG.access(this,bG.attr,e,bZ,arguments.length>1)},removeAttr:function(e){return this.each(function(){bG.removeAttr(this,e)})},prop:function(e,bZ){return bG.access(this,bG.prop,e,bZ,arguments.length>1)},removeProp:function(e){e=bG.propFix[e]||e;return this.each(function(){try{this[e]=aB;delete this[e]}catch(bZ){}})},addClass:function(b2){var b4,b0,bZ,b1,b3,b5,e;if(bG.isFunction(b2)){return this.each(function(b6){bG(this).addClass(b2.call(this,b6,this.className))})}if(b2&&typeof b2==="string"){b4=b2.split(aV);for(b0=0,bZ=this.length;b0<bZ;b0++){b1=this[b0];if(b1.nodeType===1){if(!b1.className&&b4.length===1){b1.className=b2}else{b3=" "+b1.className+" ";for(b5=0,e=b4.length;b5<e;b5++){if(!~b3.indexOf(" "+b4[b5]+" ")){b3+=b4[b5]+" "}}b1.className=bG.trim(b3)}}}}return this},removeClass:function(b4){var b1,b2,b3,b5,bZ,b0,e;if(bG.isFunction(b4)){return this.each(function(b6){bG(this).removeClass(b4.call(this,b6,this.className))})}if((b4&&typeof b4==="string")||b4===aB){b1=(b4||"").split(aV);for(b0=0,e=this.length;b0<e;b0++){b3=this[b0];if(b3.nodeType===1&&b3.className){b2=(" "+b3.className+" ").replace(bJ," ");for(b5=0,bZ=b1.length;b5<bZ;b5++){while(b2.indexOf(" "+b1[b5]+" ")>-1){b2=b2.replace(" "+b1[b5]+" "," ")}}b3.className=b4?bG.trim(b2):""}}}return this},toggleClass:function(b1,bZ){var b0=typeof b1,e=typeof bZ==="boolean";if(bG.isFunction(b1)){return this.each(function(b2){bG(this).toggleClass(b1.call(this,b2,this.className,bZ),bZ)})}return this.each(function(){if(b0==="string"){var b4,b3=0,b2=bG(this),b5=bZ,b6=b1.split(aV);while((b4=b6[b3++])){b5=e?b5:!b2.hasClass(b4);b2[b5?"addClass":"removeClass"](b4)}}else{if(b0==="undefined"||b0==="boolean"){if(this.className){bG._data(this,"__className__",this.className)}this.className=this.className||b1===false?"":bG._data(this,"__className__")||""}}})},hasClass:function(e){var b1=" "+e+" ",b0=0,bZ=this.length;for(;b0<bZ;b0++){if(this[b0].nodeType===1&&(" "+this[b0].className+" ").replace(bJ," ").indexOf(b1)>-1){return true}}return false},val:function(b1){var e,bZ,b2,b0=this[0];if(!arguments.length){if(b0){e=bG.valHooks[b0.type]||bG.valHooks[b0.nodeName.toLowerCase()];if(e&&"get" in e&&(bZ=e.get(b0,"value"))!==aB){return bZ}bZ=b0.value;return typeof bZ==="string"?bZ.replace(ai,""):bZ==null?"":bZ}return}b2=bG.isFunction(b1);return this.each(function(b4){var b5,b3=bG(this);if(this.nodeType!==1){return}if(b2){b5=b1.call(this,b4,b3.val())}else{b5=b1}if(b5==null){b5=""}else{if(typeof b5==="number"){b5+=""}else{if(bG.isArray(b5)){b5=bG.map(b5,function(b6){return b6==null?"":b6+""})}}}e=bG.valHooks[this.type]||bG.valHooks[this.nodeName.toLowerCase()];if(!e||!("set" in e)||e.set(this,b5,"value")===aB){this.value=b5}})}});bG.extend({valHooks:{option:{get:function(e){var bZ=e.attributes.value;return !bZ||bZ.specified?e.value:e.text}},select:{get:function(e){var b4,bZ,b3,b1,b2=e.selectedIndex,b5=[],b6=e.options,b0=e.type==="select-one";if(b2<0){return null}bZ=b0?b2:0;b3=b0?b2+1:b6.length;for(;bZ<b3;bZ++){b1=b6[bZ];if(b1.selected&&(bG.support.optDisabled?!b1.disabled:b1.getAttribute("disabled")===null)&&(!b1.parentNode.disabled||!bG.nodeName(b1.parentNode,"optgroup"))){b4=bG(b1).val();if(b0){return b4}b5.push(b4)}}if(b0&&!b5.length&&b6.length){return bG(b6[b2]).val()}return b5},set:function(bZ,b0){var e=bG.makeArray(b0);bG(bZ).find("option").each(function(){this.selected=bG.inArray(bG(this).val(),e)>=0});if(!e.length){bZ.selectedIndex=-1}return e}}},attrFn:{},attr:function(b4,b1,b5,b3){var b0,e,b2,bZ=b4.nodeType;if(!b4||bZ===3||bZ===8||bZ===2){return}if(b3&&bG.isFunction(bG.fn[b1])){return bG(b4)[b1](b5)}if(typeof b4.getAttribute==="undefined"){return bG.prop(b4,b1,b5)}b2=bZ!==1||!bG.isXMLDoc(b4);if(b2){b1=b1.toLowerCase();e=bG.attrHooks[b1]||(M.test(b1)?bV:a7)}if(b5!==aB){if(b5===null){bG.removeAttr(b4,b1);return}else{if(e&&"set" in e&&b2&&(b0=e.set(b4,b5,b1))!==aB){return b0}else{b4.setAttribute(b1,""+b5);return b5}}}else{if(e&&"get" in e&&b2&&(b0=e.get(b4,b1))!==null){return b0}else{b0=b4.getAttribute(b1);return b0===null?aB:b0}}},removeAttr:function(b1,b3){var b2,b4,bZ,e,b0=0;if(b3&&b1.nodeType===1){b4=b3.split(aV);for(;b0<b4.length;b0++){bZ=b4[b0];if(bZ){b2=bG.propFix[bZ]||bZ;e=M.test(bZ);if(!e){bG.attr(b1,bZ,"")}b1.removeAttribute(bL?bZ:b2);if(e&&b2 in b1){b1[b2]=false}}}}},attrHooks:{type:{set:function(e,bZ){if(k.test(e.nodeName)&&e.parentNode){bG.error("type property can't be changed")}else{if(!bG.support.radioValue&&bZ==="radio"&&bG.nodeName(e,"input")){var b0=e.value;e.setAttribute("type",bZ);if(b0){e.value=b0}return bZ}}}},value:{get:function(bZ,e){if(a7&&bG.nodeName(bZ,"button")){return a7.get(bZ,e)}return e in bZ?bZ.value:null},set:function(bZ,b0,e){if(a7&&bG.nodeName(bZ,"button")){return a7.set(bZ,b0,e)}bZ.value=b0}}},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(b3,b1,b4){var b0,e,b2,bZ=b3.nodeType;if(!b3||bZ===3||bZ===8||bZ===2){return}b2=bZ!==1||!bG.isXMLDoc(b3);if(b2){b1=bG.propFix[b1]||b1;e=bG.propHooks[b1]}if(b4!==aB){if(e&&"set" in e&&(b0=e.set(b3,b4,b1))!==aB){return b0}else{return(b3[b1]=b4)}}else{if(e&&"get" in e&&(b0=e.get(b3,b1))!==null){return b0}else{return b3[b1]}}},propHooks:{tabIndex:{get:function(bZ){var e=bZ.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):aA.test(bZ.nodeName)||E.test(bZ.nodeName)&&bZ.href?0:aB}}}});bV={get:function(bZ,e){var b1,b0=bG.prop(bZ,e);return b0===true||typeof b0!=="boolean"&&(b1=bZ.getAttributeNode(e))&&b1.nodeValue!==false?e.toLowerCase():aB},set:function(bZ,b1,e){var b0;if(b1===false){bG.removeAttr(bZ,e)}else{b0=bG.propFix[e]||e;if(b0 in bZ){bZ[b0]=true}bZ.setAttribute(e,e.toLowerCase())}return e}};if(!bL){o={name:true,id:true,coords:true};a7=bG.valHooks.button={get:function(b0,bZ){var e;e=b0.getAttributeNode(bZ);return e&&(o[bZ]?e.value!=="":e.specified)?e.value:aB},set:function(b0,b1,bZ){var e=b0.getAttributeNode(bZ);if(!e){e=p.createAttribute(bZ);b0.setAttributeNode(e)}return(e.value=b1+"")}};bG.each(["width","height"],function(bZ,e){bG.attrHooks[e]=bG.extend(bG.attrHooks[e],{set:function(b0,b1){if(b1===""){b0.setAttribute(e,"auto");return b1}}})});bG.attrHooks.contenteditable={get:a7.get,set:function(bZ,b0,e){if(b0===""){b0="false"}a7.set(bZ,b0,e)}}}if(!bG.support.hrefNormalized){bG.each(["href","src","width","height"],function(bZ,e){bG.attrHooks[e]=bG.extend(bG.attrHooks[e],{get:function(b1){var b0=b1.getAttribute(e,2);return b0===null?aB:b0}})})}if(!bG.support.style){bG.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||aB},set:function(e,bZ){return(e.style.cssText=""+bZ)}}}if(!bG.support.optSelected){bG.propHooks.selected=bG.extend(bG.propHooks.selected,{get:function(bZ){var e=bZ.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null}})}if(!bG.support.enctype){bG.propFix.enctype="encoding"}if(!bG.support.checkOn){bG.each(["radio","checkbox"],function(){bG.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}})}bG.each(["radio","checkbox"],function(){bG.valHooks[this]=bG.extend(bG.valHooks[this],{set:function(e,bZ){if(bG.isArray(bZ)){return(e.checked=bG.inArray(bG(e).val(),bZ)>=0)}}})});var bE=/^(?:textarea|input|select)$/i,br=/^([^\.]*|)(?:\.(.+)|)$/,ba=/(?:^|\s)hover(\.\S+|)\b/,a3=/^key/,bK=/^(?:mouse|contextmenu)|click/,by=/^(?:focusinfocus|focusoutblur)$/,aq=function(e){return bG.event.special.hover?e:e.replace(ba,"mouseenter$1 mouseleave$1")};bG.event={add:function(b1,b5,cc,b3,b2){var b6,b4,cd,cb,ca,b8,e,b9,bZ,b0,b7;if(b1.nodeType===3||b1.nodeType===8||!b5||!cc||!(b6=bG._data(b1))){return}if(cc.handler){bZ=cc;cc=bZ.handler;b2=bZ.selector}if(!cc.guid){cc.guid=bG.guid++}cd=b6.events;if(!cd){b6.events=cd={}}b4=b6.handle;if(!b4){b6.handle=b4=function(ce){return typeof bG!=="undefined"&&(!ce||bG.event.triggered!==ce.type)?bG.event.dispatch.apply(b4.elem,arguments):aB};b4.elem=b1}b5=bG.trim(aq(b5)).split(" ");for(cb=0;cb<b5.length;cb++){ca=br.exec(b5[cb])||[];b8=ca[1];e=(ca[2]||"").split(".").sort();b7=bG.event.special[b8]||{};b8=(b2?b7.delegateType:b7.bindType)||b8;b7=bG.event.special[b8]||{};b9=bG.extend({type:b8,origType:ca[1],data:b3,handler:cc,guid:cc.guid,selector:b2,namespace:e.join(".")},bZ);b0=cd[b8];if(!b0){b0=cd[b8]=[];b0.delegateCount=0;if(!b7.setup||b7.setup.call(b1,b3,e,b4)===false){if(b1.addEventListener){b1.addEventListener(b8,b4,false)}else{if(b1.attachEvent){b1.attachEvent("on"+b8,b4)}}}}if(b7.add){b7.add.call(b1,b9);if(!b9.handler.guid){b9.handler.guid=cc.guid}}if(b2){b0.splice(b0.delegateCount++,0,b9)}else{b0.push(b9)}bG.event.global[b8]=true}b1=null},global:{},remove:function(b1,b6,cc,b2,b5){var cd,ce,b9,b0,bZ,b3,b4,cb,b8,e,ca,b7=bG.hasData(b1)&&bG._data(b1);if(!b7||!(cb=b7.events)){return}b6=bG.trim(aq(b6||"")).split(" ");for(cd=0;cd<b6.length;cd++){ce=br.exec(b6[cd])||[];b9=b0=ce[1];bZ=ce[2];if(!b9){for(b9 in cb){bG.event.remove(b1,b9+b6[cd],cc,b2,true)}continue}b8=bG.event.special[b9]||{};b9=(b2?b8.delegateType:b8.bindType)||b9;e=cb[b9]||[];b3=e.length;bZ=bZ?new RegExp("(^|\\.)"+bZ.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(b4=0;b4<e.length;b4++){ca=e[b4];if((b5||b0===ca.origType)&&(!cc||cc.guid===ca.guid)&&(!bZ||bZ.test(ca.namespace))&&(!b2||b2===ca.selector||b2==="**"&&ca.selector)){e.splice(b4--,1);if(ca.selector){e.delegateCount--}if(b8.remove){b8.remove.call(b1,ca)}}}if(e.length===0&&b3!==e.length){if(!b8.teardown||b8.teardown.call(b1,bZ,b7.handle)===false){bG.removeEvent(b1,b9,b7.handle)}delete cb[b9]}}if(bG.isEmptyObject(cb)){delete b7.handle;bG.removeData(b1,"events",true)}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(bZ,b6,b4,cd){if(b4&&(b4.nodeType===3||b4.nodeType===8)){return}var e,b1,b7,cb,b3,b2,b9,b8,b5,cc,ca=bZ.type||bZ,b0=[];if(by.test(ca+bG.event.triggered)){return}if(ca.indexOf("!")>=0){ca=ca.slice(0,-1);b1=true}if(ca.indexOf(".")>=0){b0=ca.split(".");ca=b0.shift();b0.sort()}if((!b4||bG.event.customEvent[ca])&&!bG.event.global[ca]){return}bZ=typeof bZ==="object"?bZ[bG.expando]?bZ:new bG.Event(ca,bZ):new bG.Event(ca);bZ.type=ca;bZ.isTrigger=true;bZ.exclusive=b1;bZ.namespace=b0.join(".");bZ.namespace_re=bZ.namespace?new RegExp("(^|\\.)"+b0.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;b2=ca.indexOf(":")<0?"on"+ca:"";if(!b4){e=bG.cache;for(b7 in e){if(e[b7].events&&e[b7].events[ca]){bG.event.trigger(bZ,b6,e[b7].handle.elem,true)}}return}bZ.result=aB;if(!bZ.target){bZ.target=b4}b6=b6!=null?bG.makeArray(b6):[];b6.unshift(bZ);b9=bG.event.special[ca]||{};if(b9.trigger&&b9.trigger.apply(b4,b6)===false){return}b5=[[b4,b9.bindType||ca]];if(!cd&&!b9.noBubble&&!bG.isWindow(b4)){cc=b9.delegateType||ca;cb=by.test(cc+ca)?b4:b4.parentNode;for(b3=b4;cb;cb=cb.parentNode){b5.push([cb,cc]);b3=cb}if(b3===(b4.ownerDocument||p)){b5.push([b3.defaultView||b3.parentWindow||a2,cc])}}for(b7=0;b7<b5.length&&!bZ.isPropagationStopped();b7++){cb=b5[b7][0];bZ.type=b5[b7][1];b8=(bG._data(cb,"events")||{})[bZ.type]&&bG._data(cb,"handle");if(b8){b8.apply(cb,b6)}b8=b2&&cb[b2];if(b8&&bG.acceptData(cb)&&b8.apply(cb,b6)===false){bZ.preventDefault()}}bZ.type=ca;if(!cd&&!bZ.isDefaultPrevented()){if((!b9._default||b9._default.apply(b4.ownerDocument,b6)===false)&&!(ca==="click"&&bG.nodeName(b4,"a"))&&bG.acceptData(b4)){if(b2&&b4[ca]&&((ca!=="focus"&&ca!=="blur")||bZ.target.offsetWidth!==0)&&!bG.isWindow(b4)){b3=b4[b2];if(b3){b4[b2]=null}bG.event.triggered=ca;b4[ca]();bG.event.triggered=aB;if(b3){b4[b2]=b3}}}}return bZ.result},dispatch:function(cb){cb=bG.event.fix(cb||a2.event);var cd,ca,b2,b4,ce,cc,b5,b0,e,b9,cf,b7=((bG._data(this,"events")||{})[cb.type]||[]),b6=b7.delegateCount,b1=[].slice.call(arguments),b8=!cb.exclusive&&!cb.namespace,b3=bG.event.special[cb.type]||{},bZ=[];b1[0]=cb;cb.delegateTarget=this;if(b3.preDispatch&&b3.preDispatch.call(this,cb)===false){return}if(b6&&!(cb.button&&cb.type==="click")){b4=bG(this);b4.context=this;for(b2=cb.target;b2!=this;b2=b2.parentNode||this){if(b2.disabled!==true||cb.type!=="click"){cc={};b0=[];b4[0]=b2;for(cd=0;cd<b6;cd++){e=b7[cd];b9=e.selector;if(cc[b9]===aB){cc[b9]=b4.is(b9)}if(cc[b9]){b0.push(e)}}if(b0.length){bZ.push({elem:b2,matches:b0})}}}}if(b7.length>b6){bZ.push({elem:this,matches:b7.slice(b6)})}for(cd=0;cd<bZ.length&&!cb.isPropagationStopped();cd++){b5=bZ[cd];cb.currentTarget=b5.elem;for(ca=0;ca<b5.matches.length&&!cb.isImmediatePropagationStopped();ca++){e=b5.matches[ca];if(b8||(!cb.namespace&&!e.namespace)||cb.namespace_re&&cb.namespace_re.test(e.namespace)){cb.data=e.data;cb.handleObj=e;ce=((bG.event.special[e.origType]||{}).handle||e.handler).apply(b5.elem,b1);if(ce!==aB){cb.result=ce;if(ce===false){cb.preventDefault();cb.stopPropagation()}}}}}if(b3.postDispatch){b3.postDispatch.call(this,cb)}return cb.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(bZ,e){if(bZ.which==null){bZ.which=e.charCode!=null?e.charCode:e.keyCode}return bZ}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(b1,b0){var b2,b3,e,bZ=b0.button,b4=b0.fromElement;if(b1.pageX==null&&b0.clientX!=null){b2=b1.target.ownerDocument||p;b3=b2.documentElement;e=b2.body;b1.pageX=b0.clientX+(b3&&b3.scrollLeft||e&&e.scrollLeft||0)-(b3&&b3.clientLeft||e&&e.clientLeft||0);b1.pageY=b0.clientY+(b3&&b3.scrollTop||e&&e.scrollTop||0)-(b3&&b3.clientTop||e&&e.clientTop||0)}if(!b1.relatedTarget&&b4){b1.relatedTarget=b4===b1.target?b0.toElement:b4}if(!b1.which&&bZ!==aB){b1.which=(bZ&1?1:(bZ&2?3:(bZ&4?2:0)))}return b1}},fix:function(b0){if(b0[bG.expando]){return b0}var bZ,b3,e=b0,b1=bG.event.fixHooks[b0.type]||{},b2=b1.props?this.props.concat(b1.props):this.props;b0=bG.Event(e);for(bZ=b2.length;bZ;){b3=b2[--bZ];b0[b3]=e[b3]}if(!b0.target){b0.target=e.srcElement||p}if(b0.target.nodeType===3){b0.target=b0.target.parentNode}b0.metaKey=!!b0.metaKey;return b1.filter?b1.filter(b0,e):b0},special:{ready:{setup:bG.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(b0,bZ,e){if(bG.isWindow(this)){this.onbeforeunload=e}},teardown:function(bZ,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}},simulate:function(b0,b2,b1,bZ){var b3=bG.extend(new bG.Event(),b1,{type:b0,isSimulated:true,originalEvent:{}});if(bZ){bG.event.trigger(b3,null,b2)}else{bG.event.dispatch.call(b2,b3)}if(b3.isDefaultPrevented()){b1.preventDefault()}}};bG.event.handle=bG.event.dispatch;bG.removeEvent=p.removeEventListener?function(bZ,e,b0){if(bZ.removeEventListener){bZ.removeEventListener(e,b0,false)}}:function(b0,bZ,b1){var e="on"+bZ;if(b0.detachEvent){if(typeof b0[e]==="undefined"){b0[e]=null}b0.detachEvent(e,b1)}};bG.Event=function(bZ,e){if(!(this instanceof bG.Event)){return new bG.Event(bZ,e)}if(bZ&&bZ.type){this.originalEvent=bZ;this.type=bZ.type;this.isDefaultPrevented=(bZ.defaultPrevented||bZ.returnValue===false||bZ.getPreventDefault&&bZ.getPreventDefault())?R:X}else{this.type=bZ}if(e){bG.extend(this,e)}this.timeStamp=bZ&&bZ.timeStamp||bG.now();this[bG.expando]=true};function X(){return false}function R(){return true}bG.Event.prototype={preventDefault:function(){this.isDefaultPrevented=R;var bZ=this.originalEvent;if(!bZ){return}if(bZ.preventDefault){bZ.preventDefault()}else{bZ.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=R;var bZ=this.originalEvent;if(!bZ){return}if(bZ.stopPropagation){bZ.stopPropagation()}bZ.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=R;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};bG.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bZ,e){bG.event.special[bZ]={delegateType:e,bindType:e,handle:function(b3){var b1,b5=this,b4=b3.relatedTarget,b2=b3.handleObj,b0=b2.selector;if(!b4||(b4!==b5&&!bG.contains(b5,b4))){b3.type=b2.origType;b1=b2.handler.apply(this,arguments);b3.type=e}return b1}}});if(!bG.support.submitBubbles){bG.event.special.submit={setup:function(){if(bG.nodeName(this,"form")){return false}bG.event.add(this,"click._submit keypress._submit",function(b1){var b0=b1.target,bZ=bG.nodeName(b0,"input")||bG.nodeName(b0,"button")?b0.form:aB;if(bZ&&!bG._data(bZ,"_submit_attached")){bG.event.add(bZ,"submit._submit",function(e){e._submit_bubble=true});bG._data(bZ,"_submit_attached",true)}})},postDispatch:function(e){if(e._submit_bubble){delete e._submit_bubble;if(this.parentNode&&!e.isTrigger){bG.event.simulate("submit",this.parentNode,e,true)}}},teardown:function(){if(bG.nodeName(this,"form")){return false}bG.event.remove(this,"._submit")}}}if(!bG.support.changeBubbles){bG.event.special.change={setup:function(){if(bE.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){bG.event.add(this,"propertychange._change",function(e){if(e.originalEvent.propertyName==="checked"){this._just_changed=true}});bG.event.add(this,"click._change",function(e){if(this._just_changed&&!e.isTrigger){this._just_changed=false}bG.event.simulate("change",this,e,true)})}return false}bG.event.add(this,"beforeactivate._change",function(b0){var bZ=b0.target;if(bE.test(bZ.nodeName)&&!bG._data(bZ,"_change_attached")){bG.event.add(bZ,"change._change",function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){bG.event.simulate("change",this.parentNode,e,true)}});bG._data(bZ,"_change_attached",true)}})},handle:function(bZ){var e=bZ.target;if(this!==e||bZ.isSimulated||bZ.isTrigger||(e.type!=="radio"&&e.type!=="checkbox")){return bZ.handleObj.handler.apply(this,arguments)}},teardown:function(){bG.event.remove(this,"._change");return bE.test(this.nodeName)}}}if(!bG.support.focusinBubbles){bG.each({focus:"focusin",blur:"focusout"},function(b1,e){var bZ=0,b0=function(b2){bG.event.simulate(e,b2.target,bG.event.fix(b2),true)};bG.event.special[e]={setup:function(){if(bZ++===0){p.addEventListener(b1,b0,true)}},teardown:function(){if(--bZ===0){p.removeEventListener(b1,b0,true)}}}})}bG.fn.extend({on:function(b0,e,b3,b2,bZ){var b4,b1;if(typeof b0==="object"){if(typeof e!=="string"){b3=b3||e;e=aB}for(b1 in b0){this.on(b1,e,b3,b0[b1],bZ)}return this}if(b3==null&&b2==null){b2=e;b3=e=aB}else{if(b2==null){if(typeof e==="string"){b2=b3;b3=aB}else{b2=b3;b3=e;e=aB}}}if(b2===false){b2=X}else{if(!b2){return this}}if(bZ===1){b4=b2;b2=function(b5){bG().off(b5);return b4.apply(this,arguments)};b2.guid=b4.guid||(b4.guid=bG.guid++)}return this.each(function(){bG.event.add(this,b0,b2,b3,e)})},one:function(bZ,e,b1,b0){return this.on(bZ,e,b1,b0,1)},off:function(b0,e,b2){var bZ,b1;if(b0&&b0.preventDefault&&b0.handleObj){bZ=b0.handleObj;bG(b0.delegateTarget).off(bZ.namespace?bZ.origType+"."+bZ.namespace:bZ.origType,bZ.selector,bZ.handler);return this}if(typeof b0==="object"){for(b1 in b0){this.off(b1,e,b0[b1])}return this}if(e===false||typeof e==="function"){b2=e;e=aB}if(b2===false){b2=X}return this.each(function(){bG.event.remove(this,b0,b2,e)})},bind:function(e,b0,bZ){return this.on(e,null,b0,bZ)},unbind:function(e,bZ){return this.off(e,null,bZ)},live:function(e,b0,bZ){bG(this.context).on(e,this.selector,b0,bZ);return this},die:function(e,bZ){bG(this.context).off(e,this.selector||"**",bZ);return this},delegate:function(e,bZ,b1,b0){return this.on(bZ,e,b1,b0)},undelegate:function(e,bZ,b0){return arguments.length==1?this.off(e,"**"):this.off(bZ,e||"**",b0)},trigger:function(e,bZ){return this.each(function(){bG.event.trigger(e,bZ,this)})},triggerHandler:function(e,bZ){if(this[0]){return bG.event.trigger(e,bZ,this[0],true)}},toggle:function(b1){var bZ=arguments,e=b1.guid||bG.guid++,b0=0,b2=function(b3){var b4=(bG._data(this,"lastToggle"+b1.guid)||0)%b0;bG._data(this,"lastToggle"+b1.guid,b4+1);b3.preventDefault();return bZ[b4].apply(this,arguments)||false};b2.guid=e;while(b0<bZ.length){bZ[b0++].guid=e}return this.click(b2)},hover:function(e,bZ){return this.mouseenter(e).mouseleave(bZ||e)}});bG.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(bZ,e){bG.fn[e]=function(b1,b0){if(b0==null){b0=b1;b1=null}return arguments.length>0?this.on(e,null,b1,b0):this.trigger(e)};if(a3.test(e)){bG.event.fixHooks[e]=bG.event.keyHooks}if(bK.test(e)){bG.event.fixHooks[e]=bG.event.mouseHooks}});
/*
 * Sizzle CSS Selector Engine
 *  Copyright 2012 jQuery Foundation and other contributors
 *  Released under the MIT license
 *  http://sizzlejs.com/
 */
(function(cO,cg){var cT,co,cf,b2,b8,b6=cO.document,b9=b6.documentElement,cw="undefined",ca=false,b7=true,ce=0,cj=[].slice,cS=[].push,cW=("sizcache"+Math.random()).replace(".",""),cz="[\\x20\\t\\r\\n\\f]",ci="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",ch=ci.replace("w","w#"),c4="([*^$|!~]?=)",cL="\\["+cz+"*("+ci+")"+cz+"*(?:"+c4+cz+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+ch+")|)|)"+cz+"*\\]",c5=":("+ci+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",cB=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",cd=cz+"*([\\x20\\t\\r\\n\\f>+~])"+cz+"*",cc="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+cL+"|"+c5.replace(2,7)+"|[^\\\\(),])+",cU=new RegExp("^"+cz+"+|((?:^|[^\\\\])(?:\\\\.)*)"+cz+"+$","g"),cF=new RegExp("^"+cd),ct=new RegExp(cc+"?(?="+cz+"*,|$)","g"),cJ=new RegExp("^(?:(?!,)(?:(?:^|,)"+cz+"*"+cc+")*?|"+cz+"*(.*?))(\\)|$)"),cZ=new RegExp(cc.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+cd,"g"),cK=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,cP=/[\x20\t\r\n\f]*[+~]/,cX=/:not\($/,cp=/h\d/i,cM=/input|select|textarea|button/i,cs=/\\(?!\\)/g,cE={ID:new RegExp("^#("+ci+")"),CLASS:new RegExp("^\\.("+ci+")"),NAME:new RegExp("^\\[name=['\"]?("+ci+")['\"]?\\]"),TAG:new RegExp("^("+ci.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+cL),PSEUDO:new RegExp("^"+c5),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+cz+"*(even|odd|(([+-]|)(\\d*)n|)"+cz+"*(?:([+-]|)"+cz+"*(\\d+)|))"+cz+"*\\)|)","i"),POS:new RegExp(cB,"ig"),needsContext:new RegExp("^"+cz+"*[>+~]|"+cB,"i")},cR={},cq=[],cl={},cu=[],cY=function(e){e.sizzleFilter=true;return e},b3=function(e){return function(c6){return c6.nodeName.toLowerCase()==="input"&&c6.type===e}},cr=function(e){return function(c7){var c6=c7.nodeName.toLowerCase();return(c6==="input"||c6==="button")&&c7.type===e}},cH=function(c6){var c7=false,c9=b6.createElement("div");try{c7=c6(c9)}catch(c8){}c9=null;return c7},cn=cH(function(c6){c6.innerHTML="<select></select>";var e=typeof c6.lastChild.getAttribute("multiple");return e!=="boolean"&&e!=="string"}),b0=cH(function(c6){c6.id=cW+0;c6.innerHTML="<a name='"+cW+"'></a><div name='"+cW+"'></div>";b9.insertBefore(c6,b9.firstChild);var e=b6.getElementsByName&&b6.getElementsByName(cW).length===2+b6.getElementsByName(cW+0).length;b8=!b6.getElementById(cW);b9.removeChild(c6);return e}),b5=cH(function(e){e.appendChild(b6.createComment(""));return e.getElementsByTagName("*").length===0}),cD=cH(function(e){e.innerHTML="<a href='#'></a>";return e.firstChild&&typeof e.firstChild.getAttribute!==cw&&e.firstChild.getAttribute("href")==="#"}),cC=cH(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 cN=function(c8,e,da,dd){da=da||[];e=e||b6;var db,c6,dc,c7,c9=e.nodeType;if(c9!==1&&c9!==9){return[]}if(!c8||typeof c8!=="string"){return da}dc=ck(e);if(!dc&&!dd){if((db=cK.exec(c8))){if((c7=db[1])){if(c9===9){c6=e.getElementById(c7);if(c6&&c6.parentNode){if(c6.id===c7){da.push(c6);return da}}else{return da}}else{if(e.ownerDocument&&(c6=e.ownerDocument.getElementById(c7))&&cA(e,c6)&&c6.id===c7){da.push(c6);return da}}}else{if(db[2]){cS.apply(da,cj.call(e.getElementsByTagName(c8),0));return da}else{if((c7=db[3])&&cC&&e.getElementsByClassName){cS.apply(da,cj.call(e.getElementsByClassName(c7),0));return da}}}}}return cV(c8,e,da,dd,dc)};var cG=cN.selectors={cacheLength:50,match:cE,order:["ID","TAG"],attrHandle:{},createPseudo:cY,find:{ID:b8?function(c8,c7,c6){if(typeof c7.getElementById!==cw&&!c6){var e=c7.getElementById(c8);return e&&e.parentNode?[e]:[]}}:function(c8,c7,c6){if(typeof c7.getElementById!==cw&&!c6){var e=c7.getElementById(c8);return e?e.id===c8||typeof e.getAttributeNode!==cw&&e.getAttributeNode("id").value===c8?[e]:cg:[]}},TAG:b5?function(e,c6){if(typeof c6.getElementsByTagName!==cw){return c6.getElementsByTagName(e)}}:function(e,c9){var c8=c9.getElementsByTagName(e);if(e==="*"){var da,c7=[],c6=0;for(;(da=c8[c6]);c6++){if(da.nodeType===1){c7.push(da)}}return c7}return c8}},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(cs,"");e[3]=(e[4]||e[5]||"").replace(cs,"");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]){cN.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]){cN.error(e[0])}}return e},PSEUDO:function(e){var c6,c7=e[4];if(cE.CHILD.test(e[0])){return null}if(c7&&(c6=cJ.exec(c7))&&c6.pop()){e[0]=e[0].slice(0,c6[0].length-c7.length-1);c7=c6[0].slice(0,-1)}e.splice(2,3,c7||e[3]);return e}},filter:{ID:b8?function(e){e=e.replace(cs,"");return function(c6){return c6.getAttribute("id")===e}}:function(e){e=e.replace(cs,"");return function(c7){var c6=typeof c7.getAttributeNode!==cw&&c7.getAttributeNode("id");return c6&&c6.value===e}},TAG:function(e){if(e==="*"){return function(){return true}}e=e.replace(cs,"").toLowerCase();return function(c6){return c6.nodeName&&c6.nodeName.toLowerCase()===e}},CLASS:function(e){var c6=cR[e];if(!c6){c6=cR[e]=new RegExp("(^|"+cz+")"+e+"("+cz+"|$)");cq.push(e);if(cq.length>cG.cacheLength){delete cR[cq.shift()]}}return function(c7){return c6.test(c7.className||(typeof c7.getAttribute!==cw&&c7.getAttribute("class"))||"")}},ATTR:function(c7,c6,e){if(!c6){return function(c8){return cN.attr(c8,c7)!=null}}return function(c9){var c8=cN.attr(c9,c7),da=c8+"";if(c8==null){return c6==="!="}switch(c6){case"=":return da===e;case"!=":return da!==e;case"^=":return e&&da.indexOf(e)===0;case"*=":return e&&da.indexOf(e)>-1;case"$=":return e&&da.substr(da.length-e.length)===e;case"~=":return(" "+da+" ").indexOf(e)>-1;case"|=":return da===e||da.substr(0,e.length+1)===e+"-"}}},CHILD:function(c6,c8,c9,c7){if(c6==="nth"){var e=ce++;return function(dd){var da,de,dc=0,db=dd;if(c9===1&&c7===0){return true}da=dd.parentNode;if(da&&(da[cW]!==e||!dd.sizset)){for(db=da.firstChild;db;db=db.nextSibling){if(db.nodeType===1){db.sizset=++dc;if(db===dd){break}}}da[cW]=e}de=dd.sizset-c7;if(c9===0){return de===0}else{return(de%c9===0&&de/c9>=0)}}}return function(db){var da=db;switch(c6){case"only":case"first":while((da=da.previousSibling)){if(da.nodeType===1){return false}}if(c6==="first"){return true}da=db;case"last":while((da=da.nextSibling)){if(da.nodeType===1){return false}}return true}}},PSEUDO:function(c9,c8,c6,e){var c7=cG.pseudos[c9]||cG.pseudos[c9.toLowerCase()];if(!c7){cN.error("unsupported pseudo: "+c9)}if(!c7.sizzleFilter){return c7}return c7(c8,c6,e)}},pseudos:{not:cY(function(e,c7,c6){var c8=cb(e.replace(cU,"$1"),c7,c6);return function(c9){return !c8(c9)}}),enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var c6=e.nodeName.toLowerCase();return(c6==="input"&&!!e.checked)||(c6==="option"&&!!e.selected)},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !cG.pseudos.empty(e)},empty:function(c6){var e;c6=c6.firstChild;while(c6){if(c6.nodeName>"@"||(e=c6.nodeType)===3||e===4){return false}c6=c6.nextSibling}return true},contains:cY(function(e){return function(c6){return(c6.textContent||c6.innerText||bZ(c6)).indexOf(e)>-1}}),has:cY(function(e){return function(c6){return cN(e,c6).length>0}}),header:function(e){return cp.test(e.nodeName)},text:function(c7){var c6,e;return c7.nodeName.toLowerCase()==="input"&&(c6=c7.type)==="text"&&((e=c7.getAttribute("type"))==null||e.toLowerCase()===c6)},radio:b3("radio"),checkbox:b3("checkbox"),file:b3("file"),password:b3("password"),image:b3("image"),submit:cr("submit"),reset:cr("reset"),button:function(c6){var e=c6.nodeName.toLowerCase();return e==="input"&&c6.type==="button"||e==="button"},input:function(e){return cM.test(e.nodeName)},focus:function(e){var c6=e.ownerDocument;return e===c6.activeElement&&(!c6.hasFocus||c6.hasFocus())&&!!(e.type||e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(c7,c6,e){return e?c7.slice(1):[c7[0]]},last:function(c8,c7,c6){var e=c8.pop();return c6?c8:[e]},even:function(da,c9,c8){var c7=[],c6=c8?1:0,e=da.length;for(;c6<e;c6=c6+2){c7.push(da[c6])}return c7},odd:function(da,c9,c8){var c7=[],c6=c8?0:1,e=da.length;for(;c6<e;c6=c6+2){c7.push(da[c6])}return c7},lt:function(c7,c6,e){return e?c7.slice(+c6):c7.slice(0,+c6)},gt:function(c7,c6,e){return e?c7.slice(0,+c6+1):c7.slice(+c6+1)},eq:function(c8,c7,c6){var e=c8.splice(+c7,1);return c6?c8:e}}};cG.setFilters.nth=cG.setFilters.eq;cG.filters=cG.pseudos;if(!cD){cG.attrHandle={href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}}}if(b0){cG.order.push("NAME");cG.find.NAME=function(e,c6){if(typeof c6.getElementsByName!==cw){return c6.getElementsByName(e)}}}if(cC){cG.order.splice(1,0,"CLASS");cG.find.CLASS=function(c7,c6,e){if(typeof c6.getElementsByClassName!==cw&&!e){return c6.getElementsByClassName(c7)}}}try{cj.call(b9.childNodes,0)[0].nodeType}catch(c0){cj=function(c6){var c7,e=[];for(;(c7=this[c6]);c6++){e.push(c7)}return e}}var ck=cN.isXML=function(e){var c6=e&&(e.ownerDocument||e).documentElement;return c6?c6.nodeName!=="HTML":false};var cA=cN.contains=b9.compareDocumentPosition?function(c6,e){return !!(c6.compareDocumentPosition(e)&16)}:b9.contains?function(c6,e){var c8=c6.nodeType===9?c6.documentElement:c6,c7=e.parentNode;return c6===c7||!!(c7&&c7.nodeType===1&&c8.contains&&c8.contains(c7))}:function(c6,e){while((e=e.parentNode)){if(e===c6){return true}}return false};var bZ=cN.getText=function(c9){var c8,c6="",c7=0,e=c9.nodeType;if(e){if(e===1||e===9||e===11){if(typeof c9.textContent==="string"){return c9.textContent}else{for(c9=c9.firstChild;c9;c9=c9.nextSibling){c6+=bZ(c9)}}}else{if(e===3||e===4){return c9.nodeValue}}}else{for(;(c8=c9[c7]);c7++){c6+=bZ(c8)}}return c6};cN.attr=function(c8,c7){var e,c6=ck(c8);if(!c6){c7=c7.toLowerCase()}if(cG.attrHandle[c7]){return cG.attrHandle[c7](c8)}if(cn||c6){return c8.getAttribute(c7)}e=c8.getAttributeNode(c7);return e?typeof c8[c7]==="boolean"?c8[c7]?c7:null:e.specified?e.value:null:null};cN.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};[0,0].sort(function(){return(b7=0)});if(b9.compareDocumentPosition){cf=function(c6,e){if(c6===e){ca=true;return 0}return(!c6.compareDocumentPosition||!e.compareDocumentPosition?c6.compareDocumentPosition:c6.compareDocumentPosition(e)&4)?-1:1}}else{cf=function(dd,dc){if(dd===dc){ca=true;return 0}else{if(dd.sourceIndex&&dc.sourceIndex){return dd.sourceIndex-dc.sourceIndex}}var da,c6,c7=[],e=[],c9=dd.parentNode,db=dc.parentNode,de=c9;if(c9===db){return b2(dd,dc)}else{if(!c9){return -1}else{if(!db){return 1}}}while(de){c7.unshift(de);de=de.parentNode}de=db;while(de){e.unshift(de);de=de.parentNode}da=c7.length;c6=e.length;for(var c8=0;c8<da&&c8<c6;c8++){if(c7[c8]!==e[c8]){return b2(c7[c8],e[c8])}}return c8===da?b2(dd,e[c8],-1):b2(c7[c8],dc,1)};b2=function(c6,e,c7){if(c6===e){return c7}var c8=c6.nextSibling;while(c8){if(c8===e){return -1}c8=c8.nextSibling}return 1}}cN.uniqueSort=function(c6){var c7,e=1;if(cf){ca=b7;c6.sort(cf);if(ca){for(;(c7=c6[e]);e++){if(c7===c6[e-1]){c6.splice(e--,1)}}}}return c6};function cm(c6,da,c9,c7){var c8=0,e=da.length;for(;c8<e;c8++){cN(c6,da[c8],c9,c7)}}function cI(e,c7,db,dc,c6,da){var c8,c9=cG.setFilters[c7.toLowerCase()];if(!c9){cN.error(c7)}if(e||!(c8=c6)){cm(e||"*",dc,(c8=[]),c6)}return c8.length>0?c9(c8,db,da):[]}function cQ(df,e,dd,c7,dj){var da,c6,c9,dl,dc,dk,de,di,dg=0,dh=dj.length,c8=cE.POS,db=new RegExp("^"+c8.source+"(?!"+cz+")","i"),dm=function(){var dp=1,dn=arguments.length-2;for(;dp<dn;dp++){if(arguments[dp]===cg){da[dp]=cg}}};for(;dg<dh;dg++){c8.exec("");df=dj[dg];dl=[];c9=0;dc=c7;while((da=c8.exec(df))){di=c8.lastIndex=da.index+da[0].length;if(di>c9){de=df.slice(c9,da.index);c9=di;dk=[e];if(cF.test(de)){if(dc){dk=dc}dc=c7}if((c6=cX.test(de))){de=de.slice(0,-5).replace(cF,"$&*")}if(da.length>1){da[0].replace(db,dm)}dc=cI(de,da[1],da[2],dk,dc,c6)}}if(dc){dl=dl.concat(dc);if((de=df.slice(c9))&&de!==")"){if(cF.test(de)){cm(de,dl,dd,c7)}else{cN(de,e,dd,c7?c7.concat(dc):dc)}}else{cS.apply(dd,dl)}}else{cN(df,e,dd,c7)}}return dh===1?dd:cN.uniqueSort(dd)}function b1(db,c7,de){var dg,df,dh,c9=[],dc=0,dd=cJ.exec(db),c6=!dd.pop()&&!dd.pop(),di=c6&&db.match(ct)||[""],e=cG.preFilter,c8=cG.filter,da=!de&&c7!==b6;for(;(df=di[dc])!=null&&c6;dc++){c9.push(dg=[]);if(da){df=" "+df}while(df){c6=false;if((dd=cF.exec(df))){df=df.slice(dd[0].length);c6=dg.push({part:dd.pop().replace(cU," "),captures:dd})}for(dh in c8){if((dd=cE[dh].exec(df))&&(!e[dh]||(dd=e[dh](dd,c7,de)))){df=df.slice(dd.shift().length);c6=dg.push({part:dh,captures:dd})}}if(!c6){break}}}if(!c6){cN.error(db)}return c9}function cx(c9,c8,c7){var e=c8.dir,c6=ce++;if(!c9){c9=function(da){return da===c7}}return c8.first?function(db,da){while((db=db[e])){if(db.nodeType===1){return c9(db,da)&&db}}}:function(dc,db){var da,dd=c6+"."+co,de=dd+"."+cT;while((dc=dc[e])){if(dc.nodeType===1){if((da=dc[cW])===de){return dc.sizset}else{if(typeof da==="string"&&da.indexOf(dd)===0){if(dc.sizset){return dc}}else{dc[cW]=de;if(c9(dc,db)){dc.sizset=true;return dc}dc.sizset=false}}}}}}function cv(e,c6){return e?function(c9,c8){var c7=c6(c9,c8);return c7&&e(c7===true?c9:c7,c8)}:c6}function cy(da,c8,e){var c7,c9,c6=0;for(;(c7=da[c6]);c6++){if(cG.relative[c7.part]){c9=cx(c9,cG.relative[c7.part],c8)}else{c7.captures.push(c8,e);c9=cv(c9,cG.filter[c7.part].apply(null,c7.captures))}}return c9}function b4(e){return function(c8,c7){var c9,c6=0;for(;(c9=e[c6]);c6++){if(c9(c8,c7)){return true}}return false}}var cb=cN.compile=function(e,c8,c6){var db,da,c7,c9=cl[e];if(c9&&c9.context===c8){return c9}da=b1(e,c8,c6);for(c7=0;(db=da[c7]);c7++){da[c7]=cy(db,c8,c6)}c9=cl[e]=b4(da);c9.context=c8;c9.runs=c9.dirruns=0;cu.push(e);if(cu.length>cG.cacheLength){delete cl[cu.shift()]}return c9};cN.matches=function(c6,e){return cN(c6,null,null,e)};cN.matchesSelector=function(e,c6){return cN(c6,null,null,[e]).length>0};var cV=function(c9,c6,db,df,de){c9=c9.replace(cU,"$1");var e,dg,dc,dh,c7,c8,dj,dk,da,dd=c9.match(ct),di=c9.match(cZ),dl=c6.nodeType;if(cE.POS.test(c9)){return cQ(c9,c6,db,df,dd)}if(df){e=cj.call(df,0)}else{if(dd&&dd.length===1){if(di.length>1&&dl===9&&!de&&(dd=cE.ID.exec(di[0]))){c6=cG.find.ID(dd[1],c6,de)[0];if(!c6){return db}c9=c9.slice(di.shift().length)}dk=((dd=cP.exec(di[0]))&&!dd.index&&c6.parentNode)||c6;da=di.pop();c8=da.split(":not")[0];for(dc=0,dh=cG.order.length;dc<dh;dc++){dj=cG.order[dc];if((dd=cE[dj].exec(c8))){e=cG.find[dj]((dd[1]||"").replace(cs,""),dk,de);if(e==null){continue}if(c8===da){c9=c9.slice(0,c9.length-da.length)+c8.replace(cE[dj],"");if(!c9){cS.apply(db,cj.call(e,0))}}break}}}}if(c9){dg=cb(c9,c6,de);co=dg.dirruns++;if(e==null){e=cG.find.TAG("*",(cP.test(c9)&&c6.parentNode)||c6)}for(dc=0;(c7=e[dc]);dc++){cT=dg.runs++;if(dg(c7,c6)){db.push(c7)}}}return db};if(b6.querySelectorAll){(function(){var da,db=cV,c9=/'|\\/g,c7=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,c6=[],e=[":active"],c8=b9.matchesSelector||b9.mozMatchesSelector||b9.webkitMatchesSelector||b9.oMatchesSelector||b9.msMatchesSelector;cH(function(dc){dc.innerHTML="<select><option selected></option></select>";if(!dc.querySelectorAll("[selected]").length){c6.push("\\["+cz+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)")}if(!dc.querySelectorAll(":checked").length){c6.push(":checked")}});cH(function(dc){dc.innerHTML="<p test=''></p>";if(dc.querySelectorAll("[test^='']").length){c6.push("[*^$]="+cz+"*(?:\"\"|'')")}dc.innerHTML="<input type='hidden'>";if(!dc.querySelectorAll(":enabled").length){c6.push(":enabled",":disabled")}});c6=c6.length&&new RegExp(c6.join("|"));cV=function(dh,dd,di,dk,dj){if(!dk&&!dj&&(!c6||!c6.test(dh))){if(dd.nodeType===9){try{cS.apply(di,cj.call(dd.querySelectorAll(dh),0));return di}catch(dg){}}else{if(dd.nodeType===1&&dd.nodeName.toLowerCase()!=="object"){var df=dd.getAttribute("id"),dc=df||cW,de=cP.test(dh)&&dd.parentNode||dd;if(df){dc=dc.replace(c9,"\\$&")}else{dd.setAttribute("id",dc)}try{cS.apply(di,cj.call(de.querySelectorAll(dh.replace(ct,"[id='"+dc+"'] $&")),0));return di}catch(dg){}finally{if(!df){dd.removeAttribute("id")}}}}}return db(dh,dd,di,dk,dj)};if(c8){cH(function(dd){da=c8.call(dd,"div");try{c8.call(dd,"[test!='']:sizzle");e.push(cG.match.PSEUDO)}catch(dc){}});e=new RegExp(e.join("|"));cN.matchesSelector=function(dd,df){df=df.replace(c7,"='$1']");if(!ck(dd)&&!e.test(df)&&(!c6||!c6.test(df))){try{var dc=c8.call(dd,df);if(dc||da||dd.document&&dd.document.nodeType!==11){return dc}}catch(de){}}return cN(df,null,null,[dd]).length>0}}})()}cN.attr=bG.attr;bG.find=cN;bG.expr=cN.selectors;bG.expr[":"]=bG.expr.pseudos;bG.unique=cN.uniqueSort;bG.text=cN.getText;bG.isXMLDoc=cN.isXML;bG.contains=cN.contains})(a2);var ag=/Until$/,bq=/^(?:parents|prev(?:Until|All))/,al=/^.[^:#\[\.,]*$/,z=bG.expr.match.needsContext,bu={children:true,contents:true,next:true,prev:true};bG.fn.extend({find:function(e){var b2,bZ,b4,b5,b3,b1,b0=this;if(typeof e!=="string"){return bG(e).filter(function(){for(b2=0,bZ=b0.length;b2<bZ;b2++){if(bG.contains(b0[b2],this)){return true}}})}b1=this.pushStack("","find",e);for(b2=0,bZ=this.length;b2<bZ;b2++){b4=b1.length;bG.find(e,this[b2],b1);if(b2>0){for(b5=b4;b5<b1.length;b5++){for(b3=0;b3<b4;b3++){if(b1[b3]===b1[b5]){b1.splice(b5--,1);break}}}}}return b1},has:function(b1){var b0,bZ=bG(b1,this),e=bZ.length;return this.filter(function(){for(b0=0;b0<e;b0++){if(bG.contains(this,bZ[b0])){return true}}})},not:function(e){return this.pushStack(aM(this,e,false),"not",e)},filter:function(e){return this.pushStack(aM(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?z.test(e)?bG(e,this.context).index(this[0])>=0:bG.filter(e,this).length>0:this.filter(e).length>0)},closest:function(b2,b1){var b3,b0=0,e=this.length,bZ=[],b4=z.test(b2)||typeof b2!=="string"?bG(b2,b1||this.context):0;for(;b0<e;b0++){b3=this[b0];while(b3&&b3.ownerDocument&&b3!==b1&&b3.nodeType!==11){if(b4?b4.index(b3)>-1:bG.find.matchesSelector(b3,b2)){bZ.push(b3);break}b3=b3.parentNode}}bZ=bZ.length>1?bG.unique(bZ):bZ;return this.pushStack(bZ,"closest",b2)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return bG.inArray(this[0],bG(e))}return bG.inArray(e.jquery?e[0]:e,this)},add:function(e,bZ){var b1=typeof e==="string"?bG(e,bZ):bG.makeArray(e&&e.nodeType?[e]:e),b0=bG.merge(this.get(),b1);return this.pushStack(aR(b1[0])||aR(b0[0])?b0:bG.unique(b0))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});bG.fn.andSelf=bG.fn.addBack;function aR(e){return !e||!e.parentNode||e.parentNode.nodeType===11}function aY(bZ,e){do{bZ=bZ[e]}while(bZ&&bZ.nodeType!==1);return bZ}bG.each({parent:function(bZ){var e=bZ.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return bG.dir(e,"parentNode")},parentsUntil:function(bZ,e,b0){return bG.dir(bZ,"parentNode",b0)},next:function(e){return aY(e,"nextSibling")},prev:function(e){return aY(e,"previousSibling")},nextAll:function(e){return bG.dir(e,"nextSibling")},prevAll:function(e){return bG.dir(e,"previousSibling")},nextUntil:function(bZ,e,b0){return bG.dir(bZ,"nextSibling",b0)},prevUntil:function(bZ,e,b0){return bG.dir(bZ,"previousSibling",b0)},siblings:function(e){return bG.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return bG.sibling(e.firstChild)},contents:function(e){return bG.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:bG.merge([],e.childNodes)}},function(e,bZ){bG.fn[e]=function(b2,b0){var b1=bG.map(this,bZ,b2);if(!ag.test(e)){b0=b2}if(b0&&typeof b0==="string"){b1=bG.filter(b0,b1)}b1=this.length>1&&!bu[e]?bG.unique(b1):b1;if(this.length>1&&bq.test(e)){b1=b1.reverse()}return this.pushStack(b1,e,a4.call(arguments).join(","))}});bG.extend({filter:function(b0,e,bZ){if(bZ){b0=":not("+b0+")"}return e.length===1?bG.find.matchesSelector(e[0],b0)?[e[0]]:[]:bG.find.matches(b0,e)},dir:function(b0,bZ,b2){var e=[],b1=b0[bZ];while(b1&&b1.nodeType!==9&&(b2===aB||b1.nodeType!==1||!bG(b1).is(b2))){if(b1.nodeType===1){e.push(b1)}b1=b1[bZ]}return e},sibling:function(b0,bZ){var e=[];for(;b0;b0=b0.nextSibling){if(b0.nodeType===1&&b0!==bZ){e.push(b0)}}return e}});function aM(b1,b0,e){b0=b0||0;if(bG.isFunction(b0)){return bG.grep(b1,function(b3,b2){var b4=!!b0.call(b3,b2,b3);return b4===e})}else{if(b0.nodeType){return bG.grep(b1,function(b3,b2){return(b3===b0)===e})}else{if(typeof b0==="string"){var bZ=bG.grep(b1,function(b2){return b2.nodeType===1});if(al.test(b0)){return bG.filter(b0,bZ,!e)}else{b0=bG.filter(b0,bZ)}}}}return bG.grep(b1,function(b3,b2){return(bG.inArray(b3,b0)>=0)===e})}function B(e){var b0=c.split("|"),bZ=e.createDocumentFragment();if(bZ.createElement){while(b0.length){bZ.createElement(b0.pop())}}return bZ}var c="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",av=/ jQuery\d+="(?:null|\d+)"/g,bY=/^\s+/,ay=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,q=/<([\w:]+)/,bT=/<tbody/i,J=/<|&#?\w+;/,aj=/<(?:script|style|link)/i,ap=/<(?:script|object|embed|option|style)/i,K=new RegExp("<(?:"+c+")[\\s/>]","i"),aE=/^(?:checkbox|radio)$/,bR=/checked\s*(?:[^=]|=\s*.checked.)/i,bw=/\/(java|ecma)script/i,aH=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,T={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,"",""]},aQ=B(p),m=aQ.appendChild(p.createElement("div"));T.optgroup=T.option;T.tbody=T.tfoot=T.colgroup=T.caption=T.thead;T.th=T.td;if(!bG.support.htmlSerialize){T._default=[1,"X<div>","</div>"]}bG.fn.extend({text:function(e){return bG.access(this,function(bZ){return bZ===aB?bG.text(this):this.empty().append((this[0]&&this[0].ownerDocument||p).createTextNode(bZ))},null,e,arguments.length)},wrapAll:function(e){if(bG.isFunction(e)){return this.each(function(b0){bG(this).wrapAll(e.call(this,b0))})}if(this[0]){var bZ=bG(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bZ.insertBefore(this[0])}bZ.map(function(){var b0=this;while(b0.firstChild&&b0.firstChild.nodeType===1){b0=b0.firstChild}return b0}).append(this)}return this},wrapInner:function(e){if(bG.isFunction(e)){return this.each(function(bZ){bG(this).wrapInner(e.call(this,bZ))})}return this.each(function(){var bZ=bG(this),b0=bZ.contents();if(b0.length){b0.wrapAll(e)}else{bZ.append(e)}})},wrap:function(e){var bZ=bG.isFunction(e);return this.each(function(b0){bG(this).wrapAll(bZ?e.call(this,b0):e)})},unwrap:function(){return this.parent().each(function(){if(!bG.nodeName(this,"body")){bG(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(!aR(this[0])){return this.domManip(arguments,false,function(bZ){this.parentNode.insertBefore(bZ,this)})}if(arguments.length){var e=bG.clean(arguments);return this.pushStack(bG.merge(e,this),"before",this.selector)}},after:function(){if(!aR(this[0])){return this.domManip(arguments,false,function(bZ){this.parentNode.insertBefore(bZ,this.nextSibling)})}if(arguments.length){var e=bG.clean(arguments);return this.pushStack(bG.merge(this,e),"after",this.selector)}},remove:function(e,b1){var b0,bZ=0;for(;(b0=this[bZ])!=null;bZ++){if(!e||bG.filter(e,[b0]).length){if(!b1&&b0.nodeType===1){bG.cleanData(b0.getElementsByTagName("*"));bG.cleanData([b0])}if(b0.parentNode){b0.parentNode.removeChild(b0)}}}return this},empty:function(){var bZ,e=0;for(;(bZ=this[e])!=null;e++){if(bZ.nodeType===1){bG.cleanData(bZ.getElementsByTagName("*"))}while(bZ.firstChild){bZ.removeChild(bZ.firstChild)}}return this},clone:function(bZ,e){bZ=bZ==null?false:bZ;e=e==null?bZ:e;return this.map(function(){return bG.clone(this,bZ,e)})},html:function(e){return bG.access(this,function(b2){var b1=this[0]||{},b0=0,bZ=this.length;if(b2===aB){return b1.nodeType===1?b1.innerHTML.replace(av,""):aB}if(typeof b2==="string"&&!aj.test(b2)&&(bG.support.htmlSerialize||!K.test(b2))&&(bG.support.leadingWhitespace||!bY.test(b2))&&!T[(q.exec(b2)||["",""])[1].toLowerCase()]){b2=b2.replace(ay,"<$1></$2>");try{for(;b0<bZ;b0++){b1=this[b0]||{};if(b1.nodeType===1){bG.cleanData(b1.getElementsByTagName("*"));b1.innerHTML=b2}}b1=0}catch(b3){}}if(b1){this.empty().append(b2)}},null,e,arguments.length)},replaceWith:function(e){if(!aR(this[0])){if(bG.isFunction(e)){return this.each(function(b1){var b0=bG(this),bZ=b0.html();b0.replaceWith(e.call(this,b1,bZ))})}if(typeof e!=="string"){e=bG(e).detach()}return this.each(function(){var b0=this.nextSibling,bZ=this.parentNode;bG(this).remove();if(b0){bG(b0).before(e)}else{bG(bZ).append(e)}})}return this.length?this.pushStack(bG(bG.isFunction(e)?e():e),"replaceWith",e):this},detach:function(e){return this.remove(e,true)},domManip:function(b4,b8,b7){b4=[].concat.apply([],b4);var b0,b2,b3,b6,b1=0,b5=b4[0],bZ=[],e=this.length;if(!bG.support.checkClone&&e>1&&typeof b5==="string"&&bR.test(b5)){return this.each(function(){bG(this).domManip(b4,b8,b7)})}if(bG.isFunction(b5)){return this.each(function(ca){var b9=bG(this);b4[0]=b5.call(this,ca,b8?b9.html():aB);b9.domManip(b4,b8,b7)})}if(this[0]){b0=bG.buildFragment(b4,this,bZ);b3=b0.fragment;b2=b3.firstChild;if(b3.childNodes.length===1){b3=b2}if(b2){b8=b8&&bG.nodeName(b2,"tr");for(b6=b0.cacheable||e-1;b1<e;b1++){b7.call(b8&&bG.nodeName(this[b1],"table")?y(this[b1],"tbody"):this[b1],b1===b6?b3:bG.clone(b3,true,true))}}b3=b2=null;if(bZ.length){bG.each(bZ,function(b9,ca){if(ca.src){if(bG.ajax){bG.ajax({url:ca.src,type:"GET",dataType:"script",async:false,global:false,"throws":true})}else{bG.error("no ajax")}}else{bG.globalEval((ca.text||ca.textContent||ca.innerHTML||"").replace(aH,""))}if(ca.parentNode){ca.parentNode.removeChild(ca)}})}}return this}});function y(bZ,e){return bZ.getElementsByTagName(e)[0]||bZ.appendChild(bZ.ownerDocument.createElement(e))}function ao(b5,bZ){if(bZ.nodeType!==1||!bG.hasData(b5)){return}var b2,b1,e,b4=bG._data(b5),b3=bG._data(bZ,b4),b0=b4.events;if(b0){delete b3.handle;b3.events={};for(b2 in b0){for(b1=0,e=b0[b2].length;b1<e;b1++){bG.event.add(bZ,b2,b0[b2][b1])}}}if(b3.data){b3.data=bG.extend({},b3.data)}}function G(bZ,e){var b0;if(e.nodeType!==1){return}if(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(bZ)}b0=e.nodeName.toLowerCase();if(b0==="object"){if(e.parentNode){e.outerHTML=bZ.outerHTML}if(bG.support.html5Clone&&(bZ.innerHTML&&!bG.trim(e.innerHTML))){e.innerHTML=bZ.innerHTML}}else{if(b0==="input"&&aE.test(bZ.type)){e.defaultChecked=e.checked=bZ.checked;if(e.value!==bZ.value){e.value=bZ.value}}else{if(b0==="option"){e.selected=bZ.defaultSelected}else{if(b0==="input"||b0==="textarea"){e.defaultValue=bZ.defaultValue}else{if(b0==="script"&&e.text!==bZ.text){e.text=bZ.text}}}}}e.removeAttribute(bG.expando)}bG.buildFragment=function(b1,b2,bZ){var b0,e,b3,b4=b1[0];b2=b2||p;b2=(b2[0]||b2).ownerDocument||b2[0]||b2;if(typeof b2.createDocumentFragment==="undefined"){b2=p}if(b1.length===1&&typeof b4==="string"&&b4.length<512&&b2===p&&b4.charAt(0)==="<"&&!ap.test(b4)&&(bG.support.checkClone||!bR.test(b4))&&(bG.support.html5Clone||!K.test(b4))){e=true;b0=bG.fragments[b4];b3=b0!==aB}if(!b0){b0=b2.createDocumentFragment();bG.clean(b1,b2,b0,bZ);if(e){bG.fragments[b4]=b3&&b0}}return{fragment:b0,cacheable:e}};bG.fragments={};bG.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bZ){bG.fn[e]=function(b0){var b2,b4=0,b3=[],b6=bG(b0),b1=b6.length,b5=this.length===1&&this[0].parentNode;if((b5==null||b5&&b5.nodeType===11&&b5.childNodes.length===1)&&b1===1){b6[bZ](this[0]);return this}else{for(;b4<b1;b4++){b2=(b4>0?this.clone(true):this).get();bG(b6[b4])[bZ](b2);b3=b3.concat(b2)}return this.pushStack(b3,e,b6.selector)}}});function n(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function bS(e){if(aE.test(e.type)){e.defaultChecked=e.checked}}bG.extend({clone:function(b2,b4,b0){var e,bZ,b1,b3;if(bG.support.html5Clone||bG.isXMLDoc(b2)||!K.test("<"+b2.nodeName+">")){b3=b2.cloneNode(true)}else{m.innerHTML=b2.outerHTML;m.removeChild(b3=m.firstChild)}if((!bG.support.noCloneEvent||!bG.support.noCloneChecked)&&(b2.nodeType===1||b2.nodeType===11)&&!bG.isXMLDoc(b2)){G(b2,b3);e=n(b2);bZ=n(b3);for(b1=0;e[b1];++b1){if(bZ[b1]){G(e[b1],bZ[b1])}}}if(b4){ao(b2,b3);if(b0){e=n(b2);bZ=n(b3);for(b1=0;e[b1];++b1){ao(e[b1],bZ[b1])}}}e=bZ=null;return b3},clean:function(cb,b0,e,b1){var b7,b3,ca,cf,b4,ce,b5,b2,bZ,b9,cd,b6,b8=0,cc=[];if(!b0||typeof b0.createDocumentFragment==="undefined"){b0=p}for(b3=b0===p&&aQ;(ca=cb[b8])!=null;b8++){if(typeof ca==="number"){ca+=""}if(!ca){continue}if(typeof ca==="string"){if(!J.test(ca)){ca=b0.createTextNode(ca)}else{b3=b3||B(b0);b5=b5||b3.appendChild(b0.createElement("div"));ca=ca.replace(ay,"<$1></$2>");cf=(q.exec(ca)||["",""])[1].toLowerCase();b4=T[cf]||T._default;ce=b4[0];b5.innerHTML=b4[1]+ca+b4[2];while(ce--){b5=b5.lastChild}if(!bG.support.tbody){b2=bT.test(ca);bZ=cf==="table"&&!b2?b5.firstChild&&b5.firstChild.childNodes:b4[1]==="<table>"&&!b2?b5.childNodes:[];for(b7=bZ.length-1;b7>=0;--b7){if(bG.nodeName(bZ[b7],"tbody")&&!bZ[b7].childNodes.length){bZ[b7].parentNode.removeChild(bZ[b7])}}}if(!bG.support.leadingWhitespace&&bY.test(ca)){b5.insertBefore(b0.createTextNode(bY.exec(ca)[0]),b5.firstChild)}ca=b5.childNodes;b5=b3.lastChild}}if(ca.nodeType){cc.push(ca)}else{cc=bG.merge(cc,ca)}}if(b5){b3.removeChild(b5);ca=b5=b3=null}if(!bG.support.appendChecked){for(b8=0;(ca=cc[b8])!=null;b8++){if(bG.nodeName(ca,"input")){bS(ca)}else{if(typeof ca.getElementsByTagName!=="undefined"){bG.grep(ca.getElementsByTagName("input"),bS)}}}}if(e){cd=function(cg){if(!cg.type||bw.test(cg.type)){return b1?b1.push(cg.parentNode?cg.parentNode.removeChild(cg):cg):e.appendChild(cg)}};for(b8=0;(ca=cc[b8])!=null;b8++){if(!(bG.nodeName(ca,"script")&&cd(ca))){e.appendChild(ca);if(typeof ca.getElementsByTagName!=="undefined"){b6=bG.grep(bG.merge([],ca.getElementsByTagName("script")),cd);cc.splice.apply(cc,[b8+1,0].concat(b6));b8+=b6.length}}}}return cc},cleanData:function(bZ,b7){var b2,b0,b1,b6,b3=0,b8=bG.expando,e=bG.cache,b4=bG.support.deleteExpando,b5=bG.event.special;for(;(b1=bZ[b3])!=null;b3++){if(b7||bG.acceptData(b1)){b0=b1[b8];b2=b0&&e[b0];if(b2){if(b2.events){for(b6 in b2.events){if(b5[b6]){bG.event.remove(b1,b6)}else{bG.removeEvent(b1,b6,b2.handle)}}}if(e[b0]){delete e[b0];if(b4){delete b1[b8]}else{if(b1.removeAttribute){b1.removeAttribute(b8)}else{b1[b8]=null}}bG.deletedIds.push(b0)}}}}}});(function(){var e,bZ;bG.uaMatch=function(b1){b1=b1.toLowerCase();var b0=/(chrome)[ \/]([\w.]+)/.exec(b1)||/(webkit)[ \/]([\w.]+)/.exec(b1)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b1)||/(msie) ([\w.]+)/.exec(b1)||b1.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b1)||[];return{browser:b0[1]||"",version:b0[2]||"0"}};e=bG.uaMatch(d.userAgent);bZ={};if(e.browser){bZ[e.browser]=true;bZ.version=e.version}if(bZ.webkit){bZ.safari=true}bG.browser=bZ;bG.sub=function(){function b0(b3,b4){return new b0.fn.init(b3,b4)}bG.extend(true,b0,this);b0.superclass=this;b0.fn=b0.prototype=this();b0.fn.constructor=b0;b0.sub=this.sub;b0.fn.init=function b2(b3,b4){if(b4&&b4 instanceof bG&&!(b4 instanceof b0)){b4=b0(b4)}return bG.fn.init.call(this,b3,b4,b1)};b0.fn.init.prototype=b0.fn;var b1=b0(p);return b0}})();var F,az,aW,be=/alpha\([^)]*\)/i,aS=/opacity=([^)]*)/,bk=/^(top|right|bottom|left)$/,aZ=/^margin/,a8=new RegExp("^("+bx+")(.*)$","i"),W=new RegExp("^("+bx+")(?!px)[a-z%]+$","i"),S=new RegExp("^([-+])=("+bx+")","i"),bh={},a9={position:"absolute",visibility:"hidden",display:"block"},bA={letterSpacing:0,fontWeight:400,lineHeight:1},bQ=["Top","Right","Bottom","Left"],ar=["Webkit","O","Moz","ms"],aJ=bG.fn.toggle;function b(b1,bZ){if(bZ in b1){return bZ}var b2=bZ.charAt(0).toUpperCase()+bZ.slice(1),e=bZ,b0=ar.length;while(b0--){bZ=ar[b0]+b2;if(bZ in b1){return bZ}}return e}function Q(bZ,e){bZ=e||bZ;return bG.css(bZ,"display")==="none"||!bG.contains(bZ.ownerDocument,bZ)}function t(b3,e){var b2,b4,bZ=[],b0=0,b1=b3.length;for(;b0<b1;b0++){b2=b3[b0];if(!b2.style){continue}bZ[b0]=bG._data(b2,"olddisplay");if(e){if(!bZ[b0]&&b2.style.display==="none"){b2.style.display=""}if(b2.style.display===""&&Q(b2)){bZ[b0]=bG._data(b2,"olddisplay",bC(b2.nodeName))}}else{b4=F(b2,"display");if(!bZ[b0]&&b4!=="none"){bG._data(b2,"olddisplay",b4)}}}for(b0=0;b0<b1;b0++){b2=b3[b0];if(!b2.style){continue}if(!e||b2.style.display==="none"||b2.style.display===""){b2.style.display=e?bZ[b0]||"":"none"}}return b3}bG.fn.extend({css:function(e,bZ){return bG.access(this,function(b1,b0,b2){return b2!==aB?bG.style(b1,b0,b2):bG.css(b1,b0)},e,bZ,arguments.length>1)},show:function(){return t(this,true)},hide:function(){return t(this)},toggle:function(b0,bZ){var e=typeof b0==="boolean";if(bG.isFunction(b0)&&bG.isFunction(bZ)){return aJ.apply(this,arguments)}return this.each(function(){if(e?b0:Q(this)){bG(this).show()}else{bG(this).hide()}})}});bG.extend({cssHooks:{opacity:{get:function(b0,bZ){if(bZ){var e=F(b0,"opacity");return e===""?"1":e}}}},cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":bG.support.cssFloat?"cssFloat":"styleFloat"},style:function(b1,b0,b7,b2){if(!b1||b1.nodeType===3||b1.nodeType===8||!b1.style){return}var b5,b6,b8,b3=bG.camelCase(b0),bZ=b1.style;b0=bG.cssProps[b3]||(bG.cssProps[b3]=b(bZ,b3));b8=bG.cssHooks[b0]||bG.cssHooks[b3];if(b7!==aB){b6=typeof b7;if(b6==="string"&&(b5=S.exec(b7))){b7=(b5[1]+1)*b5[2]+parseFloat(bG.css(b1,b0));b6="number"}if(b7==null||b6==="number"&&isNaN(b7)){return}if(b6==="number"&&!bG.cssNumber[b3]){b7+="px"}if(!b8||!("set" in b8)||(b7=b8.set(b1,b7,b2))!==aB){try{bZ[b0]=b7}catch(b4){}}}else{if(b8&&"get" in b8&&(b5=b8.get(b1,false,b2))!==aB){return b5}return bZ[b0]}},css:function(b4,b2,b3,bZ){var b5,b1,e,b0=bG.camelCase(b2);b2=bG.cssProps[b0]||(bG.cssProps[b0]=b(b4.style,b0));e=bG.cssHooks[b2]||bG.cssHooks[b0];if(e&&"get" in e){b5=e.get(b4,true,bZ)}if(b5===aB){b5=F(b4,b2)}if(b5==="normal"&&b2 in bA){b5=bA[b2]}if(b3||bZ!==aB){b1=parseFloat(b5);return b3||bG.isNumeric(b1)?b1||0:b5}return b5},swap:function(b2,b1,b3){var b0,bZ,e={};for(bZ in b1){e[bZ]=b2.style[bZ];b2.style[bZ]=b1[bZ]}b0=b3.call(b2);for(bZ in b1){b2.style[bZ]=e[bZ]}return b0}});if(a2.getComputedStyle){F=function(b5,bZ){var e,b2,b1,b4,b3=getComputedStyle(b5,null),b0=b5.style;if(b3){e=b3[bZ];if(e===""&&!bG.contains(b5.ownerDocument.documentElement,b5)){e=bG.style(b5,bZ)}if(W.test(e)&&aZ.test(bZ)){b2=b0.width;b1=b0.minWidth;b4=b0.maxWidth;b0.minWidth=b0.maxWidth=b0.width=e;e=b3.width;b0.width=b2;b0.minWidth=b1;b0.maxWidth=b4}}return e}}else{if(p.documentElement.currentStyle){F=function(b2,b0){var b3,e,bZ=b2.currentStyle&&b2.currentStyle[b0],b1=b2.style;if(bZ==null&&b1&&b1[b0]){bZ=b1[b0]}if(W.test(bZ)&&!bk.test(b0)){b3=b1.left;e=b2.runtimeStyle&&b2.runtimeStyle.left;if(e){b2.runtimeStyle.left=b2.currentStyle.left}b1.left=b0==="fontSize"?"1em":bZ;bZ=b1.pixelLeft+"px";b1.left=b3;if(e){b2.runtimeStyle.left=e}}return bZ===""?"auto":bZ}}}function aG(e,b0,b1){var bZ=a8.exec(b0);return bZ?Math.max(0,bZ[1]-(b1||0))+(bZ[2]||"px"):b0}function at(b1,bZ,e,b3){var b0=e===(b3?"border":"content")?4:bZ==="width"?1:0,b2=0;for(;b0<4;b0+=2){if(e==="margin"){b2+=bG.css(b1,e+bQ[b0],true)}if(b3){if(e==="content"){b2-=parseFloat(F(b1,"padding"+bQ[b0]))||0}if(e!=="margin"){b2-=parseFloat(F(b1,"border"+bQ[b0]+"Width"))||0}}else{b2+=parseFloat(F(b1,"padding"+bQ[b0]))||0;if(e!=="padding"){b2+=parseFloat(F(b1,"border"+bQ[b0]+"Width"))||0}}}return b2}function v(b1,bZ,e){var b2=bZ==="width"?b1.offsetWidth:b1.offsetHeight,b0=true,b3=bG.support.boxSizing&&bG.css(b1,"boxSizing")==="border-box";if(b2<=0){b2=F(b1,bZ);if(b2<0||b2==null){b2=b1.style[bZ]}if(W.test(b2)){return b2}b0=b3&&(bG.support.boxSizingReliable||b2===b1.style[bZ]);b2=parseFloat(b2)||0}return(b2+at(b1,bZ,e||(b3?"border":"content"),b0))+"px"}function bC(b0){if(bh[b0]){return bh[b0]}var e=bG("<"+b0+">").appendTo(p.body),bZ=e.css("display");e.remove();if(bZ==="none"||bZ===""){az=p.body.appendChild(az||bG.extend(p.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!aW||!az.createElement){aW=(az.contentWindow||az.contentDocument).document;aW.write("<!doctype html><html><body>");aW.close()}e=aW.body.appendChild(aW.createElement(b0));bZ=F(e,"display");p.body.removeChild(az)}bh[b0]=bZ;return bZ}bG.each(["height","width"],function(bZ,e){bG.cssHooks[e]={get:function(b2,b1,b0){if(b1){if(b2.offsetWidth!==0||F(b2,"display")!=="none"){return v(b2,e,b0)}else{return bG.swap(b2,a9,function(){return v(b2,e,b0)})}}},set:function(b1,b2,b0){return aG(b1,b2,b0?at(b1,e,b0,bG.support.boxSizing&&bG.css(b1,"boxSizing")==="border-box"):0)}}});if(!bG.support.opacity){bG.cssHooks.opacity={get:function(bZ,e){return aS.test((e&&bZ.currentStyle?bZ.currentStyle.filter:bZ.style.filter)||"")?(0.01*parseFloat(RegExp.$1))+"":e?"1":""},set:function(b2,b3){var b1=b2.style,bZ=b2.currentStyle,e=bG.isNumeric(b3)?"alpha(opacity="+b3*100+")":"",b0=bZ&&bZ.filter||b1.filter||"";b1.zoom=1;if(b3>=1&&bG.trim(b0.replace(be,""))===""&&b1.removeAttribute){b1.removeAttribute("filter");if(bZ&&!bZ.filter){return}}b1.filter=be.test(b0)?b0.replace(be,e):b0+" "+e}}}bG(function(){if(!bG.support.reliableMarginRight){bG.cssHooks.marginRight={get:function(bZ,e){return bG.swap(bZ,{display:"inline-block"},function(){if(e){return F(bZ,"marginRight")}})}}}if(!bG.support.pixelPosition&&bG.fn.position){bG.each(["top","left"],function(e,bZ){bG.cssHooks[bZ]={get:function(b2,b1){if(b1){var b0=F(b2,bZ);return W.test(b0)?bG(b2).position()[bZ]+"px":b0}}}})}});if(bG.expr&&bG.expr.filters){bG.expr.filters.hidden=function(e){return(e.offsetWidth===0&&e.offsetHeight===0)||(!bG.support.reliableHiddenOffsets&&((e.style&&e.style.display)||F(e,"display"))==="none")};bG.expr.filters.visible=function(e){return !bG.expr.filters.hidden(e)}}bG.each({margin:"",padding:"",border:"Width"},function(e,bZ){bG.cssHooks[e+bZ]={expand:function(b2){var b1,b3=typeof b2==="string"?b2.split(" "):[b2],b0={};for(b1=0;b1<4;b1++){b0[e+bQ[b1]+bZ]=b3[b1]||b3[b1-2]||b3[0]}return b0}};if(!aZ.test(e)){bG.cssHooks[e+bZ].set=aG}});var bs=/%20/g,aP=/\[\]$/,U=/\r?\n/g,bz=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aD=/^(?:select|textarea)/i;bG.fn.extend({serialize:function(){return bG.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?bG.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||aD.test(this.nodeName)||bz.test(this.type))}).map(function(e,bZ){var b0=bG(this).val();return b0==null?null:bG.isArray(b0)?bG.map(b0,function(b2,b1){return{name:bZ.name,value:b2.replace(U,"\r\n")}}):{name:bZ.name,value:b0.replace(U,"\r\n")}}).get()}});bG.param=function(e,b0){var b1,bZ=[],b2=function(b3,b4){b4=bG.isFunction(b4)?b4():(b4==null?"":b4);bZ[bZ.length]=encodeURIComponent(b3)+"="+encodeURIComponent(b4)};if(b0===aB){b0=bG.ajaxSettings&&bG.ajaxSettings.traditional}if(bG.isArray(e)||(e.jquery&&!bG.isPlainObject(e))){bG.each(e,function(){b2(this.name,this.value)})}else{for(b1 in e){l(b1,e[b1],b0,b2)}}return bZ.join("&").replace(bs,"+")};function l(b0,b2,bZ,b1){var e;if(bG.isArray(b2)){bG.each(b2,function(b4,b3){if(bZ||aP.test(b0)){b1(b0,b3)}else{l(b0+"["+(typeof b3==="object"?b4:"")+"]",b3,bZ,b1)}})}else{if(!bZ&&bG.type(b2)==="object"){for(e in b2){l(b0+"["+e+"]",b2[e],bZ,b1)}}else{b1(b0,b2)}}}var Y,bX,an=/#.*$/,ad=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,C=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,s=/^(?:GET|HEAD)$/,aC=/^\/\//,bN=/\?/,g=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,P=/([?&])_=[^&]*/,aT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,bW=bG.fn.load,w={},a6={},aX=["*/"]+["*"];try{Y=aI.href}catch(bd){Y=p.createElement("a");Y.href="";Y=Y.href}bX=aT.exec(Y.toLowerCase())||[];function bI(e){return function(b2,b4){if(typeof b2!=="string"){b4=b2;b2="*"}var bZ,b5,b6,b1=b2.toLowerCase().split(aV),b0=0,b3=b1.length;if(bG.isFunction(b4)){for(;b0<b3;b0++){bZ=b1[b0];b6=/^\+/.test(bZ);if(b6){bZ=bZ.substr(1)||"*"}b5=e[bZ]=e[bZ]||[];b5[b6?"unshift":"push"](b4)}}}}function r(bZ,b8,b3,b6,b5,b1){b5=b5||b8.dataTypes[0];b1=b1||{};b1[b5]=true;var b7,b4=bZ[b5],b0=0,e=b4?b4.length:0,b2=(bZ===w);for(;b0<e&&(b2||!b7);b0++){b7=b4[b0](b8,b3,b6);if(typeof b7==="string"){if(!b2||b1[b7]){b7=aB}else{b8.dataTypes.unshift(b7);b7=r(bZ,b8,b3,b6,b7,b1)}}}if((b2||!b7)&&!b1["*"]){b7=r(bZ,b8,b3,b6,"*",b1)}return b7}function u(b0,b1){var bZ,e,b2=bG.ajaxSettings.flatOptions||{};for(bZ in b1){if(b1[bZ]!==aB){(b2[bZ]?b0:(e||(e={})))[bZ]=b1[bZ]}}if(e){bG.extend(true,b0,e)}}bG.fn.load=function(b1,b4,b5){if(typeof b1!=="string"&&bW){return bW.apply(this,arguments)}if(!this.length){return this}var e,b2,b0,bZ=this,b3=b1.indexOf(" ");if(b3>=0){e=b1.slice(b3,b1.length);b1=b1.slice(0,b3)}if(bG.isFunction(b4)){b5=b4;b4=aB}else{if(typeof b4==="object"){b2="POST"}}bG.ajax({url:b1,type:b2,dataType:"html",data:b4,complete:function(b7,b6){if(b5){bZ.each(b5,b0||[b7.responseText,b6,b7])}}}).done(function(b6){b0=arguments;bZ.html(e?bG("<div>").append(b6.replace(g,"")).find(e):b6)});return this};bG.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bZ){bG.fn[bZ]=function(b0){return this.on(bZ,b0)}});bG.each(["get","post"],function(e,bZ){bG[bZ]=function(b0,b2,b3,b1){if(bG.isFunction(b2)){b1=b1||b3;b3=b2;b2=aB}return bG.ajax({type:bZ,url:b0,data:b2,success:b3,dataType:b1})}});bG.extend({getScript:function(e,bZ){return bG.get(e,aB,bZ,"script")},getJSON:function(e,bZ,b0){return bG.get(e,bZ,b0,"json")},ajaxSetup:function(bZ,e){if(e){u(bZ,bG.ajaxSettings)}else{e=bZ;bZ=bG.ajaxSettings}u(bZ,e);return bZ},ajaxSettings:{url:Y,isLocal:C.test(bX[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","*":aX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a2.String,"text html":true,"text json":bG.parseJSON,"text xml":bG.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:bI(w),ajaxTransport:bI(a6),ajax:function(b4,b1){if(typeof b4==="object"){b1=b4;b4=aB}b1=b1||{};var b7,cl,b2,cg,b9,cd,b0,cf,b8=bG.ajaxSetup({},b1),cn=b8.context||b8,cb=cn!==b8&&(cn.nodeType||cn instanceof bG)?bG(cn):bG.event,cm=bG.Deferred(),ci=bG.Callbacks("once memory"),b5=b8.statusCode||{},cc={},cj={},b3=0,b6="canceled",ce={readyState:0,setRequestHeader:function(co,cp){if(!b3){var e=co.toLowerCase();co=cj[e]=cj[e]||co;cc[co]=cp}return this},getAllResponseHeaders:function(){return b3===2?cl:null},getResponseHeader:function(co){var e;if(b3===2){if(!b2){b2={};while((e=ad.exec(cl))){b2[e[1].toLowerCase()]=e[2]}}e=b2[co.toLowerCase()]}return e===aB?null:e},overrideMimeType:function(e){if(!b3){b8.mimeType=e}return this},abort:function(e){e=e||b6;if(cg){cg.abort(e)}ca(0,e);return this}};function ca(cs,co,ct,cq){var e,cw,cu,cr,cv,cp=co;if(b3===2){return}b3=2;if(b9){clearTimeout(b9)}cg=aB;cl=cq||"";ce.readyState=cs>0?4:0;if(ct){cr=h(b8,ce,ct)}if(cs>=200&&cs<300||cs===304){if(b8.ifModified){cv=ce.getResponseHeader("Last-Modified");if(cv){bG.lastModified[b7]=cv}cv=ce.getResponseHeader("Etag");if(cv){bG.etag[b7]=cv}}if(cs===304){cp="notmodified";e=true}else{e=ae(b8,cr);cp=e.state;cw=e.data;cu=e.error;e=!cu}}else{cu=cp;if(!cp||cs){cp="error";if(cs<0){cs=0}}}ce.status=cs;ce.statusText=""+(co||cp);if(e){cm.resolveWith(cn,[cw,cp,ce])}else{cm.rejectWith(cn,[ce,cp,cu])}ce.statusCode(b5);b5=aB;if(b0){cb.trigger("ajax"+(e?"Success":"Error"),[ce,b8,e?cw:cu])}ci.fireWith(cn,[ce,cp]);if(b0){cb.trigger("ajaxComplete",[ce,b8]);if(!(--bG.active)){bG.event.trigger("ajaxStop")}}}cm.promise(ce);ce.success=ce.done;ce.error=ce.fail;ce.complete=ci.add;ce.statusCode=function(co){if(co){var e;if(b3<2){for(e in co){b5[e]=[b5[e],co[e]]}}else{e=co[ce.status];ce.always(e)}}return this};b8.url=((b4||b8.url)+"").replace(an,"").replace(aC,bX[1]+"//");b8.dataTypes=bG.trim(b8.dataType||"*").toLowerCase().split(aV);if(b8.crossDomain==null){cd=aT.exec(b8.url.toLowerCase());b8.crossDomain=!!(cd&&(cd[1]!=bX[1]||cd[2]!=bX[2]||(cd[3]||(cd[1]==="http:"?80:443))!=(bX[3]||(bX[1]==="http:"?80:443))))}if(b8.data&&b8.processData&&typeof b8.data!=="string"){b8.data=bG.param(b8.data,b8.traditional)}r(w,b8,b1,ce);if(b3===2){return ce}b0=b8.global;b8.type=b8.type.toUpperCase();b8.hasContent=!s.test(b8.type);if(b0&&bG.active++===0){bG.event.trigger("ajaxStart")}if(!b8.hasContent){if(b8.data){b8.url+=(bN.test(b8.url)?"&":"?")+b8.data;delete b8.data}b7=b8.url;if(b8.cache===false){var bZ=bG.now(),ck=b8.url.replace(P,"$1_="+bZ);b8.url=ck+((ck===b8.url)?(bN.test(b8.url)?"&":"?")+"_="+bZ:"")}}if(b8.data&&b8.hasContent&&b8.contentType!==false||b1.contentType){ce.setRequestHeader("Content-Type",b8.contentType)}if(b8.ifModified){b7=b7||b8.url;if(bG.lastModified[b7]){ce.setRequestHeader("If-Modified-Since",bG.lastModified[b7])}if(bG.etag[b7]){ce.setRequestHeader("If-None-Match",bG.etag[b7])}}ce.setRequestHeader("Accept",b8.dataTypes[0]&&b8.accepts[b8.dataTypes[0]]?b8.accepts[b8.dataTypes[0]]+(b8.dataTypes[0]!=="*"?", "+aX+"; q=0.01":""):b8.accepts["*"]);for(cf in b8.headers){ce.setRequestHeader(cf,b8.headers[cf])}if(b8.beforeSend&&(b8.beforeSend.call(cn,ce,b8)===false||b3===2)){return ce.abort()}b6="abort";for(cf in {success:1,error:1,complete:1}){ce[cf](b8[cf])}cg=r(a6,b8,b1,ce);if(!cg){ca(-1,"No Transport")}else{ce.readyState=1;if(b0){cb.trigger("ajaxSend",[ce,b8])}if(b8.async&&b8.timeout>0){b9=setTimeout(function(){ce.abort("timeout")},b8.timeout)}try{b3=1;cg.send(cc,ca)}catch(ch){if(b3<2){ca(-1,ch)}else{throw ch}}}return ce},active:0,lastModified:{},etag:{}});function h(b7,b6,b3){var b2,b4,b1,e,bZ=b7.contents,b5=b7.dataTypes,b0=b7.responseFields;for(b4 in b0){if(b4 in b3){b6[b0[b4]]=b3[b4]}}while(b5[0]==="*"){b5.shift();if(b2===aB){b2=b7.mimeType||b6.getResponseHeader("content-type")}}if(b2){for(b4 in bZ){if(bZ[b4]&&bZ[b4].test(b2)){b5.unshift(b4);break}}}if(b5[0] in b3){b1=b5[0]}else{for(b4 in b3){if(!b5[0]||b7.converters[b4+" "+b5[0]]){b1=b4;break}if(!e){e=b4}}b1=b1||e}if(b1){if(b1!==b5[0]){b5.unshift(b1)}return b3[b1]}}function ae(b9,b1){var b7,bZ,b5,b3,b6=b9.dataTypes.slice(),b0=b6[0],b8={},b2=0;if(b9.dataFilter){b1=b9.dataFilter(b1,b9.dataType)}if(b6[1]){for(b7 in b9.converters){b8[b7.toLowerCase()]=b9.converters[b7]}}for(;(b5=b6[++b2]);){if(b5!=="*"){if(b0!=="*"&&b0!==b5){b7=b8[b0+" "+b5]||b8["* "+b5];if(!b7){for(bZ in b8){b3=bZ.split(" ");if(b3[1]===b5){b7=b8[b0+" "+b3[0]]||b8["* "+b3[0]];if(b7){if(b7===true){b7=b8[bZ]}else{if(b8[bZ]!==true){b5=b3[0];b6.splice(b2--,0,b5)}}break}}}}if(b7!==true){if(b7&&b9["throws"]){b1=b7(b1)}else{try{b1=b7(b1)}catch(b4){return{state:"parsererror",error:b7?b4:"No conversion from "+b0+" to "+b5}}}}}b0=b5}}return{state:"success",data:b1}}var bp=[],aw=/\?/,a5=/(=)\?(?=&|$)|\?\?/,bl=bG.now();bG.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=bp.pop()||(bG.expando+"_"+(bl++));this[e]=true;return e}});bG.ajaxPrefilter("json jsonp",function(b8,b3,b7){var b6,e,b5,b1=b8.data,bZ=b8.url,b0=b8.jsonp!==false,b4=b0&&a5.test(bZ),b2=b0&&!b4&&typeof b1==="string"&&!(b8.contentType||"").indexOf("application/x-www-form-urlencoded")&&a5.test(b1);if(b8.dataTypes[0]==="jsonp"||b4||b2){b6=b8.jsonpCallback=bG.isFunction(b8.jsonpCallback)?b8.jsonpCallback():b8.jsonpCallback;e=a2[b6];if(b4){b8.url=bZ.replace(a5,"$1"+b6)}else{if(b2){b8.data=b1.replace(a5,"$1"+b6)}else{if(b0){b8.url+=(aw.test(bZ)?"&":"?")+b8.jsonp+"="+b6}}}b8.converters["script json"]=function(){if(!b5){bG.error(b6+" was not called")}return b5[0]};b8.dataTypes[0]="json";a2[b6]=function(){b5=arguments};b7.always(function(){a2[b6]=e;if(b8[b6]){b8.jsonpCallback=b3.jsonpCallback;bp.push(b6)}if(b5&&bG.isFunction(e)){e(b5[0])}b5=e=aB});return"script"}});bG.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){bG.globalEval(e);return e}}});bG.ajaxPrefilter("script",function(e){if(e.cache===aB){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});bG.ajaxTransport("script",function(b0){if(b0.crossDomain){var e,bZ=p.head||p.getElementsByTagName("head")[0]||p.documentElement;return{send:function(b1,b2){e=p.createElement("script");e.async="async";if(b0.scriptCharset){e.charset=b0.scriptCharset}e.src=b0.url;e.onload=e.onreadystatechange=function(b4,b3){if(b3||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(bZ&&e.parentNode){bZ.removeChild(e)}e=aB;if(!b3){b2(200,"success")}}};bZ.insertBefore(e,bZ.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var ah,aO=a2.ActiveXObject?function(){for(var e in ah){ah[e](0,1)}}:false,au=0;function bB(){try{return new a2.XMLHttpRequest()}catch(bZ){}}function bb(){try{return new a2.ActiveXObject("Microsoft.XMLHTTP")}catch(bZ){}}bG.ajaxSettings.xhr=a2.ActiveXObject?function(){return !this.isLocal&&bB()||bb()}:bB;(function(e){bG.extend(bG.support,{ajax:!!e,cors:!!e&&("withCredentials" in e)})})(bG.ajaxSettings.xhr());if(bG.support.ajax){bG.ajaxTransport(function(e){if(!e.crossDomain||bG.support.cors){var bZ;return{send:function(b5,b0){var b3,b2,b4=e.xhr();if(e.username){b4.open(e.type,e.url,e.async,e.username,e.password)}else{b4.open(e.type,e.url,e.async)}if(e.xhrFields){for(b2 in e.xhrFields){b4[b2]=e.xhrFields[b2]}}if(e.mimeType&&b4.overrideMimeType){b4.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!b5["X-Requested-With"]){b5["X-Requested-With"]="XMLHttpRequest"}try{for(b2 in b5){b4.setRequestHeader(b2,b5[b2])}}catch(b1){}b4.send((e.hasContent&&e.data)||null);bZ=function(ce,b8){var b9,b7,b6,cc,cb;try{if(bZ&&(b8||b4.readyState===4)){bZ=aB;if(b3){b4.onreadystatechange=bG.noop;if(aO){delete ah[b3]}}if(b8){if(b4.readyState!==4){b4.abort()}}else{b9=b4.status;b6=b4.getAllResponseHeaders();cc={};cb=b4.responseXML;if(cb&&cb.documentElement){cc.xml=cb}try{cc.text=b4.responseText}catch(ce){}try{b7=b4.statusText}catch(cd){b7=""}if(!b9&&e.isLocal&&!e.crossDomain){b9=cc.text?200:404}else{if(b9===1223){b9=204}}}}}catch(ca){if(!b8){b0(-1,ca)}}if(cc){b0(b9,b7,cc,b6)}};if(!e.async){bZ()}else{if(b4.readyState===4){setTimeout(bZ,0)}else{b3=++au;if(aO){if(!ah){ah={};bG(a2).unload(aO)}ah[b3]=bZ}b4.onreadystatechange=bZ}}},abort:function(){if(bZ){bZ(0,1)}}}}})}var L,ab,bO=/^(?:toggle|show|hide)$/,bH=new RegExp("^(?:([-+])=|)("+bx+")([a-z%]*)$","i"),bM=/queueHooks$/,ax=[j],a1={"*":[function(bZ,b5){var b2,b6,e,b7=this.createTween(bZ,b5),b3=bH.exec(b5),b4=b7.cur(),b0=+b4||0,b1=1;if(b3){b2=+b3[2];b6=b3[3]||(bG.cssNumber[bZ]?"":"px");if(b6!=="px"&&b0){b0=bG.css(b7.elem,bZ,true)||b2||1;do{e=b1=b1||".5";b0=b0/b1;bG.style(b7.elem,bZ,b0+b6);b1=b7.cur()/b4}while(b1!==1&&b1!==e)}b7.unit=b6;b7.start=b0;b7.end=b3[1]?b0+(b3[1]+1)*b2:b2}return b7}]};function bj(){setTimeout(function(){L=aB},0);return(L=bG.now())}function bc(bZ,e){bG.each(e,function(b4,b2){var b3=(a1[b4]||[]).concat(a1["*"]),b0=0,b1=b3.length;for(;b0<b1;b0++){if(b3[b0].call(bZ,b4,b2)){return}}})}function f(b0,b4,b7){var b8,b3=0,e=0,bZ=ax.length,b6=bG.Deferred().always(function(){delete b2.elem}),b2=function(){var cd=L||bj(),ca=Math.max(0,b1.startTime+b1.duration-cd),cc=1-(ca/b1.duration||0),b9=0,cb=b1.tweens.length;for(;b9<cb;b9++){b1.tweens[b9].run(cc)}b6.notifyWith(b0,[b1,cc,ca]);if(cc<1&&cb){return ca}else{b6.resolveWith(b0,[b1]);return false}},b1=b6.promise({elem:b0,props:bG.extend({},b4),opts:bG.extend(true,{specialEasing:{}},b7),originalProperties:b4,originalOptions:b7,startTime:L||bj(),duration:b7.duration,tweens:[],createTween:function(cc,b9,cb){var ca=bG.Tween(b0,b1.opts,cc,b9,b1.opts.specialEasing[cc]||b1.opts.easing);b1.tweens.push(ca);return ca},stop:function(ca){var b9=0,cb=ca?b1.tweens.length:0;for(;b9<cb;b9++){b1.tweens[b9].run(1)}if(ca){b6.resolveWith(b0,[b1,ca])}else{b6.rejectWith(b0,[b1,ca])}return this}}),b5=b1.props;ak(b5,b1.opts.specialEasing);for(;b3<bZ;b3++){b8=ax[b3].call(b1,b0,b5,b1.opts);if(b8){return b8}}bc(b1,b5);if(bG.isFunction(b1.opts.start)){b1.opts.start.call(b0,b1)}bG.fx.timer(bG.extend(b2,{anim:b1,queue:b1.opts.queue,elem:b0}));return b1.progress(b1.opts.progress).done(b1.opts.done,b1.opts.complete).fail(b1.opts.fail).always(b1.opts.always)}function ak(b1,b3){var b0,bZ,b4,b2,e;for(b0 in b1){bZ=bG.camelCase(b0);b4=b3[bZ];b2=b1[b0];if(bG.isArray(b2)){b4=b2[1];b2=b1[b0]=b2[0]}if(b0!==bZ){b1[bZ]=b2;delete b1[b0]}e=bG.cssHooks[bZ];if(e&&"expand" in e){b2=e.expand(b2);delete b1[bZ];for(b0 in b2){if(!(b0 in b1)){b1[b0]=b2[b0];b3[b0]=b4}}}else{b3[bZ]=b4}}}bG.Animation=bG.extend(f,{tweener:function(bZ,b2){if(bG.isFunction(bZ)){b2=bZ;bZ=["*"]}else{bZ=bZ.split(" ")}var b1,e=0,b0=bZ.length;for(;e<b0;e++){b1=bZ[e];a1[b1]=a1[b1]||[];a1[b1].unshift(b2)}},prefilter:function(bZ,e){if(e){ax.unshift(bZ)}else{ax.push(bZ)}}});function j(b2,b7,e){var b6,b0,b9,b1,cd,cc,cb,ca,b3=this,bZ=b2.style,b8={},b5=[],b4=b2.nodeType&&Q(b2);if(!e.queue){cb=bG._queueHooks(b2,"fx");if(cb.unqueued==null){cb.unqueued=0;ca=cb.empty.fire;cb.empty.fire=function(){if(!cb.unqueued){ca()}}}cb.unqueued++;b3.always(function(){b3.always(function(){cb.unqueued--;if(!bG.queue(b2,"fx").length){cb.empty.fire()}})})}if(b2.nodeType===1&&("height" in b7||"width" in b7)){e.overflow=[bZ.overflow,bZ.overflowX,bZ.overflowY];if(bG.css(b2,"display")==="inline"&&bG.css(b2,"float")==="none"){if(!bG.support.inlineBlockNeedsLayout||bC(b2.nodeName)==="inline"){bZ.display="inline-block"}else{bZ.zoom=1}}}if(e.overflow){bZ.overflow="hidden";if(!bG.support.shrinkWrapBlocks){b3.done(function(){bZ.overflow=e.overflow[0];bZ.overflowX=e.overflow[1];bZ.overflowY=e.overflow[2]})}}for(b6 in b7){b9=b7[b6];if(bO.exec(b9)){delete b7[b6];if(b9===(b4?"hide":"show")){continue}b5.push(b6)}}b1=b5.length;if(b1){cd=bG._data(b2,"fxshow")||bG._data(b2,"fxshow",{});if(b4){bG(b2).show()}else{b3.done(function(){bG(b2).hide()})}b3.done(function(){var ce;bG.removeData(b2,"fxshow",true);for(ce in b8){bG.style(b2,ce,b8[ce])}});for(b6=0;b6<b1;b6++){b0=b5[b6];cc=b3.createTween(b0,b4?cd[b0]:0);b8[b0]=cd[b0]||bG.style(b2,b0);if(!(b0 in cd)){cd[b0]=cc.start;if(b4){cc.end=cc.start;cc.start=b0==="width"||b0==="height"?1:0}}}}}function H(b0,bZ,b2,e,b1){return new H.prototype.init(b0,bZ,b2,e,b1)}bG.Tween=H;H.prototype={constructor:H,init:function(b1,bZ,b3,e,b2,b0){this.elem=b1;this.prop=b3;this.easing=b2||"swing";this.options=bZ;this.start=this.now=this.cur();this.end=e;this.unit=b0||(bG.cssNumber[b3]?"":"px")},cur:function(){var e=H.propHooks[this.prop];return e&&e.get?e.get(this):H.propHooks._default.get(this)},run:function(b0){var bZ,e=H.propHooks[this.prop];this.pos=bZ=bG.easing[this.easing](b0,this.options.duration*b0,0,1,this.options.duration);this.now=(this.end-this.start)*bZ+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(e&&e.set){e.set(this)}else{H.propHooks._default.set(this)}return this}};H.prototype.init.prototype=H.prototype;H.propHooks={_default:{get:function(bZ){var e;if(bZ.elem[bZ.prop]!=null&&(!bZ.elem.style||bZ.elem.style[bZ.prop]==null)){return bZ.elem[bZ.prop]}e=bG.css(bZ.elem,bZ.prop,false,"");return !e||e==="auto"?0:e},set:function(e){if(bG.fx.step[e.prop]){bG.fx.step[e.prop](e)}else{if(e.elem.style&&(e.elem.style[bG.cssProps[e.prop]]!=null||bG.cssHooks[e.prop])){bG.style(e.elem,e.prop,e.now+e.unit)}else{e.elem[e.prop]=e.now}}}}};H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(e){if(e.elem.nodeType&&e.elem.parentNode){e.elem[e.prop]=e.now}}};bG.each(["toggle","show","hide"],function(bZ,e){var b0=bG.fn[e];bG.fn[e]=function(b1,b3,b2){return b1==null||typeof b1==="boolean"||(!bZ&&bG.isFunction(b1)&&bG.isFunction(b3))?b0.apply(this,arguments):this.animate(bF(e,true),b1,b3,b2)}});bG.fn.extend({fadeTo:function(e,b1,b0,bZ){return this.filter(Q).css("opacity",0).show().end().animate({opacity:b1},e,b0,bZ)},animate:function(b4,b1,b3,b2){var b0=bG.isEmptyObject(b4),e=bG.speed(b1,b3,b2),bZ=function(){var b5=f(this,bG.extend({},b4),e);if(b0){b5.stop(true)}};return b0||e.queue===false?this.each(bZ):this.queue(e.queue,bZ)},stop:function(b0,bZ,e){var b1=function(b2){var b3=b2.stop;delete b2.stop;b3(e)};if(typeof b0!=="string"){e=bZ;bZ=b0;b0=aB}if(bZ&&b0!==false){this.queue(b0||"fx",[])}return this.each(function(){var b5=true,b2=b0!=null&&b0+"queueHooks",b4=bG.timers,b3=bG._data(this);if(b2){if(b3[b2]&&b3[b2].stop){b1(b3[b2])}}else{for(b2 in b3){if(b3[b2]&&b3[b2].stop&&bM.test(b2)){b1(b3[b2])}}}for(b2=b4.length;b2--;){if(b4[b2].elem===this&&(b0==null||b4[b2].queue===b0)){b4[b2].anim.stop(e);b5=false;b4.splice(b2,1)}}if(b5||!e){bG.dequeue(this,b0)}})}});function bF(b0,b2){var b1,e={height:b0},bZ=0;for(;bZ<4;bZ+=2-b2){b1=bQ[bZ];e["margin"+b1]=e["padding"+b1]=b0}if(b2){e.opacity=e.width=b0}return e}bG.each({slideDown:bF("show"),slideUp:bF("hide"),slideToggle:bF("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bZ){bG.fn[e]=function(b0,b2,b1){return this.animate(bZ,b0,b2,b1)}});bG.speed=function(b0,b1,bZ){var e=b0&&typeof b0==="object"?bG.extend({},b0):{complete:bZ||!bZ&&b1||bG.isFunction(b0)&&b0,duration:b0,easing:bZ&&b1||b1&&!bG.isFunction(b1)&&b1};e.duration=bG.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in bG.fx.speeds?bG.fx.speeds[e.duration]:bG.fx.speeds._default;if(e.queue==null||e.queue===true){e.queue="fx"}e.old=e.complete;e.complete=function(){if(bG.isFunction(e.old)){e.old.call(this)}if(e.queue){bG.dequeue(this,e.queue)}};return e};bG.easing={linear:function(e){return e},swing:function(e){return 0.5-Math.cos(e*Math.PI)/2}};bG.timers=[];bG.fx=H.prototype.init;bG.fx.tick=function(){var b0,bZ=bG.timers,e=0;for(;e<bZ.length;e++){b0=bZ[e];if(!b0()&&bZ[e]===b0){bZ.splice(e--,1)}}if(!bZ.length){bG.fx.stop()}};bG.fx.timer=function(e){if(e()&&bG.timers.push(e)&&!ab){ab=setInterval(bG.fx.tick,bG.fx.interval)}};bG.fx.interval=13;bG.fx.stop=function(){clearInterval(ab);ab=null};bG.fx.speeds={slow:600,fast:200,_default:400};bG.fx.step={};if(bG.expr&&bG.expr.filters){bG.expr.filters.animated=function(e){return bG.grep(bG.timers,function(bZ){return e===bZ.elem}).length}}var bm=/^(?:body|html)$/i;bG.fn.offset=function(ca){if(arguments.length){return ca===aB?this:this.each(function(cb){bG.offset.setOffset(this,ca,cb)})}var b4,bZ,b5,b6,b3,b7,e,b2,b8,b1,b0=this[0],b9=b0&&b0.ownerDocument;if(!b9){return}if((b5=b9.body)===b0){return bG.offset.bodyOffset(b0)}bZ=b9.documentElement;if(!bG.contains(bZ,b0)){return{top:0,left:0}}b4=b0.getBoundingClientRect();b6=bn(b9);b3=bZ.clientTop||b5.clientTop||0;b7=bZ.clientLeft||b5.clientLeft||0;e=b6.pageYOffset||bZ.scrollTop;b2=b6.pageXOffset||bZ.scrollLeft;b8=b4.top+e-b3;b1=b4.left+b2-b7;return{top:b8,left:b1}};bG.offset={bodyOffset:function(e){var b0=e.offsetTop,bZ=e.offsetLeft;if(bG.support.doesNotIncludeMarginInBodyOffset){b0+=parseFloat(bG.css(e,"marginTop"))||0;bZ+=parseFloat(bG.css(e,"marginLeft"))||0}return{top:b0,left:bZ}},setOffset:function(b1,ca,b4){var b5=bG.css(b1,"position");if(b5==="static"){b1.style.position="relative"}var b3=bG(b1),bZ=b3.offset(),e=bG.css(b1,"top"),b8=bG.css(b1,"left"),b9=(b5==="absolute"||b5==="fixed")&&bG.inArray("auto",[e,b8])>-1,b7={},b6={},b0,b2;if(b9){b6=b3.position();b0=b6.top;b2=b6.left}else{b0=parseFloat(e)||0;b2=parseFloat(b8)||0}if(bG.isFunction(ca)){ca=ca.call(b1,b4,bZ)}if(ca.top!=null){b7.top=(ca.top-bZ.top)+b0}if(ca.left!=null){b7.left=(ca.left-bZ.left)+b2}if("using" in ca){ca.using.call(b1,b7)}else{b3.css(b7)}}};bG.fn.extend({position:function(){if(!this[0]){return}var b0=this[0],bZ=this.offsetParent(),b1=this.offset(),e=bm.test(bZ[0].nodeName)?{top:0,left:0}:bZ.offset();b1.top-=parseFloat(bG.css(b0,"marginTop"))||0;b1.left-=parseFloat(bG.css(b0,"marginLeft"))||0;e.top+=parseFloat(bG.css(bZ[0],"borderTopWidth"))||0;e.left+=parseFloat(bG.css(bZ[0],"borderLeftWidth"))||0;return{top:b1.top-e.top,left:b1.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||p.body;while(e&&(!bm.test(e.nodeName)&&bG.css(e,"position")==="static")){e=e.offsetParent}return e||p.body})}});bG.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b0,bZ){var e=/Y/.test(bZ);bG.fn[b0]=function(b1){return bG.access(this,function(b2,b5,b4){var b3=bn(b2);if(b4===aB){return b3?(bZ in b3)?b3[bZ]:b3.document.documentElement[b5]:b2[b5]}if(b3){b3.scrollTo(!e?b4:bG(b3).scrollLeft(),e?b4:bG(b3).scrollTop())}else{b2[b5]=b4}},b0,b1,arguments.length,null)}});function bn(e){return bG.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}bG.each({Height:"height",Width:"width"},function(e,bZ){bG.each({padding:"inner"+e,content:bZ,"":"outer"+e},function(b0,b1){bG.fn[b1]=function(b5,b4){var b3=arguments.length&&(b0||typeof b5!=="boolean"),b2=b0||(b5===true||b4===true?"margin":"border");return bG.access(this,function(b7,b6,b8){var b9;if(bG.isWindow(b7)){return b7.document.documentElement["client"+e]}if(b7.nodeType===9){b9=b7.documentElement;return Math.max(b7.body["scroll"+e],b9["scroll"+e],b7.body["offset"+e],b9["offset"+e],b9["client"+e])}return b8===aB?bG.css(b7,b6,b8,b2):bG.style(b7,b6,b8,b2)},bZ,b3?b5:aB,b3)}})});a2.jQuery=a2.$=bG;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return bG})}})(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(d){var b=[];function c(j,h){h=h||"";if(j===undefined||j===null){c("",h)}else{if(j.constructor==Object){for(var k in j){var f=h+(h==""?k:"."+k);c(j[k],f)}}else{if(j.constructor==Array){if(j.length==0){c("[]",h)}else{for(var g=0;g<j.length;g++){var e="["+g+"]",f=h+e;c(j[g],f)}}}else{if(b[h]==undefined){b[h]=j}else{if(b[h].constructor!=Array){b[h]=[b[h],j]}else{b[h].push(j)}}}}}}c(d);return b},unnestjson:function(c){var d=a.rup_utils.jsontoarray(c);var b={};for(key in d){if(!a.isFunction(d[key])){b[key]=d[key]}}return b},elementFromPoint:function(c,g,f){var e=true,d=f||true;if(!document.elementFromPoint){return null}if(!d){var b;if((b=a(document).scrollTop())>0){e=(document.elementFromPoint(0,b+a(window).height()-1)==null)}else{if((b=a(document).scrollLeft())>0){e=(document.elementFromPoint(b+a(window).width()-1,0)==null)}}d=(b>0)}if(!e){c+=a(document).scrollLeft();g+=a(document).scrollTop()}return document.elementFromPoint(c,g)},firstCharToLowerCase:function(b){return b.substring(0,1).toLowerCase()+b.substring(1)},getJQueryId:function(b,d){var c;if(typeof b==="string"){c=b;if(d===true){c=String(c).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")}return c[0]==="#"?c:"#"+c}return null},queryStringToJson:function(b){function d(m,p,o){if(p.length>1){var n=p.shift();if(typeof m[n]=="undefined"){m[n]=p[0]==""?[]:{}}arguments.callee(m[n],p,o)}else{if(m instanceof Array){m.push(o)}else{m[p]=o}}}var l=b.split("&"),g={},e,c,j,k,h;for(var f=0;f<l.length;f++){e=l[f].split("=");c=decodeURIComponent(e[0]);j=decodeURIComponent(e[1]);k=c.match(/(^[^\[]+)(\[.*\]$)?/);h=k[1];if(k[2]){k=k[2].match(/(?=\[(.*)\]$)/)[1].split("][")}else{k=[]}k.unshift(h);d(g,k,j)}return g},populateForm:function(c,f){var e,b;var h,k;if(c){for(var d in c){h=new Array();b=a("[name='"+d+"']",f);if(b.length==0){k=d.substr(0,d.indexOf("["));b=a("[name='"+k+"']",f)}if(b.is("[ruptype]")){if(b.hasClass("jstree")){for(var j in c){if(j.substr(0,j.indexOf("["))==k){h.push(c[j])}}b["rup_"+b.attr("ruptype")]("setRupValue",h);var g=[];g[k]=h;b.on("loaded.jstree",function(m,n){var l=this.id;a(this).trigger("rup_filter_treeLoaded",g[l])})}else{b["rup_"+b.attr("ruptype")]("setRupValue",c[d])}}else{if(b.is("input:radio")||b.is("input:checkbox")){b.each(function(){if(a(this).val()==c[d]){a(this).attr("checked","checked")}else{a(this).removeAttr("checked")}})}else{if(b.is("select")){b.val(c[d]).click()}else{if(b.is(":not(img)")){b.val(c[d])}}}}}}},createDate:function(b,d,c){return a.datepicker.formatDate(a.rup.i18n.base.rup_date.dateFormat,new Date(c,d-1,b))},createTime:function(b,d,c){return new Date(null,null,null,b,d,c)},
/*
		 * 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(d,e,c){if(typeof d==="undefined"||typeof e==="undefined"||d===null||e===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 f=d+"="+encodeURIComponent(e);if(typeof c!=="undefined"&&c!==null){if(c.domain){f+="; domain="+c.domain}if(c.path){f+="; path="+c.path}if(c.duration){var b=new Date();b.setTime(b.getTime()+c.duration*24*60*60*1000);f+="; expires="+b.toGMTString()}if(c.secure){f+="; secure"}}return(document.cookie=f)},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 c=document.cookie.match("(?:^|;)\\s*"+b.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")+"=([^;]*)");return(c)?decodeURIComponent(c[1]):null},get:function(b,e){var g=null;if(document.cookie&&document.cookie!=""){var f=document.cookie.split(";");for(var d=0;d<f.length;d++){var c=a.trim(f[d]);if(c.substring(0,b.length+1)==(b+"=")){g=e?a.JSON.decode(decodeURIComponent(c.substring(b.length+1))):decodeURIComponent(c.substring(b.length+1));break}}}return g},set:function(e,g,d){d=a.extend({},d);if(g===null){g="";d.expires=-1}var b="";if(d.expires&&(typeof d.expires=="number"||d.expires.toUTCString)){var c;if(typeof d.expires=="number"){c=new Date();c.setTime(c.getTime()+(d.expires*24*60*60*1000))}else{c=d.expires}b="; expires="+c.toUTCString()}g=d.json?encodeURIComponent(a.JSON.encode(g)):encodeURIComponent(g);var j=d.path?"; path="+(d.path):"";var f=d.domain?"; domain="+(d.domain):"";var h=d.secure?"; secure":"";document.cookie=[e,"=",g,b,j,f,h].join("")},compareObjects:function(b,e){var d=true;if(Object.keys(b).length!==Object.keys(e).length){return false}for(var c in b){if(typeof b[c]=="object"&&typeof e[c]=="object"){d=compareObjects(b[c],e[c]);if(!d){break}}else{if(b[c]!==e[c]){d=false;break}}}return d},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 c="rupRandomLayerId-"+a.rup_utils.autoGenerateIdNum;b.attr("id",c).addClass("rupRandomLayerId");a.rup_utils.autoGenerateIdNum=a.rup_utils.autoGenerateIdNum+1;return c},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(c){var l=a(location);if(typeof c==="string"){var g=c.substring(0,1);var f=c.substring(1,2);if(a.url(c).attr("protocol")===undefined||a.url(c).attr("protocol")===""){if(g==="/"){if(f===undefined||f!=="/"){return(l.attr("protocol")+"//"+l.attr("host")+c)}else{return(l.attr("protocol")+c)}}else{if(g==="."){if(f===undefined){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamError")+c+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamErrorEnd"));return(undefined)}else{if(f==="/"){var h=a.url(l.attr("href"),true);return(h.attr("base")+h.attr("directory")+c.substring(2,c.length))}else{if(f==="."){var d=l.attr("pathname").split("/");var j=(d.length)-2;if((c.substring(2,3)!==undefined)&&(c.substring(2,3)==="/")){var k=c.split("../");var m=(k.length)-1;if(m>=j){return(l.attr("protocol")+"//"+l.attr("host")+"/"+k[k.length-1])}else{var b="";for(var e=j-m;e>0;e--){b=d[e]+"/"+b}return(l.attr("protocol")+"//"+l.attr("host")+"/"+b+k[k.length-1])}}else{var k=c.split("..");var m=(k.length)-1;if(m>=j){return(l.attr("protocol")+"//"+l.attr("host")+k[k.length-1])}else{var b="";for(var e=j-m;e>0;e--){b=d[e]+"/"+b}return(l.attr("protocol")+"//"+l.attr("host")+"/"+b+k[k.length-1])}}}else{a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamError")+c+a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamErrorEnd"));return(undefined)}}}}else{var h=a.url(l.attr("href"),true);return(h.attr("base")+h.attr("directory")+c)}}}else{return(c)}}else{a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_utils.relToAbsUrlParamFormatError"));return(undefined)}},printMsg:function(d){var b="";if(typeof d==="string"){return d+"<br/>"}else{if(typeof d==="object"){if(jQuery.isArray(d)){for(var c=0;c<d.length;c++){b+=a.rup_utils.printMsgAux(d[c],1)}return b}else{b+=a.rup_utils.printMsgAux(d,1)}}}return b},printMsgAux:function(f,g){var b="";if(typeof f==="string"){return a("<span>").append(f)[0].outerHTML+"<br/>"}else{if(typeof f==="object"){if(jQuery.isArray(f)){var d=a("<ul>").addClass("rup-maint_feedbackUL");for(var c=0;c<f.length;c++){if(g===1){d.append(a("<li>").append(a.rup_utils.printMsgAux(f[c],g+1)))}else{d.append(a.rup_utils.printMsgAux(f[c],g+1))}}return b+=d[0].outerHTML}else{var e=a("<span>");if(f.style!==undefined){e.addClass(f.style)}if(f.label!==undefined){e.append(f.label)}return e[0].outerHTML+"<br/>"}}}},getUrlVars:function(){if(a.rup.getParams===undefined){var e={},d;var b=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var c=0;c<b.length;c++){d=decodeURIComponent(b[c]).split("=");e[d[0]]=d[1]}a.rup.getParams=e}return a.rup.getParams},getUrlVar:function(b){return a.rup_utils.getUrlVars()[b]},sortArray:function(e,d){function b(g,f){return g-f}function c(f,k){var j;do{j=false;for(var h=0;h<f.length-1;h++){if(k(f[h],f[h+1])<0){var g=f[h];f[h]=f[h+1];f[h+1]=g;j=true}}}while(j)}if(!a.isArray(e)){return undefined}if(a.isFunction(d)){c(e,d)}else{c(e,b)}},insertSorted:function(e,c,d){function b(g,f){return f-g}if(!a.isArray(e)){return undefined}e.push(c);if(a.isFunction(d)){a.rup_utils.sortArray(e,d)}else{a.rup_utils.sortArray(e,b)}return a.inArray(c,e)},getRupValueAsJson:function(e,h){var g,j,b=false,c,d,j=[];if(e){g=e.split(".");if(g.length>1){b=true;c=g[g.length-1]}else{c=g[0]}if(jQuery.isArray(h)){for(var f=0;f<h.length;f++){d={};if(b){d[c]=h[f];j.push(d)}else{d[c]=h[f];j.push(d)}}return j}else{d={};d[c]=h;return d}}return null},getRupValueWrapped:function(e,g){var f,b=false,d,c={};if(e){f=e.split(".");if(f.length>1){b=true;d=f[f.length-1]}else{return g}c[d]=g;return c}return null}});a.fn.serializeToObject=function(){var c={},b=this.serializeArrayWithoutNulls();a.each(b,function(){if(c[this.name]){if(!c[this.name].push){c[this.name]=[c[this.name]]}c[this.name].push(this.value||"")}else{c[this.name]=this.value}});return c};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,c){var d=jQuery(this).val();if((jQuery(this).hasClass("numeric")||jQuery(this).hasClass("datepicker"))){return{name:c.name,value:null}}return d===null||d===""?null:jQuery.isArray(d)?jQuery.map(d,function(f,e){return{name:c.name,value:f}}):{name:c.name,value:d}}).get()};a.fn.serializeObject=function(){var c={},b=this.serializeArrayNull();a.each(b,function(){if(c[this.name]){if(!c[this.name].push){c[this.name]=[c[this.name]]}c[this.name].push(this.value||"")}else{c[this.name]=this.value}});return c};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,c){var d=jQuery(this).val();if((jQuery(this).hasClass("numeric")||jQuery(this).hasClass("datepicker"))&&d===""){return{name:c.name,value:null}}return d===null?null:jQuery.isArray(d)?jQuery.map(d,function(f,e){return{name:c.name,value:f}}):{name:c.name,value:d}}).get()};jQuery.rup_utils.base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(d){var b="";var l,j,g,k,h,f,e;var c=0;d=jQuery.rup_utils.base64._utf8_encode(d);while(c<d.length){l=d.charCodeAt(c++);j=d.charCodeAt(c++);g=d.charCodeAt(c++);k=l>>2;h=((l&3)<<4)|(j>>4);f=((j&15)<<2)|(g>>6);e=g&63;if(isNaN(j)){f=e=64}else{if(isNaN(g)){e=64}}b=b+this._keyStr.charAt(k)+this._keyStr.charAt(h)+this._keyStr.charAt(f)+this._keyStr.charAt(e)}return b},decode:function(d){var b="";var l,j,g;var k,h,f,e;var c=0;d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(c<d.length){k=this._keyStr.indexOf(d.charAt(c++));h=this._keyStr.indexOf(d.charAt(c++));f=this._keyStr.indexOf(d.charAt(c++));e=this._keyStr.indexOf(d.charAt(c++));l=(k<<2)|(h>>4);j=((h&15)<<4)|(f>>2);g=((f&3)<<6)|e;b=b+String.fromCharCode(l);if(f!=64){b=b+String.fromCharCode(j)}if(e!=64){b=b+String.fromCharCode(g)}}b=jQuery.rup_utils.base64._utf8_decode(b);return b},_utf8_encode:function(d){d=d.replace(/\r\n/g,"\n");var b="";for(var f=0;f<d.length;f++){var e=d.charCodeAt(f);if(e<128){b+=String.fromCharCode(e)}else{if((e>127)&&(e<2048)){b+=String.fromCharCode((e>>6)|192);b+=String.fromCharCode((e&63)|128)}else{b+=String.fromCharCode((e>>12)|224);b+=String.fromCharCode(((e>>6)&63)|128);b+=String.fromCharCode((e&63)|128)}}}return b},_utf8_decode:function(b){var d="";var e=0;var f=c1=c2=0;while(e<b.length){f=b.charCodeAt(e);if(f<128){d+=String.fromCharCode(f);e++}else{if((f>191)&&(f<224)){c2=b.charCodeAt(e+1);d+=String.fromCharCode(((f&31)<<6)|(c2&63));e+=2}else{c2=b.charCodeAt(e+1);c3=b.charCodeAt(e+2);d+=String.fromCharCode(((f&15)<<12)|((c2&63)<<6)|(c3&63));e+=3}}}return d}}})(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(c){String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};c.extend({set_uda_ajax_mode_on:function(){if(c.ajax!==c.rup_ajax){c.ajaxUDA=c.ajax;c.ajax=c.rup_ajax}},rup_ajax:function(g){var k={cache:false,error:null},h=c.extend({},k,g),f,l,e,j;l=h.error;f=function(o,p,n){var m=c.rup.rupAjaxDefaultError(o,p,n);if(l!=null){c(l(o,p,n))}else{if(m){c.rup.showErrorToUser(m)}}};e=h.complete;j=function(m,n){if(c.ajax===c.rup_ajax&&c.ajaxUDA!==c.rup_ajax){c.ajax=c.ajaxUDA}if(e!=null){e(m,n)}};h.complete=j;h.error=f;h.url=c.rup_utils.setNoPortalParam(h.url);if(typeof c.ajaxUDA==="function"){c.ajaxUDA(h)}else{c.ajax(h)}}});c.rup=c.rup||{};c.extend(c.rup,{i18n:{},appResources:{},lang:null,getBrowserLenguage:function(){return((navigator.language||navigator.userLanguage).split("-")[0].toLowerCase())},browser:{version:c.browser.version,versionNumber:c.isNumeric(c.browser.version)?parseInt(c.browser.version):undefined,isIE:c.browser.msie?true:false,isSafari:c.browser.safari&&c.browser.webkit?true:false,isChrome:c.browser.safari&&c.browser.webkit?true:false,isFF:c.browser.mozilla?true:false,isOpera:c.browser.opera?true:false,xhrFileUploadSupport:new XMLHttpRequest().upload!==undefined?true:false},setLiterals:function(e){if(e!==undefined&&e!==null&&e!==""){c.rup.lang=e}c.rup_ajax({url:c.rup.RUP+"/resources/rup.i18n_"+c.rup.lang+".json",dataType:"json",type:"GET",async:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(f){c.rup.i18n.base=f;c.jgrid={};c.extend(c.jgrid,f.rup_grid);c.jgrid.formatter.date.S=new Function("j",f.rup_grid.formatter.date.S)},error:function(f,h,g){alert("Se ha producido un error en el parseo del fichero JSON de literales => "+h+".\n\nError devuelto:\n"+h+": "+f.status+" - "+f.statusText)}})},getFile_i18n:function(){c.rup_ajax({url:c.rup.APP_STATICS+"/resources/"+c.rup.WAR_NAME+".i18n_"+c.rup.lang+".json",dataType:"json",type:"GET",async:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(e){c.rup.i18n.app=e},error:function(e,g,f){alert("Se ha producido un error en el parseo del fichero JSON de literales de la aplicación => "+g+".\n\nError devuelto:\n"+g+": "+e.status+" - "+e.statusText)}})},getFile:function(e){if(e===undefined&&e===null&&e===""){c.rup.errorGestor("No se ha definido el fichero a cargar")}else{if(!c.rup.i18n[e]){c.rup_ajax({url:c.rup.APP_STATICS+"/resources/"+e+".json",dataType:"json",type:"GET",async:false,contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(g,h,f){c.rup.i18n[e]=g},error:function(f,h,g){c.rup.errorGestor("Se ha producido un error en el parseo del fichero JSON de la aplicación => "+h+".<br>Error devuelto:<br>"+g)}})}}},i18nParse:function(h,e,f){if(e!==undefined&&e!==null&&e!==""){var j=e.split("."),k=h;for(var g=0;g<j.length;g++){if(!c.isEmptyObject(k)){k=k[j[g]]}else{if(f===undefined||f===null||f===""){k=e}else{k=f}break}}return(k==undefined)?e:k}else{return"null_i18nCaption"}},i18nTemplate:function(g,e){var h=jQuery.rup.i18nParse(g,e),f=c.makeArray(arguments).slice(2);if(h===undefined){h=""}return h.replace(/\{(\d+)\}/g,function(j,k){return f[k]})},errorGestor:function(e){c.rup_messages("msgError",{title:c.rup.i18nParse(c.rup.i18n.base,"rup_global.developerError"),message:"<p>"+e+"</p>"});throw (e)},iniRup:function(){c.rup.i18n.app={};c.rup.i18n.base={};if(!window.LOCALE_COOKIE_NAME){LOCALE_COOKIE_NAME="language"}if(!window.LOCALE_PARAM_NAME){LOCALE_PARAM_NAME="locale"}c.rup.APP_RESOURCES=APP_RESOURCES;c.rup.APP_STATICS=STATICS+"/"+APP_RESOURCES;c.rup.CTX_PATH=CTX_PATH;c.rup.RUP=RUP;c.rup.STATICS=STATICS;c.rup.WAR_NAME=WAR_NAME;c.rup.AVAILABLE_LANGS=AVAILABLE_LANGS;c.rup.AVAILABLE_LANGS_ARRAY=c.map(c.rup.AVAILABLE_LANGS.split(","),function(f){return f.replace(/^\s*|\s*$/g,"")});c.rup.LAYOUT=LAYOUT;c.rup.LOCALE_COOKIE_NAME=LOCALE_COOKIE_NAME;c.rup.LOCALE_PARAM_NAME=LOCALE_PARAM_NAME;c.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 e=c.rup_utils.get(c.rup.LOCALE_COOKIE_NAME);if(e!==null&&e!==""){if(c.inArray(e,c.rup.AVAILABLE_LANGS_ARRAY)!==-1){this.lang=e}else{alert("La 'cookie' de idioma ("+c.rup.LOCALE_COOKIE_NAME+") no se corresponde con los idiomas soportados.\n\nLa página no se mostrará correctamente.");c.rup._avoidRUPFails();return false}}else{alert("No se ha encontrado la 'cookie' de idioma ("+c.rup.LOCALE_COOKIE_NAME+") requerida por UDA.\nRevise la configuración del navegador.\n\nLa página no se mostrará correctamente.");c.rup._avoidRUPFails();return false}c.rup.setLiterals();c.rup.getFile_i18n()},_avoidRUPFails:function(){var e=c.rup.i18nParse(c.rup.i18n.base,"rup_date.dateFormat");if(e==="rup_date.dateFormat"){c.rup.i18n.base.rup_date={dateFormat:"dd/mm/yy"}}c.jgrid={formatter:{integer:{}}}},getAccessor:function(g,e,f){if(typeof f==="string"){fn=g[f];if(fn===undefined){c.rup.errorGestor(e+' - No Existe el método "'+f+'"  en el patrón.')}else{return fn}}else{if(typeof f==="function"){c.rup.errorGestor(e+" - No es posible pasar funciones al patrón.")}}return undefined},rupAjaxDefaultError:function(j,k,h){var e=null;if(j.status==0){e=c.rup.i18nParse(c.rup.i18n.base,"rup_ajax.httpStatus0")}else{if(j.status==401){e=c.rup.i18nParse(c.rup.i18n.base,"rup_ajax.httpStatus401")}else{if(j.status==404){e=c.rup.i18nParse(c.rup.i18n.base,"rup_ajax.httpStatus404")}else{if(j.status==500){e=c.rup.i18nParse(c.rup.i18n.base,"rup_ajax.httpStatus500")}else{if(j.status==503){e=c.rup.i18nParse(c.rup.i18n.base,"rup_ajax.httpStatus503")}else{if(j.status==406){var g="";try{g=JSON.parse(j.responseText)}catch(f){e=j.responseText}}else{if(j.status==413){var g="";try{g=JSON.parse(j.responseText);e=g.rupFeedback.message.label}catch(f){e=j.responseText}}}}}}}}return e},rupObjectConstructor:function(f,e){if(c[f]===undefined){c[f]=function(k){var k=k,h=typeof k==="string",j=c.makeArray(arguments).slice(1),m=this;if(h&&k.charAt(0)==="_"){return m}if(h){if(k!=="extend"){var g=(c.isEmptyObject(c.data(e))?c.data(e,e):c.data(e)),l=g&&c.isFunction(g[k])?g[k].apply(g,j):"no-function";if(l==="no-function"){return false}else{m=l}}else{e=c.extend.apply(null,[true,e].concat(j[0]))}}else{var g=(c.isEmptyObject(c.data(e))?c.data(e,e):c.data(e));if(g&&e._init!==undefined&&e._init!==null){g._init(c.makeArray(arguments))}}return m}}},rupSelectorObjectConstructor:function(f,e){if(c.fn[f]===undefined){c.fn[f]=function(k){var k=k,h=typeof k==="string",j=c.makeArray(arguments).slice(1),m=this;if(h&&k.charAt(0)==="_"){return m}if(h){if(k!=="extend"){var g=c.extend(this,e),l=g&&c.isFunction(g[k])?g[k].apply(g,j):"no-function";if(l==="no-function"){return false}else{m=l}}else{e=c.fn.extend.apply(null,[true,e].concat(j[0]))}}else{var g=c.extend(this,e);if(g&&e._init!==undefined&&e._init!==null){g._init(c.makeArray(arguments))}}return m}}},showErrorToUser:function(e){if(e!=null&&e!==""){var g=c(".ui-dialog:visible .rup-feedback"),h=g.length!==0?g:c(".rup-feedback");if(h.length!=0){var j={delay:null},f=c("#"+h[0].id);f.rup_feedback("option",j);f.rup_feedback("set",e,"error");f.rup_feedback("show")}else{c.rup_messages("msgError",{title:c.rup.i18nParse(c.rup.i18n.base,"rup_ajax.errorTitle"),message:e})}}}});c.fn.extend({storeEvents:function(){this.each(function(){c(this).data("storedEvents",c.extend(true,{},c._data(c(this)[0],"events")))});c(this).unbind();return this},restoreEvents:function(){this.each(function(){var e=c.data(this,"storedEvents");if(e){c(this).unbind();for(var g in e){for(var f in e[g]){c.event.add(this,g,e[g][f],e[g][f].data)}}}});return this}});c.fn.mousestop={};c.fn.mousestop.defaults={delay:300};c.event.special.mousestop={setup:function(f){var e=this,g=c(this);g.data("mousestop",c.extend(true,{},c.fn.mousestop.defaults,f));g.on({"mouseenter.rup_mousestop":b,"mouseleave.rup_mousestop":a,"mousemove.rup_mousestop":d})},teardown:function(){c(this).removeData("mousestop").off(".rup_mousestop")}};function b(f){var e=this,g=c(this);clearTimeout(e.timeout)}function a(f){var e=this,g=c(this);clearTimeout(e.timeout)}function d(f){var e=this,g=c(this);clearTimeout(e.timeout);e.timeout=setTimeout(function(){g.trigger("mousestop",f)},g.data("mousestop").delay)}jQuery("body").on({"keydown.rup":function(f){var g=jQuery("body"),e;switch(f.which){case 16:if(g.data("tmp.multiselect.shiftPressed")!==true){g.data("tmp.multiselect.shiftPressed",true);e=g.triggerHandler("rup_shiftKeyDown");if(e===false){f.preventDefault();return false}}break;case 17:if(g.data("tmp.multiselect.ctrlPressed")!==true){g.data("tmp.multiselect.ctrlPressed",true);e=g.triggerHandler("rup_ctrlKeyDown");if(e===false){f.preventDefault();return false}}break}},"keyup.rup":function(f){var g=jQuery("body"),e;switch(f.which){case 16:if(g.data("tmp.multiselect.shiftPressed")!==false){g.data("tmp.multiselect.shiftPressed",false);e=g.triggerHandler("rup_shiftKeyUp");if(e===false){return false}}break;case 17:if(g.data("tmp.multiselect.ctrlPressed")!==false){g.data("tmp.multiselect.ctrlPressed",false);e=g.triggerHandler("rup_ctrlKeyUp");if(e===false){return false}}break}}});jQuery.extend(c.rup,{isCtrlPressed:function(){return jQuery("body").data("tmp.multiselect.ctrlPressed")===true},isShiftPressed:function(){return jQuery("body").data("tmp.multiselect.shiftPressed")===true}});c.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,j){var g,d,k,e,h,f,c;this.blur(b);if(this._hasScroll()){d=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0;k=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0;e=j.offset().top-this.activeMenu.offset().top-d-k;h=this.activeMenu.scrollTop();f=this.activeMenu.height();c=j.height();if(e<0){this.activeMenu.scrollTop(h+e)}else{if(e+c>f){this.activeMenu.scrollTop(h+e-f+c)}}}var l=this.activeMenu;this.active=j.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(l)}}else{this._close();g=a("> .ui-menu",j);if((g.length&&(/^focus/.test(b.type)&&j.attr("rupMenu_firsLevel")!=="true"))||(g.length&&(/^click/.test(b.type)&&j.attr("rupMenu_firsLevel")==="true"))){this._startOpening(g)}}this.activeMenu=j.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 c=a(b.currentTarget);if(!(c.attr("rupMenu_firsLevel")!=="true")){if(c.children("[aria-expanded = 'true']").size()>0){this._close(c)}else{this.focus(b,c)}}},"focus .ui-menu-item a":function(b){var c=a(b.currentTarget).parent();this.focus(b,c)},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(d){clearTimeout(this.timer);this.element.find(".ui-menu").not(d.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(d.parent().attr("rupMenu_firsLevel")==="true"){b.my="left top";b.at="left bottom"}var c=widgetMenu(d);c.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(b)},expand:function(c){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(c,b){clearTimeout(this.timer);this.timer=this._delay(function(){var d;if(b){d=this.element}else{d=a(c&&c.target).closest(this.element.find(".ui-menu"))}if(!d.length){d=this.element}this._close(d);this.blur(c);this.activeMenu=d},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 c=((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(!c){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(!c){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(!c){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(!c){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 j=a(b.target).parent().parent();if(!(j.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(j.children().find("a").last().html()!==a(b.currentTarget).find("a").last().html()){b.stopImmediatePropagation();b.preventDefault();var e=j.parent();var h=e.nextAll("[role='presentation']:not(.ui-state-disabled):first");while(h.length===0){e=e.parent();h=e.parent().nextAll("[role='presentation']:not(.ui-state-disabled):first")}h.children("a").focus()}}break}else{a(b.currentTarget).attr("rup_shift_nofocus","true");a(b.currentTarget).focus()}default:clearTimeout(this.filterTimer);var f,d=this.previousFilter||"",g=String.fromCharCode(b.keyCode),k=false;if(g===d){k=true}else{g=d+g}function l(m){return m.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}f=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+l(g),"i").test(a(this).children("a").text())});f=k&&f.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):f;if(!f.length){g=String.fromCharCode(b.keyCode);f=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+l(g),"i").test(a(this).children("a").text())})}if(f.length){this.focus(b,f);if(f.length>1){this.previousFilter=g;this.filterTimer=this._delay(function(){delete this.previousFilter},1000)}else{delete this.previousFilter}}else{delete this.previousFilter}}},_move:function(e,c,d){var b;if(this.active){if(e==="first"||e==="last"){b=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").not(".ui-state-disabled").eq(-1)}else{b=this.active[e+"All"](".ui-menu-item").not(".ui-state-disabled").eq(0)}}if(!b||!b.length||!this.active){b=this.activeMenu.children(".ui-menu-item")[c]()}this.element.off("mouseleave");this.element.off("mouseover");this.element.one("mousemove",function(f){widgetMenu(f.currentTarget).rupMenu("restoreScrollEvents");widgetMenu(f.currentTarget).off("mousemove")});this.focus(d,b);if(b.is(".ui-state-disabled")){this._move(e,c,d)}},restoreScrollEvents:function(){this._bind({mouseover:function(b){a("#"+this.menuId).attr("rup_menu_nofocus","true")},"mouseover .rup_menu_horizontal_children":function(b){var c=a(b.currentTarget);a(".ui-state-focus").removeClass("ui-state-focus");c.addClass("ui-state-focus");a(c).focus()},"mouseover .ui-menu-item":function(d){a("#"+this.menuId).attr("rup_menu_nofocus","true");d.stopImmediatePropagation();var e=a(d.currentTarget);e.siblings().children(".ui-state-active").removeClass("ui-state-active");if((e.offset().left+e.width()>d.pageX)&&((e.offset().top+a("#"+this.menuId).height()>d.pageY)||(e.offset().top+e.height()>d.pageY))){if(!(a("#"+e.children("a").attr("id")+":focus").size()>0)){var b=d.target;var c=a("#"+e.children("a").attr("id"));a("#"+e.children("a").attr("id")).focus();a("#"+e.children("a").attr("id")).focus()}else{if(!(e.hasClass("rup_menu_horizontal_children"))){if(!(a("#"+e.children("a").attr("id")).hasClass("ui-state-focus"))){a("#"+e.children("a").attr("id")).addClass("ui-state-focus");if(a("#"+e.children("a").attr("id")).attr("role")==="menuitem"){this._startOpening(a(e).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 c=a(b.currentTarget);if(c.attr("rupmenu_firslevel")===undefined||((c.offset().top-1<b.pageY)&&(c.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(c){var b=this.get_settings();b.contextmenu.items=c;this._set_settings(b)},set_theme_data:function(b){this.data.themes.theme=b},types_portal_css:function(){var e=this._get_settings().types;var d=e.types,c=e.type_attr,b="",g=this;a.each(d,function(h,j){a.each(j,function(m,l){if(!/^(max_depth|max_children|icon|valid_children)$/.test(m)){g.data.types.attach_to.push(m)}});if(!j.icon){return true}if(j.icon.image||j.icon.position){b+="div.r01gContainer ";if(h=="default"){b+=".jstree-"+g.get_index()+" a > .jstree-icon { "}else{b+=".jstree-"+g.get_index()+" li["+c+'="'+h+'"] > a > .jstree-icon { '}if(j.icon.image){b+=" background-image:url("+j.icon.image+"); "}if(j.icon.position){b+=" background-position:"+j.icon.position+"; "}else{b+=" background-position:0 0; "}b+="} "}});var f=a("#jstree-types-stylesheet");if(f!==undefined){f.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,d){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(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=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{e=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"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});if(!a("<a>").outerWidth(1).jquery){a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(n,m,l,o){a.each(f,function(){m-=parseFloat(a.curCSS(n,"padding"+this,true))||0;if(l){m-=parseFloat(a.curCSS(n,"border"+this+"Width",true))||0}if(o){m-=parseFloat(a.curCSS(n,"margin"+this,true))||0}});return m}a.fn["inner"+e]=function(l){if(l===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,l)+"px")})};a.fn["outer"+e]=function(l,m){if(typeof l!=="number"){return k["outer"+e].call(this,l)}return this.each(function(){a(this).css(h,j(this,l,true,m)+"px")})}})}function c(g,e){var k=g.nodeName.toLowerCase();if("area"===k){var j=g.parentNode,h=j.name,f;if(!g.href||!h||j.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(k)?!g.disabled:"a"==k?g.href||e:e)&&b(g)}function b(e){return !a(e).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(e){return function(f){return !!a.data(f,e)}}):function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});if(!a.curCSS){a.curCSS=a.css}a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h<j.length;h++){if(e.options[j[h][0]]){j[h][1].apply(e.element,f)}}}},contains:function(f,e){return document.compareDocumentPosition?f.compareDocumentPosition(e)&16:f!==e&&f.contains(e)},hasScroll:function(h,f){if(a(h).css("overflow")==="hidden"){return false}var e=(f&&f==="left")?"scrollLeft":"scrollTop",g=false;if(h[e]>0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(k,f,j,h,e,g){return a.ui.isOverAxis(k,j,e)&&a.ui.isOverAxis(f,h,g)}})})(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,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],k;f=f.split(".")[1];k=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][k]=function(l){return !!b.data(l,f)};b[g]=b[g]||{};b[g][f]=function(l,m){if(arguments.length){this._createWidget(l,m)}};var j=new h();j.options=b.extend(true,{},j.options);b[g][f].prototype=b.extend(true,j,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:k},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(j){var g=typeof j==="string",h=Array.prototype.slice.call(arguments,1),k=this;j=!g&&h.length?b.extend.apply(null,[true,j].concat(h)):j;if(g&&j.charAt(0)==="_"){return k}if(g){this.each(function(){var l=b.data(this,f),m=l&&b.isFunction(l[j])?l[j].apply(l,h):l;if(m!==l&&m!==d){k=m;return false}})}else{this.each(function(){var l=b.data(this,f);if(l){l.option(j||{})._init()}else{b.data(this,f,new e(j,this))}})}return k}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.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(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var k,j,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];j=f.originalEvent;if(j){for(k in j){if(!(k in f)){f[k]=j[k]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.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,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.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(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){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(g,h){g.ui=g.ui||{};var d=/left|center|right/,e=/top|center|bottom/,a="center",f={},b=g.fn.position,c=g.fn.offset;g.fn.position=function(k){if(!k||!k.of){return b.apply(this,arguments)}k=g.extend({},k);var o=g(k.of),n=o[0],q=(k.collision||"flip").split(" "),p=k.offset?k.offset.split(" "):[0,0],m,j,l;if(n.nodeType===9){m=o.width();j=o.height();l={top:0,left:0}}else{if(n.setTimeout){m=o.width();j=o.height();l={top:o.scrollTop(),left:o.scrollLeft()}}else{if(n.preventDefault){k.at="left top";m=j=0;l={top:k.of.pageY,left:k.of.pageX}}else{m=o.outerWidth();j=o.outerHeight();l=o.offset()}}}g.each(["my","at"],function(){var r=(k[this]||"").split(" ");if(r.length===1){r=d.test(r[0])?r.concat([a]):e.test(r[0])?[a].concat(r):[a,a]}r[0]=d.test(r[0])?r[0]:a;r[1]=e.test(r[1])?r[1]:a;k[this]=r});if(q.length===1){q[1]=q[0]}p[0]=parseInt(p[0],10)||0;if(p.length===1){p[1]=p[0]}p[1]=parseInt(p[1],10)||0;if(k.at[0]==="right"){l.left+=m}else{if(k.at[0]===a){l.left+=m/2}}if(k.at[1]==="bottom"){l.top+=j}else{if(k.at[1]===a){l.top+=j/2}}l.left+=p[0];l.top+=p[1];return this.each(function(){var u=g(this),w=u.outerWidth(),t=u.outerHeight(),v=parseInt(g.curCSS(this,"marginLeft",true))||0,s=parseInt(g.curCSS(this,"marginTop",true))||0,y=w+v+(parseInt(g.curCSS(this,"marginRight",true))||0),z=t+s+(parseInt(g.curCSS(this,"marginBottom",true))||0),x=g.extend({},l),r;if(k.my[0]==="right"){x.left-=w}else{if(k.my[0]===a){x.left-=w/2}}if(k.my[1]==="bottom"){x.top-=t}else{if(k.my[1]===a){x.top-=t/2}}if(!f.fractions){x.left=Math.round(x.left);x.top=Math.round(x.top)}r={left:x.left-v,top:x.top-s};g.each(["left","top"],function(B,A){if(g.ui.position[q[B]]){g.ui.position[q[B]][A](x,{targetWidth:m,targetHeight:j,elemWidth:w,elemHeight:t,collisionPosition:r,collisionWidth:y,collisionHeight:z,offset:p,my:k.my,at:k.at})}});if(g.fn.bgiframe){u.bgiframe()}u.offset(g.extend(x,{using:k.using}))})};g.ui.position={fit:{left:function(j,k){var m=g(window),l=k.collisionPosition.left+k.collisionWidth-m.width()-m.scrollLeft();j.left=l>0?j.left-l:Math.max(j.left-k.collisionPosition.left,j.left)},top:function(j,k){var m=g(window),l=k.collisionPosition.top+k.collisionHeight-m.height()-m.scrollTop();j.top=l>0?j.top-l:Math.max(j.top-k.collisionPosition.top,j.top)}},flip:{left:function(k,m){if(m.at[0]===a){return}var o=g(window),n=m.collisionPosition.left+m.collisionWidth-o.width()-o.scrollLeft(),j=m.my[0]==="left"?-m.elemWidth:m.my[0]==="right"?m.elemWidth:0,l=m.at[0]==="left"?m.targetWidth:-m.targetWidth,p=-2*m.offset[0];k.left+=m.collisionPosition.left<0?j+l+p:n>0?j+l+p:0},top:function(k,m){if(m.at[1]===a){return}var o=g(window),n=m.collisionPosition.top+m.collisionHeight-o.height()-o.scrollTop(),j=m.my[1]==="top"?-m.elemHeight:m.my[1]==="bottom"?m.elemHeight:0,l=m.at[1]==="top"?m.targetHeight:-m.targetHeight,p=-2*m.offset[1];k.top+=m.collisionPosition.top<0?j+l+p:n>0?j+l+p:0}}};if(!g.offset.setOffset){g.offset.setOffset=function(n,k){if(/static/.test(g.curCSS(n,"position"))){n.style.position="relative"}var m=g(n),p=m.offset(),j=parseInt(g.curCSS(n,"top",true),10)||0,o=parseInt(g.curCSS(n,"left",true),10)||0,l={top:(k.top-p.top)+j,left:(k.left-p.left)+o};if("using" in k){k.using.call(n,l)}else{m.css(l)}};g.fn.offset=function(j){var k=this[0];if(!k||!k.ownerDocument){return null}if(j){if(g.isFunction(j)){return this.each(function(l){g(this).offset(j.call(this,l,g(this).offset()))})}return this.each(function(){g.offset.setOffset(this,j)})}return c.call(this)}}if(!g.curCSS){g.curCSS=g.css}(function(){var j=document.getElementsByTagName("body")[0],q=document.createElement("div"),n,p,k,o,m;n=document.createElement(j?"div":"body");k={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(j){g.extend(k,{position:"absolute",left:"-1000px",top:"-1000px"})}for(var l in k){n.style[l]=k[l]}n.appendChild(q);p=j||document.documentElement;p.insertBefore(n,p.firstChild);q.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";o=g(q).offset(function(r,s){return s}).offset();n.innerHTML="";p.removeChild(n);m=o.top+o.left+(j?2000:0);f.fractions=m>21&&m<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(c){var d=this.options;if(this.helper||d.disabled||a(c.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(c);if(!this.handle){return false}if(d.iframeFix){a(d.iframeFix===true?"iframe":d.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(c){var d=this.options;this.helper=this._createHelper(c);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:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;(d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt));if(d.containment){this._setContainment()}if(this._trigger("start",c)===false){this._clear();return false}this._cacheHelperProportions();if(a.ui.ddmanager&&!d.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,c)}this._mouseDrag(c,true);if(a.ui.ddmanager){a.ui.ddmanager.dragStart(this,c)}return true},_mouseDrag:function(c,e){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!e){var d=this._uiHash();if(this._trigger("drag",c,d)===false){this._mouseUp({});return false}this.position=d.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,c)}return false},_mouseStop:function(e){var g=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){g=a.ui.ddmanager.drop(this,e)}if(this.dropped){g=this.dropped;this.dropped=false}var d=this.element[0],f=false;while(d&&(d=d.parentNode)){if(d==document){f=true}}if(!f&&this.options.helper==="original"){return false}if((this.options.revert=="invalid"&&!g)||(this.options.revert=="valid"&&g)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,g))){var c=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(c._trigger("stop",e)!==false){c._clear()}})}else{if(this._trigger("stop",e)!==false){this._clear()}}return false},_mouseUp:function(c){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,c)}return a.ui.mouse.prototype._mouseUp.call(this,c)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(c){var d=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==c.target){d=true}});return d},_createHelper:function(d){var e=this.options;var c=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[d])):(e.helper=="clone"?this.element.clone().removeAttr("id"):this.element);if(!c.parents("body").length){c.appendTo((e.appendTo=="parent"?this.element[0].parentNode:e.appendTo))}if(c[0]!=this.element[0]&&!(/(fixed|absolute)/).test(c.css("position"))){c.css("position","absolute")}return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string"){c=c.split(" ")}if(a.isArray(c)){c={left:+c[0],top:+c[1]||0}}if("left" in c){this.offset.click.left=c.left+this.margins.left}if("right" in c){this.offset.click.left=this.helperProportions.width-c.right+this.margins.left}if("top" in c){this.offset.click.top=c.top+this.margins.top}if("bottom" in c){this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){c={top:0,left:0}}return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.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(g,j){if(!j){j=this.position}var e=g=="absolute"?1:-1;var f=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(c[0].tagName);return{top:(j.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(h?0:c.scrollTop()))*e)),left:(j.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:c.scrollLeft())*e))}},_generatePosition:function(d){var e=this.options,m=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(m[0].tagName);var h=d.pageX;var g=d.pageY;if(this.originalPosition){var c;if(this.containment){if(this.relative_container){var l=this.relative_container.offset();c=[this.containment[0]+l.left,this.containment[1]+l.top,this.containment[2]+l.left,this.containment[3]+l.top]}else{c=this.containment}if(d.pageX-this.offset.click.left<c[0]){h=c[0]+this.offset.click.left}if(d.pageY-this.offset.click.top<c[1]){g=c[1]+this.offset.click.top}if(d.pageX-this.offset.click.left>c[2]){h=c[2]+this.offset.click.left}if(d.pageY-this.offset.click.top>c[3]){g=c[3]+this.offset.click.top}}if(e.grid){var k=e.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/e.grid[1])*e.grid[1]:this.originalPageY;g=c?(!(k-this.offset.click.top<c[1]||k-this.offset.click.top>c[3])?k:(!(k-this.offset.click.top<c[1])?k-e.grid[1]:k+e.grid[1])):k;var f=e.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/e.grid[0])*e.grid[0]:this.originalPageX;h=c?(!(f-this.offset.click.left<c[0]||f-this.offset.click.left>c[2])?f:(!(f-this.offset.click.left<c[0])?f-e.grid[0]:f+e.grid[0])):f}}return{top:(g-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():(j?0:m.scrollTop())))),left:(h-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():j?0:m.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(c,d,e){e=e||this._uiHash();a.ui.plugin.call(this,c,[d,e]);if(c=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.Widget.prototype._trigger.call(this,c,d,e)},plugins:{},_uiHash:function(c){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(d,f){var e=a(this).data("draggable"),g=e.options,c=a.extend({},f,{item:e.element});e.sortables=[];a(g.connectToSortable).each(function(){var h=a.data(this,"sortable");if(h&&!h.options.disabled){e.sortables.push({instance:h,shouldRevert:h.options.revert});h.refreshPositions();h._trigger("activate",d,c)}})},stop:function(d,f){var e=a(this).data("draggable"),c=a.extend({},f,{item:e.element});a.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;e.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(d);this.instance.options.helper=this.instance.options._helper;if(e.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",d,c)}})},drag:function(d,g){var f=a(this).data("draggable"),c=this;var e=function(k){var q=this.offset.click.top,p=this.offset.click.left;var h=this.positionAbs.top,m=this.positionAbs.left;var l=k.height,n=k.width;var r=k.top,j=k.left;return a.ui.isOver(h+q,m+p,r,j,l,n)};a.each(f.sortables,function(h){this.instance.positionAbs=f.positionAbs;this.instance.helperProportions=f.helperProportions;this.instance.offset.click=f.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(c).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 g.helper[0]};d.target=this.instance.currentItem[0];this.instance._mouseCapture(d,true);this.instance._mouseStart(d,true,true);this.instance.offset.click.top=f.offset.click.top;this.instance.offset.click.left=f.offset.click.left;this.instance.offset.parent.left-=f.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=f.offset.parent.top-this.instance.offset.parent.top;f._trigger("toSortable",d);f.dropped=this.instance.element;f.currentItem=f.element;this.instance.fromOutside=f}if(this.instance.currentItem){this.instance._mouseDrag(d)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",d,this.instance._uiHash(this.instance));this.instance._mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}f._trigger("fromSortable",d);f.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(d,e){var c=a("body"),f=a(this).data("draggable").options;if(c.css("cursor")){f._cursor=c.css("cursor")}c.css("cursor",f.cursor)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._cursor){a("body").css("cursor",e._cursor)}}});a.ui.plugin.add("draggable","opacity",{start:function(d,e){var c=a(e.helper),f=a(this).data("draggable").options;if(c.css("opacity")){f._opacity=c.css("opacity")}c.css("opacity",f.opacity)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._opacity){a(d.helper).css("opacity",e._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(d,e){var c=a(this).data("draggable");if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){c.overflowOffset=c.scrollParent.offset()}},drag:function(e,f){var d=a(this).data("draggable"),g=d.options,c=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!g.axis||g.axis!="x"){if((d.overflowOffset.top+d.scrollParent[0].offsetHeight)-e.pageY<g.scrollSensitivity){d.scrollParent[0].scrollTop=c=d.scrollParent[0].scrollTop+g.scrollSpeed}else{if(e.pageY-d.overflowOffset.top<g.scrollSensitivity){d.scrollParent[0].scrollTop=c=d.scrollParent[0].scrollTop-g.scrollSpeed}}}if(!g.axis||g.axis!="y"){if((d.overflowOffset.left+d.scrollParent[0].offsetWidth)-e.pageX<g.scrollSensitivity){d.scrollParent[0].scrollLeft=c=d.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(e.pageX-d.overflowOffset.left<g.scrollSensitivity){d.scrollParent[0].scrollLeft=c=d.scrollParent[0].scrollLeft-g.scrollSpeed}}}}else{if(!g.axis||g.axis!="x"){if(e.pageY-a(document).scrollTop()<g.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(e.pageY-a(document).scrollTop())<g.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}}if(!g.axis||g.axis!="y"){if(e.pageX-a(document).scrollLeft()<g.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(e.pageX-a(document).scrollLeft())<g.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}}if(c!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(d,e)}}});a.ui.plugin.add("draggable","snap",{start:function(d,e){var c=a(this).data("draggable"),f=c.options;c.snapElements=[];a(f.snap.constructor!=String?(f.snap.items||":data(draggable)"):f.snap).each(function(){var h=a(this);var g=h.offset();if(this!=c.element[0]){c.snapElements.push({item:this,width:h.outerWidth(),height:h.outerHeight(),top:g.top,left:g.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(d,e){var g=a(this).data("draggable").options;var f=a.makeArray(a(g.stack)).sort(function(j,h){return(parseInt(a(j).css("zIndex"),10)||0)-(parseInt(a(h).css("zIndex"),10)||0)});if(!f.length){return}var c=parseInt(f[0].style.zIndex)||0;a(f).each(function(h){this.style.zIndex=c+h});this[0].style.zIndex=c+f.length}});a.ui.plugin.add("draggable","zIndex",{start:function(d,e){var c=a(e.helper),f=a(this).data("draggable").options;if(c.css("zIndex")){f._zIndex=c.css("zIndex")}c.css("zIndex",f.zIndex)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._zIndex){a(d.helper).css("zIndex",e._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 d=this.options,c=d.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(e){return e.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[d.scope]=a.ui.ddmanager.droppables[d.scope]||[];a.ui.ddmanager.droppables[d.scope].push(this);(d.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var c=a.ui.ddmanager.droppables[this.options.scope];for(var d=0;d<c.length;d++){if(c[d]==this){c.splice(d,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(c,d){if(c=="accept"){this.accept=a.isFunction(d)?d:function(e){return e.is(d)}}a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(d){var c=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(c&&this._trigger("activate",d,this.ui(c)))},_deactivate:function(d){var c=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(c&&this._trigger("deactivate",d,this.ui(c)))},_over:function(d){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0]){return}if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",d,this.ui(c))}},_out:function(d){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0]){return}if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",d,this.ui(c))}},_drop:function(d,e){var c=e||a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0]){return false}var f=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=a.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],(c.currentItem||c.element))&&a.ui.intersect(c,a.extend(g,{offset:g.element.offset()}),g.options.tolerance)){f=true;return false}});if(f){return false}if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",d,this.ui(c));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(s,k,p){if(!k.offset){return false}var e=(s.positionAbs||s.position.absolute).left,d=e+s.helperProportions.width,o=(s.positionAbs||s.position.absolute).top,n=o+s.helperProportions.height;var g=k.offset.left,c=g+k.proportions.width,q=k.offset.top,m=q+k.proportions.height;switch(p){case"fit":return(g<=e&&d<=c&&q<=o&&n<=m);break;case"intersect":return(g<e+(s.helperProportions.width/2)&&d-(s.helperProportions.width/2)<c&&q<o+(s.helperProportions.height/2)&&n-(s.helperProportions.height/2)<m);break;case"pointer":var h=((s.positionAbs||s.position.absolute).left+(s.clickOffset||s.offset.click).left),j=((s.positionAbs||s.position.absolute).top+(s.clickOffset||s.offset.click).top),f=a.ui.isOver(j,h,q,g,k.proportions.height,k.proportions.width);return f;break;case"touch":return((o>=q&&o<=m)||(n>=q&&n<=m)||(o<q&&n>m))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(f,h){var c=a.ui.ddmanager.droppables[f.options.scope]||[];var g=h?h.type:null;var k=(f.currentItem||f.element).find(":data(droppable)").andSelf();droppablesLoop:for(var e=0;e<c.length;e++){if(c[e].options.disabled||(f&&!c[e].accept.call(c[e].element[0],(f.currentItem||f.element)))){continue}for(var d=0;d<k.length;d++){if(k[d]==c[e].element[0]){c[e].proportions.height=0;continue droppablesLoop}}c[e].visible=c[e].element.css("display")!="none";if(!c[e].visible){continue}if(g=="mousedown"){c[e]._activate.call(c[e],h)}c[e].offset=c[e].element.offset();c[e].proportions={width:c[e].element[0].offsetWidth,height:c[e].element[0].offsetHeight}}},drop:function(c,d){var e=false;a.each(a.ui.ddmanager.droppables[c.options.scope]||[],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(c,this,this.options.tolerance)){e=this._drop.call(this,d)||e}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(c.currentItem||c.element))){this.isout=1;this.isover=0;this._deactivate.call(this,d)}});return e},dragStart:function(c,d){c.element.parents(":not(body,html)").bind("scroll.droppable",function(){if(!c.options.refreshPositions){a.ui.ddmanager.prepareOffsets(c,d)}})},drag:function(c,d){if(c.options.refreshPositions){a.ui.ddmanager.prepareOffsets(c,d)}a.each(a.ui.ddmanager.droppables[c.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var f=a.ui.intersect(c,this,this.options.tolerance);var h=!f&&this.isover==1?"isout":(f&&this.isover==0?"isover":null);if(!h){return}var g;if(this.options.greedy){var e=this.element.parents(":data(droppable):eq(0)");if(e.length){g=a.data(e[0],"droppable");g.greedyChild=(h=="isover"?1:0)}}if(g&&h=="isover"){g.isover=0;g.isout=1;g._out.call(g,d)}this[h]=1;this[h=="isout"?"isover":"isout"]=0;this[h=="isover"?"_over":"_out"].call(this,d);if(g&&h=="isout"){g.isout=0;g.isover=1;g._over.call(g,d)}})},dragStop:function(c,d){c.element.parents(":not(body,html)").unbind("scroll.droppable");if(!c.options.refreshPositions){a.ui.ddmanager.prepareOffsets(c,d)}}}})(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(c,d){c.widget("ui.resizable",c.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 f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('<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=k.handles||(!c(".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 l=this.handles.split(",");this.handles={};for(var g=0;g<l.length;g++){var j=c.trim(l[g]),e="ui-resizable-"+j;var h=c('<div class="ui-resizable-handle '+e+'"></div>');h.css({zIndex:k.zIndex});if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var m=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=m&&m[1]?m[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var k=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var l=b(this.helper.css("left")),h=b(this.helper.css("top"));if(k.containment){l+=c(k.containment).scrollLeft()||0;h+=c(k.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:l,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:l,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof k.aspectRatio=="number")?k.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var j=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",j=="auto"?this.axis+"-resize":j);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,n={},r=this,k=this.originalMousePosition,p=this.axis;var s=(e.pageX-k.left)||0,q=(e.pageY-k.top)||0;var j=this._change[p];if(!j){return false}var m=j.apply(this,[e,s,q]),l=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){m=this._updateRatio(m,e)}m=this._respectSize(m,e);this._propagate("resize",e);h.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(m);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var j=this.options,n=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,l=e?0:n.sizeDiff.width;var p={width:(n.helper.width()-l),height:(n.helper.height()-f)},k=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,m=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;if(!j.animate){this.element.css(c.extend(p,{top:m,left:k}))}n.helper.height(n.size.height);n.helper.width(n.size.width);if(this._helper&&!j.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var k=this.options,j,h,f,l,e;e={minWidth:a(k.minWidth)?k.minWidth:0,maxWidth:a(k.maxWidth)?k.maxWidth:Infinity,minHeight:a(k.minHeight)?k.minHeight:0,maxHeight:a(k.maxHeight)?k.maxHeight:Infinity};if(this._aspectRatio||g){j=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;l=e.maxWidth/this.aspectRatio;if(j>e.minWidth){e.minWidth=j}if(f>e.minHeight){e.minHeight=f}if(h<e.maxWidth){e.maxWidth=h}if(l<e.maxHeight){e.maxHeight=l}}this._vBoundaries=e},_updateCache:function(e){var f=this.options;this.offset=this.helper.offset();if(a(e.left)){this.position.left=e.left}if(a(e.top)){this.position.top=e.top}if(a(e.height)){this.size.height=e.height}if(a(e.width)){this.size.width=e.width}},_updateRatio:function(h,g){var j=this.options,k=this.position,f=this.size,e=this.axis;if(a(h.height)){h.width=(h.height*this.aspectRatio)}else{if(a(h.width)){h.height=(h.width/this.aspectRatio)}}if(e=="sw"){h.left=k.left+(f.width-h.width);h.top=null}if(e=="nw"){h.top=k.top+(f.height-h.height);h.left=k.left+(f.width-h.width)}return h},_respectSize:function(m,g){var k=this.helper,j=this._vBoundaries,s=this._aspectRatio||g.shiftKey,r=this.axis,u=a(m.width)&&j.maxWidth&&(j.maxWidth<m.width),n=a(m.height)&&j.maxHeight&&(j.maxHeight<m.height),h=a(m.width)&&j.minWidth&&(j.minWidth>m.width),t=a(m.height)&&j.minHeight&&(j.minHeight>m.height);if(h){m.width=j.minWidth}if(t){m.height=j.minHeight}if(u){m.width=j.maxWidth}if(n){m.height=j.maxHeight}var f=this.originalPosition.left+this.originalSize.width,q=this.position.top+this.size.height;var l=/sw|nw|w/.test(r),e=/nw|ne|n/.test(r);if(h&&l){m.left=f-j.minWidth}if(u&&l){m.left=f-j.maxWidth}if(t&&e){m.top=q-j.minHeight}if(n&&e){m.top=q-j.maxHeight}var p=!m.width&&!m.height;if(p&&!m.left&&m.top){m.top=null}else{if(p&&!m.top&&m.left){m.left=null}}return m},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f<this._proportionallyResizeElements.length;f++){var h=this._proportionallyResizeElements[f];if(!this.borderDif){var e=[h.css("borderTopWidth"),h.css("borderRightWidth"),h.css("borderBottomWidth"),h.css("borderLeftWidth")],j=[h.css("paddingTop"),h.css("paddingRight"),h.css("paddingBottom"),h.css("paddingLeft")];this.borderDif=c.map(e,function(l,n){var m=parseInt(l,10)||0,o=parseInt(j[n],10)||0;return m+o})}if(c.browser.msie&&!(!(c(g).is(":hidden")||c(g).parents(":hidden").length))){continue}h.css({height:(g.height()-this.borderDif[0]-this.borderDif[2])||0,width:(g.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var f=this.element,j=this.options;this.elementOffset=f.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++j.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var k=this.options,g=this.originalSize,j=this.originalPosition;return{left:j.left+f,width:g.width-f}},n:function(h,f,e){var k=this.options,g=this.originalSize,j=this.originalPosition;return{top:j.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,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}}});c.extend(c.ui.resizable,{version:"1.8.23"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),j=e.options;var h=function(k){c(k).each(function(){var l=c(this);l.data("resizable-alsoresize",{width:parseInt(l.width(),10),height:parseInt(l.height(),10),left:parseInt(l.css("left"),10),top:parseInt(l.css("top"),10)})})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.parentNode){if(j.alsoResize.length){j.alsoResize=j.alsoResize[0];h(j.alsoResize)}else{c.each(j.alsoResize,function(k){h(k)})}}else{h(j.alsoResize)}},resize:function(g,j){var f=c(this).data("resizable"),k=f.options,h=f.originalSize,m=f.originalPosition;var l={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-m.top)||0,left:(f.position.left-m.left)||0},e=function(n,o){c(n).each(function(){var r=c(this),s=c(this).data("resizable-alsoresize"),q={},p=o&&o.length?o:r.parents(j.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(p,function(t,v){var u=(s[v]||0)+(l[v]||0);if(u&&u>=0){q[v]=u||null}});r.css(q)})};if(typeof(k.alsoResize)=="object"&&!k.alsoResize.nodeType){c.each(k.alsoResize,function(n,o){e(n,o)})}else{e(k.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(j,p){var q=c(this).data("resizable"),k=q.options;var h=q._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:q.sizeDiff.height,m=e?0:q.sizeDiff.width;var g={width:(q.size.width-m),height:(q.size.height-f)},l=(parseInt(q.element.css("left"),10)+(q.position.left-q.originalPosition.left))||null,n=(parseInt(q.element.css("top"),10)+(q.position.top-q.originalPosition.top))||null;q.element.animate(c.extend(g,n&&l?{top:n,left:l}:{}),{duration:k.animateDuration,easing:k.animateEasing,step:function(){var o={width:parseInt(q.element.css("width"),10),height:parseInt(q.element.css("height"),10),top:parseInt(q.element.css("top"),10),left:parseInt(q.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}q._updateCache(o);q._propagate("resize",j)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,s){var u=c(this).data("resizable"),k=u.options,m=u.element;var g=k.containment,l=(g instanceof c)?g.get(0):(/parent/.test(g))?m.parent().get(0):g;if(!l){return}u.containerElement=c(l);if(/document/.test(g)||g==document){u.containerOffset={left:0,top:0};u.containerPosition={left:0,top:0};u.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var q=c(l),j=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){j[p]=b(q.css("padding"+o))});u.containerOffset=q.offset();u.containerPosition=q.position();u.containerSize={height:(q.innerHeight()-j[3]),width:(q.innerWidth()-j[1])};var r=u.containerOffset,e=u.containerSize.height,n=u.containerSize.width,h=(c.ui.hasScroll(l,"left")?l.scrollWidth:n),t=(c.ui.hasScroll(l)?l.scrollHeight:e);u.parentData={element:l,left:r.left,top:r.top,width:h,height:t}}},resize:function(g,r){var u=c(this).data("resizable"),j=u.options,f=u.containerSize,q=u.containerOffset,n=u.size,p=u.position,s=u._aspectRatio||g.shiftKey,e={top:0,left:0},h=u.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=q}if(p.left<(u._helper?q.left:0)){u.size.width=u.size.width+(u._helper?(u.position.left-q.left):(u.position.left-e.left));if(s){u.size.height=u.size.width/u.aspectRatio}u.position.left=j.helper?q.left:0}if(p.top<(u._helper?q.top:0)){u.size.height=u.size.height+(u._helper?(u.position.top-q.top):u.position.top);if(s){u.size.width=u.size.height*u.aspectRatio}u.position.top=u._helper?q.top:0}u.offset.left=u.parentData.left+u.position.left;u.offset.top=u.parentData.top+u.position.top;var m=Math.abs((u._helper?u.offset.left-e.left:(u.offset.left-e.left))+u.sizeDiff.width),t=Math.abs((u._helper?u.offset.top-e.top:(u.offset.top-q.top))+u.sizeDiff.height);var l=u.containerElement.get(0)==u.element.parent().get(0),k=/relative|absolute/.test(u.containerElement.css("position"));if(l&&k){m-=u.parentData.left}if(m+u.size.width>=u.parentData.width){u.size.width=u.parentData.width-m;if(s){u.size.height=u.size.width/u.aspectRatio}}if(t+u.size.height>=u.parentData.height){u.size.height=u.parentData.height-t;if(s){u.size.width=u.size.height*u.aspectRatio}}},stop:function(f,p){var r=c(this).data("resizable"),g=r.options,m=r.position,n=r.containerOffset,e=r.containerPosition,j=r.containerElement;var k=c(r.helper),s=k.offset(),q=k.outerWidth()-r.sizeDiff.width,l=k.outerHeight()-r.sizeDiff.height;if(r._helper&&!g.animate&&(/relative/).test(j.css("position"))){c(this).css({left:s.left-e.left-n.left,width:q,height:l})}if(r._helper&&!g.animate&&(/static/).test(j.css("position"))){c(this).css({left:s.left-e.left-n.left,width:q,height:l})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),j=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof j.ghost=="string"?j.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,n){var q=c(this).data("resizable"),h=q.options,l=q.size,j=q.originalSize,k=q.originalPosition,p=q.axis,m=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((l.width-j.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((l.height-j.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(p)){q.size.width=j.width+g;q.size.height=j.height+f}else{if(/^(ne)$/.test(p)){q.size.width=j.width+g;q.size.height=j.height+f;q.position.top=k.top-f}else{if(/^(sw)$/.test(p)){q.size.width=j.width+g;q.size.height=j.height+f;q.position.left=k.left-g}else{q.size.width=j.width+g;q.size.height=j.height+f;q.position.top=k.top-f;q.position.left=k.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,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 c=this;this.element.addClass("ui-selectable");this.dragged=false;var d;this.refresh=function(){d=a(c.options.filter,c.element[0]);d.addClass("ui-selectee");d.each(function(){var e=a(this);var f=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:f.left,top:f.top,right:f.left+e.outerWidth(),bottom:f.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=d.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(e){var c=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled){return}var d=this.options;this.selectees=a(d.filter,this.element[0]);this._trigger("start",e);a(d.appendTo).append(this.helper);this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0});if(d.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var f=a.data(this,"selectable-item");f.startselected=true;if(!e.metaKey&&!e.ctrlKey){f.$element.removeClass("ui-selected");f.selected=false;f.$element.addClass("ui-unselecting");f.unselecting=true;c._trigger("unselecting",e,{unselecting:f.element})}});a(e.target).parents().andSelf().each(function(){var g=a.data(this,"selectable-item");if(g){var f=(!e.metaKey&&!e.ctrlKey)||!g.$element.hasClass("ui-selected");g.$element.removeClass(f?"ui-unselecting":"ui-selected").addClass(f?"ui-selecting":"ui-unselecting");g.unselecting=!f;g.selecting=f;g.selected=f;if(f){c._trigger("selecting",e,{selecting:g.element})}else{c._trigger("unselecting",e,{unselecting:g.element})}return false}})},_mouseDrag:function(k){var d=this;this.dragged=true;if(this.options.disabled){return}var f=this.options;var e=this.opos[0],j=this.opos[1],c=k.pageX,h=k.pageY;if(e>c){var g=c;c=e;e=g}if(j>h){var g=h;h=j;j=g}this.helper.css({left:e,top:j,width:c-e,height:h-j});this.selectees.each(function(){var l=a.data(this,"selectable-item");if(!l||l.element==d.element[0]){return}var m=false;if(f.tolerance=="touch"){m=(!(l.left>c||l.right<e||l.top>h||l.bottom<j))}else{if(f.tolerance=="fit"){m=(l.left>e&&l.right<c&&l.top>j&&l.bottom<h)}}if(m){if(l.selected){l.$element.removeClass("ui-selected");l.selected=false}if(l.unselecting){l.$element.removeClass("ui-unselecting");l.unselecting=false}if(!l.selecting){l.$element.addClass("ui-selecting");l.selecting=true;d._trigger("selecting",k,{selecting:l.element})}}else{if(l.selecting){if((k.metaKey||k.ctrlKey)&&l.startselected){l.$element.removeClass("ui-selecting");l.selecting=false;l.$element.addClass("ui-selected");l.selected=true}else{l.$element.removeClass("ui-selecting");l.selecting=false;if(l.startselected){l.$element.addClass("ui-unselecting");l.unselecting=true}d._trigger("unselecting",k,{unselecting:l.element})}}if(l.selected){if(!k.metaKey&&!k.ctrlKey&&!l.startselected){l.$element.removeClass("ui-selected");l.selected=false;l.$element.addClass("ui-unselecting");l.unselecting=true;d._trigger("unselecting",k,{unselecting:l.element})}}}});return false},_mouseStop:function(e){var c=this;this.dragged=false;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-unselecting");f.unselecting=false;f.startselected=false;c._trigger("unselected",e,{unselected:f.element})});a(".ui-selecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-selecting").addClass("ui-selected");f.selecting=false;f.selected=true;f.startselected=true;c._trigger("selected",e,{selected:f.element})});this._trigger("stop",e);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 c=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?c.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 c=this.items.length-1;c>=0;c--){this.items[c].item.removeData(this.widgetName+"-item")}return this},_setOption:function(c,d){if(c==="disabled"){this.options[c]=d;this.widget()[d?"addClass":"removeClass"]("ui-sortable-disabled")}else{a.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(g,h){var f=this;if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(g);var e=null,d=this,c=a(g.target).parents().each(function(){if(a.data(this,f.widgetName+"-item")==d){e=a(this);return false}});if(a.data(g.target,f.widgetName+"-item")==d){e=a(g.target)}if(!e){return false}if(this.options.handle&&!h){var j=false;a(this.options.handle,e).find("*").andSelf().each(function(){if(this==g.target){j=true}});if(!j){return false}}this.currentItem=e;this._removeCurrentsFromItems();return true},_mouseStart:function(f,g,c){var h=this.options,d=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(f);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:f.pageX-this.offset.left,top:f.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(f);this.originalPageX=f.pageX;this.originalPageY=f.pageY;(h.cursorAt&&this._adjustOffsetFromHelper(h.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(h.containment){this._setContainment()}if(h.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",h.cursor)}if(h.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",h.opacity)}if(h.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",h.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",f,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!c){for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("activate",f,d._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(f);return true},_mouseDrag:function(g){this.position=this._generatePosition(g);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var h=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-g.pageY<h.scrollSensitivity){this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+h.scrollSpeed}else{if(g.pageY-this.overflowOffset.top<h.scrollSensitivity){this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-h.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-g.pageX<h.scrollSensitivity){this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+h.scrollSpeed}else{if(g.pageX-this.overflowOffset.left<h.scrollSensitivity){this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-h.scrollSpeed}}}else{if(g.pageY-a(document).scrollTop()<h.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()-h.scrollSpeed)}else{if(a(window).height()-(g.pageY-a(document).scrollTop())<h.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()+h.scrollSpeed)}}if(g.pageX-a(document).scrollLeft()<h.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()-h.scrollSpeed)}else{if(a(window).width()-(g.pageX-a(document).scrollLeft())<h.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()+h.scrollSpeed)}}}if(c!==false&&a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,g)}}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 e=this.items.length-1;e>=0;e--){var f=this.items[e],d=f.item[0],j=this._intersectsWithPointer(f);if(!j){continue}if(d!=this.currentItem[0]&&this.placeholder[j==1?"next":"prev"]()[0]!=d&&!a.ui.contains(this.placeholder[0],d)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],d):true)){this.direction=j==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f)){this._rearrange(g,f)}else{break}this._trigger("change",g,this._uiHash());break}}this._contactContainers(g);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,g)}this._trigger("sort",g,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,e){if(!d){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,d)}if(this.options.revert){var c=this;var f=c.placeholder.offset();c.reverting=true;a(this.helper).animate({left:f.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(d)})}else{this._clear(d,e)}return false},cancel:function(){var c=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 d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",null,c._uiHash(this));if(this.containers[d].containerCache.over){this.containers[d]._trigger("out",null,c._uiHash(this));this.containers[d].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(e){var c=this._getItemsAsjQuery(e&&e.connected);var d=[];e=e||{};a(c).each(function(){var f=(a(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[-=_](.+)/));if(f){d.push((e.key||f[1]+"[]")+"="+(e.key&&e.expression?f[1]:f[2]))}});if(!d.length&&e.key){d.push(e.key+"=")}return d.join("&")},toArray:function(e){var c=this._getItemsAsjQuery(e&&e.connected);var d=[];e=e||{};c.each(function(){d.push(a(e.item||this).attr(e.attribute||"id")||"")});return d},_intersectsWith:function(n){var e=this.positionAbs.left,d=e+this.helperProportions.width,m=this.positionAbs.top,k=m+this.helperProportions.height;var f=n.left,c=f+n.width,o=n.top,j=o+n.height;var p=this.offset.click.top,h=this.offset.click.left;var g=(m+p)>o&&(m+p)<j&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>n[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&o<m+(this.helperProportions.height/2)&&k-(this.helperProportions.height/2)<j)}},_intersectsWithPointer:function(e){var f=(this.options.axis==="x")||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),d=(this.options.axis==="y")||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),h=f&&d,c=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!h){return false}return this.floating?(((g&&g=="right")||c=="down")?2:1):(c&&(c=="down"?2:1))},_intersectsWithSides:function(f){var d=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,f.top+(f.height/2),f.height),e=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,f.left+(f.width/2),f.width),c=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(this.floating&&g){return((g=="right"&&e)||(g=="left"&&!e))}else{return c&&((c=="down"&&d)||(c=="up"&&!d))}},_getDragVerticalDirection:function(){var c=this.positionAbs.top-this.lastPositionAbs.top;return c!=0&&(c>0?"down":"up")},_getDragHorizontalDirection:function(){var c=this.positionAbs.left-this.lastPositionAbs.left;return c!=0&&(c>0?"right":"left")},refresh:function(c){this._refreshItems(c);this.refreshPositions();return this},_connectWith:function(){var c=this.options;return c.connectWith.constructor==String?[c.connectWith]:c.connectWith},_getItemsAsjQuery:function(c){var m=this;var h=[];var f=[];var k=this._connectWith();if(k&&c){for(var e=k.length-1;e>=0;e--){var l=a(k[e]);for(var d=l.length-1;d>=0;d--){var g=a.data(l[d],this.widgetName);if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element):a(g.options.items,g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g])}}}}f.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 e=f.length-1;e>=0;e--){f[e][0].each(function(){h.push(this)})}return a(h)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");for(var d=0;d<this.items.length;d++){for(var c=0;c<e.length;c++){if(e[c]==this.items[d].item[0]){this.items.splice(d,1)}}}},_refreshItems:function(c){this.items=[];this.containers=[this];var k=this.items;var q=this;var g=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],c,{item:this.currentItem}):a(this.options.items,this.element),this]];var m=this._connectWith();if(m&&this.ready){for(var f=m.length-1;f>=0;f--){var n=a(m[f]);for(var e=n.length-1;e>=0;e--){var h=a.data(n[e],this.widgetName);if(h&&h!=this&&!h.options.disabled){g.push([a.isFunction(h.options.items)?h.options.items.call(h.element[0],c,{item:this.currentItem}):a(h.options.items,h.element),h]);this.containers.push(h)}}}}for(var f=g.length-1;f>=0;f--){var l=g[f][1];var d=g[f][0];for(var e=0,o=d.length;e<o;e++){var p=a(d[e]);p.data(this.widgetName+"-item",l);k.push({item:p,instance:l,width:0,height:0,left:0,top:0})}}},refreshPositions:function(c){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var e=this.items.length-1;e>=0;e--){var f=this.items[e];if(f.instance!=this.currentContainer&&this.currentContainer&&f.item[0]!=this.currentItem[0]){continue}var d=this.options.toleranceElement?a(this.options.toleranceElement,f.item):f.item;if(!c){f.width=d.outerWidth();f.height=d.outerHeight()}var g=d.offset();f.left=g.left;f.top=g.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var e=this.containers.length-1;e>=0;e--){var g=this.containers[e].element.offset();this.containers[e].containerCache.left=g.left;this.containers[e].containerCache.top=g.top;this.containers[e].containerCache.width=this.containers[e].element.outerWidth();this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}}return this},_createPlaceholder:function(e){var c=e||this,f=c.options;if(!f.placeholder||f.placeholder.constructor==String){var d=f.placeholder;f.placeholder={element:function(){var g=a(document.createElement(c.currentItem[0].nodeName)).addClass(d||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!d){g.style.visibility="hidden"}return g},update:function(g,h){if(d&&!f.forcePlaceholderSize){return}if(!h.height()){h.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10))}if(!h.width()){h.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}}c.placeholder=a(f.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);f.placeholder.update(c,c.placeholder)},_contactContainers:function(c){var e=null,l=null;for(var g=this.containers.length-1;g>=0;g--){if(a.ui.contains(this.currentItem[0],this.containers[g].element[0])){continue}if(this._intersectsWith(this.containers[g].containerCache)){if(e&&a.ui.contains(this.containers[g].element[0],e.element[0])){continue}e=this.containers[g];l=g}else{if(this.containers[g].containerCache.over){this.containers[g]._trigger("out",c,this._uiHash(this));this.containers[g].containerCache.over=0}}}if(!e){return}if(this.containers.length===1){this.containers[l]._trigger("over",c,this._uiHash(this));this.containers[l].containerCache.over=1}else{if(this.currentContainer!=this.containers[l]){var k=10000;var h=null;var d=this.positionAbs[this.containers[l].floating?"left":"top"];for(var f=this.items.length-1;f>=0;f--){if(!a.ui.contains(this.containers[l].element[0],this.items[f].item[0])){continue}var m=this.containers[l].floating?this.items[f].item.offset().left:this.items[f].item.offset().top;if(Math.abs(m-d)<k){k=Math.abs(m-d);h=this.items[f];this.direction=(m-d>0)?"down":"up"}}if(!h&&!this.options.dropOnEmpty){return}this.currentContainer=this.containers[l];h?this._rearrange(c,h,null,true):this._rearrange(c,null,this.containers[l].element,true);this._trigger("change",c,this._uiHash());this.containers[l]._trigger("change",c,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[l]._trigger("over",c,this._uiHash(this));this.containers[l].containerCache.over=1}}},_createHelper:function(d){var e=this.options;var c=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[d,this.currentItem])):(e.helper=="clone"?this.currentItem.clone():this.currentItem);if(!c.parents("body").length){a(e.appendTo!="parent"?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(c[0])}if(c[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(c[0].style.width==""||e.forceHelperSize){c.width(this.currentItem.width())}if(c[0].style.height==""||e.forceHelperSize){c.height(this.currentItem.height())}return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string"){c=c.split(" ")}if(a.isArray(c)){c={left:+c[0],top:+c[1]||0}}if("left" in c){this.offset.click.left=c.left+this.margins.left}if("right" in c){this.offset.click.left=this.helperProportions.width-c.right+this.margins.left}if("top" in c){this.offset.click.top=c.top+this.margins.top}if("bottom" in c){this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){c={top:0,left:0}}return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.currentItem.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.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 f=this.options;if(f.containment=="parent"){f.containment=this.helper[0].parentNode}if(f.containment=="document"||f.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(f.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(f.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(f.containment)){var d=a(f.containment)[0];var e=a(f.containment).offset();var c=(a(d).css("overflow")!="hidden");this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(c?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(c?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(g,j){if(!j){j=this.position}var e=g=="absolute"?1:-1;var f=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(c[0].tagName);return{top:(j.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(h?0:c.scrollTop()))*e)),left:(j.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:c.scrollLeft())*e))}},_generatePosition:function(f){var j=this.options,c=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(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var e=f.pageX;var d=f.pageY;if(this.originalPosition){if(this.containment){if(f.pageX-this.offset.click.left<this.containment[0]){e=this.containment[0]+this.offset.click.left}if(f.pageY-this.offset.click.top<this.containment[1]){d=this.containment[1]+this.offset.click.top}if(f.pageX-this.offset.click.left>this.containment[2]){e=this.containment[2]+this.offset.click.left}if(f.pageY-this.offset.click.top>this.containment[3]){d=this.containment[3]+this.offset.click.top}}if(j.grid){var h=this.originalPageY+Math.round((d-this.originalPageY)/j.grid[1])*j.grid[1];d=this.containment?(!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:(!(h-this.offset.click.top<this.containment[1])?h-j.grid[1]:h+j.grid[1])):h;var g=this.originalPageX+Math.round((e-this.originalPageX)/j.grid[0])*j.grid[0];e=this.containment?(!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:(!(g-this.offset.click.left<this.containment[0])?g-j.grid[0]:g+j.grid[0])):g}}return{top:(d-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():(k?0:c.scrollTop())))),left:(e-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():k?0:c.scrollLeft())))}},_rearrange:function(h,g,d,f){d?d[0].appendChild(this.placeholder[0]):g.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?g.item[0]:g.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var e=this,c=this.counter;window.setTimeout(function(){if(c==e.counter){e.refreshPositions(!f)}},0)},_clear:function(e,f){this.reverting=false;var g=[],c=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 d in this._storedCSS){if(this._storedCSS[d]=="auto"||this._storedCSS[d]=="static"){this._storedCSS[d]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!f){g.push(function(h){this._trigger("receive",h,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])&&!f){g.push(function(h){this._trigger("update",h,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!f){g.push(function(h){this._trigger("remove",h,this._uiHash())})}for(var d=this.containers.length-1;d>=0;d--){if(a.ui.contains(this.containers[d].element[0],this.currentItem[0])&&!f){g.push((function(h){return function(j){h._trigger("receive",j,this._uiHash(this))}}).call(this,this.containers[d]));g.push((function(h){return function(j){h._trigger("update",j,this._uiHash(this))}}).call(this,this.containers[d]))}}}for(var d=this.containers.length-1;d>=0;d--){if(!f){g.push((function(h){return function(j){h._trigger("deactivate",j,this._uiHash(this))}}).call(this,this.containers[d]))}if(this.containers[d].containerCache.over){g.push((function(h){return function(j){h._trigger("out",j,this._uiHash(this))}}).call(this,this.containers[d]));this.containers[d].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(!f){this._trigger("beforeStop",e,this._uiHash());for(var d=0;d<g.length;d++){g[d].call(this,e)}this._trigger("stop",e,this._uiHash())}this.fromOutside=false;return false}if(!f){this._trigger("beforeStop",e,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!f){for(var d=0;d<g.length;d++){g[d].call(this,e)}this._trigger("stop",e,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:d?d.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 c=this,d=c.options;c.running=0;c.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");c.headers=c.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(d.disabled){return}a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(d.disabled){return}a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(d.disabled){return}a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(d.disabled){return}a(this).removeClass("ui-state-focus")});c.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(d.navigation){var e=c.element.find("a").filter(d.navigationFilter).eq(0);if(e.length){var f=e.closest(".ui-accordion-header");if(f.length){c.active=f}else{c.active=e.closest(".ui-accordion-content").prev()}}}c.active=c._findActive(c.active||d.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");c.active.next().addClass("ui-accordion-content-active");c._createIcons();c.resize();c.element.attr("role","tablist");c.headers.attr("role","tab").bind("keydown.accordion",function(g){return c._keydown(g)}).next().attr("role","tabpanel");c.headers.not(c.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();if(!c.active.length){c.headers.eq(0).attr("tabIndex",0)}else{c.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0})}if(!a.browser.safari){c.headers.find("a").attr("tabIndex",-1)}if(d.event){c.headers.bind(d.event.split(" ").join(".accordion ")+".accordion",function(g){c._clickHandler.call(c,g,this);g.preventDefault()})}},_createIcons:function(){var c=this.options;if(c.icons){a("<span></span>").addClass("ui-icon "+c.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(c.icons.header).toggleClass(c.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 c=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 d=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(c.autoHeight||c.fillHeight){d.css("height","")}return a.Widget.prototype.destroy.call(this)},_setOption:function(c,d){a.Widget.prototype._setOption.apply(this,arguments);if(c=="active"){this.activate(d)}if(c=="icons"){this._destroyIcons();if(d){this._createIcons()}}if(c=="disabled"){this.headers.add(this.headers.next())[d?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")}},_keydown:function(f){if(this.options.disabled||f.altKey||f.ctrlKey){return}var g=a.ui.keyCode,e=this.headers.length,c=this.headers.index(f.target),d=false;switch(f.keyCode){case g.RIGHT:case g.DOWN:d=this.headers[(c+1)%e];break;case g.LEFT:case g.UP:d=this.headers[(c-1+e)%e];break;case g.SPACE:case g.ENTER:this._clickHandler({target:f.target},f.target);f.preventDefault()}if(d){a(f.target).attr("tabIndex",-1);a(d).attr("tabIndex",0);d.focus();return false}return true},resize:function(){var c=this.options,e;if(c.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}e=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",d)}this.headers.each(function(){e-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,e-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else{if(c.autoHeight){e=0;this.headers.next().each(function(){e=Math.max(e,a(this).height("").height())}).height(e)}}return this},activate:function(c){this.options.active=c;var d=this._findActive(c)[0];this._clickHandler({target:d},d);return this},_findActive:function(c){return c?typeof c==="number"?this.headers.filter(":eq("+c+")"):this.headers.not(this.headers.not(c)):c===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(c,g){var m=this.options;if(m.disabled){return}if(!c.target){if(!m.collapsible){return}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(m.icons.headerSelected).addClass(m.icons.header);this.active.next().addClass("ui-accordion-content-active");var j=this.active.next(),f={options:m,newHeader:a([]),oldHeader:m.active,newContent:a([]),oldContent:j},d=(this.active=a([]));this._toggle(d,j,f);return}var h=a(c.currentTarget||g),k=h[0]===this.active[0];m.active=m.collapsible&&k?false:this.headers.index(h);if(this.running||(!m.collapsible&&k)){return}var e=this.active,d=h.next(),j=this.active.next(),f={options:m,newHeader:k&&m.collapsible?a([]):h,oldHeader:this.active,newContent:k&&m.collapsible?a([]):d,oldContent:j},l=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=k?a([]):h;this._toggle(d,j,f,k,l);e.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(m.icons.headerSelected).addClass(m.icons.header);if(!k){h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(m.icons.header).addClass(m.icons.headerSelected);h.next().addClass("ui-accordion-content-active")}return},_toggle:function(c,j,g,k,l){var n=this,o=n.options;n.toShow=c;n.toHide=j;n.data=g;var d=function(){if(!n){return}return n._completed.apply(n,arguments)};n._trigger("changestart",null,n.data);n.running=j.size()===0?c.size():j.size();if(o.animated){var f={};if(o.collapsible&&k){f={toShow:a([]),toHide:j,complete:d,down:l,autoHeight:o.autoHeight||o.fillSpace}}else{f={toShow:c,toHide:j,complete:d,down:l,autoHeight:o.autoHeight||o.fillSpace}}if(!o.proxied){o.proxied=o.animated}if(!o.proxiedDuration){o.proxiedDuration=o.duration}o.animated=a.isFunction(o.proxied)?o.proxied(f):o.proxied;o.duration=a.isFunction(o.proxiedDuration)?o.proxiedDuration(f):o.proxiedDuration;var m=a.ui.accordion.animations,e=o.duration,h=o.animated;if(h&&!m[h]&&!a.easing[h]){h="slide"}if(!m[h]){m[h]=function(p){this.slide(p,{easing:h,duration:e||700})}}m[h](f)}else{if(o.collapsible&&k){c.toggle()}else{j.hide();c.show()}d(true)}j.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur();c.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(c){this.running=c?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(l,j){l=a.extend({easing:"swing",duration:300},l,j);if(!l.toHide.size()){l.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},l);return}if(!l.toShow.size()){l.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},l);return}var d=l.toShow.css("overflow"),h=0,e={},g={},f=["height","paddingTop","paddingBottom"],c;var k=l.toShow;c=k[0].style.width;k.width(k.parent().width()-parseFloat(k.css("paddingLeft"))-parseFloat(k.css("paddingRight"))-(parseFloat(k.css("borderLeftWidth"))||0)-(parseFloat(k.css("borderRightWidth"))||0));a.each(f,function(m,o){g[o]="hide";var n=(""+a.css(l.toShow[0],o)).match(/^([\d+-.]+)(.*)$/);e[o]={value:n[1],unit:n[2]||"px"}});l.toShow.css({height:0,overflow:"hidden"}).show();l.toHide.filter(":hidden").each(l.complete).end().filter(":visible").animate(g,{step:function(m,n){if(n.prop=="height"){h=(n.end-n.start===0)?0:(n.now-n.start)/(n.end-n.start)}l.toShow[0].style[n.prop]=(h*e[n.prop].value)+e[n.prop].unit},duration:l.duration,easing:l.easing,complete:function(){if(!l.autoHeight){l.toShow.css("height","")}l.toShow.css({width:c,overflow:d});l.complete()}})},bounceslide:function(c){this.slide(c,{easing:c.down?"easeOutBounce":"swing",duration:c.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 c=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 d=this,f=this.element[0].ownerDocument,e;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(g){if(d.options.disabled||d.element.propAttr("readOnly")){return}e=false;var h=a.ui.keyCode;switch(g.keyCode){case h.PAGE_UP:d._move("previousPage",g);break;case h.PAGE_DOWN:d._move("nextPage",g);break;case h.UP:d._keyEvent("previous",g);break;case h.DOWN:d._keyEvent("next",g);break;case h.ENTER:case h.NUMPAD_ENTER:if(d.menu.active){e=true;g.preventDefault()}case h.TAB:if(!d.menu.active){return}d.menu.select(g);break;case h.ESCAPE:d.element.val(d.term);d.close(g);break;default:clearTimeout(d.searching);d.searching=setTimeout(function(){if(d.term!=d.element.val()){d.selectedItem=null;d.search(null,g)}},d.options.delay);break}}).bind("keypress.autocomplete",function(g){if(e){e=false;g.preventDefault()}}).bind("focus.autocomplete",function(){if(d.options.disabled){return}d.selectedItem=null;d.previous=d.element.val()}).bind("blur.autocomplete",function(g){if(d.options.disabled){return}clearTimeout(d.searching);d.closing=setTimeout(function(){d.close(g);d._change(g)},150)});this._initSource();this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",f)[0]).mousedown(function(g){var h=d.menu.element[0];if(!a(g.target).closest(".ui-menu-item").length){setTimeout(function(){a(document).one("mousedown",function(j){if(j.target!==d.element[0]&&j.target!==h&&!a.ui.contains(h,j.target)){d.close()}})},1)}setTimeout(function(){clearTimeout(d.closing)},13)}).menu({focus:function(h,j){var g=j.item.data("item.autocomplete");if(false!==d._trigger("focus",h,{item:g})){if(/^key/.test(h.originalEvent.type)){d.element.val(g.value)}}},selected:function(j,k){var h=k.item.data("item.autocomplete"),g=d.previous;if(d.element[0]!==f.activeElement){d.element.focus();d.previous=g;setTimeout(function(){d.previous=g;d.selectedItem=h},1)}if(false!==d._trigger("select",j,{item:h})){d.element.val(h.value)}d.term=d.element.val();d.close(j);d.selectedItem=h},blur:function(g,h){if(d.menu.element.is(":visible")&&(d.element.val()!==d.term)){d.element.val(d.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(a.fn.bgiframe){this.menu.element.bgiframe()}d.beforeunloadHandler=function(){d.element.removeAttr("autocomplete")};a(window).bind("beforeunload",d.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(d,e){a.Widget.prototype._setOption.apply(this,arguments);if(d==="source"){this._initSource()}if(d==="appendTo"){this.menu.element.appendTo(a(e||"body",this.element[0].ownerDocument)[0])}if(d==="disabled"&&e&&this.xhr){this.xhr.abort()}},_initSource:function(){var d=this,f,e;if(a.isArray(this.options.source)){f=this.options.source;this.source=function(h,g){g(a.ui.autocomplete.filter(f,h.term))}}else{if(typeof this.options.source==="string"){e=this.options.source;this.source=function(h,g){if(d.xhr){d.xhr.abort()}d.xhr=a.ajax({url:e,data:h,dataType:"json",success:function(k,j){g(k)},error:function(){g([])}})}}else{this.source=this.options.source}}},search:function(e,d){e=e!=null?e:this.element.val();this.term=this.element.val();if(e.length<this.options.minLength){return this.close(d)}clearTimeout(this.closing);if(this._trigger("search",d)===false){return}return this._search(e)},_search:function(d){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:d},this._response())},_response:function(){var e=this,d=++c;return function(f){if(d===c){e.__response(f)}e.pending--;if(!e.pending){e.element.removeClass("ui-autocomplete-loading")}}},__response:function(d){if(!this.options.disabled&&d&&d.length){d=this._normalize(d);this._suggest(d);this._trigger("open")}else{this.close()}},close:function(d){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",d)}},_change:function(d){if(this.previous!==this.element.val()){this._trigger("change",d,{item:this.selectedItem})}},_normalize:function(d){if(d.length&&d[0].label&&d[0].value){return d}return a.map(d,function(e){if(typeof e==="string"){return{label:e,value:e}}return a.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(d){var e=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(e,d);this.menu.deactivate();this.menu.refresh();e.show();this._resizeMenu();e.position(a.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new a.Event("mouseover"))}},_resizeMenu:function(){var d=this.menu.element;d.outerWidth(Math.max(d.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(f,e){var d=this;a.each(e,function(g,h){d._renderItem(f,h)})},_renderItem:function(d,e){return a("<li></li>").data("item.autocomplete",e).append(a("<a></a>").text(e.label)).appendTo(d)},_move:function(e,d){if(!this.menu.element.is(":visible")){this.search(null,d);return}if(this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)){this.element.val(this.term);this.menu.deactivate();return}this.menu[e](d)},widget:function(){return this.menu.element},_keyEvent:function(e,d){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(e,d);d.preventDefault()}}});a.extend(a.ui.autocomplete,{escapeRegex:function(d){return d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(f,d){var e=new RegExp(a.ui.autocomplete.escapeRegex(d),"i");return a.grep(f,function(g){return e.test(g.label||g.value||g)})}})}(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(c){if(!a(c.target).closest(".ui-menu-item a").length){return}c.preventDefault();b.select(c)});this.refresh()},refresh:function(){var c=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(d){c.activate(d,a(this).parent())}).mouseleave(function(){c.deactivate()})},activate:function(e,d){this.deactivate();if(this.hasScroll()){var f=d.offset().top-this.element.offset().top,b=this.element.scrollTop(),c=this.element.height();if(f<0){this.element.scrollTop(b+f)}else{if(f>=c){this.element.scrollTop(b+f-c+d.height())}}}this.active=d.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:d})},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(e,d,c){if(!this.active){this.activate(c,this.element.children(d));return}var b=this.active[e+"All"](".ui-menu-item").eq(0);if(b.length){this.activate(c,b)}else{this.activate(c,this.element.children(d))}},nextPage:function(d){if(this.hasScroll()){if(!this.active||this.last()){this.activate(d,this.element.children(".ui-menu-item:first"));return}var e=this.active.offset().top,c=this.element.height(),b=this.element.children(".ui-menu-item").filter(function(){var f=a(this).offset().top-e-c+a(this).height();return f<10&&f>-10});if(!b.length){b=this.element.children(".ui-menu-item:last")}this.activate(d,b)}else{this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(d){if(this.hasScroll()){if(!this.active||this.first()){this.activate(d,this.element.children(".ui-menu-item:last"));return}var e=this.active.offset().top,c=this.element.height(),b=this.element.children(".ui-menu-item").filter(function(){var f=a(this).offset().top-e+c-a(this).height();return f<10&&f>-10});if(!b.length){b=this.element.children(".ui-menu-item:first")}this.activate(d,b)}else{this.activate(d,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(f,b){var l,e,a,h,j="ui-button ui-widget ui-state-default ui-corner-all",c="ui-state-hover ui-state-active ",g="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",k=function(){var m=f(this).find(":ui-button");setTimeout(function(){m.button("refresh")},1)},d=function(n){var m=n.name,o=n.form,p=f([]);if(m){if(o){p=f(o).find("[name='"+m+"']")}else{p=f("[name='"+m+"']",n.ownerDocument).filter(function(){return !this.form})}}return p};f.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",k);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 m=this,o=this.options,p=this.type==="checkbox"||this.type==="radio",q="ui-state-hover"+(!p?" ui-state-active":""),n="ui-state-focus";if(o.label===null){o.label=this.buttonElement.html()}this.buttonElement.addClass(j).attr("role","button").bind("mouseenter.button",function(){if(o.disabled){return}f(this).addClass("ui-state-hover");if(this===l){f(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){if(o.disabled){return}f(this).removeClass(q)}).bind("click.button",function(r){if(o.disabled){r.preventDefault();r.stopImmediatePropagation()}});this.element.bind("focus.button",function(){m.buttonElement.addClass(n)}).bind("blur.button",function(){m.buttonElement.removeClass(n)});if(p){this.element.bind("change.button",function(){if(h){return}m.refresh()});this.buttonElement.bind("mousedown.button",function(r){if(o.disabled){return}h=false;e=r.pageX;a=r.pageY}).bind("mouseup.button",function(r){if(o.disabled){return}if(e!==r.pageX||a!==r.pageY){h=true}})}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(o.disabled||h){return false}f(this).toggleClass("ui-state-active");m.buttonElement.attr("aria-pressed",m.element[0].checked)})}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(o.disabled||h){return false}f(this).addClass("ui-state-active");m.buttonElement.attr("aria-pressed","true");var r=m.element[0];d(r).not(r).map(function(){return f(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")})}else{this.buttonElement.bind("mousedown.button",function(){if(o.disabled){return false}f(this).addClass("ui-state-active");l=this;f(document).one("mouseup",function(){l=null})}).bind("mouseup.button",function(){if(o.disabled){return false}f(this).removeClass("ui-state-active")}).bind("keydown.button",function(r){if(o.disabled){return false}if(r.keyCode==f.ui.keyCode.SPACE||r.keyCode==f.ui.keyCode.ENTER){f(this).addClass("ui-state-active")}}).bind("keyup.button",function(){f(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(r){if(r.keyCode===f.ui.keyCode.SPACE){f(this).click()}})}}}this._setOption("disabled",o.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 m=this.element.parents().filter(":last"),o="label[for='"+this.element.attr("id")+"']";this.buttonElement=m.find(o);if(!this.buttonElement.length){m=m.length?m.siblings():this.element.siblings();this.buttonElement=m.filter(o);if(!this.buttonElement.length){this.buttonElement=m.find(o)}}this.element.addClass("ui-helper-hidden-accessible");var n=this.element.is(":checked");if(n){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",n)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(j+" "+c+" "+g).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}f.Widget.prototype.destroy.call(this)},_setOption:function(m,n){f.Widget.prototype._setOption.apply(this,arguments);if(m==="disabled"){if(n){this.element.propAttr("disabled",true)}else{this.element.propAttr("disabled",false)}return}this._resetButton()},refresh:function(){var m=this.element.is(":disabled");if(m!==this.options.disabled){this._setOption("disabled",m)}if(this.type==="radio"){d(this.element[0]).each(function(){if(f(this).is(":checked")){f(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true")}else{f(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 q=this.buttonElement.removeClass(g),o=f("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(q.empty()).text(),n=this.options.icons,m=n.primary&&n.secondary,p=[];if(n.primary||n.secondary){if(this.options.text){p.push("ui-button-text-icon"+(m?"s":(n.primary?"-primary":"-secondary")))}if(n.primary){q.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>")}if(n.secondary){q.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>")}if(!this.options.text){p.push(m?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){q.attr("title",o)}}}else{p.push("ui-button-text-only")}q.addClass(p.join(" "))}});f.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(m,n){if(m==="disabled"){this.buttons.button("option",m,n)}f.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var m=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 f(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(m?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(m?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return f(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");f.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(d,e){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},c={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};d.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(g){var f=d(this).css(g).offset().top;if(f<0){d(this).css("top",g.top-f)}}},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 o=this,p=o.options,m=p.title||"&#160;",g=d.ui.dialog.getTitleId(o.element),n=(o.uiDialog=d("<div></div>")).appendTo(document.body).hide().addClass(b+p.dialogClass).css({zIndex:p.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(q){if(p.closeOnEscape&&!q.isDefaultPrevented()&&q.keyCode&&q.keyCode===d.ui.keyCode.ESCAPE){o.close(q);q.preventDefault()}}).attr({role:"dialog","aria-labelledby":g}).mousedown(function(q){o.moveToTop(false,q)}),j=o.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(n),h=(o.uiDialogTitlebar=d("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(n),l=d('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).focus(function(){l.addClass("ui-state-focus")}).blur(function(){l.removeClass("ui-state-focus")}).click(function(q){o.close(q);return false}).appendTo(h),k=(o.uiDialogTitlebarCloseText=d("<span></span>")).addClass("ui-icon ui-icon-closethick").text(p.closeText).appendTo(l),f=d("<span></span>").addClass("ui-dialog-title").attr("id",g).html(m).prependTo(h);if(d.isFunction(p.beforeclose)&&!d.isFunction(p.beforeClose)){p.beforeClose=p.beforeclose}h.find("*").add(h).disableSelection();if(p.draggable&&d.fn.draggable){o._makeDraggable()}if(p.resizable&&d.fn.resizable){o._makeResizable()}o._createButtons(p.buttons);o._isOpen=false;if(d.fn.bgiframe){n.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var f=this;if(f.overlay){f.overlay.destroy()}f.uiDialog.hide();f.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");f.uiDialog.remove();if(f.originalTitle){f.element.attr("title",f.originalTitle)}return f},widget:function(){return this.uiDialog},close:function(j){var f=this,h,g;if(false===f._trigger("beforeClose",j)){return}if(f.overlay){f.overlay.destroy()}f.uiDialog.unbind("keypress.ui-dialog");f._isOpen=false;if(f.options.hide){f.uiDialog.hide(f.options.hide,function(){f._trigger("close",j)})}else{f.uiDialog.hide();f._trigger("close",j)}d.ui.dialog.overlay.resize();if(f.options.modal){h=0;d(".ui-dialog").each(function(){if(this!==f.uiDialog[0]){g=d(this).css("z-index");if(!isNaN(g)){h=Math.max(h,g)}}});d.ui.dialog.maxZ=h}return f},isOpen:function(){return this._isOpen},moveToTop:function(k,j){var f=this,h=f.options,g;if((h.modal&&!k)||(!h.stack&&!h.modal)){return f._trigger("focus",j)}if(h.zIndex>d.ui.dialog.maxZ){d.ui.dialog.maxZ=h.zIndex}if(f.overlay){d.ui.dialog.maxZ+=1;f.overlay.$el.css("z-index",d.ui.dialog.overlay.maxZ=d.ui.dialog.maxZ)}g={scrollTop:f.element.scrollTop(),scrollLeft:f.element.scrollLeft()};d.ui.dialog.maxZ+=1;f.uiDialog.css("z-index",d.ui.dialog.maxZ);f.element.attr(g);f._trigger("focus",j);return f},open:function(){if(this._isOpen){return}var g=this,h=g.options,f=g.uiDialog;g.overlay=h.modal?new d.ui.dialog.overlay(g):null;g._size();g._position(h.position);f.show(h.show);g.moveToTop(true);if(h.modal){f.bind("keydown.ui-dialog",function(l){if(l.keyCode!==d.ui.keyCode.TAB){return}var k=d(":tabbable",this),m=k.filter(":first"),j=k.filter(":last");if(l.target===j[0]&&!l.shiftKey){m.focus(1);return false}else{if(l.target===m[0]&&l.shiftKey){j.focus(1);return false}}})}d(g.element.find(":tabbable").get().concat(f.find(".ui-dialog-buttonpane :tabbable").get().concat(f.get()))).eq(0).focus();g._isOpen=true;g._trigger("open");return g},_createButtons:function(j){var h=this,f=false,g=d("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),k=d("<div></div>").addClass("ui-dialog-buttonset").appendTo(g);h.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof j==="object"&&j!==null){d.each(j,function(){return !(f=true)})}if(f){d.each(j,function(l,n){n=d.isFunction(n)?{click:n,text:l}:n;var m=d('<button type="button"></button>').click(function(){n.click.apply(h.element[0],arguments)}).appendTo(k);d.each(n,function(o,p){if(o==="click"){return}if(o in m){m[o](p)}else{m.attr(o,p)}});if(d.fn.button){m.button()}});g.appendTo(h.uiDialog)}},_makeDraggable:function(){var f=this,j=f.options,k=d(document),h;function g(l){return{position:l.position,offset:l.offset}}f.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(l,m){h=j.height==="auto"?"auto":d(this).height();d(this).height(d(this).height()).addClass("ui-dialog-dragging");f._trigger("dragStart",l,g(m))},drag:function(l,m){f._trigger("drag",l,g(m))},stop:function(l,m){j.position=[m.position.left-k.scrollLeft(),m.position.top-k.scrollTop()];d(this).removeClass("ui-dialog-dragging").height(h);f._trigger("dragStop",l,g(m));d.ui.dialog.overlay.resize()}})},_makeResizable:function(l){l=(l===e?this.options.resizable:l);var g=this,k=g.options,f=g.uiDialog.css("position"),j=(typeof l==="string"?l:"n,e,s,w,se,sw,ne,nw");function h(m){return{originalPosition:m.originalPosition,originalSize:m.originalSize,position:m.position,size:m.size}}g.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:g.element,maxWidth:k.maxWidth,maxHeight:k.maxHeight,minWidth:k.minWidth,minHeight:g._minHeight(),handles:j,start:function(m,n){d(this).addClass("ui-dialog-resizing");g._trigger("resizeStart",m,h(n))},resize:function(m,n){g._trigger("resize",m,h(n))},stop:function(m,n){d(this).removeClass("ui-dialog-resizing");k.height=d(this).height();k.width=d(this).width();g._trigger("resizeStop",m,h(n));d.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var f=this.options;if(f.height==="auto"){return f.minHeight}else{return Math.min(f.minHeight,f.height)}},_position:function(g){var h=[],j=[0,0],f;if(g){if(typeof g==="string"||(typeof g==="object"&&"0" in g)){h=g.split?g.split(" "):[g[0],g[1]];if(h.length===1){h[1]=h[0]}d.each(["left","top"],function(l,k){if(+h[l]===h[l]){j[l]=h[l];h[l]=k}});g={my:h.join(" "),at:h.join(" "),offset:j.join(" ")}}g=d.extend({},d.ui.dialog.prototype.options.position,g)}else{g=d.ui.dialog.prototype.options.position}f=this.uiDialog.is(":visible");if(!f){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position(d.extend({of:window},g));if(!f){this.uiDialog.hide()}},_setOptions:function(j){var g=this,f={},h=false;d.each(j,function(k,l){g._setOption(k,l);if(k in a){h=true}if(k in c){f[k]=l}});if(h){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",f)}},_setOption:function(j,k){var g=this,f=g.uiDialog;switch(j){case"beforeclose":j="beforeClose";break;case"buttons":g._createButtons(k);break;case"closeText":g.uiDialogTitlebarCloseText.text(""+k);break;case"dialogClass":f.removeClass(g.options.dialogClass).addClass(b+k);break;case"disabled":if(k){f.addClass("ui-dialog-disabled")}else{f.removeClass("ui-dialog-disabled")}break;case"draggable":var h=f.is(":data(draggable)");if(h&&!k){f.draggable("destroy")}if(!h&&k){g._makeDraggable()}break;case"position":g._position(k);break;case"resizable":var l=f.is(":data(resizable)");if(l&&!k){f.resizable("destroy")}if(l&&typeof k==="string"){f.resizable("option","handles",k)}if(!l&&k!==false){g._makeResizable(k)}break;case"title":d(".ui-dialog-title",g.uiDialogTitlebar).html(""+(k||"&#160;"));break}d.Widget.prototype._setOption.apply(g,arguments)},_size:function(){var k=this.options,g,j,f=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(k.minWidth>k.width){k.width=k.minWidth}g=this.uiDialog.css({height:"auto",width:k.width}).height();j=Math.max(0,k.minHeight-g);if(k.height==="auto"){if(d.support.minHeight){this.element.css({minHeight:j,height:"auto"})}else{this.uiDialog.show();var h=this.element.css("height","auto").height();if(!f){this.uiDialog.hide()}this.element.height(Math.max(h,j))}}else{this.element.height(Math.max(k.height-g,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});d.extend(d.ui.dialog,{version:"1.8.23",uuid:0,maxZ:0,getTitleId:function(f){var g=f.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(f){this.$el=d.ui.dialog.overlay.create(f)}});d.extend(d.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:d.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(f){return f+".dialog-overlay"}).join(" "),create:function(g){if(this.instances.length===0){setTimeout(function(){if(d.ui.dialog.overlay.instances.length){d(document).bind(d.ui.dialog.overlay.events,function(h){if(d(h.target).zIndex()<d.ui.dialog.overlay.maxZ){return false}})}},1);d(document).bind("keydown.dialog-overlay",function(h){if(g.options.closeOnEscape&&!h.isDefaultPrevented()&&h.keyCode&&h.keyCode===d.ui.keyCode.ESCAPE){g.close(h);h.preventDefault()}});d(window).bind("resize.dialog-overlay",d.ui.dialog.overlay.resize)}var f=(this.oldInstances.pop()||d("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if(d.fn.bgiframe){f.bgiframe()}this.instances.push(f);return f},destroy:function(f){var g=d.inArray(f,this.instances);if(g!=-1){this.oldInstances.push(this.instances.splice(g,1)[0])}if(this.instances.length===0){d([document,window]).unbind(".dialog-overlay")}f.remove();var h=0;d.each(this.instances,function(){h=Math.max(h,this.css("z-index"))});this.maxZ=h},height:function(){var g,f;if(d.browser.msie&&d.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);f=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(g<f){return d(window).height()+"px"}else{return g+"px"}}else{return d(document).height()+"px"}},width:function(){var f,g;if(d.browser.msie){f=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);g=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(f<g){return d(window).width()+"px"}else{return f+"px"}}else{return d(document).width()+"px"}},resize:function(){var f=d([]);d.each(d.ui.dialog.overlay.instances,function(){f=f.add(this)});f.css({width:0,height:0}).css({width:d.ui.dialog.overlay.width(),height:d.ui.dialog.overlay.height()})}});d.extend(d.ui.dialog.overlay.prototype,{destroy:function(){d.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,c){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 e=this,k=this.options,j=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),h="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",d=(k.values&&k.values.length)||1,g=[];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"+(k.disabled?" ui-slider-disabled ui-disabled":""));this.range=b([]);if(k.range){if(k.range===true){if(!k.values){k.values=[this._valueMin(),this._valueMin()]}if(k.values.length&&k.values.length!==2){k.values=[k.values[0],k.values[0]]}}this.range=b("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+((k.range==="min"||k.range==="max")?" ui-slider-range-"+k.range:""))}for(var f=j.length;f<d;f+=1){g.push(h)}this.handles=j.add(b(g.join("")).appendTo(e.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(l){l.preventDefault()}).hover(function(){if(!k.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!k.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(l){b(this).data("index.ui-slider-handle",l)});this.handles.keydown(function(p){var m=b(this).data("index.ui-slider-handle"),q,n,l,o;if(e.options.disabled){return}switch(p.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:p.preventDefault();if(!e._keySliding){e._keySliding=true;b(this).addClass("ui-state-active");q=e._start(p,m);if(q===false){return}}break}o=e.options.step;if(e.options.values&&e.options.values.length){n=l=e.values(m)}else{n=l=e.value()}switch(p.keyCode){case b.ui.keyCode.HOME:l=e._valueMin();break;case b.ui.keyCode.END:l=e._valueMax();break;case b.ui.keyCode.PAGE_UP:l=e._trimAlignValue(n+((e._valueMax()-e._valueMin())/a));break;case b.ui.keyCode.PAGE_DOWN:l=e._trimAlignValue(n-((e._valueMax()-e._valueMin())/a));break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(n===e._valueMax()){return}l=e._trimAlignValue(n+o);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(n===e._valueMin()){return}l=e._trimAlignValue(n-o);break}e._slide(p,m,l)}).keyup(function(m){var l=b(this).data("index.ui-slider-handle");if(e._keySliding){e._keySliding=false;e._stop(m,l);e._change(m,l);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(f){var g=this.options,k,m,e,h,p,l,n,j,d;if(g.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();k={x:f.pageX,y:f.pageY};m=this._normValueFromMouse(k);e=this._valueMax()-this._valueMin()+1;p=this;this.handles.each(function(o){var q=Math.abs(m-p.values(o));if(e>q){e=q;h=b(this);l=o}});if(g.range===true&&this.values(1)===g.min){l+=1;h=b(this.handles[l])}n=this._start(f,l);if(n===false){return false}this._mouseSliding=true;p._handleIndex=l;h.addClass("ui-state-active").focus();j=h.offset();d=!b(f.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=d?{left:0,top:0}:{left:f.pageX-j.left-(h.width()/2),top:f.pageY-j.top-(h.height()/2)-(parseInt(h.css("borderTopWidth"),10)||0)-(parseInt(h.css("borderBottomWidth"),10)||0)+(parseInt(h.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(f,l,m)}this._animateOff=true;return true},_mouseStart:function(d){return true},_mouseDrag:function(f){var d={x:f.pageX,y:f.pageY},e=this._normValueFromMouse(d);this._slide(f,this._handleIndex,e);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,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(e){var d,h,g,f,j;if(this.orientation==="horizontal"){d=this.elementSize.width;h=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;h=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}g=(h/d);if(g>1){g=1}if(g<0){g=0}if(this.orientation==="vertical"){g=1-g}f=this._valueMax()-this._valueMin();j=this._valueMin()+g*f;return this._trimAlignValue(j)},_start:function(f,e){var d={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(e);d.values=this.values()}return this._trigger("start",f,d)},_slide:function(h,g,f){var d,e,j;if(this.options.values&&this.options.values.length){d=this.values(g?0:1);if((this.options.values.length===2&&this.options.range===true)&&((g===0&&f>d)||(g===1&&f<d))){f=d}if(f!==this.values(g)){e=this.values();e[g]=f;j=this._trigger("slide",h,{handle:this.handles[g],value:f,values:e});d=this.values(g?0:1);if(j!==false){this.values(g,f,true)}}}else{if(f!==this.value()){j=this._trigger("slide",h,{handle:this.handles[g],value:f});if(j!==false){this.value(f)}}}},_stop:function(f,e){var d={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(e);d.values=this.values()}this._trigger("stop",f,d)},_change:function(f,e){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(e);d.values=this.values()}this._trigger("change",f,d)}},value:function(d){if(arguments.length){this.options.value=this._trimAlignValue(d);this._refreshValue();this._change(null,0);return}return this._value()},values:function(e,h){var g,d,f;if(arguments.length>1){this.options.values[e]=this._trimAlignValue(h);this._refreshValue();this._change(null,e);return}if(arguments.length){if(b.isArray(arguments[0])){g=this.options.values;d=arguments[0];for(f=0;f<g.length;f+=1){g[f]=this._trimAlignValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(e,f){var d,g=0;if(b.isArray(this.options.values)){g=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(e){case"disabled":if(f){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(d=0;d<g;d+=1){this._change(null,d)}this._animateOff=false;break}},_value:function(){var d=this.options.value;d=this._trimAlignValue(d);return d},_values:function(d){var g,f,e;if(arguments.length){g=this.options.values[d];g=this._trimAlignValue(g);return g}else{f=this.options.values.slice();for(e=0;e<f.length;e+=1){f[e]=this._trimAlignValue(f[e])}return f}},_trimAlignValue:function(g){if(g<=this._valueMin()){return this._valueMin()}if(g>=this._valueMax()){return this._valueMax()}var d=(this.options.step>0)?this.options.step:1,f=(g-this._valueMin())%d,e=g-f;if(Math.abs(f)*2>=d){e+=(f>0)?d:(-d)}return parseFloat(e.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var g=this.options.range,f=this.options,n=this,e=(!this._animateOff)?f.animate:false,h,d={},j,l,k,m;if(this.options.values&&this.options.values.length){this.handles.each(function(p,o){h=(n.values(p)-n._valueMin())/(n._valueMax()-n._valueMin())*100;d[n.orientation==="horizontal"?"left":"bottom"]=h+"%";b(this).stop(1,1)[e?"animate":"css"](d,f.animate);if(n.options.range===true){if(n.orientation==="horizontal"){if(p===0){n.range.stop(1,1)[e?"animate":"css"]({left:h+"%"},f.animate)}if(p===1){n.range[e?"animate":"css"]({width:(h-j)+"%"},{queue:false,duration:f.animate})}}else{if(p===0){n.range.stop(1,1)[e?"animate":"css"]({bottom:(h)+"%"},f.animate)}if(p===1){n.range[e?"animate":"css"]({height:(h-j)+"%"},{queue:false,duration:f.animate})}}}j=h})}else{l=this.value();k=this._valueMin();m=this._valueMax();h=(m!==k)?(l-k)/(m-k)*100:0;d[n.orientation==="horizontal"?"left":"bottom"]=h+"%";this.handle.stop(1,1)[e?"animate":"css"](d,f.animate);if(g==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[e?"animate":"css"]({width:h+"%"},f.animate)}if(g==="max"&&this.orientation==="horizontal"){this.range[e?"animate":"css"]({width:(100-h)+"%"},{queue:false,duration:f.animate})}if(g==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[e?"animate":"css"]({height:h+"%"},f.animate)}if(g==="max"&&this.orientation==="vertical"){this.range[e?"animate":"css"]({height:(100-h)+"%"},{queue:false,duration:f.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(d,f){var c=0,b=0;function e(){return ++c}function a(){return ++b}d.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(g,h){if(g=="selected"){if(this.options.collapsible&&h==this.options.selected){return}this.select(h)}else{this.options[g]=h;this._tabify()}},_tabId:function(g){return g.title&&g.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(g){return g.replace(/:/g,"\\:")},_cookie:function(){var g=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a());return d.cookie.apply(null,[g].concat(d.makeArray(arguments)))},_ui:function(h,g){return{tab:h,panel:g,index:this.anchors.index(h)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var g=d(this);g.html(g.data("label.tabs")).removeData("label.tabs")})},_tabify:function(t){var u=this,j=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(w,o){var v=d(o).attr("href");var x=v.split("#")[0],y;if(x&&(x===location.toString().split("#")[0]||(y=d("base")[0])&&x===y.href)){v=o.hash;o.href=v}if(h.test(v)){u.panels=u.panels.add(u.element.find(u._sanitizeSelector(v)))}else{if(v&&v!=="#"){d.data(o,"href.tabs",v);d.data(o,"load.tabs",v.replace(/#.*$/,""));var A=u._tabId(o);o.href="#"+A;var z=u.element.find("#"+A);if(!z.length){z=d(j.panelTemplate).attr("id",A).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(u.panels[w-1]||u.list);z.data("destroy.tabs",true)}u.panels=u.panels.add(z)}else{j.disabled.push(w)}}});if(t){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(j.selected===f){if(location.hash){this.anchors.each(function(v,o){if(o.hash==location.hash){j.selected=v;return false}})}if(typeof j.selected!=="number"&&j.cookie){j.selected=parseInt(u._cookie(),10)}if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}j.selected=j.selected||(this.lis.length?0:-1)}else{if(j.selected===null){j.selected=-1}}j.selected=((j.selected>=0&&this.anchors[j.selected])||j.selected<0)?j.selected:0;j.disabled=d.unique(j.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(v,o){return u.lis.index(v)}))).sort();if(d.inArray(j.selected,j.disabled)!=-1){j.disabled.splice(d.inArray(j.selected,j.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(j.selected>=0&&this.anchors.length){u.element.find(u._sanitizeSelector(u.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");u.element.queue("tabs",function(){u._trigger("show",null,u._ui(u.anchors[j.selected],u.element.find(u._sanitizeSelector(u.anchors[j.selected].hash))[0]))});this.load(j.selected)}d(window).bind("unload",function(){u.lis.add(u.anchors).unbind(".tabs");u.lis=u.anchors=u.panels=null})}else{j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(j.cookie){this._cookie(j.selected,j.cookie)}for(var m=0,s;(s=this.lis[m]);m++){d(s)[d.inArray(m,j.disabled)!=-1&&!d(s).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(j.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var l=function(v,o){if(o.is(":not(.ui-state-disabled)")){o.addClass("ui-state-"+v)}};var p=function(v,o){o.removeClass("ui-state-"+v)};this.lis.bind("mouseover.tabs",function(){l("hover",d(this))});this.lis.bind("mouseout.tabs",function(){p("hover",d(this))});this.anchors.bind("focus.tabs",function(){l("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){p("focus",d(this).closest("li"))})}var g,n;if(j.fx){if(d.isArray(j.fx)){g=j.fx[0];n=j.fx[1]}else{g=n=j.fx}}function k(o,v){o.css("display","");if(!d.support.opacity&&v.opacity){o[0].style.removeAttribute("filter")}}var q=n?function(o,v){d(o).closest("li").addClass("ui-tabs-selected ui-state-active");v.hide().removeClass("ui-tabs-hide").animate(n,n.duration||"normal",function(){k(v,n);u._trigger("show",null,u._ui(o,v[0]))})}:function(o,v){d(o).closest("li").addClass("ui-tabs-selected ui-state-active");v.removeClass("ui-tabs-hide");u._trigger("show",null,u._ui(o,v[0]))};var r=g?function(v,o){o.animate(g,g.duration||"normal",function(){u.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");k(o,g);u.element.dequeue("tabs")})}:function(v,o,w){u.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");u.element.dequeue("tabs")};this.anchors.bind(j.event+".tabs",function(){var v=this,x=d(v).closest("li"),o=u.panels.filter(":not(.ui-tabs-hide)"),w=u.element.find(u._sanitizeSelector(v.hash));if((x.hasClass("ui-tabs-selected")&&!j.collapsible)||x.hasClass("ui-state-disabled")||x.hasClass("ui-state-processing")||u.panels.filter(":animated").length||u._trigger("select",null,u._ui(this,w[0]))===false){this.blur();return false}j.selected=u.anchors.index(this);u.abort();if(j.collapsible){if(x.hasClass("ui-tabs-selected")){j.selected=-1;if(j.cookie){u._cookie(j.selected,j.cookie)}u.element.queue("tabs",function(){r(v,o)}).dequeue("tabs");this.blur();return false}else{if(!o.length){if(j.cookie){u._cookie(j.selected,j.cookie)}u.element.queue("tabs",function(){q(v,w)});u.load(u.anchors.index(this));this.blur();return false}}}if(j.cookie){u._cookie(j.selected,j.cookie)}if(w.length){if(o.length){u.element.queue("tabs",function(){r(v,o)})}u.element.queue("tabs",function(){q(v,w)});u.load(u.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(d.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(g){if(typeof g=="string"){g=this.anchors.index(this.anchors.filter("[href$='"+g+"']"))}return g},destroy:function(){var g=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 h=d.data(this,"href.tabs");if(h){this.href=h}var j=d(this).unbind(".tabs");d.each(["href","load","cache"],function(k,l){j.removeData(l+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(d.data(this,"destroy.tabs")){d(this).remove()}else{d(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(g.cookie){this._cookie(null,g.cookie)}return this},add:function(k,j,h){if(h===f){h=this.anchors.length}var g=this,m=this.options,p=d(m.tabTemplate.replace(/#\{href\}/g,k).replace(/#\{label\}/g,j)),n=!k.indexOf("#")?k.replace("#",""):this._tabId(d("a",p)[0]);p.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var l=g.element.find("#"+n);if(!l.length){l=d(m.panelTemplate).attr("id",n).data("destroy.tabs",true)}l.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(h>=this.lis.length){p.appendTo(this.list);l.appendTo(this.list[0].parentNode)}else{p.insertBefore(this.lis[h]);l.insertBefore(this.panels[h])}m.disabled=d.map(m.disabled,function(q,o){return q>=h?++q:q});this._tabify();if(this.anchors.length==1){m.selected=0;p.addClass("ui-tabs-selected ui-state-active");l.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){g._trigger("show",null,g._ui(g.anchors[0],g.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[h],this.panels[h]));return this},remove:function(g){g=this._getIndex(g);var j=this.options,k=this.lis.eq(g).remove(),h=this.panels.eq(g).remove();if(k.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(g+(g+1<this.anchors.length?1:-1))}j.disabled=d.map(d.grep(j.disabled,function(m,l){return m!=g}),function(m,l){return m>=g?--m:m});this._tabify();this._trigger("remove",null,this._ui(k.find("a")[0],h[0]));return this},enable:function(g){g=this._getIndex(g);var h=this.options;if(d.inArray(g,h.disabled)==-1){return}this.lis.eq(g).removeClass("ui-state-disabled");h.disabled=d.grep(h.disabled,function(k,j){return k!=g});this._trigger("enable",null,this._ui(this.anchors[g],this.panels[g]));return this},disable:function(h){h=this._getIndex(h);var g=this,j=this.options;if(h!=j.selected){this.lis.eq(h).addClass("ui-state-disabled");j.disabled.push(h);j.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[h],this.panels[h]))}return this},select:function(g){g=this._getIndex(g);if(g==-1){if(this.options.collapsible&&this.options.selected!=-1){g=this.options.selected}else{return this}}this.anchors.eq(g).trigger(this.options.event+".tabs");return this},load:function(k){k=this._getIndex(k);var h=this,m=this.options,g=this.anchors.eq(k)[0],j=d.data(g,"load.tabs");this.abort();if(!j||this.element.queue("tabs").length!==0&&d.data(g,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(k).addClass("ui-state-processing");if(m.spinner){var l=d("span",g);l.data("label.tabs",l.html()).html(m.spinner)}this.xhr=d.ajax(d.extend({},m.ajaxOptions,{url:j,success:function(o,n){h.element.find(h._sanitizeSelector(g.hash)).html(o);h._cleanup();if(m.cache){d.data(g,"cache.tabs",true)}h._trigger("load",null,h._ui(h.anchors[k],h.panels[k]));try{m.ajaxOptions.success(o,n)}catch(p){}},error:function(p,n,o){h._cleanup();h._trigger("load",null,h._ui(h.anchors[k],h.panels[k]));try{m.ajaxOptions.error(p,n,k,g)}catch(o){}}}));h.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(h,g){this.anchors.eq(h).removeData("cache.tabs").data("load.tabs",g);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.23"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(j,l){var g=this,m=this.options;var h=g._rotate||(g._rotate=function(n){clearTimeout(g.rotation);g.rotation=setTimeout(function(){var o=m.selected;g.select(++o<g.anchors.length?o:0)},j);if(n){n.stopPropagation()}});var k=g._unrotate||(g._unrotate=!l?function(n){if(n.clientX){g.rotate(null)}}:function(n){h()});if(j){this.element.bind("tabsshow",h);this.anchors.bind(m.event+".tabs",k);h()}else{clearTimeout(g.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(m.event+".tabs",k);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(c){if(c===b){return this._value()}this._setOption("value",c);return this},_setOption:function(c,d){if(c==="value"){this.options.value=d;this._refreshValue();if(this._value()===this.options.max){this._trigger("complete")}}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number"){c=0}return Math.min(this.options.max,Math.max(this.min,c))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var d=this.value();var c=this._percentage();if(this.oldValue!==d){this.oldValue=d;this._trigger("change")}this.valueDiv.toggle(d>this.min).toggleClass("ui-corner-right",d===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",d)}});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(h,e){h.effects={};h.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(p,o){h.fx.step[o]=function(q){if(!q.colorInit){q.start=n(q.elem,o);q.end=l(q.end);q.colorInit=true}q.elem.style[o]="rgb("+Math.max(Math.min(parseInt((q.pos*(q.end[0]-q.start[0]))+q.start[0],10),255),0)+","+Math.max(Math.min(parseInt((q.pos*(q.end[1]-q.start[1]))+q.start[1],10),255),0)+","+Math.max(Math.min(parseInt((q.pos*(q.end[2]-q.start[2]))+q.start[2],10),255),0)+")"}});function l(p){var o;if(p&&p.constructor==Array&&p.length==3){return p}if(o=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(p)){return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10)]}if(o=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(p)){return[parseFloat(o[1])*2.55,parseFloat(o[2])*2.55,parseFloat(o[3])*2.55]}if(o=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(p)){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}if(o=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(p)){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}if(o=/rgba\(0, 0, 0, 0\)/.exec(p)){return a.transparent}return a[h.trim(p).toLowerCase()]}function n(q,o){var p;do{p=(h.curCSS||h.css)(q,o);if(p!=""&&p!="transparent"||h.nodeName(q,"body")){break}o="backgroundColor"}while(q=q.parentNode);return l(p)}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 f=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function g(){var r=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,s={},p,q;if(r&&r.length&&r[0]&&r[r[0]]){var o=r.length;while(o--){p=r[o];if(typeof r[p]=="string"){q=p.replace(/\-(\w)/g,function(t,u){return u.toUpperCase()});s[q]=r[p]}}}else{for(p in r){if(typeof r[p]==="string"){s[p]=r[p]}}}return s}function b(p){var o,q;for(o in p){q=p[o];if(q==null||h.isFunction(q)||o in c||(/scrollbar/).test(o)||(!(/color/i).test(o)&&isNaN(parseFloat(q)))){delete p[o]}}return p}function j(o,q){var r={_:0},p;for(p in q){if(o[p]!=q[p]){r[p]=q[p]}}return r}h.effects.animateClass=function(o,p,r,q){if(h.isFunction(r)){q=r;r=null}return this.queue(function(){var v=h(this),s=v.attr("style")||" ",w=b(g.call(this)),u,t=v.attr("class")||"";h.each(f,function(x,y){if(o[y]){v[y+"Class"](o[y])}});u=b(g.call(this));v.attr("class",t);v.animate(j(w,u),{queue:false,duration:p,easing:r,complete:function(){h.each(f,function(x,y){if(o[y]){v[y+"Class"](o[y])}});if(typeof v.attr("style")=="object"){v.attr("style").cssText="";v.attr("style").cssText=s}else{v.attr("style",s)}if(q){q.apply(this,arguments)}h.dequeue(this)}})})};h.fn.extend({_addClass:h.fn.addClass,addClass:function(p,o,r,q){return o?h.effects.animateClass.apply(this,[{add:p},o,r,q]):this._addClass(p)},_removeClass:h.fn.removeClass,removeClass:function(p,o,r,q){return o?h.effects.animateClass.apply(this,[{remove:p},o,r,q]):this._removeClass(p)},_toggleClass:h.fn.toggleClass,toggleClass:function(q,p,o,s,r){if(typeof p=="boolean"||p===e){if(!o){return this._toggleClass(q,p)}else{return h.effects.animateClass.apply(this,[(p?{add:q}:{remove:q}),o,s,r])}}else{return h.effects.animateClass.apply(this,[{toggle:q},p,o,s])}},switchClass:function(o,q,p,s,r){return h.effects.animateClass.apply(this,[{add:q,remove:o},p,s,r])}});h.extend(h.effects,{version:"1.8.23",save:function(p,q){for(var o=0;o<q.length;o++){if(q[o]!==null){p.data("ec.storage."+q[o],p[0].style[q[o]])}}},restore:function(p,q){for(var o=0;o<q.length;o++){if(q[o]!==null){p.css(q[o],p.data("ec.storage."+q[o]))}}},setMode:function(o,p){if(p=="toggle"){p=o.is(":hidden")?"show":"hide"}return p},getBaseline:function(p,q){var r,o;switch(p[0]){case"top":r=0;break;case"middle":r=0.5;break;case"bottom":r=1;break;default:r=p[0]/q.height}switch(p[1]){case"left":o=0;break;case"center":o=0.5;break;case"right":o=1;break;default:o=p[1]/q.width}return{x:o,y:r}},createWrapper:function(o){if(o.parent().is(".ui-effects-wrapper")){return o.parent()}var p={width:o.outerWidth(true),height:o.outerHeight(true),"float":o.css("float")},s=h("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),r=document.activeElement;try{r.id}catch(q){r=document.body}o.wrap(s);if(o[0]===r||h.contains(o[0],r)){h(r).focus()}s=o.parent();if(o.css("position")=="static"){s.css({position:"relative"});o.css({position:"relative"})}else{h.extend(p,{position:o.css("position"),zIndex:o.css("z-index")});h.each(["top","left","bottom","right"],function(t,u){p[u]=o.css(u);if(isNaN(parseInt(p[u],10))){p[u]="auto"}});o.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return s.css(p).show()},removeWrapper:function(o){var p,q=document.activeElement;if(o.parent().is(".ui-effects-wrapper")){p=o.parent().replaceWith(o);if(o[0]===q||h.contains(o[0],q)){h(q).focus()}return p}return o},setTransition:function(p,r,o,q){q=q||{};h.each(r,function(t,s){var u=p.cssUnit(s);if(u[0]>0){q[s]=u[0]*o+u[1]}});return q}});function d(p,o,q,r){if(typeof p=="object"){r=o;q=null;o=p;p=o.effect}if(h.isFunction(o)){r=o;q=null;o={}}if(typeof o=="number"||h.fx.speeds[o]){r=q;q=o;o={}}if(h.isFunction(q)){r=q;q=null}o=o||{};q=q||o.duration;q=h.fx.off?0:typeof q=="number"?q:q in h.fx.speeds?h.fx.speeds[q]:h.fx.speeds._default;r=r||o.complete;return[p,o,q,r]}function m(o){if(!o||typeof o==="number"||h.fx.speeds[o]){return true}if(typeof o==="string"&&!h.effects[o]){return true}return false}h.fn.extend({effect:function(r,q,t,v){var p=d.apply(this,arguments),s={options:p[1],duration:p[2],callback:p[3]},u=s.options.mode,o=h.effects[r];if(h.fx.off||!o){if(u){return this[u](s.duration,s.callback)}else{return this.each(function(){if(s.callback){s.callback.call(this)}})}}return o.call(this,s)},_show:h.fn.show,show:function(p){if(m(p)){return this._show.apply(this,arguments)}else{var o=d.apply(this,arguments);o[1].mode="show";return this.effect.apply(this,o)}},_hide:h.fn.hide,hide:function(p){if(m(p)){return this._hide.apply(this,arguments)}else{var o=d.apply(this,arguments);o[1].mode="hide";return this.effect.apply(this,o)}},__toggle:h.fn.toggle,toggle:function(p){if(m(p)||typeof p==="boolean"||h.isFunction(p)){return this.__toggle.apply(this,arguments)}else{var o=d.apply(this,arguments);o[1].mode="toggle";return this.effect.apply(this,o)}},cssUnit:function(o){var p=this.css(o),q=[];h.each(["em","px","%","pt"],function(r,s){if(p.indexOf(s)>0){q=[parseFloat(p),s]}});return q}});var k={};h.each(["Quad","Cubic","Quart","Quint","Expo"],function(p,o){k[o]=function(q){return Math.pow(q,p+2)}});h.extend(k,{Sine:function(o){return 1-Math.cos(o*Math.PI/2)},Circ:function(o){return 1-Math.sqrt(1-o*o)},Elastic:function(o){return o===0||o===1?o:-Math.pow(2,8*(o-1))*Math.sin(((o-1)*80-7.5)*Math.PI/15)},Back:function(o){return o*o*(3*o-2)},Bounce:function(r){var o,q=4;while(r<((o=Math.pow(2,--q))-1)/11){}return 1/Math.pow(4,3-q)-7.5625*Math.pow((o*3-2)/22-r,2)}});h.each(k,function(p,o){h.easing["easeIn"+p]=o;h.easing["easeOut"+p]=function(q){return 1-o(1-q)};h.easing["easeInOut"+p]=function(q){return q<0.5?o(q*2)/2:o(q*-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(c){return this.queue(function(){var e=a(this),d=["position","top","bottom","left","right"];var j=a.effects.setMode(e,c.options.mode||"hide");var h=c.options.direction||"vertical";a.effects.save(e,d);e.show();var l=a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="vertical")?"height":"width";var k=(h=="vertical")?l.height():l.width();if(j=="show"){l.css(f,0)}var g={};g[f]=j=="show"?k:0;l.animate(g,c.duration,c.options.easing,function(){if(j=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(c.callback){c.callback.apply(e[0],arguments)}e.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(c){return this.queue(function(){var f=a(this),m=["position","top","bottom","left","right"];var l=a.effects.setMode(f,c.options.mode||"effect");var o=c.options.direction||"up";var d=c.options.distance||20;var e=c.options.times||5;var h=c.duration||250;if(/show|hide/.test(l)){m.push("opacity")}a.effects.save(f,m);f.show();a.effects.createWrapper(f);var g=(o=="up"||o=="down")?"top":"left";var q=(o=="up"||o=="left")?"pos":"neg";var d=c.options.distance||(g=="top"?f.outerHeight(true)/3:f.outerWidth(true)/3);if(l=="show"){f.css("opacity",0).css(g,q=="pos"?-d:d)}if(l=="hide"){d=d/(e*2)}if(l!="hide"){e--}if(l=="show"){var j={opacity:1};j[g]=(q=="pos"?"+=":"-=")+d;f.animate(j,h/2,c.options.easing);d=d/2;e--}for(var k=0;k<e;k++){var p={},n={};p[g]=(q=="pos"?"-=":"+=")+d;n[g]=(q=="pos"?"+=":"-=")+d;f.animate(p,h/2,c.options.easing).animate(n,h/2,c.options.easing);d=(l=="hide")?d*2:d/2}if(l=="hide"){var j={opacity:0};j[g]=(q=="pos"?"-=":"+=")+d;f.animate(j,h/2,c.options.easing,function(){f.hide();a.effects.restore(f,m);a.effects.removeWrapper(f);if(c.callback){c.callback.apply(this,arguments)}})}else{var p={},n={};p[g]=(q=="pos"?"-=":"+=")+d;n[g]=(q=="pos"?"+=":"-=")+d;f.animate(p,h/2,c.options.easing).animate(n,h/2,c.options.easing,function(){a.effects.restore(f,m);a.effects.removeWrapper(f);if(c.callback){c.callback.apply(this,arguments)}})}f.queue("fx",function(){f.dequeue()});f.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(c){return this.queue(function(){var g=a(this),l=["position","top","bottom","left","right","height","width"];var k=a.effects.setMode(g,c.options.mode||"hide");var m=c.options.direction||"vertical";a.effects.save(g,l);g.show();var d=a.effects.createWrapper(g).css({overflow:"hidden"});var f=g[0].tagName=="IMG"?d:g;var h={size:(m=="vertical")?"height":"width",position:(m=="vertical")?"top":"left"};var e=(m=="vertical")?f.height():f.width();if(k=="show"){f.css(h.size,0);f.css(h.position,e/2)}var j={};j[h.size]=k=="show"?e:0;j[h.position]=k=="show"?0:e/2;f.animate(j,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){if(k=="hide"){g.hide()}a.effects.restore(g,l);a.effects.removeWrapper(g);if(c.callback){c.callback.apply(g[0],arguments)}g.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(c){return this.queue(function(){var f=a(this),e=["position","top","bottom","left","right","opacity"];var k=a.effects.setMode(f,c.options.mode||"hide");var j=c.options.direction||"left";a.effects.save(f,e);f.show();a.effects.createWrapper(f);var g=(j=="up"||j=="down")?"top":"left";var d=(j=="up"||j=="left")?"pos":"neg";var l=c.options.distance||(g=="top"?f.outerHeight(true)/2:f.outerWidth(true)/2);if(k=="show"){f.css("opacity",0).css(g,d=="pos"?-l:l)}var h={opacity:k=="show"?1:0};h[g]=(k=="show"?(d=="pos"?"+=":"-="):(d=="pos"?"-=":"+="))+l;f.animate(h,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){if(k=="hide"){f.hide()}a.effects.restore(f,e);a.effects.removeWrapper(f);if(c.callback){c.callback.apply(this,arguments)}f.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(c){return this.queue(function(){var l=c.options.pieces?Math.round(Math.sqrt(c.options.pieces)):3;var f=c.options.pieces?Math.round(Math.sqrt(c.options.pieces)):3;c.options.mode=c.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):c.options.mode;var k=a(this).show().css("visibility","hidden");var m=k.offset();m.top-=parseInt(k.css("marginTop"),10)||0;m.left-=parseInt(k.css("marginLeft"),10)||0;var h=k.outerWidth(true);var d=k.outerHeight(true);for(var g=0;g<l;g++){for(var e=0;e<f;e++){k.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-e*(h/f),top:-g*(d/l)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/f,height:d/l,left:m.left+e*(h/f)+(c.options.mode=="show"?(e-Math.floor(f/2))*(h/f):0),top:m.top+g*(d/l)+(c.options.mode=="show"?(g-Math.floor(l/2))*(d/l):0),opacity:c.options.mode=="show"?0:1}).animate({left:m.left+e*(h/f)+(c.options.mode=="show"?0:(e-Math.floor(f/2))*(h/f)),top:m.top+g*(d/l)+(c.options.mode=="show"?0:(g-Math.floor(l/2))*(d/l)),opacity:c.options.mode=="show"?1:0},c.duration||500)}}setTimeout(function(){c.options.mode=="show"?k.css({visibility:"visible"}):k.css({visibility:"visible"}).hide();if(c.callback){c.callback.apply(k[0])}k.dequeue();a("div.ui-effects-explode").remove()},c.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(c){return this.queue(function(){var d=a(this),e=a.effects.setMode(d,c.options.mode||"hide");d.animate({opacity:e},{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){(c.callback&&c.callback.apply(this,arguments));d.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(c){return this.queue(function(){var f=a(this),m=["position","top","bottom","left","right"];var j=a.effects.setMode(f,c.options.mode||"hide");var q=c.options.size||15;var p=!(!c.options.horizFirst);var h=c.duration?c.duration/2:a.fx.speeds._default/2;a.effects.save(f,m);f.show();var e=a.effects.createWrapper(f).css({overflow:"hidden"});var k=((j=="show")!=p);var g=k?["width","height"]:["height","width"];var d=k?[e.width(),e.height()]:[e.height(),e.width()];var l=/([0-9]+)%/.exec(q);if(l){q=parseInt(l[1],10)/100*d[j=="hide"?0:1]}if(j=="show"){e.css(p?{height:0,width:q}:{height:q,width:0})}var o={},n={};o[g[0]]=j=="show"?d[0]:q;n[g[1]]=j=="show"?d[1]:0;e.animate(o,h,c.options.easing).animate(n,h,c.options.easing,function(){if(j=="hide"){f.hide()}a.effects.restore(f,m);a.effects.removeWrapper(f);if(c.callback){c.callback.apply(f[0],arguments)}f.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(c){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"],g=a.effects.setMode(e,c.options.mode||"show"),f={backgroundColor:e.css("backgroundColor")};if(g=="hide"){f.opacity=0}a.effects.save(e,d);e.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){(g=="hide"&&e.hide());a.effects.restore(e,d);(g=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"));(c.callback&&c.callback.apply(this,arguments));e.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(c){return this.queue(function(){var g=a(this),k=a.effects.setMode(g,c.options.mode||"show"),j=((c.options.times||5)*2)-1,h=c.duration?c.duration/2:a.fx.speeds._default/2,d=g.is(":visible"),e=0;if(!d){g.css("opacity",0).show();e=1}if((k=="hide"&&d)||(k=="show"&&!d)){j--}for(var f=0;f<j;f++){g.animate({opacity:e},h,c.options.easing);e=(e+1)%2}g.animate({opacity:e},h,c.options.easing,function(){if(e==0){g.hide()}(c.callback&&c.callback.apply(this,arguments))});g.queue("fx",function(){g.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(c){return this.queue(function(){var g=a(this),h=a.effects.setMode(g,c.options.mode||"hide"),f=parseInt(c.options.percent,10)||150,e=f/100,d={height:g.height(),width:g.width()};a.extend(c.options,{fade:true,mode:h,percent:h=="hide"?f:100,from:h=="hide"?d:{height:d.height*e,width:d.width*e}});g.effect("scale",c.options,c.duration,c.callback);g.dequeue()})};a.effects.scale=function(c){return this.queue(function(){var h=a(this);var e=a.extend(true,{},c.options);var l=a.effects.setMode(h,c.options.mode||"effect");var j=parseInt(c.options.percent,10)||(parseInt(c.options.percent,10)==0?0:(l=="hide"?0:100));var k=c.options.direction||"both";var d=c.options.origin;if(l!="effect"){e.origin=d||["middle","center"];e.restore=true}var g={height:h.height(),width:h.width()};h.from=c.options.from||(l=="show"?{height:0,width:0}:g);var f={y:k!="horizontal"?(j/100):1,x:k!="vertical"?(j/100):1};h.to={height:g.height*f.y,width:g.width*f.x};if(c.options.fade){if(l=="show"){h.from.opacity=0;h.to.opacity=1}if(l=="hide"){h.from.opacity=1;h.to.opacity=0}}e.from=h.from;e.to=h.to;e.mode=l;h.effect("size",e,c.duration,c.callback);h.dequeue()})};a.effects.size=function(c){return this.queue(function(){var d=a(this),p=["position","top","bottom","left","right","width","height","overflow","opacity"];var o=["position","top","bottom","left","right","overflow","opacity"];var l=["width","height","overflow"];var r=["fontSize"];var m=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var g=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var h=a.effects.setMode(d,c.options.mode||"effect");var k=c.options.restore||false;var f=c.options.scale||"both";var q=c.options.origin;var e={height:d.height(),width:d.width()};d.from=c.options.from||e;d.to=c.options.to||e;if(q){var j=a.effects.getBaseline(q,e);d.from.top=(e.height-d.from.height)*j.y;d.from.left=(e.width-d.from.width)*j.x;d.to.top=(e.height-d.to.height)*j.y;d.to.left=(e.width-d.to.width)*j.x}var n={from:{y:d.from.height/e.height,x:d.from.width/e.width},to:{y:d.to.height/e.height,x:d.to.width/e.width}};if(f=="box"||f=="both"){if(n.from.y!=n.to.y){p=p.concat(m);d.from=a.effects.setTransition(d,m,n.from.y,d.from);d.to=a.effects.setTransition(d,m,n.to.y,d.to)}if(n.from.x!=n.to.x){p=p.concat(g);d.from=a.effects.setTransition(d,g,n.from.x,d.from);d.to=a.effects.setTransition(d,g,n.to.x,d.to)}}if(f=="content"||f=="both"){if(n.from.y!=n.to.y){p=p.concat(r);d.from=a.effects.setTransition(d,r,n.from.y,d.from);d.to=a.effects.setTransition(d,r,n.to.y,d.to)}}a.effects.save(d,k?p:o);d.show();a.effects.createWrapper(d);d.css("overflow","hidden").css(d.from);if(f=="content"||f=="both"){m=m.concat(["marginTop","marginBottom"]).concat(r);g=g.concat(["marginLeft","marginRight"]);l=p.concat(m).concat(g);d.find("*[width]").each(function(){var t=a(this);if(k){a.effects.save(t,l)}var s={height:t.height(),width:t.width()};t.from={height:s.height*n.from.y,width:s.width*n.from.x};t.to={height:s.height*n.to.y,width:s.width*n.to.x};if(n.from.y!=n.to.y){t.from=a.effects.setTransition(t,m,n.from.y,t.from);t.to=a.effects.setTransition(t,m,n.to.y,t.to)}if(n.from.x!=n.to.x){t.from=a.effects.setTransition(t,g,n.from.x,t.from);t.to=a.effects.setTransition(t,g,n.to.x,t.to)}t.css(t.from);t.animate(t.to,c.duration,c.options.easing,function(){if(k){a.effects.restore(t,l)}})})}d.animate(d.to,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){if(d.to.opacity===0){d.css("opacity",d.from.opacity)}if(h=="hide"){d.hide()}a.effects.restore(d,k?p:o);a.effects.removeWrapper(d);if(c.callback){c.callback.apply(this,arguments)}d.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(c){return this.queue(function(){var f=a(this),m=["position","top","bottom","left","right"];var l=a.effects.setMode(f,c.options.mode||"effect");var o=c.options.direction||"left";var d=c.options.distance||20;var e=c.options.times||3;var h=c.duration||c.options.duration||140;a.effects.save(f,m);f.show();a.effects.createWrapper(f);var g=(o=="up"||o=="down")?"top":"left";var q=(o=="up"||o=="left")?"pos":"neg";var j={},p={},n={};j[g]=(q=="pos"?"-=":"+=")+d;p[g]=(q=="pos"?"+=":"-=")+d*2;n[g]=(q=="pos"?"-=":"+=")+d*2;f.animate(j,h,c.options.easing);for(var k=1;k<e;k++){f.animate(p,h,c.options.easing).animate(n,h,c.options.easing)}f.animate(p,h,c.options.easing).animate(j,h/2,c.options.easing,function(){a.effects.restore(f,m);a.effects.removeWrapper(f);if(c.callback){c.callback.apply(this,arguments)}});f.queue("fx",function(){f.dequeue()});f.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(c){return this.queue(function(){var f=a(this),e=["position","top","bottom","left","right"];var k=a.effects.setMode(f,c.options.mode||"show");var j=c.options.direction||"left";a.effects.save(f,e);f.show();a.effects.createWrapper(f).css({overflow:"hidden"});var g=(j=="up"||j=="down")?"top":"left";var d=(j=="up"||j=="left")?"pos":"neg";var l=c.options.distance||(g=="top"?f.outerHeight(true):f.outerWidth(true));if(k=="show"){f.css(g,d=="pos"?(isNaN(l)?"-"+l:-l):l)}var h={};h[g]=(k=="show"?(d=="pos"?"+=":"-="):(d=="pos"?"-=":"+="))+l;f.animate(h,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){if(k=="hide"){f.hide()}a.effects.restore(f,e);a.effects.removeWrapper(f);if(c.callback){c.callback.apply(this,arguments)}f.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(c){return this.queue(function(){var g=a(this),j=a(c.options.to),f=j.offset(),h={top:f.top,left:f.left,height:j.innerHeight(),width:j.innerWidth()},e=g.offset(),d=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(c.options.className).css({top:e.top,left:e.left,height:g.innerHeight(),width:g.innerWidth(),position:"absolute"}).animate(h,c.duration,c.options.easing,function(){d.remove();(c.callback&&c.callback.apply(g[0],arguments));g.dequeue()})})}})(jQuery);(function(a){a.fn.multiDatesPicker=function(b){var k=arguments;var l=this;var h=new Date();var d=new Date(0);var j={};function c(n){return n=="avoided"?"avoidedDates":"selectedDates"}function f(n,o){this.multiDatesPicker[c(o)].splice(n,1)}function e(n,o){if(g.gotDate.call(this,n,o)===false){var p=c(o);this.multiDatesPicker[p].push(m(n,"object"));this.multiDatesPicker[p].sort(g.compareDates)}}function m(n,o){return g.dateConvert(n,o)}var g={init:function(n){$this=a(this);this.multiDatesPicker.changed=false;if(n){this.multiDatesPicker.originalBeforeShow=n.beforeShow;this.multiDatesPicker.originalOnSelect=n.onSelect;this.multiDatesPicker.originalBeforeShowDay=n.beforeShowDay;this.multiDatesPicker.originalOnClose=n.onClose;this.multiDatesPicker.minDate=a.datepicker._determineDate(this,n.minDate,d);this.multiDatesPicker.firstAvailableDay=g.compareDates(this.multiDatesPicker.minDate,d);if(n.addDates){g.addDates.call(this,n.addDates)}if(n.addAvoidedDates){g.addDates.call(this,n.addAvoidedDates,"avoided")}if(n.mode){g.setMode.call(this,n.mode)}}$this.datepicker(n);j={beforeShow:function(o,p){this.multiDatesPicker.changed=false;if(this.multiDatesPicker.originalBeforeShow){this.multiDatesPicker.originalBeforeShow.call(this,o,p)}},onSelect:function(w,t){this.multiDatesPicker.changed=true;if(w){a(this).multiDatesPicker("toggleDate",w);var q=g.dateConvert(w,"object")}var v=a(this).multiDatesPicker("getDates");var u=this.multiDatesPicker.mode.options;if(v.length>0){if(this.multiDatesPicker.mode.modeName=="normal"){if(u.pickableRange){var o=g.compareDates(this.multiDatesPicker.minDate,h);var y=o+u.pickableRangeDelay+pickableRange;var s=g.compareDates(v[0],o);var p=s+u.pickableRange;if(p>y){o=y-u.pickableRange+1}else{y=p;o=s}var x;do{x=0;for(var r in this.multiDatesPicker.avoidedDates){if(g.compareDates(this.multiDatesPicker.avoidedDates[r],o)>=0&&g.compareDates(this.multiDatesPicker.avoidedDates[r],y)<=0){x++}}y=y+x}while(x!=0);a(this).datepicker("option","minDate",o);a(this).datepicker("option","maxDate",y)}}}if(this.tagName=="INPUT"){a(this).val(a(this).multiDatesPicker("getDates","string"))}if(this.multiDatesPicker.originalOnSelect&&w){this.multiDatesPicker.originalOnSelect.call(this,w,t)}},beforeShowDay:function(p){var r=a(this).multiDatesPicker("gotDate",p)!==false;var t=r?"ui-state-highlight":"";var q=a(this).multiDatesPicker("gotDate",p,"avoided")!==false;var o=this.multiDatesPicker.mode.options.maxPicks==a(this).multiDatesPicker("getDates").length;var s=(q||(o&&!t))?false:true;if(this.multiDatesPicker.originalBeforeShowDay){this.multiDatesPicker.originalBeforeShowDay.call(this,p)}return[s,t]},onClose:function(p,o){if(this.tagName=="INPUT"&&this.multiDatesPicker.changed){a(o.dpDiv[0]).stop(false,true);setTimeout('$("#'+o.id+'").datepicker("show")',50)}if(this.multiDatesPicker.originalOnClose){this.multiDatesPicker.originalOnClose.call(this,p,o)}}};$this.datepicker("option",j)},compareDates:function(r,p){var o=[r,p];var s=new Array();var n=1000*60*60*24;for(i in o){s.push(m(o[i],"object"))}var q=(s[0].getTime()-s[1].getTime())/n;return(-1<q&&q<1)?0:(q<0)?Math.ceil(q*-1)*-1:Math.ceil(q)},sumDays:function(n,p){var o=typeof n;obj_date=m(n,"object");obj_date.setDate(obj_date.getDate()+p);return m(obj_date,o)},dateConvert:function(o,n){if(typeof o=="undefined"){o=new Date(0)}if(n!="string"&&n!="object"){a.error('Date format "'+n+'" not supported on jQuery.multiDatesPicker')}if(typeof o==n){return o}var p=typeof o+"->"+n;switch(p){case"object->string":return a.datepicker.formatDate(a.datepicker._defaults.dateFormat,o);case"string->object":return a.datepicker.parseDate(a.datepicker._defaults.dateFormat,o);default:a.error('Conversion "'+p+'" not allowed on jQuery.multiDatesPicker')}},gotDate:function(n,p){for(var o=0;o<this.multiDatesPicker[c(p)].length;o++){if(g.compareDates(this.multiDatesPicker[c(p)][o],n)==0){return o}}return false},getDates:function(o,n){switch(o){case"object":return this.multiDatesPicker[c(n)];default:var p=new Array();for(i in this.multiDatesPicker[c(n)]){p.push(m(this.multiDatesPicker[c(n)][i],"string"))}return p}},addDates:function(o,n){switch(typeof o){case"object":case"array":if(o.length){for(i in o){e.call(this,o[i],n)}break}case"string":e.call(this,o,n);break;default:a.error('Date format "'+typeof o+'" not allowed on jQuery.multiDatesPicker')}a(this).datepicker("refresh")},removeDates:function(n,o){if(typeof index=="array"){for(i in n){f.call(this,i,o)}}else{f.call(this,n,o)}a(this).datepicker("refresh")},resetDates:function(n){this.multiDatesPicker[c(n)]=[];a(this).datepicker("refresh")},toggleDate:function(p,s){var o=g.gotDate.call(this,p);var t=this.multiDatesPicker.mode;switch(t.modeName){case"daysRange":this.multiDatesPicker.selectedDates=[];var n=t.options.autoselectRange[1];var r=t.options.autoselectRange[0];if(n<r){n=t.options.autoselectRange[0];r=t.options.autoselectRange[1]}for(var q=r;q<n;q++){g.addDates.call(this,g.sumDays(p,q))}break;default:if(o===false){g.addDates.call(this,p)}else{g.removeDates.call(this,o)}break}},setMode:function(o){this.multiDatesPicker.mode.modeName=o.modeName;switch(o.modeName){case"normal":for(option in o.options){switch(option){case"maxPicks":case"minPicks":case"pickableRange":case"pickableRangeDelay":case"adjustRangeToAvoided":this.multiDatesPicker.mode.options[option]=o.options[option];break;default:a.error("Option "+option+" does not exist for setMode on jQuery.multiDatesPicker")}}break;case"daysRange":case"weeksRange":var n=1;for(option in o.options){switch(option){case"autoselectRange":n--;case"pickableRange":case"pickableRangeDelay":case"adjustRangeToAvoided":this.multiDatesPicker.mode.options[option]=o.options[option];break;default:a.error("Option "+option+" does not exist for setMode on jQuery.multiDatesPicker")}}if(n>0){a.error("Some mandatory options not specified!")}break}if(o.options.pickableRange){a(this).datepicker("option","maxDate",o.options.pickableRange+(o.options.pickableRangeDelay||0));a(this).datepicker("option","minDate",this.multiDatesPicker.minDate)}if(j.onSelect){j.onSelect()}a(this).datepicker("refresh")}};this.each(function(){if(!this.multiDatesPicker){this.multiDatesPicker={selectedDates:[],avoidedDates:[],mode:{modeName:"normal",options:{adjustRangeToAvoided:true}}}}if(g[b]){var n=g[b].apply(this,Array.prototype.slice.call(k,1));switch(b){case"getDates":case"gotDate":case"sumDays":case"compareDates":case"dateConvert":l=n}return n}else{if(typeof b==="object"||!b){return g.init.apply(this,k)}else{a.error("Method "+b+" does not exist on jQuery.multiDatesPicker")}}});return l}})(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,c=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(d){var e=a.ui.keyCode;switch(d.keyCode){case e.PAGE_UP:b._move("previousPage",d);break;case e.PAGE_DOWN:b._move("nextPage",d);break;case e.UP:b._move("previous",d);d.preventDefault();break;case e.DOWN:b._move("next",d);d.preventDefault();break;case e.ENTER:if(b.menu.active){d.preventDefault()}case e.TAB:if(!b.menu.active){return}b.menu.select();break;case e.ESCAPE:b.element.val(b.term);b.close(d);break;case e.SHIFT:case e.CONTROL:case 18:break;default:clearTimeout(b.searching);b.searching=setTimeout(function(){b.search(null,d)},b.options.delay);break}}).bind("focus.autocomplete",function(){b.previous=b.element.val()}).bind("blur.autocomplete",function(d){clearTimeout(b.searching);b.closing=setTimeout(function(){b.close(d)},150)});this._initSource();this.response=function(){return b._response.apply(b,arguments)};this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo("body",c).menu({focus:function(e,f){var d=f.item.data("item.autocomplete");if(false!==b._trigger("focus",null,{item:d})){if(/^key/.test(e.originalEvent.type)){b.element.val(d.value)}}},selected:function(e,f){var d=f.item.data("item.autocomplete");if(false!==b._trigger("select",e,{item:d})){b.element.val(d.value)}b.close(e);b.previous=b.element.val();if(b.element[0]!==c.activeElement){b.element.focus()}},blur:function(d,e){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 c,b;if(a.isArray(this.options.source)){c=this.options.source;this.source=function(e,d){var f=new RegExp(a.ui.autocomplete.escapeRegex(e.term),"i");d(a.grep(c,function(g){return f.test(g.label||g.value||g)}))}}else{if(typeof this.options.source==="string"){b=this.options.source;this.source=function(e,d){a.getJSON(b,e,d)}}else{this.source=this.options.source}}},search:function(c,b){c=c!=null?c:this.element.val();if(c.length<this.options.minLength){return this.close(b)}clearTimeout(this.closing);if(this._trigger("search")===false){return}return this._search(c)},_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(c){if(typeof c==="string"){return{label:c,value:c}}return a.extend({label:c.label||c.value,value:c.value||c.label},c)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1),d,e;this._renderMenu(c,b);this.menu.deactivate();this.menu.refresh();this.menu.element.show().position({my:"left top",at:"left bottom",of:this.element,collision:"none"});d=c.width("").width();e=this.element.width();c.width(Math.max(d,e))},_renderMenu:function(d,c){var b=this;a.each(c,function(e,f){b._renderItem(d,f)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append("<a>"+c.label+"</a>").appendTo(b)},_move:function(c,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate();return}this.menu[c](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,typeAhead:500,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,f=this.options;var e=this.element.attr("id")||"ui-selectmenu-"+Math.random().toString(16).slice(2,10);this.ids=[e+"-button",e+"-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(f.wrapperElement);var d=this.element.attr("tabindex");if(d){this.newelement.attr("tabindex",d)}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(g){b._toggle(g,true);if(f.style=="popup"){b._safemouseup=false;setTimeout(function(){b._safemouseup=true},300)}return false}).bind("click.selectmenu",function(){return false}).bind("keydown.selectmenu",function(h){var g=false;switch(h.keyCode){case a.ui.keyCode.ENTER:g=true;break;case a.ui.keyCode.SPACE:b._toggle(h);break;case a.ui.keyCode.UP:if(h.altKey){b.open(h)}else{b._moveSelection(-1)}break;case a.ui.keyCode.DOWN:if(h.altKey){b.open(h)}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:g=true;break;case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.HOME:b.index(0);break;case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.END:b.index(b._optionLis.length);break;default:g=true}return g}).bind("keypress.selectmenu",function(g){if(g.which>0){b._typeAhead(g.which,"mouseup")}return true}).bind("mouseover.selectmenu",function(){if(!f.disabled){a(this).addClass("ui-state-hover")}}).bind("mouseout.selectmenu",function(){if(!f.disabled){a(this).removeClass("ui-state-hover")}}).bind("focus.selectmenu",function(){if(!f.disabled){a(this).addClass("ui-state-focus")}}).bind("blur.selectmenu",function(){if(!f.disabled){a(this).removeClass("ui-state-focus")}});a(document).bind("mousedown.selectmenu",function(g){b.close(g)});this.element.bind("click.selectmenu",function(){b._refreshValue()}).bind("focus.selectmenu",function(){if(this.newelement){this.newelement[0].focus()}});var c=this.element.width();this.newelement.width((f.width)?f.width:c);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(f.wrapperElement);this.list.bind("keydown.selectmenu",function(h){var g=false;switch(h.keyCode){case a.ui.keyCode.UP:if(h.altKey){b.close(h,true)}else{b._moveFocus(-1)}break;case a.ui.keyCode.DOWN:if(h.altKey){b.close(h,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(h,true);a(h.target).parents("li:eq(0)").trigger("mouseup");break;case a.ui.keyCode.TAB:g=true;b.close(h,true);break;case a.ui.keyCode.ESCAPE:b.close(h,true);break;default:g=true;break}return g}).bind("keypress.selectmenu",function(g){if(g.which>0){b._typeAhead(g.which,"focus")}return true});a(window).bind("resize.selectmenu",function(){a.proxy(b._refreshPosition,this)})},_init:function(){var n=this,e=this.options;var b=[];this.element.find("option").each(function(){b.push({value:a(this).attr("value"),text:n._formatText(a(this).text()),selected:a(this).attr("selected"),classes:a(this).attr("class"),parentOptGroup:a(this).parent("optgroup").attr("label"),bgImage:e.bgImage.call(a(this))})});var l=(n.options.style=="popup")?" ui-state-active":"";this.list.html("");for(var h=0;h<b.length;h++){var d=a('<li role="presentation"><a href="#" tabindex="-1" role="option" aria-selected="false">'+b[h].text+"</a></li>").data("index",h).addClass(b[h].classes).data("optionClasses",b[h].classes||"").bind("mouseup.selectmenu",function(j){if(n._safemouseup){var o=a(this).data("index")!=n._selectedIndex();n.index(a(this).data("index"));n.select(j);if(o){n.change(j)}n.close(j,true)}return false}).bind("click.selectmenu",function(){return false}).bind("mouseover.selectmenu focus.selectmenu",function(){n._selectedOptionLi().addClass(l);n._focusedOptionLi().removeClass(n.widgetBaseClass+"-item-focus ui-state-hover");a(this).removeClass("ui-state-active").addClass(n.widgetBaseClass+"-item-focus ui-state-hover")}).bind("mouseout.selectmenu blur.selectmenu",function(){a(this).removeClass(n.widgetBaseClass+"-item-focus ui-state-hover")});d.find("a").bind("focus.selectmenu",function(){a(this).parent().mouseover()}).bind("blur.selectmenu",function(){a(this).parent().mouseout()});if(b[h].parentOptGroup){var k=n.widgetBaseClass+"-group-"+b[h].parentOptGroup.replace(/[^a-zA-Z0-9]/g,"");if(this.list.find("li."+k).size()){this.list.find("li."+k+":last ul").append(d)}else{a('<li role="presentation" class="'+n.widgetBaseClass+"-group "+k+'"><span class="'+n.widgetBaseClass+'-group-label">'+b[h].parentOptGroup+"</span><ul></ul></li>").appendTo(this.list).find("ul").append(d)}}else{d.appendTo(this.list)}this.list.bind("mousedown.selectmenu mouseup.selectmenu",function(){return false});if(e.icons){for(var g in e.icons){if(d.is(e.icons[g].find)){d.data("optionClasses",b[h].classes+" "+n.widgetBaseClass+"-hasIcon").addClass(n.widgetBaseClass+"-hasIcon");var m=e.icons[g].icon||"";d.find("a:eq(0)").prepend('<span class="'+n.widgetBaseClass+"-item-icon ui-icon "+m+'"></span>');if(b[h].bgImage){d.find("span").css("background-image",b[h].bgImage)}}}}}var c=(e.style=="dropdown")?true:false;this.newelement.toggleClass(n.widgetBaseClass+"-dropdown",c).toggleClass(n.widgetBaseClass+"-popup",!c);this.list.toggleClass(n.widgetBaseClass+"-menu-dropdown ui-corner-bottom",c).toggleClass(n.widgetBaseClass+"-menu-popup ui-corner-all",!c).find("li:first").toggleClass("ui-corner-top",!c).end().find("li:last").addClass("ui-corner-bottom");this.selectmenuIcon.toggleClass("ui-icon-triangle-1-s",c).toggleClass("ui-icon-triangle-2-n-s",!c);if(e.transferClasses){var p=this.element.attr("class")||"";this.newelement.add(this.list).addClass(p)}var f=this.element.width();if(e.style=="dropdown"){this.list.width((e.menuWidth)?e.menuWidth:((e.width)?e.width:f))}else{this.list.width((e.menuWidth)?e.menuWidth:((e.width)?e.width-e.handleWidth:f-e.handleWidth))}if(e.maxHeight){if(e.maxHeight<this.list.height()){this.list.height(e.maxHeight)}}else{if(!e.format&&(a(window).height()/3)<this.list.height()){e.maxHeight=a(window).height()/3;this.list.height(e.maxHeight)}}this._optionLis=this.list.find("li:not(."+n.widgetBaseClass+"-group)");if(this.element.attr("disabled")==true){this.disable()}this.index(this._selectedIndex());window.setTimeout(function(){n._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(e,f){var l=this,k=String.fromCharCode(e).toLowerCase(),d=null,j=null;if(l._typeAhead_timer){window.clearTimeout(l._typeAhead_timer);l._typeAhead_timer=undefined}l._typeAhead_chars=(l._typeAhead_chars===undefined?"":l._typeAhead_chars).concat(k);if(l._typeAhead_chars.length<2||(l._typeAhead_chars.substr(-2,1)===k&&l._typeAhead_cycling)){l._typeAhead_cycling=true;d=k}else{l._typeAhead_cycling=false;d=l._typeAhead_chars}var g=(f!=="focus"?this._selectedOptionLi().data("index"):this._focusedOptionLi().data("index"))||0;for(var h=0;h<this._optionLis.length;h++){var b=this._optionLis.eq(h).text().substr(0,d.length).toLowerCase();if(b===d){if(l._typeAhead_cycling){if(j===null){j=h}if(h>g){j=h;break}}else{j=h}}}if(j!==null){this._optionLis.eq(j).find("a").trigger(f)}l._typeAhead_timer=window.setTimeout(function(){l._typeAhead_timer=undefined;l._typeAhead_chars=undefined;l._typeAhead_cycling=undefined},l.options.typeAhead)},_uiHash:function(){var b=this.index();return{index:b,option:a("option",this.element).get(b),value:this.element[0].value}},open:function(d){var c=this;var b=this.newelement.attr("aria-disabled");if(b!="true"){this._refreshPosition();this._closeOthers(d);this.newelement.addClass("ui-state-active");this.list.addClass(c.widgetBaseClass+"-open").attr("aria-hidden",false).find("li:not(."+c.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",d,this._uiHash())}},close:function(c,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",c,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(c,b){if(this.list.is("."+this.widgetBaseClass+"-open")){this.close(c,b)}else{this.open(c)}},_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(d){var c=parseInt(this._selectedOptionLi().data("index"),10);var b=c+d;return this._optionLis.eq(b).trigger("mouseup")},_moveFocus:function(e){if(!isNaN(e)){var d=parseInt(this._focusedOptionLi().data("index")||0,10);var c=d+e}else{var c=parseInt(this._optionLis.filter(e).data("index"),10)}if(c<0){c=0}if(c>this._optionLis.size()-1){c=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(c).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(c).addClass("ui-selectmenu-item-selected ui-state-hover");this.index(c)},_scrollPage:function(c){var b=Math.floor(this.list.outerHeight()/this.list.find("li:first").outerHeight());b=(c=="up")?-b:b;this._moveFocus(b)},_setOption:function(b,c){this.options[b]=c;if(b=="disabled"){this.close();this.element.add(this.newelement).add(this.list)[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",c)}},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 d=(this.options.style=="popup")?" ui-state-active":"";var c=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1000);this.list.find("."+this.widgetBaseClass+"-item-selected").removeClass(this.widgetBaseClass+"-item-selected"+d).find("a").attr("aria-selected","false").attr("id","");this._selectedOptionLi().addClass(this.widgetBaseClass+"-item-selected"+d).find("a").attr("aria-selected","true").attr("id",c);var b=this.newelement.data("optionClasses")?this.newelement.data("optionClasses"):"";var e=this._selectedOptionLi().data("optionClasses")?this._selectedOptionLi().data("optionClasses"):"";this.newelement.removeClass(b).data("optionClasses",e).addClass(e).find("."+this.widgetBaseClass+"-status").html(this._selectedOptionLi().find("a:eq(0)").html());this.list.attr("aria-activedescendant",c)},_refreshPosition:function(){var d=this.options;if(d.style=="popup"&&!d.positionOptions.offset){var c=this._selectedOptionLi();var b="0 -"+(c.outerHeight()+c.offset().top-this.list.offset().top)}this.list.css({zIndex:this.element.zIndex()}).position({of:d.positionOptions.of||this.newelement,my:d.positionOptions.my,at:d.positionOptions.at,offset:d.positionOptions.offset||b})}})})(jQuery);(function(b,c){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 g=this.element.hide(),j=this.options;this.speed=b.fx.speeds._default;this._isOpen=false;var f=(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(j.classes).attr({title:g.attr("title"),"aria-haspopup":true,tabIndex:g.attr("tabIndex")}).insertAfter(g),d=(this.buttonlabel=b("<span />")).html(j.noneSelectedText).appendTo(f),h=(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(j.classes).appendTo(document.body),l=(this.header=b("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(h),e=(this.headerLinkContainer=b("<ul />")).addClass("ui-helper-reset").html(function(){if(j.header===true){return'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+j.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+j.uncheckAllText+"</span></a></li>"}else{if(typeof j.header==="string"){return"<li>"+j.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(l),k=(this.checkboxContainer=b("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(h);this._bindEvents();this.refresh(true);if(!j.multiple){h.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(j){var f=this.element,h=this.options,g=this.menu,l=this.checkboxContainer,d=[],e="",k=f.attr("id")||a++;f.find("option").each(function(o){var p=b(this),u=this.parentNode,s=this.innerHTML,w=this.title,t=this.value,n="ui-multiselect-"+(this.id||k+"-option-"+o),x=this.disabled,m=this.selected,r=["ui-corner-all"],q=(x?"ui-multiselect-disabled ":" ")+this.className,v;if(u.tagName==="OPTGROUP"){v=u.getAttribute("label");if(b.inArray(v,d)===-1){e+='<li class="ui-multiselect-optgroup-label '+u.className+'"><a href="#">'+v+"</a></li>";d.push(v)}}if(x){r.push("ui-state-disabled")}if(m&&!h.multiple){r.push("ui-state-active")}e+='<li class="'+q+'">';e+='<label for="'+n+'" title="'+w+'" class="'+r.join(" ")+'">';e+='<input id="'+n+'" name="multiselect_'+k+'" type="'+(h.multiple?"checkbox":"radio")+'" value="'+t+'" title="'+s+'"';if(m){e+=' checked="checked"';e+=' aria-selected="true"'}if(x){e+=' disabled="disabled"';e+=' aria-disabled="true"'}e+=" /><span>"+s+"</span></label></li>"});l.html(e);this.labels=g.find("label");this.inputs=this.labels.children("input");this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();if(!j){this._trigger("refresh")}},update:function(){var h=this.options,e=this.inputs,d=e.filter(":checked"),f=d.length,g;if(f===0){g=h.noneSelectedText}else{if(b.isFunction(h.selectedText)){g=h.selectedText.call(this,f,e.length,d.get())}else{if(/\d/.test(h.selectedList)&&h.selectedList>0&&f<=h.selectedList){g=d.map(function(){return b(this).next().html()}).get().join(", ")}else{g=h.selectedText.replace("#",f).replace("#",e.length)}}}this.buttonlabel.html(g);return g},_bindEvents:function(){var d=this,e=this.button;function f(){d[d._isOpen?"close":"open"]();return false}e.find("span").bind("click.multiselect",f);e.bind({click:f,keypress:function(g){switch(g.which){case 27:case 38:case 37:d.close();break;case 39:case 40:d.open();break}},mouseenter:function(){if(!e.hasClass("ui-state-disabled")){b(this).addClass("ui-state-hover")}},mouseleave:function(){b(this).removeClass("ui-state-hover")},focus:function(){if(!e.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(g){if(b(this).hasClass("ui-multiselect-close")){d.close()}else{d[b(this).hasClass("ui-multiselect-all")?"checkAll":"uncheckAll"]()}g.preventDefault()});this.menu.delegate("li.ui-multiselect-optgroup-label a","click.multiselect",function(l){l.preventDefault();var k=b(this),j=k.parent().nextUntil("li.ui-multiselect-optgroup-label").find("input:visible:not(:disabled)"),g=j.get(),h=k.parent().text();if((d._trigger("beforeoptgrouptoggle",l,{inputs:g,label:h})===false)||(!g.length)){return}d._toggleChecked(j.filter(":checked").length!==j.length,j);d._trigger("optgrouptoggle",l,{inputs:g,label:h,checked:g[0].checked})}).delegate("label","mouseenter.multiselect",function(){if(!b(this).hasClass("ui-state-disabled")){d.labels.removeClass("ui-state-hover");b(this).addClass("ui-state-hover").find("input:not(:disabled)").focus()}}).delegate("label","keydown.multiselect",function(g){g.preventDefault();switch(g.which){case 9:case 27:d.close();break;case 38:case 40:case 37:case 39:d._traverse(g.which,this);break;case 13:b(this).find("input")[0].click();break}}).delegate('input[type="checkbox"], input[type="radio"]',"click.multiselect",function(k){var j=b(this),l=this.value,h=this.checked,g=d.element.find("option");if(this.disabled||d._trigger("click",k,{value:l,text:this.title,checked:h})===false){k.preventDefault();return}j.focus();j.attr("aria-selected",h);g.each(function(){if(this.value===l){this.selected=h}else{if(!d.options.multiple){this.selected=false}}});if(!d.options.multiple){d.labels.removeClass("ui-state-active");j.closest("label").toggleClass("ui-state-active",h);d.close()}d.element.trigger("change");setTimeout(b.proxy(d.update,d),10)});b(document).bind("mousedown.multiselect",function(g){if(d._isOpen&&!b.contains(d.menu[0],g.target)&&!b.contains(d.button[0],g.target)&&g.target!==d.button[0]){d.close()}});b(this.element[0].form).bind("reset.multiselect",function(){setTimeout(b.proxy(d.refresh,d),10)})},_setButtonWidth:function(){var d=this.element.outerWidth(),e=this.options;if(/\d/.test(e.minWidth)&&d<e.minWidth){d=e.minWidth}this.button.width(d)},_setMenuWidth:function(){var d=this.menu,e=this.button.outerWidth()-parseInt(d.css("padding-left"),10)-parseInt(d.css("padding-right"),10)-parseInt(d.css("border-right-width"),10)-parseInt(d.css("border-left-width"),10);d.width(e||this.button.outerWidth())},_traverse:function(h,j){var f=b(j),e=h===38||h===37,d=f.parent()[e?"prevAll":"nextAll"]("li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)")[e?"last":"first"]();if(!d.length){var g=this.menu.find("ul").last();this.menu.find("label")[e?"last":"first"]().trigger("mouseover");g.scrollTop(e?g.height():0)}else{d.find("label").trigger("mouseover")}},_toggleState:function(e,d){return function(){if(!this.disabled){this[e]=d}if(d){this.setAttribute("aria-selected",true)}else{this.removeAttribute("aria-selected")}}},_toggleChecked:function(d,h){var g=(h&&h.length)?h:this.labels.find("input:enabled"),f=this;g.each(this._toggleState("checked",d));g.eq(0).focus();this.update();var e=g.map(function(){return this.value}).get();this.element.find("option").each(function(){if(!this.disabled&&b.inArray(this.value,e)>-1){f._toggleState("selected",d).call(this)}});if(g.length){this.element.trigger("change")}},_toggleDisabled:function(e){this.button.attr({disabled:e,"aria-disabled":e})[e?"addClass":"removeClass"]("ui-state-disabled");var d=this.menu.find("input");var f="ech-multiselect-disabled";if(e){d=d.filter(":enabled").data(f,true)}else{d=d.filter(function(){return b.data(this,f)===true}).removeData(f)}d.attr({disabled:e,"arial-disabled":e}).parent()[e?"addClass":"removeClass"]("ui-state-disabled");this.element.attr({disabled:e,"aria-disabled":e})},open:function(j){var n=this,h=this.button,d=this.menu,g=this.speed,f=this.options,k=[];if(this._trigger("beforeopen")===false||h.hasClass("ui-state-disabled")||this._isOpen){return}var m=d.find("ul").last(),p=f.show,l=h.offset();if(b.isArray(f.show)){p=f.show[0];g=f.show[1]||n.speed}if(p){k=[p,g]}m.scrollTop(0).height(f.height);if(b.ui.position&&!b.isEmptyObject(f.position)){f.position.of=f.position.of||h;d.show().position(f.position).hide()}else{d.css({top:l.top+h.outerHeight(),left:l.left})}d.show();this.labels.eq(0).trigger("mouseover").trigger("mouseenter").find("input:enabled").trigger("focus");h.addClass("ui-state-active");this._isOpen=true;this._trigger("open")},close:function(){if(this._trigger("beforeclose")===false){return}var g=this.options,e=g.hide,f=this.speed,d=[];if(b.isArray(g.hide)){e=g.hide[0];f=g.hide[1]||this.speed}if(e){d=[e,f]}b.fn.hide.apply(this.menu,d);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(d){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(d,e){var f=this.menu;switch(d){case"header":f.find("div.ui-multiselect-header")[e?"show":"hide"]();break;case"checkAllText":f.find("a.ui-multiselect-all span").eq(-1).text(e);break;case"uncheckAllText":f.find("a.ui-multiselect-none span").eq(-1).text(e);break;case"height":f.find("ul").last().height(parseInt(e,10));break;case"minWidth":this.options[d]=parseInt(e,10);this._setButtonWidth();this._setMenuWidth();break;case"selectedText":case"selectedList":case"noneSelectedText":this.options[d]=e;this.update();break;case"classes":f.add(this.button).removeClass(this.options.classes).addClass(e);break;case"multiple":f.toggleClass("ui-multiselect-single",!e);this.options.multiple=e;this.element[0].multiple=e;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.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(d){var b={},f=this[0];if(!f.grid){return false}var e=f.p.colModel,c;for(c=0;c<e.length;c++){if(e[c].name==d){b=e[c];break}}return b},setColProp:function(c,b){return this.each(function(){if(this.grid){if(b){var e=this.p.colModel,d;for(d=0;d<e.length;d++){if(e[d].name==c){a.extend(true,this.p.colModel[d],b);break}}}}})},sortGrid:function(c,b,d){return this.each(function(){var h=this,e=-1,g;if(!h.grid){return}if(!c){c=h.p.sortname}for(g=0;g<h.p.colModel.length;g++){if(h.p.colModel[g].index==c||h.p.colModel[g].name==c){e=g;break}}if(e!=-1){var f=h.p.colModel[e].sortable;if(typeof f!=="boolean"){f=true}if(typeof b!=="boolean"){b=false}if(f){h.sortData("jqgh_"+h.p.id+"_"+c,e,b,d)}}})},clearBeforeUnload:function(){return this.each(function(){var d=this.grid;d.emptyRows.call(this,true,true);a(d.hDiv).unbind("mousemove");a(this).unbind();d.dragEnd=null;d.dragMove=null;d.dragStart=null;d.emptyRows=null;d.populate=null;d.populateVisible=null;d.scrollGrid=null;d.selectionPreserver=null;d.bDiv=null;d.cDiv=null;d.hDiv=null;d.cols=null;var c,b=d.headers.length;for(c=0;c<b;c++){d.headers[c].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 d={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:d.id});b.className=d.cl;var c=a.jgrid.jqID(this.id);a(b).removeClass("ui-jqgrid-btable");if(a(this.p.pager).parents("#gbox_"+c).length===1){a(b).insertBefore("#gbox_"+c).show();a(this.p.pager).insertBefore("#gbox_"+c)}else{a(b).insertBefore("#gbox_"+c).show()}a(this).jqGrid("clearBeforeUnload");a("#gbox_"+c).remove()})},setGridState:function(b){return this.each(function(){if(!this.grid){return}var c=this;if(b=="hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+a.jgrid.jqID(c.p.id)).slideUp("fast");if(c.p.pager){a(c.p.pager).slideUp("fast")}if(c.p.toppager){a(c.p.toppager).slideUp("fast")}if(c.p.toolbar[0]===true){if(c.p.toolbar[1]=="both"){a(c.grid.ubDiv).slideUp("fast")}a(c.grid.uDiv).slideUp("fast")}if(c.p.footerrow){a(".ui-jqgrid-sdiv","#gbox_"+a.jgrid.jqID(c.p.id)).slideUp("fast")}a(".ui-jqgrid-titlebar-close span",c.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");c.p.gridstate="hidden"}else{if(b=="visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+a.jgrid.jqID(c.p.id)).slideDown("fast");if(c.p.pager){a(c.p.pager).slideDown("fast")}if(c.p.toppager){a(c.p.toppager).slideDown("fast")}if(c.p.toolbar[0]===true){if(c.p.toolbar[1]=="both"){a(c.grid.ubDiv).slideDown("fast")}a(c.grid.uDiv).slideDown("fast")}if(c.p.footerrow){a(".ui-jqgrid-sdiv","#gbox_"+a.jgrid.jqID(c.p.id)).slideDown("fast")}a(".ui-jqgrid-titlebar-close span",c.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");c.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 h=this;if(this.ftoolbar){return}var c=function(){var o={},n=0,t,u,k={},l;a.each(h.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&&h.p.frozenColumns===true)?h.grid.fhDiv:h.grid.hDiv).val();if(t){o[u]=t;k[u]=l;n++}else{try{delete h.p.postData[u]}catch(j){}}});var r=n>0?true:false;if(b.stringResult===true||h.p.datatype=="local"){var s='{"groupOp":"'+b.groupOp+'","rules":[';var q=0;a.each(o,function(j,v){if(q>0){s+=","}s+='{"field":"'+j+'",';s+='"op":"'+k[j]+'",';v+="";s+='"data":"'+v.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';q++});s+="]}";a.extend(h.p.postData,{filters:s});a.each(["searchField","searchString","searchOper"],function(j,v){if(h.p.postData.hasOwnProperty(v)){delete h.p.postData[v]}})}else{a.extend(h.p.postData,o)}var p;if(h.p.searchurl){p=h.p.url;a(h).jqGrid("setGridParam",{url:h.p.searchurl})}var m=a(h).triggerHandler("jqGridToolbarBeforeSearch")==="stop"?true:false;if(!m&&a.isFunction(b.beforeSearch)){m=b.beforeSearch.call(h)}if(!m){a(h).jqGrid("setGridParam",{search:r}).trigger("reloadGrid",[{page:1}])}if(p){a(h).jqGrid("setGridParam",{url:p})}a(h).triggerHandler("jqGridToolbarAfterSearch");if(a.isFunction(b.afterSearch)){b.afterSearch.call(h)}};var g=function(k){var m={},l=0,s;k=(typeof k!=="boolean")?true:k;a.each(h.p.colModel,function(){var j;if(this.searchoptions&&this.searchoptions.defaultValue!==undefined){j=this.searchoptions.defaultValue}s=this.index||this.name;switch(this.stype){case"select":a("#gs_"+a.jgrid.jqID(this.name)+" option",(this.frozen===true&&h.p.frozenColumns===true)?h.grid.fhDiv:h.grid.hDiv).each(function(v){if(v===0){this.selected=true}if(a(this).val()==j){this.selected=true;return false}});if(j!==undefined){m[s]=j;l++}else{try{delete h.p.postData[s]}catch(t){}}break;case"text":a("#gs_"+a.jgrid.jqID(this.name),(this.frozen===true&&h.p.frozenColumns===true)?h.grid.fhDiv:h.grid.hDiv).val(j);if(j!==undefined){m[s]=j;l++}else{try{delete h.p.postData[s]}catch(u){}}break}});var p=l>0?true:false;if(b.stringResult===true||h.p.datatype=="local"){var q='{"groupOp":"'+b.groupOp+'","rules":[';var o=0;a.each(m,function(j,t){if(o>0){q+=","}q+='{"field":"'+j+'",';q+='"op":"eq",';t+="";q+='"data":"'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';o++});q+="]}";a.extend(h.p.postData,{filters:q});a.each(["searchField","searchString","searchOper"],function(j,t){if(h.p.postData.hasOwnProperty(t)){delete h.p.postData[t]}})}else{a.extend(h.p.postData,m)}var n;if(h.p.searchurl){n=h.p.url;a(h).jqGrid("setGridParam",{url:h.p.searchurl})}var r=a(h).triggerHandler("jqGridToolbarBeforeClear")==="stop"?true:false;if(!r&&a.isFunction(b.beforeClear)){r=b.beforeClear.call(h)}if(!r){if(k){a(h).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}])}}if(n){a(h).jqGrid("setGridParam",{url:n})}a(h).triggerHandler("jqGridToolbarAfterClear");if(a.isFunction(b.afterClear)){b.afterClear()}};var e=function(){var j=a("tr.ui-search-toolbar",h.grid.hDiv),k=h.p.frozenColumns===true?a("tr.ui-search-toolbar",h.grid.fhDiv):false;if(j.css("display")=="none"){j.show();if(k){k.show()}}else{j.hide();if(k){k.hide()}}};var f=a("<tr class='ui-search-toolbar' role='rowheader'></tr>");var d;a.each(h.p.colModel,function(){var v=this,t,m,r,j,y;m=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+h.p.direction+"'></th>");t=a("<div style='position:relative;height:100%;padding-right:0.3em;'></div>");if(this.hidden===true){a(m).css("display","none")}this.search=this.search===false?false:true;if(this.stype===undefined){this.stype="text"}r=a.extend({},this.searchoptions||{});if(this.search){switch(this.stype){case"select":j=this.surl||r.dataUrl;if(j){y=t;a.ajax(a.extend({url:j,dataType:"html",success:function(k){if(r.buildSelect!==undefined){var A=r.buildSelect(k);if(A){a(y).append(A)}}else{a(y).append(k)}if(r.defaultValue!==undefined){a("select",y).val(r.defaultValue)}a("select",y).attr({name:v.index||v.name,id:"gs_"+v.name});if(r.attr){a("select",y).attr(r.attr)}a("select",y).css({width:"100%"});a.jgrid.bindEv(a("select",y)[0],r,h);if(b.autosearch===true){a("select",y).change(function(){c();return false})}k=null}},a.jgrid.ajaxOptions,h.p.ajaxSelectOptions||{}))}else{var l,z,o;if(v.searchoptions){l=v.searchoptions.value===undefined?"":v.searchoptions.value;z=v.searchoptions.separator===undefined?":":v.searchoptions.separator;o=v.searchoptions.delimiter===undefined?";":v.searchoptions.delimiter}else{if(v.editoptions){l=v.editoptions.value===undefined?"":v.editoptions.value;z=v.editoptions.separator===undefined?":":v.editoptions.separator;o=v.editoptions.delimiter===undefined?";":v.editoptions.delimiter}}if(l){var q=document.createElement("select");q.style.width="100%";a(q).attr({name:v.index||v.name,id:"gs_"+v.name});var n,x,p,w,s;if(typeof l==="string"){n=l.split(o);for(s=0;s<n.length;s++){x=n[s].split(z);p=document.createElement("option");p.value=x[0];p.innerHTML=x[1];q.appendChild(p)}}else{if(typeof l==="object"){for(w in l){if(l.hasOwnProperty(w)){p=document.createElement("option");p.value=w;p.innerHTML=l[w];q.appendChild(p)}}}}if(r.defaultValue!==undefined){a(q).val(r.defaultValue)}if(r.attr){a(q).attr(r.attr)}a.jgrid.bindEv(q,r,h);a(t).append(q);if(b.autosearch===true){a(q).change(function(){c();return false})}}}break;case"text":var u=r.defaultValue!==undefined?r.defaultValue:"";a(t).append("<input type='text' style='width:95%;padding:0px;' name='"+(v.index||v.name)+"' id='gs_"+v.name+"' value='"+u+"'/>");if(r.attr){a("input",t).attr(r.attr)}a.jgrid.bindEv(a("input",t)[0],r,h);if(b.autosearch===true){if(b.searchOnEnter){a("input",t).keypress(function(A){var k=A.charCode||A.keyCode||0;if(k==13){c();return false}return this})}else{a("input",t).keydown(function(A){var k=A.which;switch(k){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:if(d){clearTimeout(d)}d=setTimeout(function(){c()},500)}})}}break}}a(m).append(t);a(f).append(m)});a("table thead",h.grid.hDiv).append(f);this.ftoolbar=true;this.triggerToolbar=c;this.clearToolbar=g;this.toggleToolbar=e})},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 h=this,m,j,f,d,p,e,c=h.grid,n=a("table.ui-jqgrid-htable thead",c.hDiv),o=h.p.colModel,k;if(!c){return}a(this).unbind(".setGroupHeaders");m=a("<tr>",{role:"rowheader"}).addClass("ui-jqgrid-labels");d=c.headers;for(j=0,f=d.length;j<f;j++){k=o[j].hidden?"none":"";p=a(d[j].el).width(d[j].width).css("display",k);try{p.removeAttr("rowSpan")}catch(g){p.attr("rowSpan",1)}m.append(p);e=p.children("span.ui-jqgrid-resize");if(e.length>0){e[0].style.height=""}p.children("div")[0].style.top=""}a(n).children("tr.ui-jqgrid-labels").remove();a(n).prepend(m);if(b===true){a(h).jqGrid("setGridParam",{groupHeader:null})}})},setGroupHeaders:function(b){b=a.extend({useColSpanStyle:false,groupHeaders:[]},b||{});return this.each(function(){this.p.groupHeader=b;var c=this,y,u,v=0,A,o,j,f,h,g,z,q,p,t,n=c.p.colModel,r=n.length,d=c.grid.headers,x=a("table.ui-jqgrid-htable",c.grid.hDiv),e=x.children("thead").children("tr.ui-jqgrid-labels:last").addClass("jqg-second-row-header"),m=x.children("thead"),s,l=x.find(".jqg-first-row-header");if(l[0]===undefined){l=a("<tr>",{role:"row","aria-hidden":"true"}).addClass("jqg-first-row-header").css("height","auto")}else{l.empty()}var k,w=function(E,C){var D=C.length,B;for(B=0;B<D;B++){if(C[B].startColumnName===E){return B}}return -1};a(c).prepend(m);A=a("<tr>",{role:"rowheader"}).addClass("ui-jqgrid-labels jqg-third-row-header");for(y=0;y<r;y++){j=d[y].el;f=a(j);u=n[y];h={height:"0px",width:d[y].width+"px",display:(u.hidden?"none":"")};a("<th>",{role:"gridcell"}).css(h).addClass("ui-first-th-"+c.p.direction).appendTo(l);j.style.width="";g=w(u.name,b.groupHeaders);if(g>=0){z=b.groupHeaders[g];q=z.numberOfColumns;p=z.titleText;for(t=0,g=0;g<q&&(y+g<r);g++){if(!n[y+g].hidden){t++}}o=a("<th>").attr({role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+c.p.direction).css({height:"22px","border-top":"0px none"}).html(p);if(t>0){o.attr("colspan",String(t))}if(c.p.headertitles){o.attr("title",o.text())}if(t===0){o.hide()}f.before(o);A.append(j);v=q-1}else{if(v===0){if(b.useColSpanStyle){f.attr("rowspan","2")}else{a("<th>",{role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+c.p.direction).css({display:u.hidden?"none":"","border-top":"0px none"}).insertBefore(f);A.append(j)}}else{A.append(j);v--}}}s=a(c).children("thead");s.prepend(l);A.insertAfter(e);x.append(s);if(b.useColSpanStyle){x.find("span.ui-jqgrid-resize").each(function(){var B=a(this).parent();if(B.is(":visible")){this.style.cssText="height: "+B.height()+"px !important; cursor: col-resize;"}});x.find("div.ui-jqgrid-sortable").each(function(){var B=a(this),C=B.parent();if(C.is(":visible")&&C.is(":has(span.ui-jqgrid-resize)")){B.css("top",(C.height()-B.outerHeight())/2+"px")}})}k=s.find("tr.jqg-first-row-header");a(c).bind("jqGridResizeStop.setGroupHeaders",function(D,C,B){k.find("th").eq(B).width(C)})})},setFrozenColumns:function(){return this.each(function(){if(!this.grid){return}var f=this,m=f.p.colModel,g=0,h=m.length,l=-1,b=false;if(f.p.subGrid===true||f.p.treeGrid===true||f.p.cellEdit===true||f.p.sortable||f.p.scroll||f.p.grouping){return}if(f.p.rownumbers){g++}if(f.p.multiselect){g++}while(g<h){if(m[g].frozen===true){b=true;l=g}else{break}g++}if(l>=0&&b){var j=f.p.caption?a(f.grid.cDiv).outerHeight():0,k=a(".ui-jqgrid-htable","#gview_"+a.jgrid.jqID(f.p.id)).height();if(f.p.toppager){j=j+a(f.grid.topDiv).outerHeight()}if(f.p.toolbar[0]===true){if(f.p.toolbar[1]!="bottom"){j=j+a(f.grid.uDiv).outerHeight()}}f.grid.fhDiv=a('<div style="position:absolute;left:0px;top:'+j+"px;height:"+k+'px;" class="frozen-div ui-state-default ui-jqgrid-hdiv"></div>');f.grid.fbDiv=a('<div style="position:absolute;left:0px;top:'+(parseInt(j,10)+parseInt(k,10)+1)+'px;overflow-y:hidden" class="frozen-bdiv ui-jqgrid-bdiv"></div>');a("#gview_"+a.jgrid.jqID(f.p.id)).append(f.grid.fhDiv);var e=a(".ui-jqgrid-htable","#gview_"+a.jgrid.jqID(f.p.id)).clone(true);if(f.p.groupHeader){a("tr.jqg-first-row-header, tr.jqg-third-row-header",e).each(function(){a("th:gt("+l+")",this).remove()});var c=-1,d=-1;a("tr.jqg-second-row-header th",e).each(function(){var n=parseInt(a(this).attr("colspan"),10);if(n){c=c+n;d++}if(c===l){return false}});if(c!==l){d=l}a("tr.jqg-second-row-header",e).each(function(){a("th:gt("+d+")",this).remove()})}else{a("tr",e).each(function(){a("th:gt("+l+")",this).remove()})}a(e).width(1);a(f.grid.fhDiv).append(e).mousemove(function(n){if(f.grid.resizing){f.grid.dragMove(n);return false}});a(f).bind("jqGridResizeStop.setFrozenColumns",function(r,n,p){var q=a(".ui-jqgrid-htable",f.grid.fhDiv);a("th:eq("+p+")",q).width(n);var o=a(".ui-jqgrid-btable",f.grid.fbDiv);a("tr:first td:eq("+p+")",o).width(n)});a(f).bind("jqGridOnSortCol.setFrozenColumns",function(o,q){var n=a("tr.ui-jqgrid-labels:last th:eq("+f.p.lastsort+")",f.grid.fhDiv),p=a("tr.ui-jqgrid-labels:last th:eq("+q+")",f.grid.fhDiv);a("span.ui-grid-ico-sort",n).addClass("ui-state-disabled");a(n).attr("aria-selected","false");a("span.ui-icon-"+f.p.sortorder,p).removeClass("ui-state-disabled");a(p).attr("aria-selected","true");if(!f.p.viewsortcols[0]){if(f.p.lastsort!=q){a("span.s-ico",n).hide();a("span.s-ico",p).show()}}});a("#gview_"+a.jgrid.jqID(f.p.id)).append(f.grid.fbDiv);a(f.grid.bDiv).scroll(function(){a(f.grid.fbDiv).scrollTop(a(this).scrollTop())});if(f.p.hoverrows===true){a("#"+a.jgrid.jqID(f.p.id)).unbind("mouseover").unbind("mouseout")}a(f).bind("jqGridAfterGridComplete.setFrozenColumns",function(){a("#"+a.jgrid.jqID(f.p.id)+"_frozen").remove();a(f.grid.fbDiv).height(a(f.grid.bDiv).height()-16);var n=a("#"+a.jgrid.jqID(f.p.id)).clone(true);a("tr",n).each(function(){a("td:gt("+l+")",this).remove()});a(n).width(1).attr("id",f.p.id+"_frozen");a(f.grid.fbDiv).append(n);if(f.p.hoverrows===true){a("tr.jqgrow",n).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(f.p.id)).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(f.p.id)).removeClass("ui-state-hover")});a("tr.jqgrow","#"+a.jgrid.jqID(f.p.id)).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(f.p.id)+"_frozen").addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(f.p.id)+"_frozen").removeClass("ui-state-hover")})}n=null});f.p.frozenColumns=true}})},destroyFrozenColumns:function(){return this.each(function(){if(!this.grid){return}if(this.p.frozenColumns===true){var c=this;a(c.grid.fhDiv).remove();a(c.grid.fbDiv).remove();c.grid.fhDiv=null;c.grid.fbDiv=null;a(this).unbind(".setFrozenColumns");if(c.p.hoverrows===true){var b;a("#"+a.jgrid.jqID(c.p.id)).bind("mouseover",function(d){b=a(d.target).closest("tr.jqgrow");if(a(b).attr("class")!=="ui-subgrid"){a(b).addClass("ui-state-hover")}}).bind("mouseout",function(d){b=a(d.target).closest("tr.jqgrow");a(b).removeClass("ui-state-hover")})}this.p.frozenColumns=false}})}})})(jQuery);(function(c){c.fn.jqm=function(f){var e={overlay:50,closeoverlay:true,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:l,ajaxText:"",target:l,modal:l,toTop:l,onShow:l,onHide:l,onLoad:l};return this.each(function(){if(this._jqm){return k[this._jqm].c=c.extend({},k[this._jqm].c,f)}n++;this._jqm=n;k[n]={c:c.extend(e,c.jqm.params,f),a:l,w:c(this).addClass("jqmID"+n),s:n};if(e.trigger){c(this).jqmAddTrigger(e.trigger)}})};c.fn.jqmAddClose=function(f){return j(this,f,"jqmHide")};c.fn.jqmAddTrigger=function(f){return j(this,f,"jqmShow")};c.fn.jqmShow=function(e){return this.each(function(){c.jqm.open(this._jqm,e)})};c.fn.jqmHide=function(e){return this.each(function(){c.jqm.close(this._jqm,e)})};c.jqm={hash:{},open:function(y,x){var p=k[y],q=p.c,m="."+q.closeClass,v=(parseInt(p.w.css("z-index")));v=(v>0)?v:3000;var f=c("<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 l}p.t=x;p.a=true;p.w.css("z-index",v);if(q.modal){if(!a[0]){setTimeout(function(){h("bind")},1)}a.push(y)}else{if(q.overlay>0){if(q.closeoverlay){p.w.jqmAddClose(f)}}else{f=l}}p.o=(f)?f.addClass(q.overlayClass).prependTo("body"):l;if(q.ajax){var e=q.target||p.w,w=q.ajax;e=(typeof e=="string")?c(e,p.w):c(e);w=(w.substr(0,1)=="@")?c(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(c(m,p.w))}g(p)})}else{if(m){p.w.jqmAddClose(c(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();g(p);return l},close:function(f){var e=k[f];if(!e.a){return l}e.a=l;if(a[0]){a.pop();if(!a[0]){h("unbind")}}if(e.c.toTop&&e.o){c("#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 l},params:{}};var n=0,k=c.jqm.hash,a=[],l=false,g=function(e){d(e)},d=function(f){try{c(":input:visible",f.w)[0].focus()}catch(e){}},h=function(e){c(document)[e]("keypress",b)[e]("keydown",b)[e]("mousedown",b)},b=function(o){var f=k[a[a.length-1]],m=(!c(o.target).parents(".jqmID"+f.s)[0]);if(m){d(f)}return !m},j=function(e,f,m){return e.each(function(){var o=this._jqm;c(f).each(function(){if(!this[m]){this[m]=[];c(this).click(function(){for(var p in {jqmShow:1,jqmHide:1}){for(var q in this[p]){if(k[this[p][q]]){k[this[p][q]].w[p](this)}}}return l})}this[m].push(o)})})}})(jQuery);(function(c){c.fn.jqDrag=function(f){return d(this,f,"d")};c.fn.jqResize=function(l,f){return d(this,l,"r",f)};c.jqDnR={dnr:{},e:0,drag:function(f){if(g.k=="d"){k.css({left:g.X+f.pageX-g.pX,top:g.Y+f.pageY-g.pY})}else{k.css({width:Math.max(f.pageX-g.pX+g.W,0),height:Math.max(f.pageY-g.pY+g.H,0)});if(a){j.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(){c(document).unbind("mousemove",h.drag).unbind("mouseup",h.stop)}};var h=c.jqDnR,g=h.dnr,k=h.e,j,a,d=function(n,m,l,f){return n.each(function(){m=(m)?c(m,n):n;m.bind("mousedown",{e:n,k:l},function(o){var t=o.data,s={};k=t.e;j=f?c(f):false;if(k.css("position")!="relative"){try{k.position(s)}catch(r){}}g={X:s.left||e("left")||0,Y:s.top||e("top")||0,W:e("width")||k[0].scrollWidth||0,H:e("height")||k[0].scrollHeight||0,pX:o.pageX,pY:o.pageY,k:t.k};if(j&&t.k!="d"){a={X:s.left||b("left")||0,Y:s.top||b("top")||0,W:j[0].offsetWidth||b("width")||0,H:j[0].offsetHeight||b("height")||0,pX:o.pageX,pY:o.pageY,k:t.k}}else{a=false}if(c("input.hasDatepicker",k[0])[0]){try{c("input.hasDatepicker",k[0]).datepicker("hide")}catch(q){}}c(document).mousemove(c.jqDnR.drag).mouseup(c.jqDnR.stop);return false})})},e=function(f){return parseInt(k.css(f),10)||false},b=function(f){return parseInt(j.css(f),10)||false}})(jQuery);var xmlJsonClass={xml2json:function(b,d){if(b.nodeType===9){b=b.documentElement}var a=this.removeWhite(b);var e=this.toObj(a);var c=this.toJson(e,b.nodeName,"\t");return"{\n"+d+(d?c.replace(/\t/g,d):c.replace(/\t|\n/g,""))+"\n}"},json2xml:function(d,c){var e=function(q,f,h){var o="";var l,g;if(q instanceof Array){if(q.length===0){o+=h+"<"+f+">__EMPTY_ARRAY_</"+f+">\n"}else{for(l=0,g=q.length;l<g;l+=1){var p=h+e(q[l],f,h+"\t")+"\n";o+=p}}}else{if(typeof(q)==="object"){var k=false;o+=h+"<"+f;var j;for(j in q){if(q.hasOwnProperty(j)){if(j.charAt(0)==="@"){o+=" "+j.substr(1)+'="'+q[j].toString()+'"'}else{k=true}}}o+=k?">":"/>";if(k){for(j in q){if(q.hasOwnProperty(j)){if(j==="#text"){o+=q[j]}else{if(j==="#cdata"){o+="<![CDATA["+q[j]+"]]>"}else{if(j.charAt(0)!=="@"){o+=e(q[j],j,h+"\t")}}}}}o+=(o.charAt(o.length-1)==="\n"?h:"")+"</"+f+">"}}else{if(typeof(q)==="function"){o+=h+"<"+f+"><![CDATA["+q+"]]></"+f+">"}else{if(q===undefined){q=""}if(q.toString()==='""'||q.toString().length===0){o+=h+"<"+f+">__EMPTY_STRING_</"+f+">"}else{o+=h+"<"+f+">"+q.toString()+"</"+f+">"}}}}return o};var b="";var a;for(a in d){if(d.hasOwnProperty(a)){b+=e(d[a],a,"")}}return c?b.replace(/\t/g,c):b.replace(/\t|\n/g,"")},toObj:function(b){var g={};var f=/function/i;if(b.nodeType===1){if(b.attributes.length){var e;for(e=0;e<b.attributes.length;e+=1){g["@"+b.attributes[e].nodeName]=(b.attributes[e].nodeValue||"").toString()}}if(b.firstChild){var a=0,d=0,c=false;var h;for(h=b.firstChild;h;h=h.nextSibling){if(h.nodeType===1){c=true}else{if(h.nodeType===3&&h.nodeValue.match(/[^ \f\n\r\t\v]/)){a+=1}else{if(h.nodeType===4){d+=1}}}}if(c){if(a<2&&d<2){this.removeWhite(b);for(h=b.firstChild;h;h=h.nextSibling){if(h.nodeType===3){g["#text"]=this.escape(h.nodeValue)}else{if(h.nodeType===4){if(f.test(h.nodeValue)){g[h.nodeName]=[g[h.nodeName],h.nodeValue]}else{g["#cdata"]=this.escape(h.nodeValue)}}else{if(g[h.nodeName]){if(g[h.nodeName] instanceof Array){g[h.nodeName][g[h.nodeName].length]=this.toObj(h)}else{g[h.nodeName]=[g[h.nodeName],this.toObj(h)]}}else{g[h.nodeName]=this.toObj(h)}}}}}else{if(!b.attributes.length){g=this.escape(this.innerXml(b))}else{g["#text"]=this.escape(this.innerXml(b))}}}else{if(a){if(!b.attributes.length){g=this.escape(this.innerXml(b));if(g==="__EMPTY_ARRAY_"){g="[]"}else{if(g==="__EMPTY_STRING_"){g=""}}}else{g["#text"]=this.escape(this.innerXml(b))}}else{if(d){if(d>1){g=this.escape(this.innerXml(b))}else{for(h=b.firstChild;h;h=h.nextSibling){if(f.test(b.firstChild.nodeValue)){g=b.firstChild.nodeValue;break}else{g["#cdata"]=this.escape(h.nodeValue)}}}}}}}if(!b.attributes.length&&!b.firstChild){g=null}}else{if(b.nodeType===9){g=this.toObj(b.documentElement)}else{alert("unhandled node type: "+b.nodeType)}}return g},toJson:function(b,a,d,e){if(e===undefined){e=true}var p=a?('"'+a+'"'):"",f="\t",g="\n";if(!e){f="";g=""}if(b==="[]"){p+=(a?":[]":"[]")}else{if(b instanceof Array){var c,k,j=[];for(k=0,c=b.length;k<c;k+=1){j[k]=this.toJson(b[k],"",d+f,e)}p+=(a?":[":"[")+(j.length>1?(g+d+f+j.join(","+g+d+f)+g+d):j.join(""))+"]"}else{if(b===null){p+=(a&&":")+"null"}else{if(typeof(b)==="object"){var l=[],h;for(h in b){if(b.hasOwnProperty(h)){l[l.length]=this.toJson(b[h],h,d+f,e)}}p+=(a?":{":"{")+(l.length>1?(g+d+f+l.join(","+g+d+f)+g+d):l.join(""))+"}"}else{if(typeof(b)==="string"){p+=(a&&":")+'"'+b.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"'}else{p+=(a&&":")+b.toString()}}}}}return p},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 c;for(c=b.firstChild;c;){if(c.nodeType===3){if(!c.nodeValue.match(/[^ \f\n\r\t\v]/)){var a=c.nextSibling;b.removeChild(c);c=a}else{c=c.nextSibling}}else{if(c.nodeType===1){this.removeWhite(c);c=c.nextSibling}else{c=c.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(g,h,f,b,c){var d=h;f=a.extend({},a.jgrid.formatter,f);try{d=a.fn.fmatter[g].call(this,h,f,b,c)}catch(e){}return d};a.fmatter.util={NumberFormat:function(d,b){if(!a.fmatter.isNumber(d)){d*=1}if(a.fmatter.isNumber(d)){var f=(d<0);var l=String(d);var h=b.decimalSeparator||".";var j;if(a.fmatter.isNumber(b.decimalPlaces)){var k=b.decimalPlaces;var e=Math.pow(10,k);l=String(Math.round(d*e)/e);j=l.lastIndexOf(".");if(k>0){if(j<0){l+=h;j=l.length-1}else{if(h!=="."){l=l.replace(".",h)}}while((l.length-1-j)<k){l+="0"}}}if(b.thousandsSeparator){var n=b.thousandsSeparator;j=l.lastIndexOf(h);j=(j>-1)?j:l.length;var m=l.substring(j);var c=-1,g;for(g=j;g>0;g--){c++;if((c%3===0)&&(g!==j)&&(!f||(g>1))){m=n+m}m=l.charAt(g-1)+m}l=m}l=(b.prefix)?b.prefix+l:l;l=(b.suffix)?l+b.suffix:l;return l}return d},DateFormat:function(J,M,P,y){var m=/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,D=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,L=/[^-+\dA-Z]/g,p=new RegExp("^/Date\\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\\)/$"),f=((typeof M==="string")?M.match(p):null),K=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},e=0,r,F,d,E=["i18n"];E.i18n={dayNames:y.dayNames,monthNames:y.monthNames};if(y.masks.hasOwnProperty(J)){J=y.masks[J]}if(!isNaN(M-0)&&String(J).toLowerCase()=="u"){e=new Date(parseFloat(M)*1000)}else{if(M.constructor===Date){e=M}else{if(f!==null){e=new Date(parseInt(f[1],10));if(f[3]){var g=Number(f[5])*60+Number(f[6]);g*=((f[4]=="-")?1:-1);g-=e.getTimezoneOffset();e.setTime(Number(Number(e)+(g*60*1000)))}}else{M=String(M).split(/[\\\/:_;.,\t\T\s-]/);J=J.split(/[\\\/:_;.,\t\T\s-]/);for(F=0,d=J.length;F<d;F++){if(J[F]=="M"){r=a.inArray(M[F],E.i18n.monthNames);if(r!==-1&&r<12){M[F]=r+1}}if(J[F]=="F"){r=a.inArray(M[F],E.i18n.monthNames);if(r!==-1&&r>11){M[F]=r+1-12}}if(M[F]){b[J[F].toLowerCase()]=parseInt(M[F],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 O=b.y;if(O>=70&&O<=99){b.y=1900+b.y}else{if(O>=0&&O<=69){b.y=2000+b.y}}e=new Date(b.y,b.m,b.d,b.h,b.i,b.s,b.u)}}}if(y.masks.hasOwnProperty(P)){P=y.masks[P]}else{if(!P){P="Y-m-d"}}var v=e.getHours(),I=e.getMinutes(),H=e.getDate(),C=e.getMonth()+1,B=e.getTimezoneOffset(),A=e.getSeconds(),x=e.getMilliseconds(),t=e.getDay(),c=e.getFullYear(),l=(t+6)%7+1,q=(new Date(c,C-1,H)-new Date(c,0,1))/86400000,h={d:K(H),D:E.i18n.dayNames[t],j:H,l:E.i18n.dayNames[t+7],N:l,S:y.S(H),w:t,z:q,W:l<5?Math.floor((q+l-1)/7)+1:Math.floor((q+l-1)/7)||((new Date(c-1,0,1).getDay()+6)%7<4?53:52),F:E.i18n.monthNames[C-1+12],m:K(C),M:E.i18n.monthNames[C-1],n:C,t:"?",L:"?",o:"?",Y:c,y:String(c).substring(2),a:v<12?y.AmPm[0]:y.AmPm[1],A:v<12?y.AmPm[2]:y.AmPm[3],B:"?",g:v%12||12,G:v,h:K(v%12||12),H:K(v),i:K(I),s:K(A),u:x,e:"?",I:"?",O:(B>0?"-":"+")+K(Math.floor(Math.abs(B)/60)*100+Math.abs(B)%60,4),P:"?",T:(String(e).match(D)||[""]).pop().replace(L,""),Z:"?",c:"?",r:"?",U:Math.floor(e/1000)};return P.replace(m,function(j){return h.hasOwnProperty(j)?h[j]:j.substring(1)})}};a.fn.fmatter.defaultFormat=function(c,b){return(a.fmatter.isValue(c)&&c!=="")?c:b.defaultValue||"&#160;"};a.fn.fmatter.email=function(c,b){if(!a.fmatter.isEmpty(c)){return'<a href="mailto:'+c+'">'+c+"</a>"}return a.fn.fmatter.defaultFormat(c,b)};a.fn.fmatter.checkbox=function(e,c){var f=a.extend({},c.checkbox),d;if(c.colModel!==undefined&&!a.fmatter.isUndefined(c.colModel.formatoptions)){f=a.extend({},f,c.colModel.formatoptions)}if(f.disabled===true){d='disabled="disabled"'}else{d=""}if(a.fmatter.isEmpty(e)||a.fmatter.isUndefined(e)){e=a.fn.fmatter.defaultFormat(e,f)}e=String(e);e=e.toLowerCase();var b=e.search(/(false|0|no|n|off)/i)<0?" checked='checked' ":"";return'<input type="checkbox" '+b+' value="'+e+'" offval="no" '+d+"/>"};a.fn.fmatter.link=function(d,b){var e={target:b.target};var c="";if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){e=a.extend({},e,b.colModel.formatoptions)}if(e.target){c="target="+e.target}if(!a.fmatter.isEmpty(d)){return"<a "+c+' href="'+d+'">'+d+"</a>"}return a.fn.fmatter.defaultFormat(d,b)};a.fn.fmatter.showlink=function(d,b){var f={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName},c="",e;if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){f=a.extend({},f,b.colModel.formatoptions)}if(f.target){c="target="+f.target}e=f.baseLinkUrl+f.showAction+"?"+f.idName+"="+b.rowId+f.addParam;if(a.fmatter.isString(d)||a.fmatter.isNumber(d)){return"<a "+c+' href="'+e+'">'+d+"</a>"}return a.fn.fmatter.defaultFormat(d,b)};a.fn.fmatter.integer=function(c,b){var d=a.extend({},b.integer);if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){d=a.extend({},d,b.colModel.formatoptions)}if(a.fmatter.isEmpty(c)){return d.defaultValue}return a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.number=function(c,b){var d=a.extend({},b.number);if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){d=a.extend({},d,b.colModel.formatoptions)}if(a.fmatter.isEmpty(c)){return d.defaultValue}return a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.currency=function(c,b){var d=a.extend({},b.currency);if(b.colModel!==undefined&&!a.fmatter.isUndefined(b.colModel.formatoptions)){d=a.extend({},d,b.colModel.formatoptions)}if(a.fmatter.isEmpty(c)){return d.defaultValue}return a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.date=function(e,d,b,c){var f=a.extend({},d.date);if(d.colModel!==undefined&&!a.fmatter.isUndefined(d.colModel.formatoptions)){f=a.extend({},f,d.colModel.formatoptions)}if(!f.reformatAfterEdit&&c=="edit"){return a.fn.fmatter.defaultFormat(e,d)}if(!a.fmatter.isEmpty(e)){return a.fmatter.util.DateFormat(f.srcformat,e,f.newformat,f)}return a.fn.fmatter.defaultFormat(e,d)};a.fn.fmatter.select=function(g,b){g=String(g);var e=false,k=[],o,d;if(!a.fmatter.isUndefined(b.colModel.formatoptions)){e=b.colModel.formatoptions.value;o=b.colModel.formatoptions.separator===undefined?":":b.colModel.formatoptions.separator;d=b.colModel.formatoptions.delimiter===undefined?";":b.colModel.formatoptions.delimiter}else{if(!a.fmatter.isUndefined(b.colModel.editoptions)){e=b.colModel.editoptions.value;o=b.colModel.editoptions.separator===undefined?":":b.colModel.editoptions.separator;d=b.colModel.editoptions.delimiter===undefined?";":b.colModel.editoptions.delimiter}}if(e){var n=b.colModel.editoptions.multiple===true?true:false,m=[],l;if(n){m=g.split(",");m=a.map(m,function(j){return a.trim(j)})}if(a.fmatter.isString(e)){var c=e.split(d),f=0,h;for(h=0;h<c.length;h++){l=c[h].split(o);if(l.length>2){l[1]=a.map(l,function(p,j){if(j>0){return p}}).join(o)}if(n){if(a.inArray(l[0],m)>-1){k[f]=l[1];f++}}else{if(a.trim(l[0])==a.trim(g)){k[0]=l[1];break}}}}else{if(a.fmatter.isObject(e)){if(n){k=a.map(m,function(j){return e[j]})}else{k[0]=e[g]||""}}}}g=k.join(", ");return g===""?a.fn.fmatter.defaultFormat(g,b):g};a.fn.fmatter.rowactions=function(h){var g=a(this).closest("tr.jqgrow"),n=a(this).parent(),l=g.attr("id"),m=a(this).closest("table.ui-jqgrid-btable"),d=m[0],b=d.p,k=b.colModel[a.jgrid.getCellIndex(this)],f={keys:false,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{},url:null,restoreAfterError:true,mtype:"POST",delOptions:{},editOptions:{}},c=function(p,o){if(a.isFunction(f.afterSave)){f.afterSave.call(d,p,o)}n.find("div.ui-inline-edit,div.ui-inline-del").show();n.find("div.ui-inline-save,div.ui-inline-cancel").hide()},j=function(o){if(a.isFunction(f.afterRestore)){f.afterRestore.call(d,o)}n.find("div.ui-inline-edit,div.ui-inline-del").show();n.find("div.ui-inline-save,div.ui-inline-cancel").hide()};if(!a.fmatter.isUndefined(k.formatoptions)){f=a.extend(f,k.formatoptions)}if(!a.fmatter.isUndefined(b.editOptions)){f.editOptions=b.editOptions}if(!a.fmatter.isUndefined(b.delOptions)){f.delOptions=b.delOptions}if(g.hasClass("jqgrid-new-row")){f.extraparam[b.prmNames.oper]=b.prmNames.addoper}var e={keys:f.keys,oneditfunc:f.onEdit,successfunc:f.onSuccess,url:f.url,extraparam:f.extraparam,aftersavefunc:c,errorfunc:f.onError,afterrestorefunc:j,restoreAfterError:f.restoreAfterError,mtype:f.mtype};switch(h){case"edit":m.jqGrid("editRow",l,e);n.find("div.ui-inline-edit,div.ui-inline-del").hide();n.find("div.ui-inline-save,div.ui-inline-cancel").show();m.triggerHandler("jqGridAfterGridComplete");break;case"save":if(m.jqGrid("saveRow",l,e)){n.find("div.ui-inline-edit,div.ui-inline-del").show();n.find("div.ui-inline-save,div.ui-inline-cancel").hide();m.triggerHandler("jqGridAfterGridComplete")}break;case"cancel":m.jqGrid("restoreRow",l,j);n.find("div.ui-inline-edit,div.ui-inline-del").show();n.find("div.ui-inline-save,div.ui-inline-cancel").hide();m.triggerHandler("jqGridAfterGridComplete");break;case"del":m.jqGrid("delGridRow",l,f.delOptions);break;case"formedit":m.jqGrid("setSelection",l);m.jqGrid("editGridRow",l,f.editOptions);break}};a.fn.fmatter.actions=function(e,c){var g={keys:false,editbutton:true,delbutton:true,editformbutton:false},b=c.rowId,f="",d;if(!a.fmatter.isUndefined(c.colModel.formatoptions)){g=a.extend(g,c.colModel.formatoptions)}if(b===undefined||a.fmatter.isEmpty(b)){return""}if(g.editformbutton){d="onclick=jQuery.fn.fmatter.rowactions.call(this,'formedit'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f+="<div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+d+"><span class='ui-icon ui-icon-pencil'></span></div>"}else{if(g.editbutton){d="onclick=jQuery.fn.fmatter.rowactions.call(this,'edit'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";f+="<div title='"+a.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+d+"><span class='ui-icon ui-icon-pencil'></span></div>"}}if(g.delbutton){d="onclick=jQuery.fn.fmatter.rowactions.call(this,'del'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f+="<div title='"+a.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+d+"><span class='ui-icon ui-icon-trash'></span></div>"}d="onclick=jQuery.fn.fmatter.rowactions.call(this,'save'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f+="<div title='"+a.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save' "+d+"><span class='ui-icon ui-icon-disk'></span></div>";d="onclick=jQuery.fn.fmatter.rowactions.call(this,'cancel'); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";f+="<div title='"+a.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel' "+d+"><span class='ui-icon ui-icon-cancel'></span></div>";return"<div style='margin-left:8px;'>"+f+"</div>"};a.unformat=function(e,n,k,c){var h,f=n.colModel.formatter,g=n.colModel.formatoptions||{},o,m=/([\.\*\_\'\(\)\{\}\+\?\\])/g,j=n.colModel.unformat||(a.fn.fmatter[f]&&a.fn.fmatter[f].unformat);if(j!==undefined&&a.isFunction(j)){h=j.call(this,a(e).text(),n,e)}else{if(!a.fmatter.isUndefined(f)&&a.fmatter.isString(f)){var b=a.jgrid.formatter||{},l;switch(f){case"integer":g=a.extend({},b.integer,g);o=g.thousandsSeparator.replace(m,"\\$1");l=new RegExp(o,"g");h=a(e).text().replace(l,"");break;case"number":g=a.extend({},b.number,g);o=g.thousandsSeparator.replace(m,"\\$1");l=new RegExp(o,"g");h=a(e).text().replace(l,"").replace(g.decimalSeparator,".");break;case"currency":g=a.extend({},b.currency,g);o=g.thousandsSeparator.replace(m,"\\$1");l=new RegExp(o,"g");h=a(e).text();if(g.prefix&&g.prefix.length){h=h.substr(g.prefix.length)}if(g.suffix&&g.suffix.length){h=h.substr(0,h.length-g.suffix.length)}h=h.replace(l,"").replace(g.decimalSeparator,".");break;case"checkbox":var d=(n.colModel.editoptions)?n.colModel.editoptions.value.split(":"):["Yes","No"];h=a("input",e).is(":checked")?d[0]:d[1];break;case"select":h=a.unformat.select(e,n,k,c);break;case"actions":return"";default:h=a(e).text()}}}return h!==undefined?h:c===true?a(e).text():a.jgrid.htmlDecode(a(e).html())};a.unformat.select=function(g,r,m,d){var l=[];var p=a(g).text();if(d===true){return p}var k=a.extend({},!a.fmatter.isUndefined(r.colModel.formatoptions)?r.colModel.formatoptions:r.colModel.editoptions),s=k.separator===undefined?":":k.separator,c=k.delimiter===undefined?";":k.delimiter;if(k.value){var e=k.value,q=k.multiple===true?true:false,o=[],n;if(q){o=p.split(",");o=a.map(o,function(j){return a.trim(j)})}if(a.fmatter.isString(e)){var b=e.split(c),f=0,h;for(h=0;h<b.length;h++){n=b[h].split(s);if(n.length>2){n[1]=a.map(n,function(t,j){if(j>0){return t}}).join(s)}if(q){if(a.inArray(n[1],o)>-1){l[f]=n[0];f++}}else{if(a.trim(n[1])==a.trim(p)){l[0]=n[0];break}}}}else{if(a.fmatter.isObject(e)||a.isArray(e)){if(!q){o[0]=p}l=a.map(o,function(t){var j;a.each(e,function(u,v){if(v==t){j=u;return false}});if(j!==undefined){return j}})}}return l.join(", ")}return p||""};a.unformat.date=function(c,b){var d=a.jgrid.formatter.date||{};if(!a.fmatter.isUndefined(b.formatoptions)){d=a.extend({},d,b.formatoptions)}if(!a.fmatter.isEmpty(c)){return a.fmatter.util.DateFormat(d.newformat,c,d.srcformat,d)}return a.fn.fmatter.defaultFormat(c,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,f){f=a.extend({jqm:true,gb:""},f||{});if(f.onClose){var c=f.gb&&typeof f.gb==="string"&&f.gb.substr(0,6)==="#gbox_"?f.onClose.call(a("#"+f.gb.substr(6))[0],b):f.onClose(b);if(typeof c==="boolean"&&!c){return}}if(a.fn.jqm&&f.jqm===true){a(b).attr("aria-hidden","true").jqmHide()}else{if(f.gb!==""){try{a(".jqgrid-overlay:first",f.gb).hide()}catch(d){}}a(b).hide().attr("aria-hidden","true")}},findPos:function(c){var d=0,b=0;if(c.offsetParent){do{d+=c.offsetLeft;b+=c.offsetTop}while(c=c.offsetParent)}return[d,b]},createModal:function(j,s,n,b,w,c,h){n=a.extend(true,{},a.jgrid.jqModal||{},n);var l=document.createElement("div"),t,m=this;h=a.extend({},h||{});t=a(n.gbox).attr("dir")=="rtl"?true:false;l.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";l.id=j.themodal;var v=document.createElement("div");v.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";v.id=j.modalhead;a(v).append("<span class='ui-jqdialog-title'>"+n.caption+"</span>");var o=a("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){o.addClass("ui-state-hover")},function(){o.removeClass("ui-state-hover")}).append("<span class='ui-icon ui-icon-closethick'></span>");a(v).append(o);if(t){l.dir="rtl";a(".ui-jqdialog-title",v).css("float","right");a(".ui-jqdialog-titlebar-close",v).css("left",0.3+"em")}else{l.dir="ltr";a(".ui-jqdialog-title",v).css("float","left");a(".ui-jqdialog-titlebar-close",v).css("right",0.3+"em")}var x=document.createElement("div");a(x).addClass("ui-jqdialog-content ui-widget-content").attr("id",j.modalcontent);a(x).append(s);l.appendChild(x);a(l).prepend(v);if(c===true){a("body").append(l)}else{if(typeof c==="string"){a(c).append(l)}else{a(l).insertBefore(b)}}a(l).css(h);if(n.jqModal===undefined){n.jqModal=true}var q={};if(a.fn.jqm&&n.jqModal===true){if(n.left===0&&n.top===0&&n.overlay){var d=[];d=a.jgrid.findPos(w);n.left=d[0]+4;n.top=d[1]+4}q.top=n.top+"px";q.left=n.left}else{if(n.left!==0||n.top!==0){q.left=n.left;q.top=n.top+"px"}}a("a.ui-jqdialog-titlebar-close",v).click(function(){var e=a("#"+a.jgrid.jqID(j.themodal)).data("onClose")||n.onClose;var p=a("#"+a.jgrid.jqID(j.themodal)).data("gbox")||n.gbox;m.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:p,jqm:n.jqModal,onClose:e});return false});if(n.width===0||!n.width){n.width=300}if(n.height===0||!n.height){n.height=200}if(!n.zIndex){var f=a(b).parents("*[role=dialog]").filter(":first").css("z-index");if(f){n.zIndex=parseInt(f,10)+2}else{n.zIndex=950}}var g=0;if(t&&q.left&&!c){g=a(n.gbox).width()-(!isNaN(n.width)?parseInt(n.width,10):0)-8;q.left=parseInt(q.left,10)+parseInt(g,10)}if(q.left){q.left+="px"}a(l).css(a.extend({width:isNaN(n.width)?"auto":n.width+"px",height:isNaN(n.height)?"auto":n.height+"px",zIndex:n.zIndex,overflow:"hidden"},q)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":j.modalhead,"aria-hidden":"true"});if(n.drag===undefined){n.drag=true}if(n.resize===undefined){n.resize=true}if(n.drag){a(v).css("cursor","move");if(a.fn.jqDrag){a(l).jqDrag(v)}else{try{a(l).draggable({handle:a("#"+a.jgrid.jqID(v.id))})}catch(u){}}}if(n.resize){if(a.fn.jqResize){a(l).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se'></div>");a("#"+a.jgrid.jqID(j.themodal)).jqResize(".jqResize",j.scrollelm?"#"+a.jgrid.jqID(j.scrollelm):false)}else{try{a(l).resizable({handles:"se, sw",alsoResize:j.scrollelm?"#"+a.jgrid.jqID(j.scrollelm):false})}catch(k){}}}if(n.closeOnEscape===true){a(l).keydown(function(r){if(r.which==27){var p=a("#"+a.jgrid.jqID(j.themodal)).data("onClose")||n.onClose;m.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:n.gbox,jqm:n.jqModal,onClose:p})}})}},viewModal:function(b,d){d=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},d||{});if(a.fn.jqm&&d.jqm===true){if(d.jqM){a(b).attr("aria-hidden","false").jqm(d).jqmShow()}else{a(b).attr("aria-hidden","false").jqmShow()}}else{if(d.gbox!==""){a(".jqgrid-overlay:first",d.gbox).show();a(b).data("gbox",d.gbox)}a(b).show().attr("aria-hidden","false");try{a(":input:visible",b)[0].focus()}catch(c){}}},info_dialog:function(q,k,c,p){var n={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,n,a.jgrid.jqModal||{},{caption:"<b>"+q+"</b>"},p||{});var f=n.jqModal,r=this;if(a.fn.jqm&&!f){f=false}var h="",g;if(n.buttons.length>0){for(g=0;g<n.buttons.length;g++){if(n.buttons[g].id===undefined){n.buttons[g].id="info_button_"+g}h+="<a href='javascript:void(0)' id='"+n.buttons[g].id+"' class='fm-button ui-state-default ui-corner-all'>"+n.buttons[g].text+"</a>"}}var l=isNaN(n.dataheight)?n.dataheight:n.dataheight+"px",o="text-align:"+n.align+";";var b="<div id='info_id'>";b+="<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+l+";"+o+"'>"+k+"</div>";b+=c?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+n.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'>"+c+"</a>"+h+"</div>":h!==""?"<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+n.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+h+"</div>":"";b+="</div>";try{if(a("#info_dialog").attr("aria-hidden")=="false"){a.jgrid.hideModal("#info_dialog",{jqm:f})}a("#info_dialog").remove()}catch(j){}a.jgrid.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},b,n,"","",true);if(h){a.each(n.buttons,function(e){a("#"+a.jgrid.jqID(this.id),"#info_id").bind("click",function(){n.buttons[e].onClick.call(a("#info_dialog"));return false})})}a("#closedialog","#info_id").click(function(){r.hideModal("#info_dialog",{jqm:f});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(n.beforeOpen)){n.beforeOpen()}a.jgrid.viewModal("#info_dialog",{onHide:function(e){e.w.hide().remove();if(e.o){e.o.remove()}},modal:n.modal,jqm:f});if(a.isFunction(n.afterOpen)){n.afterOpen()}try{a("#info_dialog").focus()}catch(d){}},bindEv:function(c,b,d){if(a.isFunction(b.dataInit)){b.dataInit.call(d,c)}if(b.dataEvents){a.each(b.dataEvents,function(){if(this.data!==undefined){a(c).bind(this.type,this.data,this.fn)}else{a(c).bind(this.type,this.fn)}})}},createEl:function(f,h,x,m,v){var w="",r=this;function t(E,D,C){var e=["dataInit","dataEvents","dataUrl","buildSelect","sopt","searchhidden","defaultValue","attr","custom_element","custom_value"];if(C!==undefined&&a.isArray(C)){a.merge(e,C)}a.each(D,function(F,G){if(a.inArray(F,e)===-1){a(E).attr(F,G)}});if(!D.hasOwnProperty("id")){a(E).attr("id",a.jgrid.randId())}}switch(f){case"textarea":w=document.createElement("textarea");if(m){if(!h.cols){a(w).css({width:"98%"})}}else{if(!h.cols){h.cols=20}}if(!h.rows){h.rows=2}if(x=="&nbsp;"||x=="&#160;"||(x.length==1&&x.charCodeAt(0)==160)){x=""}w.value=x;t(w,h);a(w).attr({role:"textbox",multiline:"true"});break;case"checkbox":w=document.createElement("input");w.type="checkbox";if(!h.value){var B=x.toLowerCase();if(B.search(/(false|0|no|off|undefined)/i)<0&&B!==""){w.checked=true;w.defaultChecked=true;w.value=x}else{w.value="on"}a(w).attr("offval","off")}else{var p=h.value.split(":");if(x===p[0]){w.checked=true;w.defaultChecked=true}w.value=p[0];a(w).attr("offval",p[1])}t(w,h,["value"]);a(w).attr("role","checkbox");break;case"select":w=document.createElement("select");w.setAttribute("role","select");var d,j=[];if(h.multiple===true){d=true;w.multiple="multiple";a(w).attr("aria-multiselectable","true")}else{d=false}if(h.dataUrl!==undefined){var l=h.name?String(h.id).substring(0,String(h.id).length-String(h.name).length-1):String(h.id),g=h.postData||v.postData;if(r.p&&r.p.idPrefix){l=a.jgrid.stripPref(r.p.idPrefix,l)}else{g=undefined}a.ajax(a.extend({url:h.dataUrl,type:"GET",dataType:"html",data:a.isFunction(g)?g.call(r,l,x,String(h.name)):g,context:{elem:w,options:h,vl:x},success:function(I){var D,C=[],H=this.elem,G=this.vl,E=a.extend({},this.options),F=E.multiple===true;if(a.isFunction(E.buildSelect)){var e=E.buildSelect.call(r,I);D=a(e).html()}else{D=a(I).html()}if(D){a(H).append(D);t(H,E);if(E.size===undefined){E.size=F?3:1}if(F){C=G.split(",");C=a.map(C,function(J){return a.trim(J)})}else{C[0]=a.trim(G)}setTimeout(function(){a("option",H).each(function(J){if(J===0&&H.multiple){this.selected=false}a(this).attr("role","option");if(a.inArray(a.trim(a(this).text()),C)>-1||a.inArray(a.trim(a(this).val()),C)>-1){this.selected="selected"}})},0)}}},v||{}))}else{if(h.value){var q;if(h.size===undefined){h.size=d?3:1}if(d){j=x.split(",");j=a.map(j,function(e){return a.trim(e)})}if(typeof h.value==="function"){h.value=h.value()}var s,o,k,n=h.separator===undefined?":":h.separator,y=h.delimiter===undefined?";":h.delimiter;if(typeof h.value==="string"){s=h.value.split(y);for(q=0;q<s.length;q++){o=s[q].split(n);if(o.length>2){o[1]=a.map(o,function(C,e){if(e>0){return C}}).join(n)}k=document.createElement("option");k.setAttribute("role","option");k.value=o[0];k.innerHTML=o[1];w.appendChild(k);if(!d&&(a.trim(o[0])==a.trim(x)||a.trim(o[1])==a.trim(x))){k.selected="selected"}if(d&&(a.inArray(a.trim(o[1]),j)>-1||a.inArray(a.trim(o[0]),j)>-1)){k.selected="selected"}}}else{if(typeof h.value==="object"){var c=h.value,A;for(A in c){if(c.hasOwnProperty(A)){k=document.createElement("option");k.setAttribute("role","option");k.value=A;k.innerHTML=c[A];w.appendChild(k);if(!d&&(a.trim(A)==a.trim(x)||a.trim(c[A])==a.trim(x))){k.selected="selected"}if(d&&(a.inArray(a.trim(c[A]),j)>-1||a.inArray(a.trim(A),j)>-1)){k.selected="selected"}}}}}t(w,h,["value"])}}break;case"text":case"password":case"button":var z;if(f=="button"){z="button"}else{z="textbox"}w=document.createElement("input");w.type=f;w.value=x;t(w,h);if(f!="button"){if(m){if(!h.size){a(w).css({width:"98%"})}}else{if(!h.size){h.size=20}}}a(w).attr("role",z);break;case"image":case"file":w=document.createElement("input");w.type=f;t(w,h);break;case"custom":w=document.createElement("span");try{if(a.isFunction(h.custom_element)){var b=h.custom_element.call(r,x,h);if(b){b=a(b).addClass("customelement").attr({id:h.id,name:h.name});a(w).empty().append(b)}else{throw"e2"}}else{throw"e1"}}catch(u){if(u=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}if(u=="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 u==="string"?u:u.message,a.jgrid.edit.bClose)}}break}return w},checkDate:function(o,e){var m=function(j){return(((j%4===0)&&(j%100!==0||(j%400===0)))?29:28)},d=function(r){var j;for(j=1;j<=r;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 g={},q;o=o.toLowerCase();if(o.indexOf("/")!=-1){q="/"}else{if(o.indexOf("-")!=-1){q="-"}else{if(o.indexOf(".")!=-1){q="."}else{q="/"}}}o=o.split(q);e=e.split(q);if(e.length!=3){return false}var k=-1,p,h=-1,f=-1,l;for(l=0;l<o.length;l++){var c=isNaN(e[l])?0:parseInt(e[l],10);g[o[l]]=c;p=o[l];if(p.indexOf("y")!=-1){k=l}if(p.indexOf("m")!=-1){f=l}if(p.indexOf("d")!=-1){h=l}}if(o[k]=="y"||o[k]=="yyyy"){p=4}else{if(o[k]=="yy"){p=2}else{p=-1}}var b=d(12),n;if(k===-1){return false}n=g[o[k]].toString();if(p==2&&n.length==1){p=1}if(n.length!=p||(g[o[k]]===0&&e[k]!="00")){return false}if(f===-1){return false}n=g[o[f]].toString();if(n.length<1||g[o[f]]<1||g[o[f]]>12){return false}if(h===-1){return false}n=g[o[h]].toString();if(n.length<1||g[o[h]]<1||g[o[h]]>31||(g[o[f]]==2&&g[o[h]]>m(g[o[k]]))||g[o[h]]>b[g[o[f]]]){return false}return true},isEmpty:function(b){if(b.match(/^\s+$/)||b===""){return true}return false},checkTime:function(d){var c=/^(\d{1,2}):(\d{2})([ap]m)?$/,b;if(!a.jgrid.isEmpty(d)){b=d.match(c);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(d,p,l,q,j){var h,k,r,c,m;if(q===undefined){if(typeof p==="string"){for(k=0,m=l.p.colModel.length;k<m;k++){if(l.p.colModel[k].name==p){h=l.p.colModel[k].editrules;p=k;try{r=l.p.colModel[k].formoptions.label}catch(o){}break}}}else{if(p>=0){h=l.p.colModel[p].editrules}}}else{h=q;r=j===undefined?"_":j}if(h){if(!r){r=l.p.colNames[p]}if(h.required===true){if(a.jgrid.isEmpty(d)){return[false,r+": "+a.jgrid.edit.msg.required,""]}}var f=h.required===false?false:true;if(h.number===true){if(!(f===false&&a.jgrid.isEmpty(d))){if(isNaN(d)){return[false,r+": "+a.jgrid.edit.msg.number,""]}}}if(h.minValue!==undefined&&!isNaN(h.minValue)){if(parseFloat(d)<parseFloat(h.minValue)){return[false,r+": "+a.jgrid.edit.msg.minValue+" "+h.minValue,""]}}if(h.maxValue!==undefined&&!isNaN(h.maxValue)){if(parseFloat(d)>parseFloat(h.maxValue)){return[false,r+": "+a.jgrid.edit.msg.maxValue+" "+h.maxValue,""]}}var b;if(h.email===true){if(!(f===false&&a.jgrid.isEmpty(d))){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(d)){return[false,r+": "+a.jgrid.edit.msg.email,""]}}}if(h.integer===true){if(!(f===false&&a.jgrid.isEmpty(d))){if(isNaN(d)){return[false,r+": "+a.jgrid.edit.msg.integer,""]}if((d%1!==0)||(d.indexOf(".")!=-1)){return[false,r+": "+a.jgrid.edit.msg.integer,""]}}}if(h.date===true){if(!(f===false&&a.jgrid.isEmpty(d))){if(l.p.colModel[p].formatoptions&&l.p.colModel[p].formatoptions.newformat){c=l.p.colModel[p].formatoptions.newformat}else{c=l.p.colModel[p].datefmt||"Y-m-d"}if(!a.jgrid.checkDate(c,d)){return[false,r+": "+a.jgrid.edit.msg.date+" - "+c,""]}}}if(h.time===true){if(!(f===false&&a.jgrid.isEmpty(d))){if(!a.jgrid.checkTime(d)){return[false,r+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""]}}}if(h.url===true){if(!(f===false&&a.jgrid.isEmpty(d))){b=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;if(!b.test(d)){return[false,r+": "+a.jgrid.edit.msg.url,""]}}}if(h.custom===true){if(!(f===false&&a.jgrid.isEmpty(d))){if(a.isFunction(h.custom_func)){var n=h.custom_func.call(l,d,r);return a.isArray(n)?n:[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 d=a.fn.jqFilter[b];if(!d){throw ("jqFilter - No such method: "+b)}var c=a.makeArray(arguments).slice(1);return d.apply(this,c)}var e=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=e;if(this.p.filter===null||this.p.filter===undefined){this.p.filter={groupOp:this.p.groupOps[0].op,rules:[],groups:[]}}var j,f=this.p.columns.length,g,k=/msie/i.test(navigator.userAgent)&&!window.opera;if(this.p._gridsopt.length){for(j=0;j<this.p._gridsopt.length;j++){this.p.ops[j].description=this.p._gridsopt[j]}}this.p.initFilter=a.extend(true,{},this.p.filter);if(!f){return}for(j=0;j<f;j++){g=this.p.columns[j];if(g.stype){g.inputtype=g.stype}else{if(!g.inputtype){g.inputtype="text"}}if(g.sorttype){g.searchtype=g.sorttype}else{if(!g.searchtype){g.searchtype="string"}}if(g.hidden===undefined){g.hidden=false}if(!g.label){g.label=g.name}if(g.index){g.name=g.index}if(!g.hasOwnProperty("searchoptions")){g.searchoptions={}}if(!g.hasOwnProperty("searchrules")){g.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 h=function(o,l){var m=[true,""];if(a.isFunction(l.searchrules)){m=l.searchrules(o,l)}else{if(a.jgrid&&a.jgrid.checkValues){try{m=a.jgrid.checkValues(o,-1,null,l.searchrules,l.label)}catch(n){}}}if(m&&m.length&&m[0]===false){e.error=!m[0];e.errmsg=m[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 l=this.createTableForGroup(e.filter,null);a(this).append(l);if(a.isFunction(this.p.afterRedraw)){this.p.afterRedraw.call(this,this.p)}};this.createTableForGroup=function(o,z){var n=this,x;var y=a("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>"),v="left";if(this.p.direction=="rtl"){v="right";y.attr("dir","rtl")}if(z===null){y.append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='"+v+"'></th></tr>")}var l=a("<tr></tr>");y.append(l);var m=a("<th colspan='5' align='"+v+"'></th>");l.append(m);if(this.p.ruleButtons===true){var s=a("<select class='opsel'></select>");m.append(s);var u="",t;for(x=0;x<e.groupOps.length;x++){t=o.groupOp===n.p.groupOps[x].op?" selected='selected'":"";u+="<option value='"+n.p.groupOps[x].op+"'"+t+">"+n.p.groupOps[x].text+"</option>"}s.append(u).bind("change",function(){o.groupOp=a(s).val();n.onchange()})}var C="<span></span>";if(this.p.groupButton){C=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>");C.bind("click",function(){if(o.groups===undefined){o.groups=[]}o.groups.push({groupOp:e.groupOps[0].op,rules:[],groups:[]});n.reDraw();n.onchange();return false})}m.append(C);if(this.p.ruleButtons===true){var q=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"),p;q.bind("click",function(){if(o.rules===undefined){o.rules=[]}for(x=0;x<n.p.columns.length;x++){var D=(n.p.columns[x].search===undefined)?true:n.p.columns[x].search,G=(n.p.columns[x].hidden===true),F=(n.p.columns[x].searchoptions.searchhidden===true);if((F&&D)||(D&&!G)){p=n.p.columns[x];break}}var E;if(p.searchoptions.sopt){E=p.searchoptions.sopt}else{if(n.p.sopt){E=n.p.sopt}else{if(a.inArray(p.searchtype,n.p.strarr)!==-1){E=n.p.stropts}else{E=n.p.numopts}}}o.rules.push({field:p.name,op:E[0],data:""});n.reDraw();return false});m.append(q)}if(z!==null){var r=a("<input type='button' value='-' title='Delete group' class='delete-group'/>");m.append(r);r.bind("click",function(){for(x=0;x<z.groups.length;x++){if(z.groups[x]===o){z.groups.splice(x,1);break}}n.reDraw();n.onchange();return false})}if(o.groups!==undefined){for(x=0;x<o.groups.length;x++){var w=a("<tr></tr>");y.append(w);var A=a("<td class='first'></td>");w.append(A);var B=a("<td colspan='4'></td>");B.append(this.createTableForGroup(o.groups[x],o));w.append(B)}}if(o.groupOp===undefined){o.groupOp=n.p.groupOps[0].op}if(o.rules!==undefined){for(x=0;x<o.rules.length;x++){y.append(this.createTableRowForRule(o.rules[x],o))}}return y};this.createTableRowForRule=function(u,w){var v=this,m=a("<tr></tr>"),G,y,o,x,B="",A;m.append("<td class='first'></td>");var p=a("<td class='columns'></td>");m.append(p);var H=a("<select></select>"),z,D=[];p.append(H);H.bind("change",function(){u.field=a(H).val();o=a(this).parents("tr:first");for(G=0;G<v.p.columns.length;G++){if(v.p.columns[G].name===u.field){x=v.p.columns[G];break}}if(!x){return}x.searchoptions.id=a.jgrid.randId();if(k&&x.inputtype==="text"){if(!x.searchoptions.size){x.searchoptions.size=10}}var M=a.jgrid.createEl(x.inputtype,x.searchoptions,"",true,v.p.ajaxSelectOptions,true);a(M).addClass("input-elm");if(x.searchoptions.sopt){y=x.searchoptions.sopt}else{if(v.p.sopt){y=v.p.sopt}else{if(a.inArray(x.searchtype,v.p.strarr)!==-1){y=v.p.stropts}else{y=v.p.numopts}}}var K="",L=0;D=[];a.each(v.p.ops,function(){D.push(this.name)});for(G=0;G<y.length;G++){z=a.inArray(y[G],D);if(z!==-1){if(L===0){u.op=v.p.ops[z].name}K+="<option value='"+v.p.ops[z].name+"'>"+v.p.ops[z].description+"</option>";L++}}a(".selectopts",o).empty().append(K);a(".selectopts",o)[0].selectedIndex=0;if(a.jgrid.msie&&a.jgrid.msiever()<9){var J=parseInt(a("select.selectopts",o)[0].offsetWidth,10)+1;a(".selectopts",o).width(J);a(".selectopts",o).css("width","auto")}a(".data",o).empty().append(M);a.jgrid.bindEv(M,x.searchoptions,v);a(".input-elm",o).bind("change",function(O){var N=a(this).hasClass("ui-autocomplete-input")?200:0;setTimeout(function(){var P=O.target;u.data=P.nodeName.toUpperCase()==="SPAN"&&x.searchoptions&&a.isFunction(x.searchoptions.custom_value)?x.searchoptions.custom_value(a(P).children(".customelement:first"),"get"):P.value;v.onchange()},N)});setTimeout(function(){u.data=a(M).val();v.onchange()},0)});var E=0;for(G=0;G<v.p.columns.length;G++){var s=(v.p.columns[G].search===undefined)?true:v.p.columns[G].search,F=(v.p.columns[G].hidden===true),I=(v.p.columns[G].searchoptions.searchhidden===true);if((I&&s)||(s&&!F)){A="";if(u.field===v.p.columns[G].name){A=" selected='selected'";E=G}B+="<option value='"+v.p.columns[G].name+"'"+A+">"+v.p.columns[G].label+"</option>"}}H.append(B);var C=a("<td class='operators'></td>");m.append(C);x=e.columns[E];x.searchoptions.id=a.jgrid.randId();if(k&&x.inputtype==="text"){if(!x.searchoptions.size){x.searchoptions.size=10}}var n=a.jgrid.createEl(x.inputtype,x.searchoptions,u.data,true,v.p.ajaxSelectOptions,true);if(u.op=="nu"||u.op=="nn"){a(n).attr("readonly","true");a(n).attr("disabled","true")}var l=a("<select class='selectopts'></select>");C.append(l);l.bind("change",function(){u.op=a(l).val();o=a(this).parents("tr:first");var J=a(".input-elm",o)[0];if(u.op==="nu"||u.op==="nn"){u.data="";J.value="";J.setAttribute("readonly","true");J.setAttribute("disabled","true")}else{J.removeAttribute("readonly");J.removeAttribute("disabled")}v.onchange()});if(x.searchoptions.sopt){y=x.searchoptions.sopt}else{if(v.p.sopt){y=v.p.sopt}else{if(a.inArray(x.searchtype,v.p.strarr)!==-1){y=v.p.stropts}else{y=v.p.numopts}}}B="";a.each(v.p.ops,function(){D.push(this.name)});for(G=0;G<y.length;G++){z=a.inArray(y[G],D);if(z!==-1){A=u.op===v.p.ops[z].name?" selected='selected'":"";B+="<option value='"+v.p.ops[z].name+"'"+A+">"+v.p.ops[z].description+"</option>"}}l.append(B);var r=a("<td class='data'></td>");m.append(r);r.append(n);a.jgrid.bindEv(n,x.searchoptions,v);a(n).addClass("input-elm").bind("change",function(){u.data=x.inputtype==="custom"?x.searchoptions.custom_value(a(this).children(".customelement:first"),"get"):a(this).val();v.onchange()});var t=a("<td></td>");m.append(t);if(this.p.ruleButtons===true){var q=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");t.append(q);q.bind("click",function(){for(G=0;G<w.rules.length;G++){if(w.rules[G]===u){w.rules.splice(G,1);break}}v.reDraw();v.onchange();return false})}return m};this.getStringForGroup=function(o){var m="(",l;if(o.groups!==undefined){for(l=0;l<o.groups.length;l++){if(m.length>1){m+=" "+o.groupOp+" "}try{m+=this.getStringForGroup(o.groups[l])}catch(p){alert(p)}}}if(o.rules!==undefined){try{for(l=0;l<o.rules.length;l++){if(m.length>1){m+=" "+o.groupOp+" "}m+=this.getStringForRule(o.rules[l])}}catch(n){alert(n)}}m+=")";if(m==="()"){return""}return m};this.getStringForRule=function(q){var n="",s="",p,m,o,r,l=["int","integer","float","number","currency"];for(p=0;p<this.p.ops.length;p++){if(this.p.ops[p].name===q.op){n=this.p.ops[p].operator;s=this.p.ops[p].name;break}}for(p=0;p<this.p.columns.length;p++){if(this.p.columns[p].name===q.field){m=this.p.columns[p];break}}if(m==null){return""}r=q.data;if(s==="bw"||s==="bn"){r=r+"%"}if(s==="ew"||s==="en"){r="%"+r}if(s==="cn"||s==="nc"){r="%"+r+"%"}if(s==="in"||s==="ni"){r=" ("+r+")"}if(e.errorcheck){h(q.data,m)}if(a.inArray(m.searchtype,l)!==-1||s==="nn"||s==="nu"){o=q.field+" "+n+" "+r}else{o=q.field+" "+n+' "'+r+'"'}return o};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(e.filter)};this.toString=function(){var m=this;function n(q){if(m.p.errorcheck){var p,o;for(p=0;p<m.p.columns.length;p++){if(m.p.columns[p].name===q.field){o=m.p.columns[p];break}}if(o){h(q.data,o)}}return q.op+"(item."+q.field+",'"+q.data+"')"}function l(q){var p="(",o;if(q.groups!==undefined){for(o=0;o<q.groups.length;o++){if(p.length>1){if(q.groupOp==="OR"){p+=" || "}else{p+=" && "}}p+=l(q.groups[o])}}if(q.rules!==undefined){for(o=0;o<q.rules.length;o++){if(p.length>1){if(q.groupOp==="OR"){p+=" || "}else{p+=" && "}}p+=n(q.rules[o])}}p+=")";if(p==="()"){return""}return p}return l(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(c){c=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,c||{});return this.each(function(){var t=this;if(!t.grid){return}var d="fbox_"+t.p.id,j=true,f={themodal:"searchmod"+d,modalhead:"searchhd"+d,modalcontent:"searchcnt"+d,scrollelm:d},g=t.p.postData[c.sFilter];if(typeof g==="string"){g=b.jgrid.parse(g)}if(c.recreateFilter===true){b("#"+b.jgrid.jqID(f.themodal)).remove()}function h(x){j=b(t).triggerHandler("jqGridFilterBeforeShow",[x]);if(j===undefined){j=true}if(j&&b.isFunction(c.beforeShowSearch)){j=c.beforeShowSearch.call(t,x)}if(j){b.jgrid.viewModal("#"+b.jgrid.jqID(f.themodal),{gbox:"#gbox_"+b.jgrid.jqID(d),jqm:c.jqModal,modal:c.modal,overlay:c.overlay,toTop:c.toTop});b(t).triggerHandler("jqGridFilterAfterShow",[x]);if(b.isFunction(c.afterShowSearch)){c.afterShowSearch.call(t,x)}}}if(b("#"+b.jgrid.jqID(f.themodal))[0]!==undefined){h(b("#fbox_"+b.jgrid.jqID(+t.p.id)))}else{var u=b("<div><div id='"+d+"' class='searchFilter' style='overflow:auto'></div></div>").insertBefore("#gview_"+b.jgrid.jqID(t.p.id)),s="left",k="";if(t.p.direction=="rtl"){s="right";k=" style='text-align:left'";u.attr("dir","rtl")}var e=b.extend([],t.p.colModel),p="<a href='javascript:void(0)' id='"+d+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+c.Find+"</a>",w="<a href='javascript:void(0)' id='"+d+"_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>"+c.Reset+"</a>",r="",l="",n,o=false,v,q=-1;if(c.showQuery){r="<a href='javascript:void(0)' id='"+d+"_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(!c.columns.length){b.each(e,function(y,B){if(!B.label){B.label=t.p.colNames[y]}if(!o){var x=(B.search===undefined)?true:B.search,A=(B.hidden===true),z=(B.searchoptions&&B.searchoptions.searchhidden===true);if((z&&x)||(x&&!A)){o=true;n=B.index||B.name;q=y}}})}else{e=c.columns}if((!g&&n)||c.multipleSearch===false){var m="eq";if(q>=0&&e[q].searchoptions&&e[q].searchoptions.sopt){m=e[q].searchoptions.sopt[0]}else{if(c.sopt&&c.sopt.length){m=c.sopt[0]}}g={groupOp:"AND",rules:[{field:n,op:m,data:""}]}}o=false;if(c.tmplNames&&c.tmplNames.length){o=true;l=c.tmplLabel;l+="<select class='ui-template'>";l+="<option value='default'>Default</option>";b.each(c.tmplNames,function(x,y){l+="<option value='"+x+"'>"+y+"</option>"});l+="</select>"}v="<table class='EditTable' style='border:0px none;margin-top:5px' id='"+d+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:"+s+"'>"+w+l+"</td><td class='EditButton' "+k+">"+r+p+"</td></tr></tbody></table>";d=b.jgrid.jqID(d);b("#"+d).jqFilter({columns:e,filter:c.loadDefaults?g:null,showQuery:c.showQuery,errorcheck:c.errorcheck,sopt:c.sopt,groupButton:c.multipleGroup,ruleButtons:c.multipleSearch,afterRedraw:c.afterRedraw,_gridsopt:b.jgrid.search.odata,ajaxSelectOptions:t.p.ajaxSelectOptions,groupOps:c.groupOps,onChange:function(){if(this.p.showQuery){b(".query",this).html(this.toUserFriendlyString())}if(b.isFunction(c.afterChange)){c.afterChange.call(t,b("#"+d),c)}},direction:t.p.direction});u.append(v);if(o&&c.tmplFilters&&c.tmplFilters.length){b(".ui-template",u).bind("change",function(){var x=b(this).val();if(x=="default"){b("#"+d).jqFilter("addFilter",g)}else{b("#"+d).jqFilter("addFilter",c.tmplFilters[parseInt(x,10)])}return false})}if(c.multipleGroup===true){c.multipleSearch=true}b(t).triggerHandler("jqGridFilterInitialize",[b("#"+d)]);if(b.isFunction(c.onInitializeSearch)){c.onInitializeSearch.call(t,b("#"+d))}c.gbox="#gbox_"+d;if(c.layer){b.jgrid.createModal(f,u,c,"#gview_"+b.jgrid.jqID(t.p.id),b("#gbox_"+b.jgrid.jqID(t.p.id))[0],"#"+b.jgrid.jqID(c.layer),{position:"relative"})}else{b.jgrid.createModal(f,u,c,"#gview_"+b.jgrid.jqID(t.p.id),b("#gbox_"+b.jgrid.jqID(t.p.id))[0])}if(c.searchOnEnter||c.closeOnEscape){b("#"+b.jgrid.jqID(f.themodal)).keydown(function(y){var x=b(y.target);if(c.searchOnEnter&&y.which===13&&!x.hasClass("add-group")&&!x.hasClass("add-rule")&&!x.hasClass("delete-group")&&!x.hasClass("delete-rule")&&(!x.hasClass("fm-button")||!x.is("[id$=_query]"))){b("#"+d+"_search").focus().click();return false}if(c.closeOnEscape&&y.which===27){b("#"+b.jgrid.jqID(f.modalhead)).find(".ui-jqdialog-titlebar-close").focus().click();return false}})}if(r){b("#"+d+"_query").bind("click",function(){b(".queryresult",u).toggle();return false})}if(c.stringResult===undefined){c.stringResult=c.multipleSearch}b("#"+d+"_search").bind("click",function(){var A=b("#"+d),y={},x,z=A.jqFilter("filterData");if(c.errorcheck){A[0].hideError();if(!c.showQuery){A.jqFilter("toSQLString")}if(A[0].p.error){A[0].showError();return false}}if(c.stringResult){try{x=xmlJsonClass.toJson(z,"","",false)}catch(C){try{x=JSON.stringify(z)}catch(B){}}if(typeof x==="string"){y[c.sFilter]=x;b.each([c.sField,c.sValue,c.sOper],function(){y[this]=""})}}else{if(c.multipleSearch){y[c.sFilter]=z;b.each([c.sField,c.sValue,c.sOper],function(){y[this]=""})}else{y[c.sField]=z.rules[0].field;y[c.sValue]=z.rules[0].data;y[c.sOper]=z.rules[0].op;y[c.sFilter]=""}}t.p.search=true;b.extend(t.p.postData,y);b(t).triggerHandler("jqGridFilterSearch");if(b.isFunction(c.onSearch)){c.onSearch.call(t)}b(t).trigger("reloadGrid",[{page:1}]);if(c.closeAfterSearch){b.jgrid.hideModal("#"+b.jgrid.jqID(f.themodal),{gb:"#gbox_"+b.jgrid.jqID(t.p.id),jqm:c.jqModal,onClose:c.onClose})}return false});b("#"+d+"_reset").bind("click",function(){var x={},y=b("#"+d);t.p.search=false;if(c.multipleSearch===false){x[c.sField]=x[c.sValue]=x[c.sOper]=""}else{x[c.sFilter]=""}y[0].resetFilter();if(o){b(".ui-template",u).val("default")}b.extend(t.p.postData,x);b(t).triggerHandler("jqGridFilterReset");if(b.isFunction(c.onReset)){c.onReset.call(t)}b(t).trigger("reloadGrid",[{page:1}]);return false});h(b("#"+d));b(".fm-button:not(.ui-state-disabled)",u).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")})}})},editGridRow:function(c,d){d=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,d||{});a[b(this)[0].p.id]=d;return this.each(function(){var e=this;if(!e.grid||!c){return}var C=e.p.id,z="FrmGrid_"+C,V="TblGrid_"+C,w="#"+b.jgrid.jqID(V),k={themodal:"editmod"+C,modalhead:"edithd"+C,modalcontent:"editcnt"+C,scrollelm:z},D=b.isFunction(a[e.p.id].beforeShowForm)?a[e.p.id].beforeShowForm:false,M=b.isFunction(a[e.p.id].afterShowForm)?a[e.p.id].afterShowForm:false,L=b.isFunction(a[e.p.id].beforeInitData)?a[e.p.id].beforeInitData:false,q=b.isFunction(a[e.p.id].onInitializeForm)?a[e.p.id].onInitializeForm:false,Y=true,H=1,s=0,E,P,F,B,G;z=b.jgrid.jqID(z);if(c==="new"){c="_empty";G="add";d.caption=a[e.p.id].addCaption}else{d.caption=a[e.p.id].editCaption;G="edit"}if(d.recreateForm===true&&b("#"+b.jgrid.jqID(k.themodal))[0]!==undefined){b("#"+b.jgrid.jqID(k.themodal)).remove()}var n=true;if(d.checkOnUpdate&&d.jqModal&&!d.modal){n=false}function X(){b(w+" > tbody > tr > td > .FormElement").each(function(){var ae=b(".customelement",this);if(ae.length){var ac=ae[0],aa=b(ac).attr("name");b.each(e.p.colModel,function(){if(this.name===aa&&this.editoptions&&b.isFunction(this.editoptions.custom_value)){try{E[aa]=this.editoptions.custom_value.call(e,b("#"+b.jgrid.jqID(aa),w),"get");if(E[aa]===undefined){throw"e1"}}catch(af){if(af==="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,af.message,b.jgrid.edit.bClose)}}return true}})}else{switch(b(this).get(0).type){case"checkbox":if(b(this).is(":checked")){E[this.name]=b(this).val()}else{var ab=b(this).attr("offval");E[this.name]=ab}break;case"select-one":E[this.name]=b("option:selected",this).val();P[this.name]=b("option:selected",this).text();break;case"select-multiple":E[this.name]=b(this).val();if(E[this.name]){E[this.name]=E[this.name].join(",")}else{E[this.name]=""}var ad=[];b("option:selected",this).each(function(af,ag){ad[af]=b(ag).text()});P[this.name]=ad.join(",");break;case"password":case"text":case"textarea":case"button":E[this.name]=b(this).val();break}if(e.p.autoencode){E[this.name]=b.jgrid.htmlEncode(E[this.name])}}});return true}function u(ac,aj,ag,ae){var aq,ak,ab,af=0,ai,ap,aa,am=[],ad=false,al="<td class='CaptionTD'>&#160;</td><td class='DataTD'>&#160;</td>",ao="",ah;for(ah=1;ah<=ae;ah++){ao+=al}if(ac!="_empty"){ad=b(aj).jqGrid("getInd",ac)}b(aj.p.colModel).each(function(au){aq=this.name;if(this.editrules&&this.editrules.edithidden===true){ak=false}else{ak=this.hidden===true?true:false}ap=ak?"style='display:none'":"";if(aq!=="cb"&&aq!=="subgrid"&&this.editable===true&&aq!=="rn"){if(ad===false){ai=""}else{if(aq==aj.p.ExpandColumn&&aj.p.treeGrid===true){ai=b("td[role='gridcell']:eq("+au+")",aj.rows[ad]).text()}else{try{ai=b.unformat.call(aj,b("td[role='gridcell']:eq("+au+")",aj.rows[ad]),{rowId:ac,colModel:this},au)}catch(ar){ai=(this.edittype&&this.edittype=="textarea")?b("td[role='gridcell']:eq("+au+")",aj.rows[ad]).text():b("td[role='gridcell']:eq("+au+")",aj.rows[ad]).html()}if(!ai||ai=="&nbsp;"||ai=="&#160;"||(ai.length==1&&ai.charCodeAt(0)==160)){ai=""}}}var at=b.extend({},this.editoptions||{},{id:aq,name:aq}),ay=b.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),av=parseInt(ay.rowpos,10)||af+1,ax=parseInt((parseInt(ay.colpos,10)||1)*2,10);if(ac=="_empty"&&at.defaultValue){ai=b.isFunction(at.defaultValue)?at.defaultValue.call(e):at.defaultValue}if(!this.edittype){this.edittype="text"}if(e.p.autoencode){ai=b.jgrid.htmlDecode(ai)}aa=b.jgrid.createEl.call(e,this.edittype,at,ai,false,b.extend({},b.jgrid.ajaxOptions,aj.p.ajaxSelectOptions||{}));if(ai===""&&this.edittype=="checkbox"){ai=b(aa).attr("offval")}if(ai===""&&this.edittype=="select"){ai=b("option:eq(0)",aa).text()}if(a[e.p.id].checkOnSubmit||a[e.p.id].checkOnUpdate){a[e.p.id]._savedData[aq]=ai}b(aa).addClass("FormElement");if(b.inArray(this.edittype,["text","textarea","password","select"])>-1){b(aa).addClass("ui-widget-content ui-corner-all")}ab=b(ag).find("tr[rowpos="+av+"]");if(ay.rowabove){var aw=b("<tr><td class='contentinfo' colspan='"+(ae*2)+"'>"+ay.rowcontent+"</td></tr>");b(ag).append(aw);aw[0].rp=av}if(ab.length===0){ab=b("<tr "+ap+" rowpos='"+av+"'></tr>").addClass("FormData").attr("id","tr_"+aq);b(ab).append(ao);b(ag).append(ab);ab[0].rp=av}b("td:eq("+(ax-2)+")",ab[0]).html(ay.label===undefined?aj.p.colNames[au]:ay.label);b("td:eq("+(ax-1)+")",ab[0]).append(ay.elmprefix).append(aa).append(ay.elmsuffix);if(b.isFunction(at.custom_value)&&ac!=="_empty"){at.custom_value.call(e,b("#"+aq,"#"+z),"set",ai)}b.jgrid.bindEv(aa,at,e);am[af]=au;af++}});if(af>0){var an=b("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(ae*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+aj.p.id+"_id' value='"+ac+"'/></td></tr>");an[0].rp=af+999;b(ag).append(an);if(a[e.p.id].checkOnSubmit||a[e.p.id].checkOnUpdate){a[e.p.id]._savedData[aj.p.id+"_id"]=ac}}return am}function r(aa,ah,ad){var al,ae=0,ai,ag,ab,af,aj;if(a[e.p.id].checkOnSubmit||a[e.p.id].checkOnUpdate){a[e.p.id]._savedData={};a[e.p.id]._savedData[ah.p.id+"_id"]=aa}var ak=ah.p.colModel;if(aa=="_empty"){b(ak).each(function(){al=this.name;ab=b.extend({},this.editoptions||{});ag=b("#"+b.jgrid.jqID(al),"#"+ad);if(ag&&ag.length&&ag[0]!==null){af="";if(ab.defaultValue){af=b.isFunction(ab.defaultValue)?ab.defaultValue.call(e):ab.defaultValue;if(ag[0].type=="checkbox"){aj=af.toLowerCase();if(aj.search(/(false|0|no|off|undefined)/i)<0&&aj!==""){ag[0].checked=true;ag[0].defaultChecked=true;ag[0].value=af}else{ag[0].checked=false;ag[0].defaultChecked=false}}else{ag.val(af)}}else{if(ag[0].type=="checkbox"){ag[0].checked=false;ag[0].defaultChecked=false;af=b(ag).attr("offval")}else{if(ag[0].type&&ag[0].type.substr(0,6)=="select"){ag[0].selectedIndex=0}else{ag.val(af)}}}if(a[e.p.id].checkOnSubmit===true||a[e.p.id].checkOnUpdate){a[e.p.id]._savedData[al]=af}}});b("#id_g","#"+ad).val(aa);return}var ac=b(ah).jqGrid("getInd",aa,true);if(!ac){return}b('td[role="gridcell"]',ac).each(function(ap){al=ak[ap].name;if(al!=="cb"&&al!=="subgrid"&&al!=="rn"&&ak[ap].editable===true){if(al==ah.p.ExpandColumn&&ah.p.treeGrid===true){ai=b(this).text()}else{try{ai=b.unformat.call(ah,b(this),{rowId:aa,colModel:ak[ap]},ap)}catch(ao){ai=ak[ap].edittype=="textarea"?b(this).text():b(this).html()}}if(e.p.autoencode){ai=b.jgrid.htmlDecode(ai)}if(a[e.p.id].checkOnSubmit===true||a[e.p.id].checkOnUpdate){a[e.p.id]._savedData[al]=ai}al=b.jgrid.jqID(al);switch(ak[ap].edittype){case"password":case"text":case"button":case"image":case"textarea":if(ai=="&nbsp;"||ai=="&#160;"||(ai.length==1&&ai.charCodeAt(0)==160)){ai=""}b("#"+al,"#"+ad).val(ai);break;case"select":var an=ai.split(",");an=b.map(an,function(ar){return b.trim(ar)});b("#"+al+" option","#"+ad).each(function(){if(!ak[ap].editoptions.multiple&&(b.trim(ai)==b.trim(b(this).text())||an[0]==b.trim(b(this).text())||an[0]==b.trim(b(this).val()))){this.selected=true}else{if(ak[ap].editoptions.multiple){if(b.inArray(b.trim(b(this).text()),an)>-1||b.inArray(b.trim(b(this).val()),an)>-1){this.selected=true}else{this.selected=false}}else{this.selected=false}}});break;case"checkbox":ai=String(ai);if(ak[ap].editoptions&&ak[ap].editoptions.value){var am=ak[ap].editoptions.value.split(":");if(am[0]==ai){b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("checked",true);b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("defaultChecked",true)}else{b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("checked",false);b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("defaultChecked",false)}}else{ai=ai.toLowerCase();if(ai.search(/(false|0|no|off|undefined)/i)<0&&ai!==""){b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("checked",true);b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("defaultChecked",true)}else{b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("checked",false);b("#"+al,"#"+ad)[e.p.useProp?"prop":"attr"]("defaultChecked",false)}}break;case"custom":try{if(ak[ap].editoptions&&b.isFunction(ak[ap].editoptions.custom_value)){ak[ap].editoptions.custom_value.call(e,b("#"+al,"#"+ad),"set",ai)}else{throw"e1"}}catch(aq){if(aq=="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,aq.message,b.jgrid.edit.bClose)}}break}ae++}});if(ae>0){b("#id_g",w).val(aa)}}function T(){b.each(e.p.colModel,function(aa,ab){if(ab.editoptions&&ab.editoptions.NullIfEmpty===true){if(E.hasOwnProperty(ab.name)&&E[ab.name]===""){E[ab.name]="null"}}})}function l(){var ak,aj=[true,"",""],aa={},af=e.p.prmNames,ai,ad,an,ag,ae;var ah=b(e).triggerHandler("jqGridAddEditBeforeCheckValues",[b("#"+z),G]);if(ah&&typeof ah==="object"){E=ah}if(b.isFunction(a[e.p.id].beforeCheckValues)){ah=a[e.p.id].beforeCheckValues.call(e,E,b("#"+z),E[e.p.id+"_id"]=="_empty"?af.addoper:af.editoper);if(ah&&typeof ah==="object"){E=ah}}for(an in E){if(E.hasOwnProperty(an)){aj=b.jgrid.checkValues.call(e,E[an],an,e);if(aj[0]===false){break}}}T();if(aj[0]){aa=b(e).triggerHandler("jqGridAddEditClickSubmit",[a[e.p.id],E,G]);if(aa===undefined&&b.isFunction(a[e.p.id].onclickSubmit)){aa=a[e.p.id].onclickSubmit.call(e,a[e.p.id],E)||{}}aj=b(e).triggerHandler("jqGridAddEditBeforeSubmit",[E,b("#"+z),G]);if(aj===undefined){aj=[true,"",""]}if(aj[0]&&b.isFunction(a[e.p.id].beforeSubmit)){aj=a[e.p.id].beforeSubmit.call(e,E,b("#"+z))}}if(aj[0]&&!a[e.p.id].processing){a[e.p.id].processing=true;b("#sData",w+"_2").addClass("ui-state-active");ad=af.oper;ai=af.id;E[ad]=(b.trim(E[e.p.id+"_id"])=="_empty")?af.addoper:af.editoper;if(E[ad]!=af.addoper){E[ai]=E[e.p.id+"_id"]}else{if(E[ai]===undefined){E[ai]=E[e.p.id+"_id"]}}delete E[e.p.id+"_id"];E=b.extend(E,a[e.p.id].editData,aa);if(e.p.treeGrid===true){if(E[ad]==af.addoper){ag=b(e).jqGrid("getGridParam","selrow");var ab=e.p.treeGridModel=="adjacency"?e.p.treeReader.parent_id_field:"parent_id";E[ab]=ag}for(ae in e.p.treeReader){if(e.p.treeReader.hasOwnProperty(ae)){var am=e.p.treeReader[ae];if(E.hasOwnProperty(am)){if(E[ad]==af.addoper&&ae==="parent_id_field"){continue}delete E[am]}}}}E[ai]=b.jgrid.stripPref(e.p.idPrefix,E[ai]);var ac=b.extend({url:a[e.p.id].url||b(e).jqGrid("getGridParam","editurl"),type:a[e.p.id].mtype,data:b.isFunction(a[e.p.id].serializeEditData)?a[e.p.id].serializeEditData.call(e,E):E,complete:function(aq,ao){var ap;E[ai]=e.p.idPrefix+E[ai];if(ao!="success"){aj[0]=false;aj[1]=b(e).triggerHandler("jqGridAddEditErrorTextFormat",[aq,G]);if(b.isFunction(a[e.p.id].errorTextFormat)){aj[1]=a[e.p.id].errorTextFormat.call(e,aq)}else{aj[1]=ao+" Status: '"+aq.statusText+"'. Error code: "+aq.status}}else{aj=b(e).triggerHandler("jqGridAddEditAfterSubmit",[aq,E,G]);if(aj===undefined){aj=[true,"",""]}if(aj[0]&&b.isFunction(a[e.p.id].afterSubmit)){aj=a[e.p.id].afterSubmit.call(e,aq,E)}}if(aj[0]===false){b("#FormError>td",w).html(aj[1]);b("#FormError",w).show()}else{b.each(e.p.colModel,function(){if(P[this.name]&&this.formatter&&this.formatter=="select"){try{delete P[this.name]}catch(at){}}});E=b.extend(E,P);if(e.p.autoencode){b.each(E,function(au,at){E[au]=b.jgrid.htmlDecode(at)})}if(E[ad]==af.addoper){if(!aj[2]){aj[2]=b.jgrid.randId()}E[ai]=aj[2];if(a[e.p.id].closeAfterAdd){if(a[e.p.id].reloadAfterSubmit){b(e).trigger("reloadGrid")}else{if(e.p.treeGrid===true){b(e).jqGrid("addChildNode",aj[2],ag,E)}else{b(e).jqGrid("addRowData",aj[2],E,d.addedrow);b(e).jqGrid("setSelection",aj[2])}}b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose})}else{if(a[e.p.id].clearAfterAdd){if(a[e.p.id].reloadAfterSubmit){b(e).trigger("reloadGrid")}else{if(e.p.treeGrid===true){b(e).jqGrid("addChildNode",aj[2],ag,E)}else{b(e).jqGrid("addRowData",aj[2],E,d.addedrow)}}r("_empty",e,z)}else{if(a[e.p.id].reloadAfterSubmit){b(e).trigger("reloadGrid")}else{if(e.p.treeGrid===true){b(e).jqGrid("addChildNode",aj[2],ag,E)}else{b(e).jqGrid("addRowData",aj[2],E,d.addedrow)}}}}}else{if(a[e.p.id].reloadAfterSubmit){b(e).trigger("reloadGrid");if(!a[e.p.id].closeAfterEdit){setTimeout(function(){b(e).jqGrid("setSelection",E[ai])},1000)}}else{if(e.p.treeGrid===true){b(e).jqGrid("setTreeRow",E[ai],E)}else{b(e).jqGrid("setRowData",E[ai],E)}}if(a[e.p.id].closeAfterEdit){b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose})}}if(b.isFunction(a[e.p.id].afterComplete)){ak=aq;setTimeout(function(){b(e).triggerHandler("jqGridAddEditAfterComplete",[ak,E,b("#"+z),G]);a[e.p.id].afterComplete.call(e,ak,E,b("#"+z));ak=null},500)}if(a[e.p.id].checkOnSubmit||a[e.p.id].checkOnUpdate){b("#"+z).data("disabled",false);if(a[e.p.id]._savedData[e.p.id+"_id"]!="_empty"){for(ap in a[e.p.id]._savedData){if(a[e.p.id]._savedData.hasOwnProperty(ap)&&E[ap]){a[e.p.id]._savedData[ap]=E[ap]}}}}}a[e.p.id].processing=false;b("#sData",w+"_2").removeClass("ui-state-active");try{b(":input:visible","#"+z)[0].focus()}catch(ar){}}},b.jgrid.ajaxOptions,a[e.p.id].ajaxEditOptions);if(!ac.url&&!a[e.p.id].useDataProxy){if(b.isFunction(e.p.dataProxy)){a[e.p.id].useDataProxy=true}else{aj[0]=false;aj[1]+=" "+b.jgrid.errors.nourl}}if(aj[0]){if(a[e.p.id].useDataProxy){var al=e.p.dataProxy.call(e,ac,"set_"+e.p.id);if(al===undefined){al=[true,""]}if(al[0]===false){aj[0]=false;aj[1]=al[1]||"Error deleting the selected row!"}else{if(ac.data.oper==af.addoper&&a[e.p.id].closeAfterAdd){b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose})}if(ac.data.oper==af.editoper&&a[e.p.id].closeAfterEdit){b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose})}}}else{b.ajax(ac)}}}if(aj[0]===false){b("#FormError>td",w).html(aj[1]);b("#FormError",w).show()}}function J(ad,aa){var ab=false,ac;for(ac in ad){if(ad.hasOwnProperty(ac)&&ad[ac]!=aa[ac]){ab=true;break}}return ab}function h(){var aa=true;b("#FormError",w).hide();if(a[e.p.id].checkOnUpdate){E={};P={};X();F=b.extend({},E,P);B=J(F,a[e.p.id]._savedData);if(B){b("#"+z).data("disabled",true);b(".confirm","#"+k.themodal).show();aa=false}}return aa}function W(){var aa;if(c!=="_empty"&&e.p.savedRow!==undefined&&e.p.savedRow.length>0&&b.isFunction(b.fn.jqGrid.restoreRow)){for(aa=0;aa<e.p.savedRow.length;aa++){if(e.p.savedRow[aa].id==c){b(e).jqGrid("restoreRow",c);break}}}}function I(ab,aa){var ac=aa[1].length-1;if(ab===0){b("#pData",w+"_2").addClass("ui-state-disabled")}else{if(aa[1][ab-1]!==undefined&&b("#"+b.jgrid.jqID(aa[1][ab-1])).hasClass("ui-state-disabled")){b("#pData",w+"_2").addClass("ui-state-disabled")}else{b("#pData",w+"_2").removeClass("ui-state-disabled")}}if(ab==ac){b("#nData",w+"_2").addClass("ui-state-disabled")}else{if(aa[1][ab+1]!==undefined&&b("#"+b.jgrid.jqID(aa[1][ab+1])).hasClass("ui-state-disabled")){b("#nData",w+"_2").addClass("ui-state-disabled")}else{b("#nData",w+"_2").removeClass("ui-state-disabled")}}}function Z(){var ab=b(e).jqGrid("getDataIDs"),aa=b("#id_g",w).val(),ac=b.inArray(aa,ab);return[ac,ab]}if(b("#"+b.jgrid.jqID(k.themodal))[0]!==undefined){Y=b(e).triggerHandler("jqGridAddEditBeforeInitData",[b("#"+b.jgrid.jqID(z)),G]);if(Y===undefined){Y=true}if(Y&&L){Y=L.call(e,b("#"+z))}if(Y===false){return}W();b(".ui-jqdialog-title","#"+b.jgrid.jqID(k.modalhead)).html(d.caption);b("#FormError",w).hide();if(a[e.p.id].topinfo){b(".topinfo",w).html(a[e.p.id].topinfo);b(".tinfo",w).show()}else{b(".tinfo",w).hide()}if(a[e.p.id].bottominfo){b(".bottominfo",w+"_2").html(a[e.p.id].bottominfo);b(".binfo",w+"_2").show()}else{b(".binfo",w+"_2").hide()}r(c,e,z);if(c=="_empty"||!a[e.p.id].viewPagerButtons){b("#pData, #nData",w+"_2").hide()}else{b("#pData, #nData",w+"_2").show()}if(a[e.p.id].processing===true){a[e.p.id].processing=false;b("#sData",w+"_2").removeClass("ui-state-active")}if(b("#"+z).data("disabled")===true){b(".confirm","#"+b.jgrid.jqID(k.themodal)).hide();b("#"+z).data("disabled",false)}b(e).triggerHandler("jqGridAddEditBeforeShowForm",[b("#"+z),G]);if(D){D.call(e,b("#"+z))}b("#"+b.jgrid.jqID(k.themodal)).data("onClose",a[e.p.id].onClose);b.jgrid.viewModal("#"+b.jgrid.jqID(k.themodal),{gbox:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,jqM:false,overlay:d.overlay,modal:d.modal});if(!n){b(".jqmOverlay").click(function(){if(!h()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose});return false})}b(e).triggerHandler("jqGridAddEditAfterShowForm",[b("#"+z),G]);if(M){M.call(e,b("#"+z))}}else{var t=isNaN(d.dataheight)?d.dataheight:d.dataheight+"px",g=isNaN(d.datawidth)?d.datawidth:d.datawidth+"px",S=b("<form name='FormPost' id='"+z+"' class='FormGrid' onSubmit='return false;' style='width:"+g+";overflow:auto;position:relative;height:"+t+";'></form>").data("disabled",false),A=b("<table id='"+V+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");Y=b(e).triggerHandler("jqGridAddEditBeforeInitData",[b("#"+z),G]);if(Y===undefined){Y=true}if(Y&&L){Y=L.call(e,b("#"+z))}if(Y===false){return}W();b(e.p.colModel).each(function(){var aa=this.formoptions;H=Math.max(H,aa?aa.colpos||0:0);s=Math.max(s,aa?aa.rowpos||0:0)});b(S).append(A);var K=b("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+(H*2)+"'></td></tr>");K[0].rp=0;b(A).append(K);K=b("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+(H*2)+"'>"+a[e.p.id].topinfo+"</td></tr>");K[0].rp=0;b(A).append(K);var f=e.p.direction=="rtl"?true:false,R=f?"nData":"pData",U=f?"pData":"nData";u(c,e,A,H);var m="<a href='javascript:void(0)' id='"+R+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",o="<a href='javascript:void(0)' id='"+U+"' 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>",v="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+d.bCancel+"</a>";var O="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+V+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(f?o+m:m+o)+"</td><td class='EditButton'>"+j+v+"</td></tr>";O+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+a[e.p.id].bottominfo+"</td></tr>";O+="</tbody></table>";if(s>0){var y=[];b.each(b(A)[0].rows,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});b.each(y,function(aa,ab){b("tbody",A).append(ab)})}d.gbox="#gbox_"+b.jgrid.jqID(C);var p=false;if(d.closeOnEscape===true){d.closeOnEscape=false;p=true}var N=b("<div></div>").append(S).append(O);b.jgrid.createModal(k,N,d,"#gview_"+b.jgrid.jqID(e.p.id),b("#gbox_"+b.jgrid.jqID(e.p.id))[0]);if(f){b("#pData, #nData",w+"_2").css("float","right");b(".EditButton",w+"_2").css("text-align","left")}if(a[e.p.id].topinfo){b(".tinfo",w).show()}if(a[e.p.id].bottominfo){b(".binfo",w+"_2").show()}N=null;O=null;b("#"+b.jgrid.jqID(k.themodal)).keydown(function(aa){var ab=aa.target;if(b("#"+z).data("disabled")===true){return false}if(a[e.p.id].savekey[0]===true&&aa.which==a[e.p.id].savekey[1]){if(ab.tagName!="TEXTAREA"){b("#sData",w+"_2").trigger("click");return false}}if(aa.which===27){if(!h()){return false}if(p){b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:d.gbox,jqm:d.jqModal,onClose:a[e.p.id].onClose})}return false}if(a[e.p.id].navkeys[0]===true){if(b("#id_g",w).val()=="_empty"){return true}if(aa.which==a[e.p.id].navkeys[1]){b("#pData",w+"_2").trigger("click");return false}if(aa.which==a[e.p.id].navkeys[2]){b("#nData",w+"_2").trigger("click");return false}}});if(d.checkOnUpdate){b("a.ui-jqdialog-titlebar-close span","#"+b.jgrid.jqID(k.themodal)).removeClass("jqmClose");b("a.ui-jqdialog-titlebar-close","#"+b.jgrid.jqID(k.themodal)).unbind("click").click(function(){if(!h()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose});return false})}d.saveicon=b.extend([true,"left","ui-icon-disk"],d.saveicon);d.closeicon=b.extend([true,"left","ui-icon-close"],d.closeicon);if(d.saveicon[0]===true){b("#sData",w+"_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){b("#cData",w+"_2").addClass(d.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.closeicon[2]+"'></span>")}if(a[e.p.id].checkOnSubmit||a[e.p.id].checkOnUpdate){j="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+d.bYes+"</a>";o="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+d.bNo+"</a>";v="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+d.bExit+"</a>";var x=d.zIndex||999;x++;b("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+x+";display:none;'>&#160;</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(x+1)+"'>"+d.saveData+"<br/><br/>"+j+o+v+"</div>").insertAfter("#"+z);b("#sNew","#"+b.jgrid.jqID(k.themodal)).click(function(){l();b("#"+z).data("disabled",false);b(".confirm","#"+b.jgrid.jqID(k.themodal)).hide();return false});b("#nNew","#"+b.jgrid.jqID(k.themodal)).click(function(){b(".confirm","#"+b.jgrid.jqID(k.themodal)).hide();b("#"+z).data("disabled",false);setTimeout(function(){b(":input","#"+z)[0].focus()},0);return false});b("#cNew","#"+b.jgrid.jqID(k.themodal)).click(function(){b(".confirm","#"+b.jgrid.jqID(k.themodal)).hide();b("#"+z).data("disabled",false);b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose});return false})}b(e).triggerHandler("jqGridAddEditInitializeForm",[b("#"+z),G]);if(q){q.call(e,b("#"+z))}if(c=="_empty"||!a[e.p.id].viewPagerButtons){b("#pData,#nData",w+"_2").hide()}else{b("#pData,#nData",w+"_2").show()}b(e).triggerHandler("jqGridAddEditBeforeShowForm",[b("#"+z),G]);if(D){D.call(e,b("#"+z))}b("#"+b.jgrid.jqID(k.themodal)).data("onClose",a[e.p.id].onClose);b.jgrid.viewModal("#"+b.jgrid.jqID(k.themodal),{gbox:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,overlay:d.overlay,modal:d.modal});if(!n){b(".jqmOverlay").click(function(){if(!h()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose});return false})}b(e).triggerHandler("jqGridAddEditAfterShowForm",[b("#"+z),G]);if(M){M.call(e,b("#"+z))}b(".fm-button","#"+b.jgrid.jqID(k.themodal)).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});b("#sData",w+"_2").click(function(){E={};P={};b("#FormError",w).hide();X();if(E[e.p.id+"_id"]=="_empty"){l()}else{if(d.checkOnSubmit===true){F=b.extend({},E,P);B=J(F,a[e.p.id]._savedData);if(B){b("#"+z).data("disabled",true);b(".confirm","#"+b.jgrid.jqID(k.themodal)).show()}else{l()}}else{l()}}return false});b("#cData",w+"_2").click(function(){if(!h()){return false}b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(C),jqm:d.jqModal,onClose:a[e.p.id].onClose});return false});b("#nData",w+"_2").click(function(){if(!h()){return false}b("#FormError",w).hide();var ab=Z();ab[0]=parseInt(ab[0],10);if(ab[0]!=-1&&ab[1][ab[0]+1]){b(e).triggerHandler("jqGridAddEditClickPgButtons",["next",b("#"+z),ab[1][ab[0]]]);var aa;if(b.isFunction(d.onclickPgButtons)){aa=d.onclickPgButtons.call(e,"next",b("#"+z),ab[1][ab[0]]);if(aa!==undefined&&aa===false){return false}}if(b("#"+b.jgrid.jqID(ab[1][ab[0]+1])).hasClass("ui-state-disabled")){return false}r(ab[1][ab[0]+1],e,z);b(e).jqGrid("setSelection",ab[1][ab[0]+1]);b(e).triggerHandler("jqGridAddEditAfterClickPgButtons",["next",b("#"+z),ab[1][ab[0]]]);if(b.isFunction(d.afterclickPgButtons)){d.afterclickPgButtons.call(e,"next",b("#"+z),ab[1][ab[0]+1])}I(ab[0]+1,ab)}return false});b("#pData",w+"_2").click(function(){if(!h()){return false}b("#FormError",w).hide();var ab=Z();if(ab[0]!=-1&&ab[1][ab[0]-1]){b(e).triggerHandler("jqGridAddEditClickPgButtons",["prev",b("#"+z),ab[1][ab[0]]]);var aa;if(b.isFunction(d.onclickPgButtons)){aa=d.onclickPgButtons.call(e,"prev",b("#"+z),ab[1][ab[0]]);if(aa!==undefined&&aa===false){return false}}if(b("#"+b.jgrid.jqID(ab[1][ab[0]-1])).hasClass("ui-state-disabled")){return false}r(ab[1][ab[0]-1],e,z);b(e).jqGrid("setSelection",ab[1][ab[0]-1]);b(e).triggerHandler("jqGridAddEditAfterClickPgButtons",["prev",b("#"+z),ab[1][ab[0]]]);if(b.isFunction(d.afterclickPgButtons)){d.afterclickPgButtons.call(e,"prev",b("#"+z),ab[1][ab[0]-1])}I(ab[0]-1,ab)}return false})}var Q=Z();I(Q[0],Q)})},viewGridRow:function(c,d){d=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,d||{});a[b(this)[0].p.id]=d;return this.each(function(){var z=this;if(!z.grid||!c){return}var t=z.p.id,D="ViewGrid_"+b.jgrid.jqID(t),v="ViewTbl_"+b.jgrid.jqID(t),w="ViewGrid_"+t,p="ViewTbl_"+t,k={themodal:"viewmod"+t,modalhead:"viewhd"+t,modalcontent:"viewcnt"+t,scrollelm:D},C=b.isFunction(a[z.p.id].beforeInitData)?a[z.p.id].beforeInitData:false,n=true,h=1,g=0;function l(){if(a[z.p.id].closeOnEscape===true||a[z.p.id].navkeys[0]===true){setTimeout(function(){b(".ui-jqdialog-titlebar-close","#"+b.jgrid.jqID(k.modalhead)).focus()},0)}}function q(N,T,R,Z){var J,M,U,X=0,ac,ad,ab=[],S=false,Y,O="<td class='CaptionTD form-view-label ui-widget-content' width='"+d.labelswidth+"'>&#160;</td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'>&#160;</td>",Q="",K="<td class='CaptionTD form-view-label ui-widget-content'>&#160;</td><td class='DataTD form-view-data ui-widget-content'>&#160;</td>",P=["integer","number","currency"],W=0,V=0,L,I,aa;for(Y=1;Y<=Z;Y++){Q+=Y==1?O:K}b(T.p.colModel).each(function(){if(this.editrules&&this.editrules.edithidden===true){M=false}else{M=this.hidden===true?true:false}if(!M&&this.align==="right"){if(this.formatter&&b.inArray(this.formatter,P)!==-1){W=Math.max(W,parseInt(this.width,10))}else{V=Math.max(V,parseInt(this.width,10))}}});L=W!==0?W:V!==0?V:0;S=b(T).jqGrid("getInd",N);b(T.p.colModel).each(function(af){J=this.name;I=false;if(this.editrules&&this.editrules.edithidden===true){M=false}else{M=this.hidden===true?true:false}ad=M?"style='display:none'":"";aa=(typeof this.viewable!=="boolean")?true:this.viewable;if(J!=="cb"&&J!=="subgrid"&&J!=="rn"&&aa){if(S===false){ac=""}else{if(J==T.p.ExpandColumn&&T.p.treeGrid===true){ac=b("td:eq("+af+")",T.rows[S]).text()}else{ac=b("td:eq("+af+")",T.rows[S]).html()}}I=this.align==="right"&&L!==0?true:false;var aj=b.extend({},{rowabove:false,rowcontent:""},this.formoptions||{}),ag=parseInt(aj.rowpos,10)||X+1,ai=parseInt((parseInt(aj.colpos,10)||1)*2,10);if(aj.rowabove){var ah=b("<tr><td class='contentinfo' colspan='"+(Z*2)+"'>"+aj.rowcontent+"</td></tr>");b(R).append(ah);ah[0].rp=ag}U=b(R).find("tr[rowpos="+ag+"]");if(U.length===0){U=b("<tr "+ad+" rowpos='"+ag+"'></tr>").addClass("FormData").attr("id","trv_"+J);b(U).append(Q);b(R).append(U);U[0].rp=ag}b("td:eq("+(ai-2)+")",U[0]).html("<b>"+(aj.label===undefined?T.p.colNames[af]:aj.label)+"</b>");b("td:eq("+(ai-1)+")",U[0]).append("<span>"+ac+"</span>").attr("id","v_"+J);if(I){b("td:eq("+(ai-1)+") span",U[0]).css({"text-align":"right",width:L+"px"})}ab[X]=af;X++}});if(X>0){var ae=b("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+(Z*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+N+"'/></td></tr>");ae[0].rp=X+99;b(R).append(ae)}return ab}function o(M,O){var I,P,L=0,K,J,N;N=b(O).jqGrid("getInd",M,true);if(!N){return}b("td",N).each(function(Q){I=O.p.colModel[Q].name;if(O.p.colModel[Q].editrules&&O.p.colModel[Q].editrules.edithidden===true){P=false}else{P=O.p.colModel[Q].hidden===true?true:false}if(I!=="cb"&&I!=="subgrid"&&I!=="rn"){if(I==O.p.ExpandColumn&&O.p.treeGrid===true){K=b(this).text()}else{K=b(this).html()}J=b.extend({},O.p.colModel[Q].editoptions||{});I=b.jgrid.jqID("v_"+I);b("#"+I+" span","#"+v).html(K);if(P){b("#"+I,"#"+v).parents("tr:first").hide()}L++}});if(L>0){b("#id_g","#"+v).val(M)}}function r(J,I){var K=I[1].length-1;if(J===0){b("#pData","#"+v+"_2").addClass("ui-state-disabled")}else{if(I[1][J-1]!==undefined&&b("#"+b.jgrid.jqID(I[1][J-1])).hasClass("ui-state-disabled")){b("#pData",v+"_2").addClass("ui-state-disabled")}else{b("#pData","#"+v+"_2").removeClass("ui-state-disabled")}}if(J==K){b("#nData","#"+v+"_2").addClass("ui-state-disabled")}else{if(I[1][J+1]!==undefined&&b("#"+b.jgrid.jqID(I[1][J+1])).hasClass("ui-state-disabled")){b("#nData",v+"_2").addClass("ui-state-disabled")}else{b("#nData","#"+v+"_2").removeClass("ui-state-disabled")}}}function j(){var J=b(z).jqGrid("getDataIDs"),I=b("#id_g","#"+v).val(),K=b.inArray(I,J);return[K,J]}if(b("#"+b.jgrid.jqID(k.themodal))[0]!==undefined){if(C){n=C.call(z,b("#"+D));if(n===undefined){n=true}}if(n===false){return}b(".ui-jqdialog-title","#"+b.jgrid.jqID(k.modalhead)).html(d.caption);b("#FormError","#"+v).hide();o(c,z);if(b.isFunction(a[z.p.id].beforeShowForm)){a[z.p.id].beforeShowForm.call(z,b("#"+D))}b.jgrid.viewModal("#"+b.jgrid.jqID(k.themodal),{gbox:"#gbox_"+b.jgrid.jqID(t),jqm:d.jqModal,jqM:false,overlay:d.overlay,modal:d.modal});l()}else{var B=isNaN(d.dataheight)?d.dataheight:d.dataheight+"px",u=isNaN(d.datawidth)?d.datawidth:d.datawidth+"px",F=b("<form name='FormPost' id='"+w+"' class='FormGrid' style='width:"+u+";overflow:auto;position:relative;height:"+B+";'></form>"),m=b("<table id='"+p+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");if(C){n=C.call(z,b("#"+D));if(n===undefined){n=true}}if(n===false){return}b(z.p.colModel).each(function(){var I=this.formoptions;h=Math.max(h,I?I.colpos||0:0);g=Math.max(g,I?I.rowpos||0:0)});b(F).append(m);q(c,z,m,h);var A=z.p.direction=="rtl"?true:false,H=A?"nData":"pData",f=A?"pData":"nData",x="<a href='javascript:void(0)' id='"+H+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",y="<a href='javascript:void(0)' id='"+f+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",G="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+d.bClose+"</a>";if(g>0){var e=[];b.each(b(m)[0].rows,function(I,J){e[I]=J});e.sort(function(J,I){if(J.rp>I.rp){return 1}if(J.rp<I.rp){return -1}return 0});b.each(e,function(I,J){b("tbody",m).append(J)})}d.gbox="#gbox_"+b.jgrid.jqID(t);var E=b("<div></div>").append(F).append("<table border='0' class='EditTable' id='"+v+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+d.labelswidth+"'>"+(A?y+x:x+y)+"</td><td class='EditButton'>"+G+"</td></tr></tbody></table>");b.jgrid.createModal(k,E,d,"#gview_"+b.jgrid.jqID(z.p.id),b("#gview_"+b.jgrid.jqID(z.p.id))[0]);if(A){b("#pData, #nData","#"+v+"_2").css("float","right");b(".EditButton","#"+v+"_2").css("text-align","left")}if(!d.viewPagerButtons){b("#pData, #nData","#"+v+"_2").hide()}E=null;b("#"+k.themodal).keydown(function(I){if(I.which===27){if(a[z.p.id].closeOnEscape){b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:d.gbox,jqm:d.jqModal,onClose:d.onClose})}return false}if(d.navkeys[0]===true){if(I.which===d.navkeys[1]){b("#pData","#"+v+"_2").trigger("click");return false}if(I.which===d.navkeys[2]){b("#nData","#"+v+"_2").trigger("click");return false}}});d.closeicon=b.extend([true,"left","ui-icon-close"],d.closeicon);if(d.closeicon[0]===true){b("#cData","#"+v+"_2").addClass(d.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.closeicon[2]+"'></span>")}if(b.isFunction(d.beforeShowForm)){d.beforeShowForm.call(z,b("#"+D))}b.jgrid.viewModal("#"+b.jgrid.jqID(k.themodal),{gbox:"#gbox_"+b.jgrid.jqID(t),jqm:d.jqModal,overlay:d.overlay,modal:d.modal});b(".fm-button:not(.ui-state-disabled)","#"+v+"_2").hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});l();b("#cData","#"+v+"_2").click(function(){b.jgrid.hideModal("#"+b.jgrid.jqID(k.themodal),{gb:"#gbox_"+b.jgrid.jqID(t),jqm:d.jqModal,onClose:d.onClose});return false});b("#nData","#"+v+"_2").click(function(){b("#FormError","#"+v).hide();var I=j();I[0]=parseInt(I[0],10);if(I[0]!=-1&&I[1][I[0]+1]){if(b.isFunction(d.onclickPgButtons)){d.onclickPgButtons.call(z,"next",b("#"+D),I[1][I[0]])}o(I[1][I[0]+1],z);b(z).jqGrid("setSelection",I[1][I[0]+1]);if(b.isFunction(d.afterclickPgButtons)){d.afterclickPgButtons.call(z,"next",b("#"+D),I[1][I[0]+1])}r(I[0]+1,I)}l();return false});b("#pData","#"+v+"_2").click(function(){b("#FormError","#"+v).hide();var I=j();if(I[0]!=-1&&I[1][I[0]-1]){if(b.isFunction(d.onclickPgButtons)){d.onclickPgButtons.call(z,"prev",b("#"+D),I[1][I[0]])}o(I[1][I[0]-1],z);b(z).jqGrid("setSelection",I[1][I[0]-1]);if(b.isFunction(d.afterclickPgButtons)){d.afterclickPgButtons.call(z,"prev",b("#"+D),I[1][I[0]-1])}r(I[0]-1,I)}l();return false})}var s=j();r(s[0],s)})},delGridRow:function(c,d){d=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,d||{});a[b(this)[0].p.id]=d;return this.each(function(){var t=this;if(!t.grid){return}if(!c){return}var x=b.isFunction(a[t.p.id].beforeShowForm),k=b.isFunction(a[t.p.id].afterShowForm),v=b.isFunction(a[t.p.id].beforeInitData)?a[t.p.id].beforeInitData:false,l=t.p.id,n={},j=true,g="DelTbl_"+b.jgrid.jqID(l),s,q,m,o,e="DelTbl_"+l,f={themodal:"delmod"+l,modalhead:"delhd"+l,modalcontent:"delcnt"+l,scrollelm:g};if(b.isArray(c)){c=c.join()}if(b("#"+b.jgrid.jqID(f.themodal))[0]!==undefined){if(v){j=v.call(t,b("#"+g));if(j===undefined){j=true}}if(j===false){return}b("#DelData>td","#"+g).text(c);b("#DelError","#"+g).hide();if(a[t.p.id].processing===true){a[t.p.id].processing=false;b("#dData","#"+g).removeClass("ui-state-active")}if(x){a[t.p.id].beforeShowForm.call(t,b("#"+g))}b.jgrid.viewModal("#"+b.jgrid.jqID(f.themodal),{gbox:"#gbox_"+b.jgrid.jqID(l),jqm:a[t.p.id].jqModal,jqM:false,overlay:a[t.p.id].overlay,modal:a[t.p.id].modal});if(k){a[t.p.id].afterShowForm.call(t,b("#"+g))}}else{var u=isNaN(a[t.p.id].dataheight)?a[t.p.id].dataheight:a[t.p.id].dataheight+"px",p=isNaN(d.datawidth)?d.datawidth:d.datawidth+"px",h="<div id='"+e+"' class='formdata' style='width:"+p+";overflow:auto;position:relative;height:"+u+";'>";h+="<table class='DelTable'><tbody>";h+="<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";h+="<tr id='DelData' style='display:none'><td >"+c+"</td></tr>";h+='<tr><td class="delmsg" style="white-space:pre;">'+a[t.p.id].msg+"</td></tr><tr><td >&#160;</td></tr>";h+="</tbody></table></div>";var r="<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+d.bSubmit+"</a>",w="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+d.bCancel+"</a>";h+="<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+g+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton'>"+r+"&#160;"+w+"</td></tr></tbody></table>";d.gbox="#gbox_"+b.jgrid.jqID(l);b.jgrid.createModal(f,h,d,"#gview_"+b.jgrid.jqID(t.p.id),b("#gview_"+b.jgrid.jqID(t.p.id))[0]);if(v){j=v.call(t,b("#"+g));if(j===undefined){j=true}}if(j===false){return}b(".fm-button","#"+g+"_2").hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});d.delicon=b.extend([true,"left","ui-icon-scissors"],a[t.p.id].delicon);d.cancelicon=b.extend([true,"left","ui-icon-cancel"],a[t.p.id].cancelicon);if(d.delicon[0]===true){b("#dData","#"+g+"_2").addClass(d.delicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.delicon[2]+"'></span>")}if(d.cancelicon[0]===true){b("#eData","#"+g+"_2").addClass(d.cancelicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+d.cancelicon[2]+"'></span>")}b("#dData","#"+g+"_2").click(function(){var A=[true,""],C,B=b("#DelData>td","#"+g).text();n={};if(b.isFunction(a[t.p.id].onclickSubmit)){n=a[t.p.id].onclickSubmit.call(t,a[t.p.id],B)||{}}if(b.isFunction(a[t.p.id].beforeSubmit)){A=a[t.p.id].beforeSubmit.call(t,B)}if(A[0]&&!a[t.p.id].processing){a[t.p.id].processing=true;m=t.p.prmNames;s=b.extend({},a[t.p.id].delData,n);o=m.oper;s[o]=m.deloper;q=m.id;B=String(B).split(",");if(!B.length){return false}for(C in B){if(B.hasOwnProperty(C)){B[C]=b.jgrid.stripPref(t.p.idPrefix,B[C])}}s[q]=B.join();b(this).addClass("ui-state-active");var y=b.extend({url:a[t.p.id].url||b(t).jqGrid("getGridParam","editurl"),type:a[t.p.id].mtype,data:b.isFunction(a[t.p.id].serializeDelData)?a[t.p.id].serializeDelData.call(t,s):s,complete:function(F,D){var E;if(D!="success"){A[0]=false;if(b.isFunction(a[t.p.id].errorTextFormat)){A[1]=a[t.p.id].errorTextFormat.call(t,F)}else{A[1]=D+" Status: '"+F.statusText+"'. Error code: "+F.status}}else{if(b.isFunction(a[t.p.id].afterSubmit)){A=a[t.p.id].afterSubmit.call(t,F,s)}}if(A[0]===false){b("#DelError>td","#"+g).html(A[1]);b("#DelError","#"+g).show()}else{if(a[t.p.id].reloadAfterSubmit&&t.p.datatype!="local"){b(t).trigger("reloadGrid")}else{if(t.p.treeGrid===true){try{b(t).jqGrid("delTreeNode",t.p.idPrefix+B[0])}catch(G){}}else{for(E=0;E<B.length;E++){b(t).jqGrid("delRowData",t.p.idPrefix+B[E])}}t.p.selrow=null;t.p.selarrrow=[]}if(b.isFunction(a[t.p.id].afterComplete)){setTimeout(function(){a[t.p.id].afterComplete.call(t,F,B)},500)}}a[t.p.id].processing=false;b("#dData","#"+g+"_2").removeClass("ui-state-active");if(A[0]){b.jgrid.hideModal("#"+b.jgrid.jqID(f.themodal),{gb:"#gbox_"+b.jgrid.jqID(l),jqm:d.jqModal,onClose:a[t.p.id].onClose})}}},b.jgrid.ajaxOptions,a[t.p.id].ajaxDelOptions);if(!y.url&&!a[t.p.id].useDataProxy){if(b.isFunction(t.p.dataProxy)){a[t.p.id].useDataProxy=true}else{A[0]=false;A[1]+=" "+b.jgrid.errors.nourl}}if(A[0]){if(a[t.p.id].useDataProxy){var z=t.p.dataProxy.call(t,y,"del_"+t.p.id);if(z===undefined){z=[true,""]}if(z[0]===false){A[0]=false;A[1]=z[1]||"Error deleting the selected row!"}else{b.jgrid.hideModal("#"+b.jgrid.jqID(f.themodal),{gb:"#gbox_"+b.jgrid.jqID(l),jqm:d.jqModal,onClose:a[t.p.id].onClose})}}else{b.ajax(y)}}}if(A[0]===false){b("#DelError>td","#"+g).html(A[1]);b("#DelError","#"+g).show()}return false});b("#eData","#"+g+"_2").click(function(){b.jgrid.hideModal("#"+b.jgrid.jqID(f.themodal),{gb:"#gbox_"+b.jgrid.jqID(l),jqm:a[t.p.id].jqModal,onClose:a[t.p.id].onClose});return false});if(x){a[t.p.id].beforeShowForm.call(t,b("#"+g))}b.jgrid.viewModal("#"+b.jgrid.jqID(f.themodal),{gbox:"#gbox_"+b.jgrid.jqID(l),jqm:a[t.p.id].jqModal,overlay:a[t.p.id].overlay,modal:a[t.p.id].modal});if(k){a[t.p.id].afterShowForm.call(t,b("#"+g))}}if(a[t.p.id].closeOnEscape===true){setTimeout(function(){b(".ui-jqdialog-titlebar-close","#"+b.jgrid.jqID(f.modalhead)).focus()},0)}})},navGrid:function(f,h,e,g,d,c,j){h=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,h||{});return this.each(function(){if(this.nav){return}var k={themodal:"alertmod_"+this.p.id,modalhead:"alerthd_"+this.p.id,modalcontent:"alertcnt_"+this.p.id},n=this,q,l;if(!n.grid||typeof f!=="string"){return}if(b("#"+k.themodal)[0]===undefined){if(!h.alerttop&&!h.alertleft){if(window.innerWidth!==undefined){h.alertleft=window.innerWidth;h.alerttop=window.innerHeight}else{if(document.documentElement!==undefined&&document.documentElement.clientWidth!==undefined&&document.documentElement.clientWidth!==0){h.alertleft=document.documentElement.clientWidth;h.alerttop=document.documentElement.clientHeight}else{h.alertleft=1024;h.alerttop=768}}h.alertleft=h.alertleft/2-parseInt(h.alertwidth,10)/2;h.alerttop=h.alerttop/2-25}b.jgrid.createModal(k,"<div>"+h.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+b.jgrid.jqID(n.p.id),jqModal:true,drag:true,resize:true,caption:h.alertcap,top:h.alerttop,left:h.alertleft,width:h.alertwidth,height:h.alertheight,closeOnEscape:h.closeOnEscape,zIndex:h.alertzIndex},"#gview_"+b.jgrid.jqID(n.p.id),b("#gbox_"+b.jgrid.jqID(n.p.id))[0],true)}var r=1,o,p=function(){if(!b(this).hasClass("ui-state-disabled")){b(this).addClass("ui-state-hover")}},s=function(){b(this).removeClass("ui-state-hover")};if(h.cloneToTop&&n.p.toppager){r=2}for(o=0;o<r;o++){var t,v=b("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),w="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",m,u;if(o===0){m=f;u=n.p.id;if(m==n.p.toppager){u+="_top";r=1}}else{m=n.p.toppager;u=n.p.id+"_top"}if(n.p.direction=="rtl"){b(v).attr("dir","rtl").css("float","right")}if(h.add){g=g||{};t=b("<td class='ui-pg-button ui-corner-all'></td>");b(t).append("<div class='ui-pg-div'><span class='ui-icon "+h.addicon+"'></span>"+h.addtext+"</div>");b("tr",v).append(t);b(t,v).attr({title:h.addtitle||"",id:g.id||"add_"+u}).click(function(){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(h.addfunc)){h.addfunc.call(n)}else{b(n).jqGrid("editGridRow","new",g)}}return false}).hover(p,s);t=null}if(h.edit){t=b("<td class='ui-pg-button ui-corner-all'></td>");e=e||{};b(t).append("<div class='ui-pg-div'><span class='ui-icon "+h.editicon+"'></span>"+h.edittext+"</div>");b("tr",v).append(t);b(t,v).attr({title:h.edittitle||"",id:e.id||"edit_"+u}).click(function(){if(!b(this).hasClass("ui-state-disabled")){var x=n.p.selrow;if(x){if(b.isFunction(h.editfunc)){h.editfunc.call(n,x)}else{b(n).jqGrid("editGridRow",x,e)}}else{b.jgrid.viewModal("#"+k.themodal,{gbox:"#gbox_"+b.jgrid.jqID(n.p.id),jqm:true});b("#jqg_alrt").focus()}}return false}).hover(p,s);t=null}if(h.view){t=b("<td class='ui-pg-button ui-corner-all'></td>");j=j||{};b(t).append("<div class='ui-pg-div'><span class='ui-icon "+h.viewicon+"'></span>"+h.viewtext+"</div>");b("tr",v).append(t);b(t,v).attr({title:h.viewtitle||"",id:j.id||"view_"+u}).click(function(){if(!b(this).hasClass("ui-state-disabled")){var x=n.p.selrow;if(x){if(b.isFunction(h.viewfunc)){h.viewfunc.call(n,x)}else{b(n).jqGrid("viewGridRow",x,j)}}else{b.jgrid.viewModal("#"+k.themodal,{gbox:"#gbox_"+b.jgrid.jqID(n.p.id),jqm:true});b("#jqg_alrt").focus()}}return false}).hover(p,s);t=null}if(h.del){t=b("<td class='ui-pg-button ui-corner-all'></td>");d=d||{};b(t).append("<div class='ui-pg-div'><span class='ui-icon "+h.delicon+"'></span>"+h.deltext+"</div>");b("tr",v).append(t);b(t,v).attr({title:h.deltitle||"",id:d.id||"del_"+u}).click(function(){if(!b(this).hasClass("ui-state-disabled")){var x;if(n.p.multiselect){x=n.p.selarrrow;if(x.length===0){x=null}}else{x=n.p.selrow}if(x){if(b.isFunction(h.delfunc)){h.delfunc.call(n,x)}else{b(n).jqGrid("delGridRow",x,d)}}else{b.jgrid.viewModal("#"+k.themodal,{gbox:"#gbox_"+b.jgrid.jqID(n.p.id),jqm:true});b("#jqg_alrt").focus()}}return false}).hover(p,s);t=null}if(h.add||h.edit||h.del||h.view){b("tr",v).append(w)}if(h.search){t=b("<td class='ui-pg-button ui-corner-all'></td>");c=c||{};b(t).append("<div class='ui-pg-div'><span class='ui-icon "+h.searchicon+"'></span>"+h.searchtext+"</div>");b("tr",v).append(t);b(t,v).attr({title:h.searchtitle||"",id:c.id||"search_"+u}).click(function(){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(h.searchfunc)){h.searchfunc.call(n,c)}else{b(n).jqGrid("searchGrid",c)}}return false}).hover(p,s);if(c.showOnLoad&&c.showOnLoad===true){b(t,v).click()}t=null}if(h.refresh){t=b("<td class='ui-pg-button ui-corner-all'></td>");b(t).append("<div class='ui-pg-div'><span class='ui-icon "+h.refreshicon+"'></span>"+h.refreshtext+"</div>");b("tr",v).append(t);b(t,v).attr({title:h.refreshtitle||"",id:"refresh_"+u}).click(function(){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(h.beforeRefresh)){h.beforeRefresh.call(n)}n.p.search=false;try{var x=n.p.id;n.p.postData.filters="";b("#fbox_"+b.jgrid.jqID(x)).jqFilter("resetFilter");if(b.isFunction(n.clearToolbar)){n.clearToolbar.call(n,false)}}catch(y){}switch(h.refreshstate){case"firstpage":b(n).trigger("reloadGrid",[{page:1}]);break;case"current":b(n).trigger("reloadGrid",[{current:true}]);break}if(b.isFunction(h.afterRefresh)){h.afterRefresh.call(n)}}return false}).hover(p,s);t=null}l=b(".ui-jqgrid").css("font-size")||"11px";b("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+l+";visibility:hidden;' ></div>");q=b(v).clone().appendTo("#testpg2").width();b("#testpg2").remove();b(m+"_"+h.position,m).append(v);if(n.p._nvtd){if(q>n.p._nvtd[0]){b(m+"_"+h.position,m).width(q);n.p._nvtd[0]=q}n.p._nvtd[1]=q}l=null;q=null;v=null;this.nav=true}})},navButtonAdd:function(c,d){d=b.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},d||{});return this.each(function(){if(!this.grid){return}if(typeof c==="string"&&c.indexOf("#")!==0){c="#"+b.jgrid.jqID(c)}var e=b(".navtable",c)[0],g=this;if(e){if(d.id&&b("#"+b.jgrid.jqID(d.id),e)[0]!==undefined){return}var f=b("<td></td>");if(d.buttonicon.toString().toUpperCase()=="NONE"){b(f).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+d.caption+"</div>")}else{b(f).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+d.buttonicon+"'></span>"+d.caption+"</div>")}if(d.id){b(f).attr("id",d.id)}if(d.position=="first"){if(e.rows[0].cells.length===0){b("tr",e).append(f)}else{b("tr td:eq(0)",e).before(f)}}else{b("tr",e).append(f)}b(f,e).attr("title",d.title||"").click(function(h){if(!b(this).hasClass("ui-state-disabled")){if(b.isFunction(d.onClickButton)){d.onClickButton.call(g,h)}}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(c,d){d=b.extend({sepclass:"ui-separator",sepcontent:"",position:"last"},d||{});return this.each(function(){if(!this.grid){return}if(typeof c==="string"&&c.indexOf("#")!==0){c="#"+b.jgrid.jqID(c)}var f=b(".navtable",c)[0];if(f){var e="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+d.sepclass+"'></span>"+d.sepcontent+"</td>";if(d.position==="first"){if(f.rows[0].cells.length===0){b("tr",f).append(e)}else{b("tr td:eq(0)",f).before(e)}}else{b("tr",f).append(e)}}})},GridToForm:function(c,d){return this.each(function(){var g=this,e;if(!g.grid){return}var f=b(g).jqGrid("getRowData",c);if(f){for(e in f){if(f.hasOwnProperty(e)){if(b("[name="+b.jgrid.jqID(e)+"]",d).is("input:radio")||b("[name="+b.jgrid.jqID(e)+"]",d).is("input:checkbox")){b("[name="+b.jgrid.jqID(e)+"]",d).each(function(){if(b(this).val()==f[e]){b(this)[g.p.useProp?"prop":"attr"]("checked",true)}else{b(this)[g.p.useProp?"prop":"attr"]("checked",false)}})}else{b("[name="+b.jgrid.jqID(e)+"]",d).val(f[e])}}}}})},FormToGrid:function(d,e,f,c){return this.each(function(){var j=this;if(!j.grid){return}if(!f){f="set"}if(!c){c="first"}var g=b(e).serializeArray();var h={};b.each(g,function(k,l){h[l.name]=l.value});if(f=="add"){b(j).jqGrid("addRowData",d,h,c)}else{if(f=="set"){b(j).jqGrid("setRowData",d,h)}}})}})})(jQuery);(function(a){a.jgrid.inlineEdit=a.jgrid.inlineEdit||{};a.jgrid.extend({editRow:function(c,m,l,f,b,g,e,h,j){var d={},k=a.makeArray(arguments).slice(1);if(a.type(k[0])==="object"){d=k[0]}else{if(m!==undefined){d.keys=m}if(a.isFunction(l)){d.oneditfunc=l}if(a.isFunction(f)){d.successfunc=f}if(b!==undefined){d.url=b}if(g!==undefined){d.extraparam=g}if(a.isFunction(e)){d.aftersavefunc=e}if(a.isFunction(h)){d.errorfunc=h}if(a.isFunction(j)){d.afterrestorefunc=j}}d=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,d);return this.each(function(){var q=this,v,r,o,p=0,u=null,t={},n,s;if(!q.grid){return}n=a(q).jqGrid("getInd",c,true);if(n===false){return}o=a(n).attr("editable")||"0";if(o=="0"&&!a(n).hasClass("not-editable-row")){s=q.p.colModel;a('td[role="gridcell"]',n).each(function(z){v=s[z].name;var y=q.p.treeGrid===true&&v==q.p.ExpandColumn;if(y){r=a("span:first",this).html()}else{try{r=a.unformat.call(q,this,{rowId:c,colModel:s[z]},z)}catch(w){r=(s[z].edittype&&s[z].edittype=="textarea")?a(this).text():a(this).html()}}if(v!="cb"&&v!="subgrid"&&v!="rn"){if(q.p.autoencode){r=a.jgrid.htmlDecode(r)}t[v]=r;if(s[z].editable===true){if(u===null){u=z}if(y){a("span:first",this).html("")}else{a(this).html("")}var x=a.extend({},s[z].editoptions||{},{id:c+"_"+v,name:v});if(!s[z].edittype){s[z].edittype="text"}if(r=="&nbsp;"||r=="&#160;"||(r.length==1&&r.charCodeAt(0)==160)){r=""}var A=a.jgrid.createEl.call(q,s[z].edittype,x,r,true,a.extend({},a.jgrid.ajaxOptions,q.p.ajaxSelectOptions||{}));a(A).addClass("editable");if(y){a("span:first",this).append(A)}else{a(this).append(A)}a.jgrid.bindEv(A,x,q);if(s[z].edittype=="select"&&s[z].editoptions!==undefined&&s[z].editoptions.multiple===true&&s[z].editoptions.dataUrl===undefined&&a.jgrid.msie){a(A).width(a(A).width())}p++}}});if(p>0){t.id=c;q.p.savedRow.push(t);a(n).attr("editable","1");a("td:eq("+u+") input",n).focus();if(d.keys===true){a(n).bind("keydown",function(x){if(x.keyCode===27){a(q).jqGrid("restoreRow",c,d.afterrestorefunc);if(q.p._inlinenav){try{a(q).jqGrid("showAddEditButtons")}catch(z){}}return false}if(x.keyCode===13){var w=x.target;if(w.tagName=="TEXTAREA"){return true}if(a(q).jqGrid("saveRow",c,d)){if(q.p._inlinenav){try{a(q).jqGrid("showAddEditButtons")}catch(y){}}}return false}})}a(q).triggerHandler("jqGridInlineEditRow",[c,d]);if(a.isFunction(d.oneditfunc)){d.oneditfunc.call(q,c)}}}})},saveRow:function(n,j,g,h,t,r,b){var d=a.makeArray(arguments).slice(1),C={};if(a.type(d[0])==="object"){C=d[0]}else{if(a.isFunction(j)){C.successfunc=j}if(g!==undefined){C.url=g}if(h!==undefined){C.extraparam=h}if(a.isFunction(t)){C.aftersavefunc=t}if(a.isFunction(r)){C.errorfunc=r}if(a.isFunction(b)){C.afterrestorefunc=b}}C=a.extend(true,{successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:true,mtype:"POST"},a.jgrid.inlineEdit,C);var q=false;var G=this[0],c,I={},B={},A={},D,m,f,w;if(!G.grid){return q}w=a(G).jqGrid("getInd",n,true);if(w===false){return q}D=a(w).attr("editable");C.url=C.url||G.p.editurl;if(D==="1"){var u;a('td[role="gridcell"]',w).each(function(o){u=G.p.colModel[o];c=u.name;if(c!="cb"&&c!="subgrid"&&u.editable===true&&c!="rn"&&!a(this).hasClass("not-editable-cell")){switch(u.edittype){case"checkbox":var k=["Yes","No"];if(u.editoptions){k=u.editoptions.value.split(":")}I[c]=a("input",this).is(":checked")?k[0]:k[1];break;case"text":case"password":case"textarea":case"button":I[c]=a("input, textarea",this).val();break;case"select":if(!u.editoptions.multiple){I[c]=a("select option:selected",this).val();B[c]=a("select option:selected",this).text()}else{var J=a("select",this),L=[];I[c]=a(J).val();if(I[c]){I[c]=I[c].join(",")}else{I[c]=""}a("select option:selected",this).each(function(e,M){L[e]=a(M).text()});B[c]=L.join(",")}if(u.formatter&&u.formatter=="select"){B={}}break;case"custom":try{if(u.editoptions&&a.isFunction(u.editoptions.custom_value)){I[c]=u.editoptions.custom_value.call(G,a(".customelement",this),"get");if(I[c]===undefined){throw"e2"}}else{throw"e1"}}catch(K){if(K=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}if(K=="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,K.message,a.jgrid.edit.bClose)}}break}f=a.jgrid.checkValues(I[c],o,G);if(f[0]===false){f[1]=I[c]+" "+f[1];return false}if(G.p.autoencode){I[c]=a.jgrid.htmlEncode(I[c])}if(C.url!=="clientArray"&&u.editoptions&&u.editoptions.NullIfEmpty===true){if(I[c]===""){A[c]="null"}}}});if(f[0]===false){try{var s=a.jgrid.findPos(a("#"+a.jgrid.jqID(n),G.grid.bDiv)[0]);a.jgrid.info_dialog(a.jgrid.errors.errcap,f[1],a.jgrid.edit.bClose,{left:s[0],top:s[1]})}catch(H){alert(f[1])}return q}var y,v=G.p.prmNames,p=n;if(G.p.keyIndex===false){y=v.id}else{y=G.p.colModel[G.p.keyIndex+(G.p.rownumbers===true?1:0)+(G.p.multiselect===true?1:0)+(G.p.subGrid===true?1:0)].name}if(I){I[v.oper]=v.editoper;if(I[y]===undefined){I[y]=n}else{if(w.id!==G.p.idPrefix+I[y]){var x=a.jgrid.stripPref(G.p.idPrefix,n);if(G.p._index[x]!==undefined){G.p._index[I[y]]=G.p._index[x];delete G.p._index[x]}n=G.p.idPrefix+I[y];a(w).attr("id",n);if(G.p.selrow===p){G.p.selrow=n}if(a.isArray(G.p.selarrrow)){var F=a.inArray(p,G.p.selarrrow);if(F>=0){G.p.selarrrow[F]=n}}if(G.p.multiselect){var l="jqg_"+G.p.id+"_"+n;a("input.cbox",w).attr("id",l).attr("name",l)}}}if(G.p.inlineData===undefined){G.p.inlineData={}}I=a.extend({},I,G.p.inlineData,C.extraparam)}if(C.url=="clientArray"){I=a.extend({},I,B);if(G.p.autoencode){a.each(I,function(k,e){I[k]=a.jgrid.htmlDecode(e)})}var E,z=a(G).jqGrid("setRowData",n,I);a(w).attr("editable","0");for(E=0;E<G.p.savedRow.length;E++){if(G.p.savedRow[E].id==p){m=E;break}}if(m>=0){G.p.savedRow.splice(m,1)}a(G).triggerHandler("jqGridInlineAfterSaveRow",[n,z,I,C]);if(a.isFunction(C.aftersavefunc)){C.aftersavefunc.call(G,n,z,C)}q=true;a(w).unbind("keydown")}else{a("#lui_"+a.jgrid.jqID(G.p.id)).show();A=a.extend({},I,A);A[y]=a.jgrid.stripPref(G.p.idPrefix,A[y]);a.ajax(a.extend({url:C.url,data:a.isFunction(G.p.serializeRowData)?G.p.serializeRowData.call(G,A):A,type:C.mtype,async:false,complete:function(J,K){a("#lui_"+a.jgrid.jqID(G.p.id)).hide();if(K==="success"){var o=true,L,e;L=a(G).triggerHandler("jqGridInlineSuccessSaveRow",[J,n,C]);if(!a.isArray(L)){L=[true,I]}if(L[0]&&a.isFunction(C.successfunc)){L=C.successfunc.call(G,J)}if(a.isArray(L)){o=L[0];I=L[1]||I}else{o=L}if(o===true){if(G.p.autoencode){a.each(I,function(M,k){I[M]=a.jgrid.htmlDecode(k)})}I=a.extend({},I,B);a(G).jqGrid("setRowData",n,I);a(w).attr("editable","0");for(e=0;e<G.p.savedRow.length;e++){if(G.p.savedRow[e].id==n){m=e;break}}if(m>=0){G.p.savedRow.splice(m,1)}a(G).triggerHandler("jqGridInlineAfterSaveRow",[n,J,I,C]);if(a.isFunction(C.aftersavefunc)){C.aftersavefunc.call(G,n,J)}q=true;a(w).unbind("keydown")}else{a(G).triggerHandler("jqGridInlineErrorSaveRow",[n,J,K,null,C]);if(a.isFunction(C.errorfunc)){C.errorfunc.call(G,n,J,K,null)}if(C.restoreAfterError===true){a(G).jqGrid("restoreRow",n,C.afterrestorefunc)}}}},error:function(o,J,K){a("#lui_"+a.jgrid.jqID(G.p.id)).hide();a(G).triggerHandler("jqGridInlineErrorSaveRow",[n,o,J,K,C]);if(a.isFunction(C.errorfunc)){C.errorfunc.call(G,n,o,J,K)}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(L){alert(k)}}if(C.restoreAfterError===true){a(G).jqGrid("restoreRow",n,C.afterrestorefunc)}}},a.jgrid.ajaxOptions,G.p.ajaxRowOptions||{}))}}return q},restoreRow:function(d,b){var c=a.makeArray(arguments).slice(1),e={};if(a.type(c[0])==="object"){e=c[0]}else{if(a.isFunction(b)){e.afterrestorefunc=b}}e=a.extend(true,a.jgrid.inlineEdit,e);return this.each(function(){var m=this,f,h,l={},g;if(!m.grid){return}h=a(m).jqGrid("getInd",d,true);if(h===false){return}for(g=0;g<m.p.savedRow.length;g++){if(m.p.savedRow[g].id==d){f=g;break}}if(f>=0){if(a.isFunction(a.fn.datepicker)){try{a("input.hasDatepicker","#"+a.jgrid.jqID(h.id)).datepicker("hide")}catch(j){}}a.each(m.p.colModel,function(){if(this.editable===true&&m.p.savedRow[f].hasOwnProperty(this.name)){l[this.name]=m.p.savedRow[f][this.name]}});a(m).jqGrid("setRowData",d,l);a(h).attr("editable","0").unbind("keydown");m.p.savedRow.splice(f,1);if(a("#"+a.jgrid.jqID(d),"#"+a.jgrid.jqID(m.p.id)).hasClass("jqgrid-new-row")){setTimeout(function(){a(m).jqGrid("delRowData",d)},0)}}a(m).triggerHandler("jqGridInlineAfterRestoreRow",[d]);if(a.isFunction(e.afterrestorefunc)){e.afterrestorefunc.call(m,d)}})},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 e=this;b.rowID=a.isFunction(b.rowID)?b.rowID.call(e,b):((b.rowID!=null)?b.rowID:a.jgrid.randId());if(b.useDefValues===true){a(e.p.colModel).each(function(){if(this.editoptions&&this.editoptions.defaultValue){var g=this.editoptions.defaultValue,f=a.isFunction(g)?g.call(e):g;b.initdata[this.name]=f}})}a(e).jqGrid("addRowData",b.rowID,b.initdata,b.position);b.rowID=e.p.idPrefix+b.rowID;a("#"+a.jgrid.jqID(b.rowID),"#"+a.jgrid.jqID(e.p.id)).addClass("jqgrid-new-row");if(b.useFormatter){a("#"+a.jgrid.jqID(b.rowID)+" .ui-inline-edit","#"+a.jgrid.jqID(e.p.id)).click()}else{var c=e.p.prmNames,d=c.oper;b.addRowParams.extraparam[d]=c.addoper;a(e).jqGrid("editRow",b.rowID,b.addRowParams);a(e).jqGrid("setSelection",b.rowID)}})},inlineNav:function(b,c){c=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,c||{});return this.each(function(){if(!this.grid){return}var k=this,e,h=a.jgrid.jqID(k.p.id);k.p._inlinenav=true;if(c.addParams.useFormatter===true){var d=k.p.colModel,g;for(g=0;g<d.length;g++){if(d[g].formatter&&d[g].formatter==="actions"){if(d[g].formatoptions){var j={keys:false,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{},url:null},f=a.extend(j,d[g].formatoptions);c.addParams.addRowParams={keys:f.keys,oneditfunc:f.onEdit,successfunc:f.onSuccess,url:f.url,extraparam:f.extraparam,aftersavefunc:f.afterSavef,errorfunc:f.onError,afterrestorefunc:f.afterRestore}}break}}}if(c.add){a(k).jqGrid("navButtonAdd",b,{caption:c.addtext,title:c.addtitle,buttonicon:c.addicon,id:k.p.id+"_iladd",onClickButton:function(){a(k).jqGrid("addRow",c.addParams);if(!c.addParams.useFormatter){a("#"+h+"_ilsave").removeClass("ui-state-disabled");a("#"+h+"_ilcancel").removeClass("ui-state-disabled");a("#"+h+"_iladd").addClass("ui-state-disabled");a("#"+h+"_iledit").addClass("ui-state-disabled")}}})}if(c.edit){a(k).jqGrid("navButtonAdd",b,{caption:c.edittext,title:c.edittitle,buttonicon:c.editicon,id:k.p.id+"_iledit",onClickButton:function(){var l=a(k).jqGrid("getGridParam","selrow");if(l){a(k).jqGrid("editRow",l,c.editParams);a("#"+h+"_ilsave").removeClass("ui-state-disabled");a("#"+h+"_ilcancel").removeClass("ui-state-disabled");a("#"+h+"_iladd").addClass("ui-state-disabled");a("#"+h+"_iledit").addClass("ui-state-disabled")}else{a.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+h,jqm:true});a("#jqg_alrt").focus()}}})}if(c.save){a(k).jqGrid("navButtonAdd",b,{caption:c.savetext||"",title:c.savetitle||"Save row",buttonicon:c.saveicon,id:k.p.id+"_ilsave",onClickButton:function(){var m=k.p.savedRow[0].id;if(m){var l=k.p.prmNames,n=l.oper;if(!c.editParams.extraparam){c.editParams.extraparam={}}if(a("#"+a.jgrid.jqID(m),"#"+h).hasClass("jqgrid-new-row")){c.editParams.extraparam[n]=l.addoper}else{c.editParams.extraparam[n]=l.editoper}if(a(k).jqGrid("saveRow",m,c.editParams)){a(k).jqGrid("showAddEditButtons")}}else{a.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+h,jqm:true});a("#jqg_alrt").focus()}}});a("#"+h+"_ilsave").addClass("ui-state-disabled")}if(c.cancel){a(k).jqGrid("navButtonAdd",b,{caption:c.canceltext||"",title:c.canceltitle||"Cancel row editing",buttonicon:c.cancelicon,id:k.p.id+"_ilcancel",onClickButton:function(){var l=k.p.savedRow[0].id;if(l){a(k).jqGrid("restoreRow",l,c.editParams);a(k).jqGrid("showAddEditButtons")}else{a.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+h,jqm:true});a("#jqg_alrt").focus()}}});a("#"+h+"_ilcancel").addClass("ui-state-disabled")}if(c.restoreAfterSelect===true){if(a.isFunction(k.p.beforeSelectRow)){e=k.p.beforeSelectRow}else{e=false}k.p.beforeSelectRow=function(n,m){var l=true;if(k.p.savedRow.length>0&&k.p._inlinenav===true&&(n!==k.p.selrow&&k.p.selrow!==null)){if(k.p.selrow==c.addParams.rowID){a(k).jqGrid("delRowData",k.p.selrow)}else{a(k).jqGrid("restoreRow",k.p.selrow,c.editParams)}a(k).jqGrid("showAddEditButtons")}if(e){l=e.call(k,n,m)}return l}}})},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(d,c,b){return this.each(function(){var j=this,n,k,g,l;if(!j.grid||j.p.cellEdit!==true){return}c=parseInt(c,10);j.p.selrow=j.rows[d].id;if(!j.p.knv){a(j).jqGrid("GridNav")}if(j.p.savedRow.length>0){if(b===true){if(d==j.p.iRow&&c==j.p.iCol){return}}a(j).jqGrid("saveCell",j.p.savedRow[0].id,j.p.savedRow[0].ic)}else{window.setTimeout(function(){a("#"+a.jgrid.jqID(j.p.knv)).attr("tabindex","-1").focus()},0)}l=j.p.colModel[c];n=l.name;if(n=="subgrid"||n=="cb"||n=="rn"){return}g=a("td:eq("+c+")",j.rows[d]);if(l.editable===true&&b===true&&!g.hasClass("not-editable-cell")){if(parseInt(j.p.iCol,10)>=0&&parseInt(j.p.iRow,10)>=0){a("td:eq("+j.p.iCol+")",j.rows[j.p.iRow]).removeClass("edit-cell ui-state-highlight");a(j.rows[j.p.iRow]).removeClass("selected-row ui-state-hover")}a(g).addClass("edit-cell ui-state-highlight");a(j.rows[d]).addClass("selected-row ui-state-hover");try{k=a.unformat.call(j,g,{rowId:j.rows[d].id,colModel:l},c)}catch(m){k=(l.edittype&&l.edittype=="textarea")?a(g).text():a(g).html()}if(j.p.autoencode){k=a.jgrid.htmlDecode(k)}if(!l.edittype){l.edittype="text"}j.p.savedRow.push({id:d,ic:c,name:n,v:k});if(k==="&nbsp;"||k==="&#160;"||(k.length===1&&k.charCodeAt(0)===160)){k=""}if(a.isFunction(j.p.formatCell)){var h=j.p.formatCell.call(j,j.rows[d].id,n,k,d,c);if(h!==undefined){k=h}}var f=a.extend({},l.editoptions||{},{id:d+"_"+n,name:n});var e=a.jgrid.createEl.call(j,l.edittype,f,k,true,a.extend({},a.jgrid.ajaxOptions,j.p.ajaxSelectOptions||{}));a(j).triggerHandler("jqGridBeforeEditCell",[j.rows[d].id,n,k,d,c]);if(a.isFunction(j.p.beforeEditCell)){j.p.beforeEditCell.call(j,j.rows[d].id,n,k,d,c)}a(g).html("").append(e).attr("tabindex","0");a.jgrid.bindEv(e,f,j);window.setTimeout(function(){a(e).focus()},0);a("input, select, textarea",g).bind("keydown",function(o){if(o.keyCode===27){if(a("input.hasDatepicker",g).length>0){if(a(".ui-datepicker").is(":hidden")){a(j).jqGrid("restoreCell",d,c)}else{a("input.hasDatepicker",g).datepicker("hide")}}else{a(j).jqGrid("restoreCell",d,c)}}if(o.keyCode===13){a(j).jqGrid("saveCell",d,c);return false}if(o.keyCode===9){if(!j.grid.hDiv.loading){if(o.shiftKey){a(j).jqGrid("prevCell",d,c)}else{a(j).jqGrid("nextCell",d,c)}}else{return false}}o.stopPropagation()});a(j).triggerHandler("jqGridAfterEditCell",[j.rows[d].id,n,k,d,c]);if(a.isFunction(j.p.afterEditCell)){j.p.afterEditCell.call(j,j.rows[d].id,n,k,d,c)}}else{if(parseInt(j.p.iCol,10)>=0&&parseInt(j.p.iRow,10)>=0){a("td:eq("+j.p.iCol+")",j.rows[j.p.iRow]).removeClass("edit-cell ui-state-highlight");a(j.rows[j.p.iRow]).removeClass("selected-row ui-state-hover")}g.addClass("edit-cell ui-state-highlight");a(j.rows[d]).addClass("selected-row ui-state-hover");k=g.html().replace(/\&#160\;/ig,"");a(j).triggerHandler("jqGridSelectCell",[j.rows[d].id,n,k,d,c]);if(a.isFunction(j.p.onSelectCell)){j.p.onSelectCell.call(j,j.rows[d].id,n,k,d,c)}}j.p.iCol=c;j.p.iRow=d})},saveCell:function(c,b){return this.each(function(){var w=this,h;if(!w.grid||w.p.cellEdit!==true){return}if(w.p.savedRow.length>=1){h=0}else{h=null}if(h!==null){var q=a("td:eq("+b+")",w.rows[c]),o,d,k=w.p.colModel[b],f=k.name,j=a.jgrid.jqID(f);switch(k.edittype){case"select":if(!k.editoptions.multiple){o=a("#"+c+"_"+j+" option:selected",w.rows[c]).val();d=a("#"+c+"_"+j+" option:selected",w.rows[c]).text()}else{var u=a("#"+c+"_"+j,w.rows[c]),t=[];o=a(u).val();if(o){o.join(",")}else{o=""}a("option:selected",u).each(function(e,v){t[e]=a(v).text()});d=t.join(",")}if(k.formatter){d=o}break;case"checkbox":var r=["Yes","No"];if(k.editoptions){r=k.editoptions.value.split(":")}o=a("#"+c+"_"+j,w.rows[c]).is(":checked")?r[0]:r[1];d=o;break;case"password":case"text":case"textarea":case"button":o=a("#"+c+"_"+j,w.rows[c]).val();d=o;break;case"custom":try{if(k.editoptions&&a.isFunction(k.editoptions.custom_value)){o=k.editoptions.custom_value.call(w,a(".customelement",q),"get");if(o===undefined){throw"e2"}else{d=o}}else{throw"e1"}}catch(x){if(x=="e1"){a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose)}if(x=="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,x.message,a.jgrid.edit.bClose)}}break}if(d!==w.p.savedRow[h].v){var z=a(w).triggerHandler("jqGridBeforeSaveCell",[w.rows[c].id,f,o,c,b]);if(z){o=z;d=z}if(a.isFunction(w.p.beforeSaveCell)){var s=w.p.beforeSaveCell.call(w,w.rows[c].id,f,o,c,b);if(s){o=s;d=s}}var g=a.jgrid.checkValues(o,b,w);if(g[0]===true){var m=a(w).triggerHandler("jqGridBeforeSubmitCell",[w.rows[c].id,f,o,c,b])||{};if(a.isFunction(w.p.beforeSubmitCell)){m=w.p.beforeSubmitCell.call(w,w.rows[c].id,f,o,c,b);if(!m){m={}}}if(a("input.hasDatepicker",q).length>0){a("input.hasDatepicker",q).datepicker("hide")}if(w.p.cellsubmit=="remote"){if(w.p.cellurl){var y={};if(w.p.autoencode){o=a.jgrid.htmlEncode(o)}y[f]=o;var p,n,l;l=w.p.prmNames;p=l.id;n=l.oper;y[p]=a.jgrid.stripPref(w.p.idPrefix,w.rows[c].id);y[n]=l.editoper;y=a.extend(m,y);a("#lui_"+a.jgrid.jqID(w.p.id)).show();w.grid.hDiv.loading=true;a.ajax(a.extend({url:w.p.cellurl,data:a.isFunction(w.p.serializeCellData)?w.p.serializeCellData.call(w,y):y,type:"POST",complete:function(e,A){a("#lui_"+w.p.id).hide();w.grid.hDiv.loading=false;if(A=="success"){var v=a(w).triggerHandler("jqGridAfterSubmitCell",[w,e,y.id,f,o,c,b])||[true,""];if(v[0]===true&&a.isFunction(w.p.afterSubmitCell)){v=w.p.afterSubmitCell.call(w,e,y.id,f,o,c,b)}if(v[0]===true){a(q).empty();a(w).jqGrid("setCell",w.rows[c].id,b,d,false,false,true);a(q).addClass("dirty-cell");a(w.rows[c]).addClass("edited");a(w).triggerHandler("jqGridAfterSaveCell",[w.rows[c].id,f,o,c,b]);if(a.isFunction(w.p.afterSaveCell)){w.p.afterSaveCell.call(w,w.rows[c].id,f,o,c,b)}w.p.savedRow.splice(0,1)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,v[1],a.jgrid.edit.bClose);a(w).jqGrid("restoreCell",c,b)}}},error:function(e,v,A){a("#lui_"+a.jgrid.jqID(w.p.id)).hide();w.grid.hDiv.loading=false;a(w).triggerHandler("jqGridErrorCell",[e,v,A]);if(a.isFunction(w.p.errorCell)){w.p.errorCell.call(w,e,v,A);a(w).jqGrid("restoreCell",c,b)}else{a.jgrid.info_dialog(a.jgrid.errors.errcap,e.status+" : "+e.statusText+"<br/>"+v,a.jgrid.edit.bClose);a(w).jqGrid("restoreCell",c,b)}}},a.jgrid.ajaxOptions,w.p.ajaxCellOptions||{}))}else{try{a.jgrid.info_dialog(a.jgrid.errors.errcap,a.jgrid.errors.nourl,a.jgrid.edit.bClose);a(w).jqGrid("restoreCell",c,b)}catch(x){}}}if(w.p.cellsubmit=="clientArray"){a(q).empty();a(w).jqGrid("setCell",w.rows[c].id,b,d,false,false,true);a(q).addClass("dirty-cell");a(w.rows[c]).addClass("edited");a(w).triggerHandler("jqGridAfterSaveCell",[w.rows[c].id,f,o,c,b]);if(a.isFunction(w.p.afterSaveCell)){w.p.afterSaveCell.call(w,w.rows[c].id,f,o,c,b)}w.p.savedRow.splice(0,1)}}else{try{window.setTimeout(function(){a.jgrid.info_dialog(a.jgrid.errors.errcap,o+" "+g[1],a.jgrid.edit.bClose)},100);a(w).jqGrid("restoreCell",c,b)}catch(x){}}}else{a(w).jqGrid("restoreCell",c,b)}}window.setTimeout(function(){a("#"+a.jgrid.jqID(w.p.knv)).attr("tabindex","-1").focus()},0)})},restoreCell:function(c,b){return this.each(function(){var h=this,d;if(!h.grid||h.p.cellEdit!==true){return}if(h.p.savedRow.length>=1){d=0}else{d=null}if(d!==null){var g=a("td:eq("+b+")",h.rows[c]);if(a.isFunction(a.fn.datepicker)){try{a("input.hasDatepicker",g).datepicker("hide")}catch(f){}}a(g).empty().attr("tabindex","-1");a(h).jqGrid("setCell",h.rows[c].id,b,h.p.savedRow[d].v,false,false,true);a(h).triggerHandler("jqGridAfterRestoreCell",[h.rows[c].id,h.p.savedRow[d].v,c,b]);if(a.isFunction(h.p.afterRestoreCell)){h.p.afterRestoreCell.call(h,h.rows[c].id,h.p.savedRow[d].v,c,b)}h.p.savedRow.splice(0,1)}window.setTimeout(function(){a("#"+h.p.knv).attr("tabindex","-1").focus()},0)})},nextCell:function(c,b){return this.each(function(){var f=this,e=false,d;if(!f.grid||f.p.cellEdit!==true){return}for(d=b+1;d<f.p.colModel.length;d++){if(f.p.colModel[d].editable===true){e=d;break}}if(e!==false){a(f).jqGrid("editCell",c,e,true)}else{if(f.p.savedRow.length>0){a(f).jqGrid("saveCell",c,b)}}})},prevCell:function(c,b){return this.each(function(){var f=this,e=false,d;if(!f.grid||f.p.cellEdit!==true){return}for(d=b-1;d>=0;d--){if(f.p.colModel[d].editable===true){e=d;break}}if(e!==false){a(f).jqGrid("editCell",c,e,true)}else{if(f.p.savedRow.length>0){a(f).jqGrid("saveCell",c,b)}}})},GridNav:function(){return this.each(function(){var g=this;if(!g.grid||g.p.cellEdit!==true){return}g.p.knv=g.p.id+"_kn";var f=a("<div style='position:fixed;top:-1000000px;width:1px;height:1px;' tabindex='0'><div tabindex='-1' style='width:1px;height:1px;' id='"+g.p.knv+"'></div></div>"),d,c;function e(q,o,p){if(p.substr(0,1)=="v"){var h=a(g.grid.bDiv)[0].clientHeight,r=a(g.grid.bDiv)[0].scrollTop,s=g.rows[q].offsetTop+g.rows[q].clientHeight,m=g.rows[q].offsetTop;if(p=="vd"){if(s>=h){a(g.grid.bDiv)[0].scrollTop=a(g.grid.bDiv)[0].scrollTop+g.rows[q].clientHeight}}if(p=="vu"){if(m<r){a(g.grid.bDiv)[0].scrollTop=a(g.grid.bDiv)[0].scrollTop-g.rows[q].clientHeight}}}if(p=="h"){var l=a(g.grid.bDiv)[0].clientWidth,k=a(g.grid.bDiv)[0].scrollLeft,j=g.rows[q].cells[o].offsetLeft+g.rows[q].cells[o].clientWidth,n=g.rows[q].cells[o].offsetLeft;if(j>=l+parseInt(k,10)){a(g.grid.bDiv)[0].scrollLeft=a(g.grid.bDiv)[0].scrollLeft+g.rows[q].cells[o].clientWidth}else{if(n<k){a(g.grid.bDiv)[0].scrollLeft=a(g.grid.bDiv)[0].scrollLeft-g.rows[q].cells[o].clientWidth}}}}function b(l,h){var k,j;if(h=="lft"){k=l+1;for(j=l;j>=0;j--){if(g.p.colModel[j].hidden!==true){k=j;break}}}if(h=="rgt"){k=l-1;for(j=l;j<g.p.colModel.length;j++){if(g.p.colModel[j].hidden!==true){k=j;break}}}return k}a(f).insertBefore(g.grid.cDiv);a("#"+g.p.knv).focus().keydown(function(h){c=h.keyCode;if(g.p.direction=="rtl"){if(c===37){c=39}else{if(c===39){c=37}}}switch(c){case 38:if(g.p.iRow-1>0){e(g.p.iRow-1,g.p.iCol,"vu");a(g).jqGrid("editCell",g.p.iRow-1,g.p.iCol,false)}break;case 40:if(g.p.iRow+1<=g.rows.length-1){e(g.p.iRow+1,g.p.iCol,"vd");a(g).jqGrid("editCell",g.p.iRow+1,g.p.iCol,false)}break;case 37:if(g.p.iCol-1>=0){d=b(g.p.iCol-1,"lft");e(g.p.iRow,d,"h");a(g).jqGrid("editCell",g.p.iRow,d,false)}break;case 39:if(g.p.iCol+1<=g.p.colModel.length-1){d=b(g.p.iCol+1,"rgt");e(g.p.iRow,d,"h");a(g).jqGrid("editCell",g.p.iRow,d,false)}break;case 13:if(parseInt(g.p.iCol,10)>=0&&parseInt(g.p.iRow,10)>=0){a(g).jqGrid("editCell",g.p.iRow,g.p.iCol,true)}break;default:return true}return false})})},getChangedCells:function(c){var b=[];if(!c){c="all"}this.each(function(){var e=this,d;if(!e.grid||e.p.cellEdit!==true){return}a(e.rows).each(function(f){var g={};if(a(this).hasClass("edited")){a("td",this).each(function(h){d=e.p.colModel[h].name;if(d!=="cb"&&d!=="subgrid"){if(c=="dirty"){if(a(this).hasClass("dirty-cell")){try{g[d]=a.unformat.call(e,this,{rowId:e.rows[f].id,colModel:e.p.colModel[h]},h)}catch(j){g[d]=a.jgrid.htmlDecode(a(this).html())}}}else{try{g[d]=a.unformat.call(e,this,{rowId:e.rows[f].id,colModel:e.p.colModel[h]},h)}catch(j){g[d]=a.jgrid.htmlDecode(a(this).html())}}}});g.id=this.id;b.push(g)}})});return b}})})(jQuery);(function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var e=this,b,d,c={plusicon:"ui-icon-plus",minusicon:"ui-icon-minus",openicon:"ui-icon-carat-1-sw",expandOnLoad:false,delayOnLoad:50,selectOnExpand:false,reloadOnExpand:true};e.p.subGridOptions=a.extend(c,e.p.subGridOptions||{});e.p.colNames.unshift("");e.p.colModel.unshift({name:"subgrid",width:a.jgrid.cell_width?e.p.subGridWidth+e.p.cellLayout:e.p.subGridWidth,sortable:false,resizable:false,hidedlg:true,search:false,fixed:true});b=e.p.subGridModel;if(b[0]){b[0].align=a.extend([],b[0].align||[]);for(d=0;d<b[0].name.length;d++){b[0].align[d]=b[0].align[d]||"left"}}})},addSubGridCell:function(f,e){var d="",b,c;this.each(function(){d=this.formatCol(f,e);c=this.p.id;b=this.p.subGridOptions.plusicon});return'<td role="gridcell" aria-describedby="'+c+'_subgrid" class="ui-sgcollapsed sgcollapsed" '+d+"><a href='javascript:void(0);'><span class='ui-icon "+b+"'></span></a></td>"},addSubGrid:function(c,b){return this.each(function(){var n=this;if(!n.grid){return}var f=function(s,r,u){var t=a("<td align='"+n.p.subGridModel[0].align[u]+"'></td>").html(r);a(s).append(t)};var e=function(s,y){var x,v,u,w=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),r=a("<tr></tr>");for(v=0;v<n.p.subGridModel[0].name.length;v++){x=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+n.p.direction+"'></th>");a(x).html(n.p.subGridModel[0].name[v]);a(x).width(n.p.subGridModel[0].width[v]);a(r).append(x)}a(w).append(r);if(s){u=n.p.xmlReader.subgrid;a(u.root+" "+u.row,s).each(function(){r=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(u.repeatitems===true){a(u.cell,this).each(function(A){f(r,a(this).text()||"&#160;",A)})}else{var z=n.p.subGridModel[0].mapping||n.p.subGridModel[0].name;if(z){for(v=0;v<z.length;v++){f(r,a(z[v],this).text()||"&#160;",v)}}}a(w).append(r)})}var t=a("table:first",n.grid.bDiv).attr("id")+"_";a("#"+a.jgrid.jqID(t+y)).append(w);n.grid.hDiv.loading=false;a("#load_"+a.jgrid.jqID(n.p.id)).hide();return false};var g=function(y,v){var A,C,w,z,r,u,t=a("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),s=a("<tr></tr>");for(w=0;w<n.p.subGridModel[0].name.length;w++){A=a("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+n.p.direction+"'></th>");a(A).html(n.p.subGridModel[0].name[w]);a(A).width(n.p.subGridModel[0].width[w]);a(s).append(A)}a(t).append(s);if(y){r=n.p.jsonReader.subgrid;C=a.jgrid.getAccessor(y,r.root);if(C!==undefined){for(w=0;w<C.length;w++){z=C[w];s=a("<tr class='ui-widget-content ui-subtblcell'></tr>");if(r.repeatitems===true){if(r.cell){z=z[r.cell]}for(u=0;u<z.length;u++){f(s,z[u]||"&#160;",u)}}else{var x=n.p.subGridModel[0].mapping||n.p.subGridModel[0].name;if(x.length){for(u=0;u<x.length;u++){f(s,z[x[u]]||"&#160;",u)}}}a(t).append(s)}}}var B=a("table:first",n.grid.bDiv).attr("id")+"_";a("#"+a.jgrid.jqID(B+v)).append(t);n.grid.hDiv.loading=false;a("#load_"+a.jgrid.jqID(n.p.id)).hide();return false};var o=function(u){var r,v,t,s;r=a(u).attr("id");v={nd_:(new Date().getTime())};v[n.p.prmNames.subgridid]=r;if(!n.p.subGridModel[0]){return false}if(n.p.subGridModel[0].params){for(s=0;s<n.p.subGridModel[0].params.length;s++){for(t=0;t<n.p.colModel.length;t++){if(n.p.colModel[t].name===n.p.subGridModel[0].params[s]){v[n.p.colModel[t].name]=a("td:eq("+t+")",u).text().replace(/\&#160\;/ig,"")}}}}if(!n.grid.hDiv.loading){n.grid.hDiv.loading=true;a("#load_"+a.jgrid.jqID(n.p.id)).show();if(!n.p.subgridtype){n.p.subgridtype=n.p.datatype}if(a.isFunction(n.p.subgridtype)){n.p.subgridtype.call(n,v)}else{n.p.subgridtype=n.p.subgridtype.toLowerCase()}switch(n.p.subgridtype){case"xml":case"json":a.ajax(a.extend({type:n.p.mtype,url:n.p.subGridUrl,dataType:n.p.subgridtype,data:a.isFunction(n.p.serializeSubGridData)?n.p.serializeSubGridData.call(n,v):v,complete:function(w){if(n.p.subgridtype==="xml"){e(w.responseXML,r)}else{g(a.jgrid.parse(w.responseText),r)}w=null}},a.jgrid.ajaxOptions,n.p.ajaxSubgridOptions||{}));break}}return false};var p,q,j,l=0,h,d;a.each(n.p.colModel,function(){if(this.hidden===true||this.name==="rn"||this.name==="cb"){l++}});var m=n.rows.length,k=1;if(b!==undefined&&b>0){k=b;m=b+1}while(k<m){if(a(n.rows[k]).hasClass("jqgrow")){a(n.rows[k].cells[c]).bind("click",function(){var r=a(this).parent("tr")[0];d=r.nextSibling;if(a(this).hasClass("sgcollapsed")){q=n.p.id;p=r.id;if(n.p.subGridOptions.reloadOnExpand===true||(n.p.subGridOptions.reloadOnExpand===false&&!a(d).hasClass("ui-subgrid"))){j=c>=1?"<td colspan='"+c+"'>&#160;</td>":"";h=a(n).triggerHandler("jqGridSubGridBeforeExpand",[q+"_"+p,p]);h=(h===false||h==="stop")?false:true;if(h&&a.isFunction(n.p.subGridBeforeExpand)){h=n.p.subGridBeforeExpand.call(n,q+"_"+p,p)}if(h===false){return false}a(r).after("<tr role='row' class='ui-subgrid'>"+j+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+n.p.subGridOptions.openicon+"'></span></td><td colspan='"+parseInt(n.p.colNames.length-1-l,10)+"' class='ui-widget-content subgrid-data'><div id="+q+"_"+p+" class='tablediv'></div></td></tr>");a(n).triggerHandler("jqGridSubGridRowExpanded",[q+"_"+p,p]);if(a.isFunction(n.p.subGridRowExpanded)){n.p.subGridRowExpanded.call(n,q+"_"+p,p)}else{o(r)}}else{a(d).show()}a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+n.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");if(n.p.subGridOptions.selectOnExpand){a(n).jqGrid("setSelection",p)}}else{if(a(this).hasClass("sgexpanded")){h=a(n).triggerHandler("jqGridSubGridRowColapsed",[q+"_"+p,p]);h=(h===false||h==="stop")?false:true;if(h&&a.isFunction(n.p.subGridRowColapsed)){p=r.id;h=n.p.subGridRowColapsed.call(n,q+"_"+p,p)}if(h===false){return false}if(n.p.subGridOptions.reloadOnExpand===true){a(d).remove(".ui-subgrid")}else{if(a(d).hasClass("ui-subgrid")){a(d).hide()}}a(this).html("<a href='javascript:void(0);'><span class='ui-icon "+n.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed")}}return false})}k++}if(n.p.subGridOptions.expandOnLoad===true){a(n.rows).filter(".jqgrow").each(function(r,s){a(s.cells[0]).click()})}n.subGridXml=function(s,r){e(s,r)};n.subGridJson=function(s,r){g(s,r)}})},expandSubGridRow:function(b){return this.each(function(){var e=this;if(!e.grid&&!b){return}if(e.p.subGrid===true){var c=a(this).jqGrid("getInd",b,true);if(c){var d=a("td.sgcollapsed",c)[0];if(d){a(d).trigger("click")}}}})},collapseSubGridRow:function(b){return this.each(function(){var e=this;if(!e.grid&&!b){return}if(e.p.subGrid===true){var c=a(this).jqGrid("getInd",b,true);if(c){var d=a("td.sgexpanded",c)[0];if(d){a(d).trigger("click")}}}})},toggleSubGridRow:function(b){return this.each(function(){var e=this;if(!e.grid&&!b){return}if(e.p.subGrid===true){var c=a(this).jqGrid("getInd",b,true);if(c){var d=a("td.sgcollapsed",c)[0];if(d){a(d).trigger("click")}else{d=a("td.sgexpanded",c)[0];if(d){a(d).trigger("click")}}}}})}})})(jQuery);(function(a){a.jgrid.extend({setTreeNode:function(c,b){return this.each(function(){var q=this;if(!q.grid||!q.p.treeGrid){return}var k=q.p.expColInd,m=q.p.treeReader.expanded_field,t=q.p.treeReader.leaf_field,d=q.p.treeReader.level_field,s=q.p.treeReader.icon_field,o=q.p.treeReader.loaded,v,l,e,h,n,w,u,j;while(c<b){var g=q.rows[c].id,f=q.p._index[g],r;u=q.p.data[f];if(q.p.treeGridModel=="nested"){if(!u[t]){v=parseInt(u[q.p.treeReader.left_field],10);l=parseInt(u[q.p.treeReader.right_field],10);u[t]=(l===v+1)?"true":"false";q.rows[c].cells[q.p._treeleafpos].innerHTML=u[t]}}if(u===undefined){c++,b++;continue}e=parseInt(u[d],10);if(q.p.tree_root_level===0){h=e+1;n=e}else{h=e;n=e-1}w="<div class='tree-wrap tree-wrap-"+q.p.direction+"' style='width:"+(h*18)+"px;'>";w+="<div style='"+(q.p.direction=="rtl"?"right:":"left:")+(n*18)+"px;' class='ui-icon ";if(u[o]!==undefined){if(u[o]=="true"||u[o]===true){u[o]=true}else{u[o]=false}}if(u[t]=="true"||u[t]===true){w+=((u[s]!==undefined&&u[s]!=="")?u[s]:q.p.treeIcons.leaf)+" tree-leaf treeclick";u[t]=true;j="leaf"}else{u[t]=false;j=""}u[m]=((u[m]=="true"||u[m]===true)?true:false)&&(u[o]||u[o]===undefined);if(u[m]===false){w+=((u[t]===true)?"'":q.p.treeIcons.plus+" tree-plus treeclick'")}else{w+=((u[t]===true)?"'":q.p.treeIcons.minus+" tree-minus treeclick'")}w+="></div></div>";a(q.rows[c].cells[k]).wrapInner("<span class='cell-wrapper"+j+"'></span>").prepend(w);if(e!==parseInt(q.p.tree_root_level,10)){var p=a(q).jqGrid("getNodeParent",u);r=p&&p.hasOwnProperty(m)?p[m]:true;if(!r){a(q.rows[c]).css("display","none")}}a(q.rows[c].cells[k]).find("div.treeclick").bind("click",function(y){var x=y.target||y.srcElement,A=a(x,q.rows).closest("tr.jqgrow")[0].id,z=q.p._index[A];if(!q.p.data[z][t]){if(q.p.data[z][m]){a(q).jqGrid("collapseRow",q.p.data[z]);a(q).jqGrid("collapseNode",q.p.data[z])}else{a(q).jqGrid("expandRow",q.p.data[z]);a(q).jqGrid("expandNode",q.p.data[z])}}return false});if(q.p.ExpandColClick===true){a(q.rows[c].cells[k]).find("span.cell-wrapper").css("cursor","pointer").bind("click",function(y){var x=y.target||y.srcElement,A=a(x,q.rows).closest("tr.jqgrow")[0].id,z=q.p._index[A];if(!q.p.data[z][t]){if(q.p.data[z][m]){a(q).jqGrid("collapseRow",q.p.data[z]);a(q).jqGrid("collapseNode",q.p.data[z])}else{a(q).jqGrid("expandRow",q.p.data[z]);a(q).jqGrid("expandNode",q.p.data[z])}}a(q).jqGrid("setSelection",A);return false})}c++}})},setTreeGrid:function(){return this.each(function(){var j=this,f=0,d,h=false,c,e,g,b=[];if(!j.p.treeGrid){return}if(!j.p.treedatatype){a.extend(j.p,{treedatatype:j.p.datatype})}j.p.subGrid=false;j.p.altRows=false;j.p.pgbuttons=false;j.p.pginput=false;j.p.gridview=true;if(j.p.rowTotal===null){j.p.rowNum=10000}j.p.multiselect=false;j.p.rowList=[];j.p.expColInd=0;d="ui-icon-triangle-1-"+(j.p.direction=="rtl"?"w":"e");j.p.treeIcons=a.extend({plus:d,minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off"},j.p.treeIcons||{});if(j.p.treeGridModel=="nested"){j.p.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},j.p.treeReader)}else{if(j.p.treeGridModel=="adjacency"){j.p.treeReader=a.extend({level_field:"level",parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},j.p.treeReader)}}for(e in j.p.colModel){if(j.p.colModel.hasOwnProperty(e)){c=j.p.colModel[e].name;if(c==j.p.ExpandColumn&&!h){h=true;j.p.expColInd=f}f++;for(g in j.p.treeReader){if(j.p.treeReader.hasOwnProperty(g)&&j.p.treeReader[g]==c){b.push(c)}}}}a.each(j.p.treeReader,function(k,l){if(l&&a.inArray(l,b)===-1){if(k==="leaf_field"){j.p._treeleafpos=f}f++;j.p.colNames.push(l);j.p.colModel.push({name:l,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false})}})})},expandRow:function(b){this.each(function(){var f=this;if(!f.grid||!f.p.treeGrid){return}var d=a(f).jqGrid("getNodeChildren",b),c=f.p.treeReader.expanded_field,e=f.rows;a(d).each(function(){var g=a.jgrid.getAccessor(this,f.p.localReader.id);a(e.namedItem(g)).css("display","");if(this[c]){a(f).jqGrid("expandRow",this)}})})},collapseRow:function(b){this.each(function(){var f=this;if(!f.grid||!f.p.treeGrid){return}var d=a(f).jqGrid("getNodeChildren",b),c=f.p.treeReader.expanded_field,e=f.rows;a(d).each(function(){var g=a.jgrid.getAccessor(this,f.p.localReader.id);a(e.namedItem(g)).css("display","none");if(this[c]){a(f).jqGrid("collapseRow",this)}})})},getRootNodes:function(){var b=[];this.each(function(){var e=this;if(!e.grid||!e.p.treeGrid){return}switch(e.p.treeGridModel){case"nested":var d=e.p.treeReader.level_field;a(e.p.data).each(function(){if(parseInt(this[d],10)===parseInt(e.p.tree_root_level,10)){b.push(this)}});break;case"adjacency":var c=e.p.treeReader.parent_id_field;a(e.p.data).each(function(){if(this[c]===null||String(this[c]).toLowerCase()=="null"){b.push(this)}});break}});return b},getNodeDepth:function(c){var b=null;this.each(function(){if(!this.grid||!this.p.treeGrid){return}var e=this;switch(e.p.treeGridModel){case"nested":var d=e.p.treeReader.level_field;b=parseInt(c[d],10)-parseInt(e.p.tree_root_level,10);break;case"adjacency":b=a(e).jqGrid("getNodeAncestors",c).length;break}});return b},getNodeParent:function(c){var b=null;this.each(function(){var g=this;if(!g.grid||!g.p.treeGrid){return}switch(g.p.treeGridModel){case"nested":var f=g.p.treeReader.left_field,m=g.p.treeReader.right_field,h=g.p.treeReader.level_field,l=parseInt(c[f],10),k=parseInt(c[m],10),d=parseInt(c[h],10);a(this.p.data).each(function(){if(parseInt(this[h],10)===d-1&&parseInt(this[f],10)<l&&parseInt(this[m],10)>k){b=this;return false}});break;case"adjacency":var j=g.p.treeReader.parent_id_field,e=g.p.localReader.id;a(this.p.data).each(function(){if(this[e]==c[j]){b=this;return false}});break}});return b},getNodeChildren:function(c){var b=[];this.each(function(){var g=this;if(!g.grid||!g.p.treeGrid){return}switch(g.p.treeGridModel){case"nested":var f=g.p.treeReader.left_field,m=g.p.treeReader.right_field,h=g.p.treeReader.level_field,l=parseInt(c[f],10),k=parseInt(c[m],10),d=parseInt(c[h],10);a(this.p.data).each(function(){if(parseInt(this[h],10)===d+1&&parseInt(this[f],10)>l&&parseInt(this[m],10)<k){b.push(this)}});break;case"adjacency":var j=g.p.treeReader.parent_id_field,e=g.p.localReader.id;a(this.p.data).each(function(){if(this[j]==c[e]){b.push(this)}});break}});return b},getFullTreeNode:function(c){var b=[];this.each(function(){var g=this,h;if(!g.grid||!g.p.treeGrid){return}switch(g.p.treeGridModel){case"nested":var f=g.p.treeReader.left_field,n=g.p.treeReader.right_field,j=g.p.treeReader.level_field,m=parseInt(c[f],10),l=parseInt(c[n],10),d=parseInt(c[j],10);a(this.p.data).each(function(){if(parseInt(this[j],10)>=d&&parseInt(this[f],10)>=m&&parseInt(this[f],10)<=l){b.push(this)}});break;case"adjacency":if(c){b.push(c);var k=g.p.treeReader.parent_id_field,e=g.p.localReader.id;a(this.p.data).each(function(o){h=b.length;for(o=0;o<h;o++){if(b[o][e]==this[k]){b.push(this);break}}})}break}});return b},getNodeAncestors:function(c){var b=[];this.each(function(){if(!this.grid||!this.p.treeGrid){return}var d=a(this).jqGrid("getNodeParent",c);while(d){b.push(d);d=a(this).jqGrid("getNodeParent",d)}});return b},isVisibleNode:function(c){var b=true;this.each(function(){var f=this;if(!f.grid||!f.p.treeGrid){return}var e=a(f).jqGrid("getNodeAncestors",c),d=f.p.treeReader.expanded_field;a(e).each(function(){b=b&&this[d];if(!b){return false}})});return b},isNodeLoaded:function(c){var b;this.each(function(){var e=this;if(!e.grid||!e.p.treeGrid){return}var d=e.p.treeReader.leaf_field;if(c!==undefined){if(c.loaded!==undefined){b=c.loaded}else{if(c[d]||a(e).jqGrid("getNodeChildren",c).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 h=this.p.treeReader.expanded_field,j=this.p.treeReader.parent_id_field,f=this.p.treeReader.loaded,c=this.p.treeReader.level_field,l=this.p.treeReader.left_field,k=this.p.treeReader.right_field;if(!b[h]){var d=a.jgrid.getAccessor(b,this.p.localReader.id);var e=a("#"+a.jgrid.jqID(d),this.grid.bDiv)[0];var g=this.p._index[d];if(a(this).jqGrid("isNodeLoaded",this.p.data[g])){b[h]=true;a("div.treeclick",e).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus")}else{if(!this.grid.hDiv.loading){b[h]=true;a("div.treeclick",e).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");this.p.treeANode=e.rowIndex;this.p.datatype=this.p.treedatatype;if(this.p.treeGridModel=="nested"){a(this).jqGrid("setGridParam",{postData:{nodeid:d,n_left:b[l],n_right:b[k],n_level:b[c]}})}else{a(this).jqGrid("setGridParam",{postData:{nodeid:d,parentid:b[j],n_level:b[c]}})}a(this).trigger("reloadGrid");b[f]=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 d=this.p.treeReader.expanded_field;if(b[d]){b[d]=false;var e=a.jgrid.getAccessor(b,this.p.localReader.id);var c=a("#"+a.jgrid.jqID(e),this.grid.bDiv)[0];a("div.treeclick",c).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus")}})},SortTree:function(e,c,b,d){return this.each(function(){if(!this.grid||!this.p.treeGrid){return}var k,f,m,j=[],n=this,l,h,g=a(this).jqGrid("getRootNodes");l=a.jgrid.from(g);l.orderBy(e,c,b,d);h=l.select();for(k=0,f=h.length;k<f;k++){m=h[k];j.push(m);a(this).jqGrid("collectChildrenSortTree",j,m,e,c,b,d)}a.each(j,function(o){var p=a.jgrid.getAccessor(this,n.p.localReader.id);a("#"+a.jgrid.jqID(n.p.id)+" tbody tr:eq("+o+")").after(a("tr#"+a.jgrid.jqID(p),n.grid.bDiv))});l=null;h=null;j=null})},collectChildrenSortTree:function(b,f,g,d,c,e){return this.each(function(){if(!this.grid||!this.p.treeGrid){return}var k,h,n,l,m,j;l=a(this).jqGrid("getNodeChildren",f);m=a.jgrid.from(l);m.orderBy(g,d,c,e);j=m.select();for(k=0,h=j.length;k<h;k++){n=j[k];b.push(n);a(this).jqGrid("collectChildrenSortTree",b,n,g,d,c,e)}})},setTreeRow:function(b,c){var d=false;this.each(function(){var e=this;if(!e.grid||!e.p.treeGrid){return}d=a(e).jqGrid("setRowData",b,c)});return d},delTreeNode:function(b){return this.each(function(){var h=this,n=h.p.localReader.id,j,g=h.p.treeReader.left_field,m=h.p.treeReader.right_field,d,e,k,l;if(!h.grid||!h.p.treeGrid){return}var c=h.p._index[b];if(c!==undefined){d=parseInt(h.p.data[c][m],10);e=d-parseInt(h.p.data[c][g],10)+1;var f=a(h).jqGrid("getFullTreeNode",h.p.data[c]);if(f.length>0){for(j=0;j<f.length;j++){a(h).jqGrid("delRowData",f[j][n])}}if(h.p.treeGridModel==="nested"){k=a.jgrid.from(h.p.data).greater(g,d,{stype:"integer"}).select();if(k.length){for(l in k){if(k.hasOwnProperty(l)){k[l][g]=parseInt(k[l][g],10)-e}}}k=a.jgrid.from(h.p.data).greater(m,d,{stype:"integer"}).select();if(k.length){for(l in k){if(k.hasOwnProperty(l)){k[l][m]=parseInt(k[l][m],10)-e}}}}}})},addChildNode:function(g,n,z,k){var t=this[0];if(z){var o=t.p.treeReader.expanded_field,w=t.p.treeReader.leaf_field,b=t.p.treeReader.level_field,h=t.p.treeReader.parent_id_field,d=t.p.treeReader.left_field,x=t.p.treeReader.right_field,p=t.p.treeReader.loaded,c,y,j,m,r,s,q=0,l=n,v,u;if(k===undefined){k=false}if(g===undefined||g===null){r=t.p.data.length-1;if(r>=0){while(r>=0){q=Math.max(q,parseInt(t.p.data[r][t.p.localReader.id],10));r--}}g=q+1}var C=a(t).jqGrid("getInd",n);v=false;if(n===undefined||n===null||n===""){n=null;l=null;c="last";m=t.p.tree_root_level;r=t.p.data.length+1}else{c="after";y=t.p._index[n];j=t.p.data[y];n=j[t.p.localReader.id];m=parseInt(j[b],10)+1;var e=a(t).jqGrid("getFullTreeNode",j);if(e.length){r=e[e.length-1][t.p.localReader.id];l=r;r=a(t).jqGrid("getInd",l)+1}else{r=a(t).jqGrid("getInd",n)+1}if(j[w]){v=true;j[o]=true;a(t.rows[C]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(t.p.treeIcons.leaf+" tree-leaf").addClass(t.p.treeIcons.minus+" tree-minus");t.p.data[y][w]=false;j[p]=true}}s=r+1;if(z[o]===undefined){z[o]=false}if(z[p]===undefined){z[p]=false}z[b]=m;if(z[w]===undefined){z[w]=true}if(t.p.treeGridModel==="adjacency"){z[h]=n}if(t.p.treeGridModel==="nested"){var f,B,A;if(n!==null){u=parseInt(j[x],10);f=a.jgrid.from(t.p.data);f=f.greaterOrEquals(x,u,{stype:"integer"});B=f.select();if(B.length){for(A in B){if(B.hasOwnProperty(A)){B[A][d]=B[A][d]>u?parseInt(B[A][d],10)+2:B[A][d];B[A][x]=B[A][x]>=u?parseInt(B[A][x],10)+2:B[A][x]}}}z[d]=u;z[x]=u+1}else{u=parseInt(a(t).jqGrid("getCol",x,false,"max"),10);B=a.jgrid.from(t.p.data).greater(d,u,{stype:"integer"}).select();if(B.length){for(A in B){if(B.hasOwnProperty(A)){B[A][d]=parseInt(B[A][d],10)+2}}}B=a.jgrid.from(t.p.data).greater(x,u,{stype:"integer"}).select();if(B.length){for(A in B){if(B.hasOwnProperty(A)){B[A][x]=parseInt(B[A][x],10)+2}}}z[d]=u+1;z[x]=u+2}}if(n===null||a(t).jqGrid("isNodeLoaded",j)||v){a(t).jqGrid("addRowData",g,z,c,l);a(t).jqGrid("setTreeNode",r,s)}if(j&&!j[o]&&k){a(t.rows[C]).find("div.treeclick").click()}}}})})(jQuery);(function(a){a.extend(a.jgrid,{template:function(e){var c=a.makeArray(arguments).slice(1),b,d=c.length;if(e==null){e=""}return e.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,function(f,j){if(!isNaN(parseInt(j,10))){return c[parseInt(j,10)]}for(b=0;b<d;b++){if(a.isArray(c[b])){var h=c[b],g=h.length;while(g--){if(j===h[g].nm){return h[g].v}}}}})}});a.jgrid.extend({groupingSetup:function(){return this.each(function(){var g=this,e,d,f,c=g.p.colModel,b=g.p.groupingView;if(b!==null&&((typeof b==="object")||a.isFunction(b))){if(!b.groupField.length){g.p.grouping=false}else{if(b.visibiltyOnNextGrouping===undefined){b.visibiltyOnNextGrouping=[]}b.lastvalues=[];b.groups=[];b.counters=[];for(e=0;e<b.groupField.length;e++){if(!b.groupOrder[e]){b.groupOrder[e]="asc"}if(!b.groupText[e]){b.groupText[e]="{0}"}if(typeof b.groupColumnShow[e]!=="boolean"){b.groupColumnShow[e]=true}if(typeof b.groupSummary[e]!=="boolean"){b.groupSummary[e]=false}if(b.groupColumnShow[e]===true){b.visibiltyOnNextGrouping[e]=true;a(g).jqGrid("showCol",b.groupField[e])}else{b.visibiltyOnNextGrouping[e]=a("#"+a.jgrid.jqID(g.p.id+"_"+b.groupField[e])).is(":visible");a(g).jqGrid("hideCol",b.groupField[e])}}b.summary=[];for(d=0,f=c.length;d<f;d++){if(c[d].summaryType){b.summary.push({nm:c[d].name,st:c[d].summaryType,v:"",sr:c[d].summaryRound,srt:c[d].summaryRoundType||"round"})}}}}else{g.p.grouping=false}})},groupingPrepare:function(d,e,b,c){this.each(function(){var n=this.p.groupingView,g=this,h,m=n.groupField.length,o,l,k,j,f=0;for(h=0;h<m;h++){o=n.groupField[h];k=n.displayField[h];l=b[o];j=k==null?null:b[k];if(j==null){j=l}if(l!==undefined){if(c===0){n.groups.push({idx:h,dataIndex:o,value:l,displayValue:j,startRow:c,cnt:1,summary:[]});n.lastvalues[h]=l;n.counters[h]={cnt:1,pos:n.groups.length-1,summary:a.extend(true,[],n.summary)};a.each(n.counters[h].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(g,this.v,this.nm,b)}else{this.v=a(g).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});n.groups[n.counters[h].pos].summary=n.counters[h].summary}else{if(typeof l!=="object"&&n.lastvalues[h]!==l){n.groups.push({idx:h,dataIndex:o,value:l,displayValue:j,startRow:c,cnt:1,summary:[]});n.lastvalues[h]=l;f=1;n.counters[h]={cnt:1,pos:n.groups.length-1,summary:a.extend(true,[],n.summary)};a.each(n.counters[h].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(g,this.v,this.nm,b)}else{this.v=a(g).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});n.groups[n.counters[h].pos].summary=n.counters[h].summary}else{if(f===1){n.groups.push({idx:h,dataIndex:o,value:l,displayValue:j,startRow:c,cnt:1,summary:[]});n.lastvalues[h]=l;n.counters[h]={cnt:1,pos:n.groups.length-1,summary:a.extend(true,[],n.summary)};a.each(n.counters[h].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(g,this.v,this.nm,b)}else{this.v=a(g).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});n.groups[n.counters[h].pos].summary=n.counters[h].summary}else{n.counters[h].cnt+=1;n.groups[n.counters[h].pos].cnt=n.counters[h].cnt;a.each(n.counters[h].summary,function(){if(a.isFunction(this.st)){this.v=this.st.call(g,this.v,this.nm,b)}else{this.v=a(g).jqGrid("groupingCalculations.handler",this.st,this.v,this.nm,this.sr,this.srt,b)}});n.groups[n.counters[h].pos].summary=n.counters[h].summary}}}}}e.push(d)});return e},groupingToggle:function(b){this.each(function(){var h=this,p=h.p.groupingView,d=b.split("_"),j=parseInt(d[d.length-2],10);d.splice(d.length-2,2);var m=d.join("_"),f=p.minusicon,l=p.plusicon,k=a("#"+a.jgrid.jqID(b)),c=k.length?k[0].nextSibling:null,n=a("#"+a.jgrid.jqID(b)+" span.tree-wrap-"+h.p.direction),g=false,o;if(n.hasClass(f)){if(p.showSummaryOnHide){if(c){while(c){if(a(c).hasClass("jqfoot")){var e=parseInt(a(c).attr("jqfootlevel"),10);if(e<=j){break}}a(c).hide();c=c.nextSibling}}}else{if(c){while(c){if(a(c).hasClass(m+"_"+String(j))||a(c).hasClass(m+"_"+String(j-1))){break}a(c).hide();c=c.nextSibling}}}n.removeClass(f).addClass(l);g=true}else{if(c){while(c){if(a(c).hasClass(m+"_"+String(j))||a(c).hasClass(m+"_"+String(j-1))){break}a(c).show();o=a(c).find("span.tree-wrap-"+h.p.direction);if(o&&a(o).hasClass(l)){a(o).removeClass(l).addClass(f)}c=c.nextSibling}}n.removeClass(l).addClass(f)}a(h).triggerHandler("jqGridGroupingClickGroup",[b,g]);if(a.isFunction(h.p.onClickGroup)){h.p.onClickGroup.call(h,b,g)}});return false},groupingRender:function(b,c){return this.each(function(){var f=this,p=f.p.groupingView,k="",l="",m,o,h=p.groupCollapse?p.plusicon:p.minusicon,d,j=[],g=p.groupField.length;h+=" tree-wrap-"+f.p.direction;a.each(f.p.colModel,function(r,t){var s;for(s=0;s<g;s++){if(p.groupField[s]===t.name){j[s]=r;break}}});var e=0;function q(u,v,r){var s=false,t;if(v===0){s=r[u]}else{var w=r[u].idx;if(w===0){s=r[u]}else{for(t=u;t>=0;t--){if(r[t].idx===w-v){s=r[t];break}}}}return s}var n=a.makeArray(p.groupSummary);n.reverse();a.each(p.groups,function(w,t){e++;o=f.p.id+"ghead_"+t.idx;m=o+"_"+w;l="<span style='cursor:pointer;' class='ui-icon "+h+"' onclick=\"jQuery('#"+a.jgrid.jqID(f.p.id)+"').jqGrid('groupingToggle','"+m+"');return false;\"></span>";try{d=f.formatter(m,t.displayValue,j[t.idx],t.value)}catch(H){d=t.displayValue}k+='<tr id="'+m+'" role="row" class= "ui-widget-content jqgroup ui-row-'+f.p.direction+" "+o+'"><td style="padding-left:'+(t.idx*12)+'px;" colspan="'+c+'">'+l+a.jgrid.template(p.groupText[t.idx],d,t.cnt,t.summary)+"</td></tr>";var z=g-1===t.idx;if(z){var A=p.groups[w+1],v,s,E;var u=A!==undefined?p.groups[w+1].startRow:b.length;for(s=t.startRow;s<u;s++){k+=b[s].join("")}var x;if(A!==undefined){for(x=0;x<p.groupField.length;x++){if(A.dataIndex===p.groupField[x]){break}}e=p.groupField.length-x}for(E=0;E<e;E++){if(!n[E]){continue}var B="";if(p.groupCollapse&&!p.showSummaryOnHide){B=' style="display:none;"'}k+="<tr"+B+' jqfootlevel="'+(t.idx-E)+'" role="row" class="ui-widget-content jqfoot ui-row-'+f.p.direction+'">';var y=q(w,E,p.groups),D=f.p.colModel,C,F=y.cnt;for(v=0;v<c;v++){var r="<td "+f.formatCol(v,1,"")+">&#160;</td>",G="{0}";a.each(y.summary,function(){if(this.nm===D[v].name){if(D[v].summaryTpl){G=D[v].summaryTpl}if(typeof this.st==="string"&&this.st.toLowerCase()==="avg"){if(this.v&&F>0){this.v=(this.v/F)}}try{C=f.formatter("",this.v,v,this)}catch(I){C=this.v}r="<td "+f.formatCol(v,1,"")+">"+a.jgrid.format(G,C)+"</td>";return false}});k+=r}k+="</tr>"}e=x}});a("#"+a.jgrid.jqID(f.p.id)+" tbody:first").append(k);k=null})},groupingGroupBy:function(c,b){return this.each(function(){var f=this;if(typeof c==="string"){c=[c]}var d=f.p.groupingView;f.p.grouping=true;if(d.visibiltyOnNextGrouping===undefined){d.visibiltyOnNextGrouping=[]}var e;for(e=0;e<d.groupField.length;e++){if(!d.groupColumnShow[e]&&d.visibiltyOnNextGrouping[e]){a(f).jqGrid("showCol",d.groupField[e])}}for(e=0;e<c.length;e++){d.visibiltyOnNextGrouping[e]=a("#"+a.jgrid.jqID(f.p.id)+"_"+a.jgrid.jqID(c[e])).is(":visible")}f.p.groupingView=a.extend(f.p.groupingView,b||{});d.groupField=c;a(f).trigger("reloadGrid")})},groupingRemove:function(b){return this.each(function(){var e=this;if(b===undefined){b=true}e.p.grouping=false;if(b===true){var c=e.p.groupingView,d;for(d=0;d<c.groupField.length;d++){if(!c.groupColumnShow[d]&&c.visibiltyOnNextGrouping[d]){a(e).jqGrid("showCol",c.groupField)}}a("tr.jqgroup, tr.jqfoot","#"+a.jgrid.jqID(e.p.id)+" tbody:first").remove();a("tr.jqgrow:hidden","#"+a.jgrid.jqID(e.p.id)+" tbody:first").show()}else{a(e).trigger("reloadGrid")}})},groupingCalculations:{handler:function(f,j,g,k,h,b){var c={sum:function(){return parseFloat(j||0)+parseFloat((b[g]||0))},min:function(){if(j===""){return parseFloat(b[g]||0)}return Math.min(parseFloat(j),parseFloat(b[g]||0))},max:function(){if(j===""){return parseFloat(b[g]||0)}return Math.max(parseFloat(j),parseFloat(b[g]||0))},count:function(){if(j===""){j=0}if(b.hasOwnProperty(g)){return j+1}return 0},avg:function(){return c.sum()}};if(!c[f]){throw ("jqGrid Grouping No such method: "+f)}var e=c[f]();if(k!=null){if(h=="fixed"){e=e.toFixed(k)}else{var d=Math.pow(10,k);e=Math.round(e*d)/d}}return e}}})})(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 f=this;var c=function(h,n){var g=a(n.xmlGrid.config,h)[0];var m=a(n.xmlGrid.data,h)[0],p,k,j;if(xmlJsonClass.xml2json&&a.jgrid.parse){p=xmlJsonClass.xml2json(g," ");p=a.jgrid.parse(p);for(j in p){if(p.hasOwnProperty(j)){k=p[j]}}if(m){var l=p.grid.datatype;p.grid.datatype="xmlstring";p.grid.datastr=h;a(f).jqGrid(k).jqGrid("setGridParam",{datatype:l})}else{a(f).jqGrid(k)}p=null;k=null}else{alert("xml2json or parse are not present")}};var e=function(j,m){if(j&&typeof j=="string"){var g=false;if(a.jgrid.useJSON){a.jgrid.useJSON=false;g=true}var h=a.jgrid.parse(j);if(g){a.jgrid.useJSON=true}var n=h[m.jsonGrid.config];var k=h[m.jsonGrid.data];if(k){var l=n.datatype;n.datatype="jsonstring";n.datastr=k;a(f).jqGrid(n).jqGrid("setGridParam",{datatype:l})}else{a(f).jqGrid(n)}}};switch(b.imptype){case"xml":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"xml",complete:function(g,h){if(h=="success"){c(g.responseXML,b);a(f).triggerHandler("jqGridImportComplete",[g,b]);if(a.isFunction(b.importComplete)){b.importComplete(g)}}g=null}},b.ajaxOptions));break;case"xmlstring":if(b.impstring&&typeof b.impstring=="string"){var d=a.jgrid.stringToDoc(b.impstring);if(d){c(d,b);a(f).triggerHandler("jqGridImportComplete",[d,b]);if(a.isFunction(b.importComplete)){b.importComplete(d)}b.impstring=null}d=null}break;case"json":a.ajax(a.extend({url:b.impurl,type:b.mtype,data:b.impData,dataType:"json",complete:function(h){try{e(h.responseText,b);a(f).triggerHandler("jqGridImportComplete",[h,b]);if(a.isFunction(b.importComplete)){b.importComplete(h)}}catch(g){}h=null}},b.ajaxOptions));break;case"jsonstring":if(b.impstring&&typeof b.impstring=="string"){e(b.impstring,b);a(f).triggerHandler("jqGridImportComplete",[b.impstring,b]);if(a.isFunction(b.importComplete)){b.importComplete(b.impstring)}b.impstring=null}break}})},jqGridExport:function(c){c=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},c||{});var b=null;this.each(function(){if(!this.grid){return}var d,e=a.extend(true,{},a(this).jqGrid("getGridParam"));if(e.rownumbers){e.colNames.splice(0,1);e.colModel.splice(0,1)}if(e.multiselect){e.colNames.splice(0,1);e.colModel.splice(0,1)}if(e.subGrid){e.colNames.splice(0,1);e.colModel.splice(0,1)}e.knv=null;if(e.treeGrid){for(d in e.treeReader){if(e.treeReader.hasOwnProperty(d)){e.colNames.splice(e.colNames.length-1);e.colModel.splice(e.colModel.length-1)}}}switch(c.exptype){case"xmlstring":b="<"+c.root+">"+xmlJsonClass.json2xml(e,c.ident)+"</"+c.root+">";break;case"jsonstring":b="{"+xmlJsonClass.toJson(e,c.root,c.ident,false)+"}";if(e.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 c;if(b.exptype=="remote"){var d=a.extend({},this.p.postData);d[b.oper]=b.tag;var e=jQuery.param(d);if(b.url.indexOf("?")!=-1){c=b.url+"&"+e}else{c=b.url+"?"+e}window.location=c}})}})})(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 n=jQuery(this).width();var p=jQuery("tr td:first-child input[type=checkbox]:first",jQuery(this));var h=jQuery("tr td:first-child input[type=radio]:first",jQuery(this));var d=p.length>0;var g=!d&&h.length>0;var j=d||g;var l=[];var o=[];jQuery("th",jQuery(this)).each(function(){if(l.length===0&&j){l.push({name:"__selection__",index:"__selection__",width:0,hidden:true});o.push("__selection__")}else{l.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});o.push(jQuery(this).html())}});var f=[];var e=[];var m=[];jQuery("tbody > tr",jQuery(this)).each(function(){var r={};var q=0;jQuery("td",jQuery(this)).each(function(){if(q===0&&j){var s=jQuery("input",jQuery(this));var t=s.attr("value");e.push(t||f.length);if(s.is(":checked")){m.push(t)}r[l[q].name]=s.attr("value")}else{r[l[q].name]=jQuery(this).html()}q++});if(q>0){f.push(r)}});jQuery(this).empty();jQuery(this).addClass("scroll");jQuery(this).jqGrid(jQuery.extend({datatype:"local",width:n,colNames:o,colModel:l,multiselect:d},b||{}));var k;for(k=0;k<f.length;k++){var c=null;if(e.length>0){c=e[k];if(c&&c.replace){c=encodeURIComponent(c).replace(/[.\-%]/g,"_")}}if(c===null){c=k+1}jQuery(this).jqGrid("addRowData",c,f[k])}for(k=0;k<m.length;k++){jQuery(this).jqGrid("setSelection",m[k])}})}
/*
 * 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 c=a(this);var e=a.extend({fluidBaseLayer:"#gbox_"+c.attr("id"),fluidOffset:0,minWidth:null,maxWidth:null},b||{});var d=function(j,h){var f=j.width(),k=a(j).data("previousWidth"),g=f;if(h===true||(f!=k)){a(j).data("previousWidth",f);g=(e.minWidth!==null&&f<e.minWidth?e.minWidth:g);g=(e.maxWidth!==null&&f>e.maxWidth?e.maxWidth:g);c.trigger("fluidWidth.resize",[k,g-e.fluidOffset])}};if(a(e.fluidBaseLayer).data("fluidWidth")!==true){a(e.fluidBaseLayer).data("fluidWidth",true);setInterval(function(){d(a(e.fluidBaseLayer),false)},100)}d(a(e.fluidBaseLayer),true)}}})(jQuery);jQuery.fn.extend({fluidWidth:jQuery.jgrid.fluid.fluidWidth});(function(){window.form2object=function(k,g,d){if(typeof d=="undefined"||d==null){d=true}if(typeof g=="undefined"||g==null){g="."}k=typeof k=="string"?document.getElementById(k):k;var o=b(k);var t={};var h={};for(var n=0;n<o.length;n++){var p=o[n].value;if(d&&p===""){continue}var f=o[n].name;if(f){var m=f.split(g);var q=t;for(var l=0;l<m.length;l++){var r=m[l];var e;if(r.indexOf("[]")>-1&&l==m.length-1){e=r.substr(0,r.indexOf("["));if(!q[e]){q[e]=[]}q[e].push(p)}else{if(r.indexOf("[")>-1){e=r.substr(0,r.indexOf("["));var s=r.replace(/^[a-z]+\[|\]$/gi,"");if(!h[e]){h[e]={}}if(!q[e]){q[e]=[]}if(l==m.length-1){q[e].push(p)}else{if(!h[e][s]){q[e].push({});h[e][s]=q[e][q[e].length-1]}}q=h[e][s]}else{if(l<m.length-1){if(!q[r]){q[r]={}}q=q[r]}else{q[r]=p}}}}}}return t};function b(g){var d=[],h;var j=g.firstChild;while(j){if(j.nodeName.match(/INPUT|SELECT|TEXTAREA|HIDDEN/i)||jQuery(j).is("[ruptype='tree']")){var k=a(j);if((jQuery(j).is("select")&&j.multiple)||jQuery(j).is("[ruptype='tree']")){var f=jQuery(j).attr("name").split(".");h=f.length>1?f[f.length-2]:f[0]}else{h=jQuery(j).attr("name")}if(k!==null){d.push({name:h,value:k})}}else{var e=b(j);d=d.concat(e)}j=j.nextSibling}return d}function a(d){var e=jQuery(d).attr("ruptype");if(e){return jQuery(d)["rup_"+e]("getRupValue")}else{switch(d.nodeName){case"HIDDEN":case"INPUT":case"TEXTAREA":switch(d.type.toLowerCase()){case"radio":case"checkbox":if(d.checked){return d.value}break;case"button":case"reset":case"submit":case"image":return"";break;default:return d.value;break}break;case"SELECT":return c(d);break;default:break}}return null}function c(j){var e=j.multiple;if(!e){return j.value}var d=[];for(var h=j.getElementsByTagName("option"),k=0,g=h.length;k<g;k++){var f=j.name.split(".");f[f.length-1];if(h[k].selected){var m={};m[f[f.length-1]]=h[k].value;d.push(m)}}return d}window.form2json=window.form2object})();(function(j){if(/1\.(0|1|2)\.(0|1|2)/.test(j.fn.jquery)||/^1.1/.test(j.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+j.fn.jquery);return}j.fn._fadeIn=j.fn.fadeIn;var c=function(){};var k=document.documentMode||0;var e=j.browser.msie&&((j.browser.version<8&&!k)||k<8);var f=j.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!k;j.blockUI=function(q){d(window,q)};j.unblockUI=function(q){h(window,q)};j.growlUI=function(u,s,t,q){var r=j('<div class="growlUI"></div>');if(u){r.append("<h1>"+u+"</h1>")}if(s){r.append("<h2>"+s+"</h2>")}if(t==undefined){t=3000}j.blockUI({message:r,fadeIn:700,fadeOut:1000,centerY:false,timeout:t,showOverlay:false,onUnblock:q,css:j.blockUI.defaults.growlCSS})};j.fn.block=function(q){return this.unblock({fadeOut:0}).each(function(){if(j.css(this,"position")=="static"){this.style.position="relative"}if(j.browser.msie){this.style.zoom=1}d(this,q)})};j.fn.unblock=function(q){return this.each(function(){h(this,q)})};j.blockUI.version=2.35;j.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 g=[];function d(u,G){var B=(u==window);var x=G&&G.message!==undefined?G.message:undefined;G=j.extend({},j.blockUI.defaults,G||{});G.overlayCSS=j.extend({},j.blockUI.defaults.overlayCSS,G.overlayCSS||{});var D=j.extend({},j.blockUI.defaults.css,G.css||{});var O=j.extend({},j.blockUI.defaults.themedCSS,G.themedCSS||{});x=x===undefined?G.message:x;if(B&&b){h(window,{fadeOut:0})}if(x&&typeof x!="string"&&(x.parentNode||x.jquery)){var J=x.jquery?x[0]:x;var Q={};j(u).data("blockUI.history",Q);Q.el=J;Q.parent=J.parentNode;Q.display=J.style.display;Q.position=J.style.position;if(Q.parent){Q.parent.removeChild(J)}}var C=G.baseZ;var N=(j.browser.msie||G.forceIframe)?j('<iframe class="blockUI" style="z-index:'+(C++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+G.iframeSrc+'"></iframe>'):j('<div class="blockUI" style="display:none"></div>');var M=j('<div class="blockUI blockOverlay" style="z-index:'+(C++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var L,H;if(G.theme&&B){H='<div class="blockUI '+G.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+C+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(G.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(G.theme){H='<div class="blockUI '+G.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+C+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(G.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>'}else{if(B){H='<div class="blockUI '+G.blockMsgClass+' blockPage" style="z-index:'+C+';display:none;position:fixed"></div>'}else{H='<div class="blockUI '+G.blockMsgClass+' blockElement" style="z-index:'+C+';display:none;position:absolute"></div>'}}}L=j(H);if(x){if(G.theme){L.css(O);L.addClass("ui-widget-content")}else{L.css(D)}}if(!G.applyPlatformOpacityRules||!(j.browser.mozilla&&/Linux/.test(navigator.platform))){M.css(G.overlayCSS)}M.css("position",B?"fixed":"absolute");if(j.browser.msie||G.forceIframe){N.css("opacity",0)}var A=[N,M,L],P=B?j("body"):j(u);j.each(A,function(){this.appendTo(P)});if(G.theme&&G.draggable&&j.fn.draggable){L.draggable({handle:".ui-dialog-titlebar",cancel:"li"})}var w=e&&(!j.boxModel||j("object,embed",B?null:u).length>0);if(f||w){if(B&&G.allowBodyStretch&&j.boxModel){j("html,body").css("height","100%")}if((f||!j.boxModel)&&!B){var F=n(u,"borderTopWidth"),K=n(u,"borderLeftWidth");var y=F?"(0 - "+F+")":0;var E=K?"(0 - "+K+")":0}j.each([N,M,L],function(t,T){var z=T[0].style;z.position="absolute";if(t<2){B?z.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+G.quirksmodeOffsetHack+') + "px"'):z.setExpression("height",'this.parentNode.offsetHeight + "px"');B?z.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):z.setExpression("width",'this.parentNode.offsetWidth + "px"');if(E){z.setExpression("left",E)}if(y){z.setExpression("top",y)}}else{if(G.centerY){if(B){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(!G.centerY&&B){var R=(G.css&&G.css.top)?parseInt(G.css.top):0;var S="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+R+') + "px"';z.setExpression("top",S)}}}})}if(x){if(G.theme){L.find(".ui-widget-content").append(x)}else{L.append(x)}if(x.jquery||x.nodeType){j(x).show()}}if((j.browser.msie||G.forceIframe)&&G.showOverlay){N.show()}if(G.fadeIn){var I=G.onBlock?G.onBlock:c;var r=(G.showOverlay&&!x)?I:c;var q=x?I:c;if(G.showOverlay){M._fadeIn(G.fadeIn,r)}if(x){L._fadeIn(G.fadeIn,q)}}else{if(G.showOverlay){M.show()}if(x){L.show()}if(G.onBlock){G.onBlock()}}m(1,u,G);if(B){b=L[0];g=j(":input:enabled:visible",b);if(G.focusInput){setTimeout(p,20)}}else{a(L[0],G.centerX,G.centerY)}if(G.timeout){var v=setTimeout(function(){B?j.unblockUI(G):j(u).unblock(G)},G.timeout);j(u).data("blockUI.timeout",v)}}function h(t,u){var s=(t==window);var r=j(t);var v=r.data("blockUI.history");var w=r.data("blockUI.timeout");if(w){clearTimeout(w);r.removeData("blockUI.timeout")}u=j.extend({},j.blockUI.defaults,u||{});m(0,t,u);var q;if(s){q=j("body").children().filter(".blockUI").add("body > .blockUI")}else{q=j(".blockUI",t)}if(s){b=g=null}if(u.fadeOut){q.fadeOut(u.fadeOut);setTimeout(function(){l(q,v,u,t)},u.fadeOut)}else{l(q,v,u,t)}}function l(q,t,s,r){q.each(function(u,v){if(this.parentNode){this.parentNode.removeChild(this)}});if(t&&t.el){t.el.style.display=t.display;t.el.style.position=t.position;if(t.parent){t.parent.appendChild(t.el)}j(r).removeData("blockUI.history")}if(typeof s.onUnblock=="function"){s.onUnblock(r,s)}}function m(q,u,v){var t=u==window,s=j(u);if(!q&&(t&&!b||!t&&!s.data("blockUI.isBlocked"))){return}if(!t){s.data("blockUI.isBlocked",q)}if(!v.bindEvents||(q&&!v.showOverlay)){return}var r="mousedown mouseup keydown keypress";q?j(document).bind(r,v,o):j(document).unbind(r,o)}function o(u){if(u.keyCode&&u.keyCode==9){if(b&&u.data.constrainTabKey){var s=g;var r=!u.shiftKey&&u.target===s[s.length-1];var q=u.shiftKey&&u.target===s[0];if(r||q){setTimeout(function(){p(q)},10);return false}}}var t=u.data;if(j(u.target).parents("div."+t.blockMsgClass).length>0){return true}return j(u.target).parents().children().filter("div.blockUI").length==0}function p(q){if(!g){return}var r=g[q===true?g.length-1:0];if(r){r.focus()}}function a(w,q,A){var z=w.parentNode,v=w.style;var r=((z.offsetWidth-w.offsetWidth)/2)-n(z,"borderLeftWidth");var u=((z.offsetHeight-w.offsetHeight)/2)-n(z,"borderTopWidth");if(q){v.left=r>0?(r+"px"):"0"}if(A){v.top=u>0?(u+"px"):"0"}}function n(q,r){return parseInt(j.css(q,r))||0}})(jQuery);var $=jQuery.noConflict();$.extend({fileDownload:function(k,c){var n=function(w,x){alert("A file download error has occurred, please try again.")};var r=$.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(w){},failCallback:n,httpMethod:"GET",data:null,checkInterval:100,cookieName:"fileDownload",cookieValue:"true",cookiePath:"/",popupWindowTitle:"Initiating file download...",encodeHTMLEntities:true},c);var u=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase();var o=false;var t=false;var b=false;if(/ip(ad|hone|od)/.test(u)){o=true}else{if(u.indexOf("android")!=-1){t=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(u)||/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(u.substr(0,4))}}var q=r.httpMethod.toUpperCase();if(t&&q!="GET"){if($().dialog){$("<div>").html(r.androidPostUnsupportedMessageHtml).dialog(r.dialogOptions)}else{alert(r.androidPostUnsupportedMessageHtml)}return}var v=null;if(r.preparingMessageHtml){v=$("<div>").html(r.preparingMessageHtml).dialog(r.dialogOptions)}var h={onSuccess:function(w){if(v){v.dialog("close")}r.successCallback(w)},onFail:function(w,x){if(v){v.dialog("close")}if(r.failMessageHtml){$("<div>").html(r.failMessageHtml).dialog(r.dialogOptions);if(r.failCallback!=n){r.failCallback(w,x)}}else{r.failCallback(w,x)}}};if(r.data!==null&&typeof r.data!=="string"){r.data=$.param(r.data)}var m,d,s,e;if(q==="GET"){if(r.data!==null){var p=k.indexOf("?");if(p!=-1){if(k.substring(k.length-1)!=="&"){k=k+"&"}}else{k=k+"?"}k=k+r.data}if(o||t){d=window.open(k);d.document.title=r.popupWindowTitle;window.focus()}else{if(b){window.location(k)}else{m=$("<iframe>").hide().attr("src",k).appendTo("body")}}}else{var g="";if(r.data!==null){$.each(r.data.replace(/\+/g," ").split("&"),function(){var w=this.split("=");var x=r.encodeHTMLEntities?f(decodeURIComponent(w[0])):decodeURIComponent(w[0]);if(!x){return}var y=w[1]||"";y=r.encodeHTMLEntities?f(decodeURIComponent(w[1])):decodeURIComponent(w[1]);g+='<input type="hidden" name="'+x+'" value="'+y+'" />'})}if(b){e=$("<form>").appendTo("body");e.hide().attr("method",r.httpMethod).attr("action",k).html(g)}else{if(o){d=window.open("about:blank");d.document.title=r.popupWindowTitle;s=d.document;window.focus()}else{m=$("<iframe style='display: none' src='about:blank'></iframe>").appendTo("body");s=a(m)}s.write("<html><head></head><body><form method='"+r.httpMethod+"' action='"+k+"'>"+g+"</form>"+r.popupWindowTitle+"</body></html>");e=$(s).find("form")}e.submit()}setTimeout(j,r.checkInterval);function j(){if(document.cookie.indexOf(r.cookieName+"="+r.cookieValue)!=-1){h.onSuccess(k);var x=new Date(1000);document.cookie=r.cookieName+"=; expires="+x.toUTCString()+"; path="+r.cookiePath;l(false);return}if(d||m){try{var w;if(d){w=d.document}else{w=a(m)}if(w&&w.body!=null&&w.body.innerHTML.length>0){var A=true;if(e&&e.length>0){var y=$(w.body).contents().first();if(y.length>0&&y[0]===e[0]){A=false}}if(A){h.onFail(w.body.innerHTML,k);l(true);return}}}catch(z){h.onFail("",k);l(true);return}}setTimeout(j,r.checkInterval)}function a(w){var x=w[0].contentWindow||w[0].contentDocument;if(x.document){x=x.document}return x}function l(w){setTimeout(function(){if(d){if(t){d.close()}if(o){if(w){d.focus();d.close()}else{d.focus()}}}},0)}function f(w){return w.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(c,b){b.submit()},processData:false,contentType:false,cache:false},_refreshOptionsList:["namespace","dropZone","fileInput"],_isXHRUpload:function(b){var c="undefined";return !b.forceIframeTransport&&typeof XMLHttpRequestUpload!==c&&typeof File!==c&&(!b.multipart||typeof FormData!==c)},_getFormData:function(b){var c;if(typeof b.formData==="function"){return b.formData(b.form)}else{if(a.isArray(b.formData)){return b.formData}else{if(b.formData){c=[];a.each(b.formData,function(d,e){c.push({name:d,value:e})});return c}}}return[]},_getTotal:function(c){var b=0;a.each(c,function(d,e){b+=e.size||1});return b},_onProgress:function(f,d){if(f.originalEvent!==undefined&&f.originalEvent.lengthComputable){var c=d.total||this._getTotal(d.files),b=parseInt(f.originalEvent.loaded/f.originalEvent.total*(d.chunkSize||c),10)+(d.uploadedBytes||0);this._loaded+=b-(d.loaded||d.uploadedBytes||0);d.lengthComputable=true;d.loaded=b;d.total=c;this._trigger("progress",f,d);this._trigger("progressall",f,{lengthComputable:true,loaded:this._loaded,total:this._total})}},_initProgressListener:function(b){var c=this,d=b.xhr?b.xhr():a.ajaxSettings.xhr();if(d.upload){a(d.upload).bind("progress",function(f){c._onProgress(f,b)});b.xhr=function(){return d}}},_initXHRData:function(b){var d,c=b.files[0];if(!b.multipart||b.blob){b.headers=a.extend(b.headers,{"X-File-Name":c.name,"X-File-Type":c.type,"X-File-Size":c.size});if(!b.blob){b.contentType=c.type;b.data=c}else{if(!b.multipart){b.contentType="application/octet-stream";b.data=b.blob}}}if(b.multipart&&typeof FormData!=="undefined"){if(b.postMessage){d=this._getFormData(b);if(b.blob){d.push({name:b.paramName,value:b.blob})}else{a.each(b.files,function(e,f){d.push({name:b.paramName,value:f})})}}else{if(b.formData instanceof FormData){d=b.formData}else{d=new FormData();a.each(this._getFormData(b),function(e,f){d.append(f.name,f.value)})}if(b.blob){d.append(b.paramName,b.blob)}else{a.each(b.files,function(e,f){if(f instanceof Blob){d.append(b.paramName,f)}})}}b.data=d}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(c){var b=a.extend({},this.options,c);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(e,d,c){var b=a.Deferred(),f=b.promise();d=d||this.options.context||f;if(e===true){b.resolveWith(d,c)}else{if(e===false){b.rejectWith(d,c)}}f.abort=b.promise;return this._enhancePromise(f)},_chunkedUpload:function(o,j){var h=this,f=o.files[0],g=f.size,b=o.uploadedBytes=o.uploadedBytes||0,e=o.maxChunkSize||g,l=f.webkitSlice||f.mozSlice||f.slice,m,c,k,d;if(!(this._isXHRUpload(o)&&l&&(b||e<g))||o.data){return false}if(j){return true}if(b>=g){f.error="uploadedBytes";return this._getXHRPromise(false)}c=Math.ceil((g-b)/e);m=function(n){if(!n){return h._getXHRPromise(true)}return m(n-=1).pipe(function(){var p=a.extend({},o);p.blob=l.call(f,b+n*e,b+(n+1)*e);p.chunkSize=p.blob.size;h._initXHRData(p);h._initProgressListener(p);k=(a.ajax(p)||h._getXHRPromise(false,p.context)).done(function(){if(!p.loaded){h._onProgress(a.Event("progress",{lengthComputable:true,loaded:p.chunkSize,total:p.chunkSize}),p)}o.uploadedBytes=p.uploadedBytes+=p.chunkSize});return k})};d=m(c);d.abort=function(){return k.abort()};return this._enhancePromise(d)},_beforeSend:function(c,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,e,d,c){if(!this._isXHRUpload(c)){this._onProgress(a.Event("progress",{lengthComputable:true,loaded:1,total:1}),c)}c.result=b;c.textStatus=e;c.jqXHR=d;this._trigger("done",null,c)},_onFail:function(c,e,d,b){b.jqXHR=c;b.textStatus=e;b.errorThrown=d;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(d,e,c,b){this._active-=1;b.textStatus=e;if(c&&c.always){b.jqXHR=c;b.result=d}else{b.jqXHR=d;b.errorThrown=c}this._trigger("always",null,b);if(this._active===0){this._trigger("stop");this._loaded=this._total=0}},_onSend:function(j,g){var f=this,d,k,c,b=f._getAJAXSettings(g),h=function(l,e){f._sending+=1;d=d||((l!==false&&f._trigger("send",j,b)!==false&&(f._chunkedUpload(b)||a.ajax(b)))||f._getXHRPromise(false,b.context,e)).done(function(m,o,n){f._onDone(m,o,n,b)}).fail(function(m,o,n){f._onFail(m,o,n,b)}).always(function(o,p,n){f._sending-=1;f._onAlways(o,p,n,b);if(b.limitConcurrentUploads&&b.limitConcurrentUploads>f._sending){var m=f._slots.shift();while(m){if(!m.isRejected()){m.resolve();break}m=f._slots.shift()}}});return d};this._beforeSend(j,b);if(this.options.sequentialUploads||(this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending)){if(this.options.limitConcurrentUploads>1){k=a.Deferred();this._slots.push(k);c=k.pipe(h)}else{c=(this._sequence=this._sequence.pipe(h,h))}c.abort=function(){var e=[undefined,"abort","abort"];if(!d){if(k){k.rejectWith(e)}return h(false,e)}return d.abort()};return this._enhancePromise(c)}return h()},_onAdd:function(k,h){var g=this,b=true,d=a.extend({},this.options,h),c=d.limitMultiFileUploads,j,f;if(!(d.singleFileUploads||c)||!this._isXHRUpload(d)){j=[h.files]}else{if(!d.singleFileUploads&&c){j=[];for(f=0;f<h.files.length;f+=c){j.push(h.files.slice(f,f+c))}}}h.originalFiles=h.files;a.each(j||h.files,function(e,l){var n=j?l:[l],m=a.extend({},h,{files:n});m.submit=function(){return(g._trigger("submit",k,m)!==false)&&g._onSend(k,m)};return(b=g._trigger("add",k,m))});return b},_normalizeFile:function(b,c){if(c.name===undefined&&c.size===undefined){c.name=c.fileName;c.size=c.fileSize}},_replaceFileInput:function(b){var c=b.clone(true);a("<form></form>").append(c)[0].reset();b.after(c).detach();a.cleanData(b.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(d,e){if(e===b[0]){return c[0]}return e});if(b[0]===this.element[0]){this.element=c}},_onChange:function(d){var b=d.data.fileupload,c={files:a.each(a.makeArray(d.target.files),b._normalizeFile),fileInput:a(d.target),form:a(d.target.form)};if(!c.files.length){c.files=[{name:d.target.value.replace(/^.*\\/,"")}]}if(b.options.replaceFileInput){b._replaceFileInput(c.fileInput)}if(b._trigger("change",d,c)===false||b._onAdd(d,c)===false){return false}},_onPaste:function(g){var c=g.data.fileupload,f=g.originalEvent.clipboardData,b=(f&&f.items)||[],d={files:[]};a.each(b,function(e,j){var h=j.getAsFile&&j.getAsFile();if(h){d.files.push(h)}});if(c._trigger("paste",g,d)===false||c._onAdd(g,d)===false){return false}},_onDrop:function(f){var b=f.data.fileupload,d=f.dataTransfer=f.originalEvent.dataTransfer,c={files:a.each(a.makeArray(d&&d.files),b._normalizeFile)};if(b._trigger("drop",f,c)===false||b._onAdd(f,c)===false){return false}f.preventDefault()},_onDragOver:function(d){var b=d.data.fileupload,c=d.dataTransfer=d.originalEvent.dataTransfer;if(b._trigger("dragover",d)===false){return false}if(c){c.dropEffect=c.effectAllowed="copy"}d.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,c){this._destroyEventHandlers()},_afterSetOption:function(c,d){var b=this.options;if(!b.fileInput){b.fileInput=a()}if(!b.dropZone){b.dropZone=a()}this._initEventHandlers()},_setOption:function(b,d){var c=a.inArray(b,this._refreshOptionsList)!==-1;if(c){this._beforeSetOption(b,d)}a.Widget.prototype._setOption.call(this,b,d);if(c){this._afterSetOption(b,d)}},_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(d,c){var b=a(this).data("fileupload");b._adjustMaxNumberOfFiles(-c.files.length);c.isAdjusted=true;c.isValidated=b._validate(c.files);c.context=b._renderUpload(c.files).appendTo(a(this).find(".files")).fadeIn(function(){a(this).show()}).data("data",c);if((b.options.autoUpload||c.autoUpload)&&c.isValidated){c.jqXHR=c.submit()}},send:function(d,c){if(!c.isValidated){var b=a(this).data("fileupload");if(!c.isAdjusted){b._adjustMaxNumberOfFiles(-c.files.length)}if(!b._validate(c.files)){return false}}if(c.context&&c.dataType&&c.dataType.substr(0,6)==="iframe"){c.context.find(".ui-progressbar").progressbar("value",parseInt(100,10))}},done:function(d,c){var b=a(this).data("fileupload");if(c.context){c.context.each(function(e){var f=(a.isArray(c.result)&&c.result[e])||{error:"emptyResult"};if(f.error){b._adjustMaxNumberOfFiles(1)}a(this).fadeOut(function(){b._renderDownload([f]).css("display","none").replaceAll(this).fadeIn(function(){a(this).show()})})})}else{b._renderDownload(c.result).css("display","none").appendTo(a(this).find(".files")).fadeIn(function(){a(this).show()})}},fail:function(d,c){var b=a(this).data("fileupload");b._adjustMaxNumberOfFiles(c.files.length);if(c.context){c.context.each(function(e){a(this).fadeOut(function(){if(c.errorThrown!=="abort"){var f=c.files[e];f.error=f.error||c.errorThrown||true;b._renderDownload([f]).css("display","none").replaceAll(this).fadeIn(function(){a(this).show()})}else{c.context.remove()}})})}else{if(c.errorThrown!=="abort"){b._adjustMaxNumberOfFiles(-c.files.length);c.context=b._renderUpload(c.files).css("display","none").appendTo(a(this).find(".files")).fadeIn(function(){a(this).show()}).data("data",c)}}},progress:function(c,b){if(b.context){b.context.find(".ui-progressbar").progressbar("value",parseInt(b.loaded/b.total*100,10))}},progressall:function(c,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(d,c){var b=a(this).data("fileupload");if(c.url){a.ajax(c).success(function(){b._adjustMaxNumberOfFiles(1);a(this).fadeOut(function(){a(this).remove()})})}else{b._adjustMaxNumberOfFiles(1);c.context.fadeOut(function(){a(this).remove()})}}},_scaleImage:function(b,d){d=d||{};var c=document.createElement("canvas"),e=Math.min((d.maxWidth||b.width)/b.width,(d.maxHeight||b.height)/b.height);if(e>=1){e=Math.max((d.minWidth||b.width)/b.width,(d.minHeight||b.height)/b.height)}b.width=parseInt(b.width*e,10);b.height=parseInt(b.height*e,10);if(!d.canvas||!c.getContext){return b}c.width=b.width;c.height=b.height;c.getContext("2d").drawImage(b,0,0,b.width,b.height);return c},_createObjectURL:function(b){var d="undefined",c=(typeof window.createObjectURL!==d&&window)||(typeof URL!==d&&URL)||(typeof webkitURL!==d&&webkitURL);return c?c.createObjectURL(b):false},_revokeObjectURL:function(b){var d="undefined",c=(typeof window.revokeObjectURL!==d&&window)||(typeof URL!==d&&URL)||(typeof webkitURL!==d&&webkitURL);return c?c.revokeObjectURL(b):false},_loadFile:function(c,d){if(typeof FileReader!=="undefined"&&FileReader.prototype.readAsDataURL){var b=new FileReader();b.onload=function(f){d(f.target.result)};b.readAsDataURL(c);return true}return false},_loadImage:function(e,g,d){var f=this,c,b;if(!d||!d.fileTypes||d.fileTypes.test(e.type)){c=this._createObjectURL(e);b=a("<img>").bind("load",function(){a(this).unbind("load");f._revokeObjectURL(c);g(f._scaleImage(b[0],d))});if(c){b.prop("src",c);return true}else{return this._loadFile(e,function(h){b.prop("src",h)})}}return false},_enableDragToDesktop:function(){var e=a(this),c=e.prop("href"),b=decodeURIComponent(c.split("/").pop()).replace(/:/g,"-"),d="application/octet-stream";e.bind("dragstart",function(g){try{g.originalEvent.dataTransfer.setData("DownloadURL",[d,b,c].join(":"))}catch(f){}})},_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(d){var c=this,b=!!d.length;a.each(d,function(e,f){f.error=c._hasError(f);if(f.error){b=false}});return b},_uploadTemplateHelper:function(b){b.sizef=this._formatFileSize(b);return b},_renderUploadTemplate:function(c){var b=this;return a.tmpl(this.options.uploadTemplate,a.map(c,function(d){return b._uploadTemplateHelper(d)}))},_renderUpload:function(f){var e=this,d=this.options,c=this._renderUploadTemplate(f),b=this._validate(f);if(!(c instanceof a)){return a()}c.css("display","none");c.find(".progress div").slice(b?1:0).remove().end().first().progressbar();c.find(".start button").slice(this.options.autoUpload||!b?0:1).remove().end().first().button({text:false,icons:{primary:"ui-icon-circle-arrow-e"}});c.find(".cancel button").slice(1).remove().end().first().button({text:false,icons:{primary:"ui-icon-cancel"}});c.find(".preview").each(function(g,h){e._loadImage(f[g],function(j){a(j).hide().appendTo(h).fadeIn()},{maxWidth:d.previewMaxWidth,maxHeight:d.previewMaxHeight,fileTypes:d.previewFileTypes,canvas:d.previewAsCanvas})});return c},_downloadTemplateHelper:function(b){b.sizef=this._formatFileSize(b);return b},_renderDownloadTemplate:function(c){var b=this;return a.tmpl(this.options.downloadTemplate,a.map(c,function(d){return b._downloadTemplateHelper(d)}))},_renderDownload:function(c){var b=this._renderDownloadTemplate(c);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(d){d.preventDefault();var b=a(this).closest(".template-upload"),c=b.data("data");if(c&&c.submit&&!c.jqXHR){c.jqXHR=c.submit();if(c.jqXHR){a(this).fadeOut()}}},_cancelHandler:function(d){d.preventDefault();var b=a(this).closest(".template-upload"),c=b.data("data")||{};if(!c.jqXHR){c.errorThrown="abort";d.data.fileupload._trigger("fail",d,c)}else{c.jqXHR.abort()}},_deleteHandler:function(c){c.preventDefault();var b=a(this);c.data.fileupload._trigger("destroy",c,{context:b.closest(".template-download"),url:b.attr("data-url"),type:b.attr("data-type"),dataType:c.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 c=this.element.find(".fileupload-buttonbar"),d=this.element.find(".files"),b=this.options.namespace;c.addClass("ui-widget-header ui-corner-top");this.element.find(".fileinput-button").each(function(){var e=a(this).find("input:file").detach();a(this).button({icons:{primary:"ui-icon-plusthick"}}).append(e)});c.find(".start").button({icons:{primary:"ui-icon-circle-arrow-e"}}).bind("click."+b,function(f){f.preventDefault();d.find(".start button").click()});c.find(".cancel").button({icons:{primary:"ui-icon-cancel"}}).bind("click."+b,function(f){f.preventDefault();d.find(".cancel button").click()});c.find(".delete").button({icons:{primary:"ui-icon-trash"}}).bind("click."+b,function(f){f.preventDefault();d.find(".delete input:checked").siblings("button").click()});c.find(".toggle").bind("change."+b,function(f){d.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 c=a(this),b=c.parent();c.detach().prop("disabled",false);b.button("enable").append(c)})},_disableFileInputButton:function(){this.element.find(".fileinput-button input:file:enabled").each(function(){var c=a(this),b=c.parent();c.detach().prop("disabled",true);b.button("disable").append(c)})},_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(d){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}var c,u,f,h=this;if(typeof d=="function"){d={success:d}}c=this.attr("method");u=this.attr("action");f=(typeof u==="string")?b.trim(u):"";f=f||window.location.href||"";if(f){f=(f.match(/^([^#]+)/)||[])[1]}d=b.extend(true,{url:f,success:b.ajaxSettings.success,type:c||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},d);var o={};this.trigger("form-pre-serialize",[this,d,o]);if(o.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(d.beforeSerialize&&d.beforeSerialize(this,d)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var g=d.traditional;if(g===undefined){g=b.ajaxSettings.traditional}var y,t,k,z=d.propperFormSerialization!==false?this.formToArray(d.semantic):[];if(d.data){d.extraData=d.data;y=b.param(d.data,g)}if(d.beforeSubmit&&d.beforeSubmit(z,this,d)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[z,this,d,o]);if(o.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var s=b.param(z,g);if(y){s=(s?(s+"&"+y):y)}if(d.type.toUpperCase()=="GET"){d.url+=(d.url.indexOf("?")>=0?"&":"?")+s;d.data=null}else{d.data=s}var B=[];if(d.resetForm){B.push(function(){h.resetForm()})}if(d.clearForm){B.push(function(){h.clearForm(d.includeHidden)})}if(!d.dataType&&d.target){var e=d.success||function(){};B.push(function(q){var n=d.replaceTarget?"replaceWith":"html";b(d.target)[n](q).each(e,arguments)})}else{if(d.success){B.push(d.success)}}d.success=function(D,q,E){var C=d.context||d;for(var v=0,n=B.length;v<n;v++){B[v].apply(C,[D,q,E||h,h])}};var x=b("input:file:enabled[value]",this);var j=x.length>0;var w="multipart/form-data";var r=(h.attr("enctype")==w||h.attr("encoding")==w);var p=!!(j&&x.get(0).files&&window.FormData);a("fileAPI :"+p);var l=(j||r)&&!p;if(d.iframe!==false&&(d.iframe||l)){if(d.closeKeepAlive){b.get(d.closeKeepAlive,function(){A(z)})}else{A(z)}}else{if((j||r)&&p){d.progress=d.progress||b.noop;m(z)}else{b.ajax(d)}}this.trigger("form-submit-notify",[this,d]);return this;function m(v){var n=new FormData();for(var D=0;D<v.length;D++){if(v[D].type=="file"){continue}n.append(v[D].name,v[D].value)}h.find("input:file:enabled").each(function(){var E=b(this).attr("name"),G=this.files;if(E){for(var F=0;F<G.length;F++){n.append(E,G[F])}}});if(d.extraData){for(var C in d.extraData){n.append(C,d.extraData[C])}}d.data=null;var q=d.beforeSend;d.beforeSend=function(F,E){E.data=n;if(F.upload){F.upload.onprogress=function(G){E.progress(G.position,G.total)}}if(q){q.call(E,F,E)}};b.ajax(d)}function A(aa){var F=h[0],E,W,Q,Y,T,H,L,J,K,U,X,O;var I=!!b.fn.prop;if(aa){if(I){for(W=0;W<aa.length;W++){E=b(F[aa[W].name]);E.prop("disabled",false)}}else{for(W=0;W<aa.length;W++){E=b(F[aa[W].name]);E.removeAttr("disabled")}}}if(b(":input[name=submit],:input[id=submit]",F).length){alert('Error: Form elements must not have name or id of "submit".');return}Q=b.extend(true,{},b.ajaxSettings,d);Q.context=Q.context||Q;T="jqFormIO"+(new Date().getTime());if(Q.iframeTarget){H=b(Q.iframeTarget);U=H.attr("name");if(U==null){H.attr("name",T)}else{T=U}}else{H=b('<iframe name="'+T+'" src="'+Q.iframeSrc+'" />');H.css({position:"absolute",top:"-1000px",left:"-1000px"})}L=H[0];J={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(n){var ad=(n==="timeout"?"timeout":"aborted");a("aborting upload... "+ad);this.aborted=1;H.attr("src",Q.iframeSrc);J.error=ad;Q.error&&Q.error.call(Q.context,J,ad,n);Y&&b.event.trigger("ajaxError",[J,Q,ad]);Q.complete&&Q.complete.call(Q.context,J,ad)}};Y=Q.global;if(Y&&!b.active++){b.event.trigger("ajaxStart")}if(Y){b.event.trigger("ajaxSend",[J,Q])}if(Q.beforeSend&&Q.beforeSend.call(Q.context,J,Q)===false){if(Q.global){b.active--}return}if(J.aborted){return}K=F.clk;if(K){U=K.name;if(U&&!K.disabled){Q.extraData=Q.extraData||{};Q.extraData[U]=K.value;if(K.type=="image"){Q.extraData[U+".x"]=F.clk_x;Q.extraData[U+".y"]=F.clk_y}}}var P=1;var M=2;function N(ad){var n=ad.contentWindow?ad.contentWindow.document:ad.contentDocument?ad.contentDocument:ad.document;return n}var D=b("meta[name=csrf-token]").attr("content");var C=b("meta[name=csrf-param]").attr("content");if(C&&D){Q.extraData=Q.extraData||{};Q.extraData[C]=D}function V(){var af=h.attr("target"),ad=h.attr("action");F.setAttribute("target",T);if(!c){F.setAttribute("method","POST")}if(ad!=Q.url){F.setAttribute("action",Q.url)}if(!Q.skipEncodingOverride&&(!c||/post/i.test(c))){h.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(Q.timeout){O=setTimeout(function(){X=true;S(P)},Q.timeout)}function ag(){try{var n=N(L).readyState;a("state = "+n);if(n.toLowerCase()=="uninitialized"){setTimeout(ag,50)}}catch(ai){a("Server abort: ",ai," (",ai.name,")");S(M);O&&clearTimeout(O);O=undefined}}var ae=[];try{if(Q.extraData){for(var ah in Q.extraData){ae.push(b('<input type="hidden" name="'+ah+'">').attr("value",Q.extraData[ah]).appendTo(F)[0])}}if(!Q.iframeTarget){H.appendTo("body");L.attachEvent?L.attachEvent("onload",S):L.addEventListener("load",S,false)}setTimeout(ag,15);F.submit()}finally{F.setAttribute("action",ad);if(af){F.setAttribute("target",af)}else{h.removeAttr("target")}b(ae).remove()}}if(Q.forceSync){V()}else{setTimeout(V,10)}var ab,ac,Z=50,G;function S(ag){if(J.aborted||G){return}try{ac=N(L)}catch(aj){a("cannot access response document: ",aj);ag=M}if(ag===P&&J){J.abort("timeout");return}else{if(ag==M&&J){J.abort("server abort");return}}if(!ac||ac.location.href==Q.iframeSrc){if(!X){return}}L.detachEvent?L.detachEvent("onload",S):L.removeEventListener("load",S,false);var af="success",ai;try{if(X){throw"timeout"}var ae=Q.dataType=="xml"||ac.XMLDocument||b.isXMLDoc(ac);a("isXml="+ae);if(!ae&&window.opera&&(ac.body==null||ac.body.innerHTML=="")){if(--Z){a("requeing onLoad callback, DOM not available");setTimeout(S,250);return}}var ak=ac.body?ac.body:ac.documentElement;J.responseText=ak?ak.innerHTML:null;J.responseXML=ac.XMLDocument?ac.XMLDocument:ac;if(ae){Q.dataType="xml"}J.getResponseHeader=function(ap){var ao={"content-type":Q.dataType};return ao[ap]};if(ak){J.status=Number(ak.getAttribute("status"))||J.status;J.statusText=ak.getAttribute("statusText")||J.statusText}var n=(Q.dataType||"").toLowerCase();var ah=/(json|script|text)/.test(n);if(ah||Q.textarea){var an,am;try{an=b(b(ac).text());am=an.is("textarea")}catch(ag){am=false}if(am){J.responseText=an.text();J.status=Number(an.attr("status"))||J.status;J.statusText=an.attr("statusText")||J.statusText}else{if(ah){var ad=ac.getElementsByTagName("pre")[0];var al=ac.getElementsByTagName("body")[0];if(ad){J.responseText=ad.textContent?ad.textContent:ad.innerText}else{if(al){J.responseText=al.textContent?al.textContent:al.innerText}}}}}else{if(n=="xml"&&!J.responseXML&&J.responseText!=null){J.responseXML=R(J.responseText)}}try{ab=q(J,n,Q)}catch(ag){af="parsererror";J.error=ai=(ag||af)}}catch(ag){a("error caught: ",ag);af="error";J.error=ai=(ag||af)}if(J.aborted){a("upload aborted");af=null}if(J.status){af=(J.status>=200&&J.status<300||J.status===304)?"success":"error"}if(af==="success"){Q.success&&Q.success.call(Q.context,ab,"success",J);Y&&b.event.trigger("ajaxSuccess",[J,Q])}else{if(af){if(ai==undefined){ai=J.statusText}Q.error&&Q.error.call(Q.context,J,af,ai);Y&&b.event.trigger("ajaxError",[J,Q,ai])}}Y&&b.event.trigger("ajaxComplete",[J,Q]);if(Y&&!--b.active){b.event.trigger("ajaxStop")}Q.complete&&Q.complete.call(Q.context,J,af);G=true;if(Q.timeout){clearTimeout(O)}setTimeout(function(){if(!Q.iframeTarget){H.remove()}J.responseXML=null},100)}var R=b.parseXML||function(n,ad){if(window.ActiveXObject){ad=new ActiveXObject("Microsoft.XMLDOM");ad.async="false";ad.loadXML(n)}else{ad=(new DOMParser()).parseFromString(n,"text/xml")}return(ad&&ad.documentElement&&ad.documentElement.nodeName!="parsererror")?ad:null};var v=b.parseJSON||function(n){return window["eval"]("("+n+")")};var q=function(ah,af,ae){var ad=ah.getResponseHeader("content-type")||"",n=af==="xml"||!af&&ad.indexOf("xml")>=0,ag=n?ah.responseXML:ah.responseText;if(n&&ag.documentElement.nodeName==="parsererror"){b.error&&b.error("parsererror")}if(ae&&ae.dataFilter){ag=ae.dataFilter(ag,af)}if(typeof ag==="string"){if(af==="json"||!af&&ad.indexOf("json")>=0){ag=v(ag)}else{if(af==="script"||!af&&ad.indexOf("javascript")>=0){b.globalEval(ag)}}}return ag}}};b.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!b.isReady&&d.s){a("DOM not ready, queuing ajaxForm");b(function(){b(d.s,d.c).ajaxForm(c)});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(c)}}).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(q){var p=[];if(this.length===0){return p}var d=this[0];var g=q?d.getElementsByTagName("*"):d.elements;if(!g){return p}var k,h,f,r,e,m,c;for(k=0,m=g.length;k<m;k++){e=g[k];f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val(),type:e.type});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(h=0,c=r.length;h<c;h++){p.push({name:f,value:r[h]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r,type:e.type})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0];f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(j===undefined){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return b(c).val()};b.fn.clearForm=function(c){return this.each(function(){b("input,select,textarea",this).clearFields(c)})};b.fn.clearFields=b.fn.clearInputs=function(c){var d=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var f=this.type,e=this.tagName.toLowerCase();if(d.test(f)||e=="textarea"||(c&&/hidden/.test(f))){this.value=""}else{if(f=="checkbox"||f=="radio"){this.checked=false}else{if(e=="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(c){if(c===undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c===undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};b.fn.ajaxSubmit.debug=false;function a(){if(!b.fn.ajaxSubmit.debug){return}var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}})(jQuery);(function(b){var a=0;b.ajaxTransport("iframe",function(c){if(c.async&&(c.type==="POST"||c.type==="GET")){var e,d;return{send:function(f,g){e=b('<form style="display:none;"></form>');d=b('<iframe src="javascript:false;" name="iframe-transport-'+(a+=1)+'"></iframe>').bind("load",function(){var h;d.unbind("load").bind("load",function(){var j;try{j=d.contents();if(!j.length||!j[0].firstChild){throw new Error()}}catch(k){j=undefined}g(200,"success",{iframe:j});b('<iframe src="javascript:false;"></iframe>').appendTo(e);e.remove()});e.prop("target",d.prop("name")).prop("action",c.url).prop("method",c.type);if(c.formData){b.each(c.formData,function(j,k){b('<input type="hidden"/>').prop("name",k.name).val(k.value).appendTo(e)})}if(c.fileInput&&c.fileInput.length&&c.type==="POST"){h=c.fileInput.clone();c.fileInput.after(function(j){return h[j]});if(c.paramName){c.fileInput.each(function(){b(this).prop("name",c.paramName)})}e.append(c.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")}e.submit();if(h&&h.length){c.fileInput.each(function(k,j){var l=b(h[k]);b(j).prop("name",l.prop("name"));l.replaceWith(j)})}});e.append(d).appendTo(document.body)},abort:function(){if(d){d.unbind("load").prop("src","javascript".concat(":false;"))}if(e){e.remove()}}}}});b.ajaxSetup({converters:{"iframe text":function(c){return c.find("body").text()},"iframe json":function(c){return b.parseJSON(c.find("body").text())},"iframe html":function(c){return c.find("body").html()},"iframe script":function(c){return b.globalEval(c.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(c,d){c=(c===false)?"":c||".";d=typeof d=="function"?d:function(){};var b=a(this);this.bind("paste",function(f){setTimeout(function(){var e=b.val();if(c===""){var g=/[^\d]/}else{var g=new RegExp("[^\\d"+c+"]")}if(g.test(e)){b.val("")}},0)});return this.data("numeric.decimal",c).data("numeric.callback",d).keypress(a.fn.numeric.keypress).blur(a.fn.numeric.blur)};a.fn.numeric.keypress=function(f){var b=a.data(this,"numeric.decimal");var c=f.charCode?f.charCode:f.keyCode?f.keyCode:0;if(c==13&&this.nodeName.toLowerCase()=="input"){return true}else{if(c==13){return false}}var d=false;if((f.ctrlKey&&c==97)||(f.ctrlKey&&c==65)){return true}if((f.ctrlKey&&c==120)||(f.ctrlKey&&c==88)){return true}if((f.ctrlKey&&c==99)||(f.ctrlKey&&c==67)){return true}if((f.ctrlKey&&c==122)||(f.ctrlKey&&c==90)){return true}if((f.ctrlKey&&c==118)||(f.ctrlKey&&c==86)||(f.shiftKey&&c==45)){return true}if(c<48||c>57){if(c==45&&this.value.length==0){return true}if(b&&c==b.charCodeAt(0)&&this.value.indexOf(b)!=-1){d=false}if(c!=8&&c!=9&&c!=13&&c!=35&&c!=36&&c!=37&&c!=39&&c!=46){d=false}else{if(typeof f.charCode!="undefined"){if(f.keyCode==f.which&&f.which!=0){d=true;if(f.which==46){d=false}}else{if(f.keyCode!=0&&f.charCode==0&&f.which==0){d=true}}}}if(b&&c==b.charCodeAt(0)){if(this.value.indexOf(b)==-1){d=true}else{d=false}}}else{d=true}return d};a.fn.numeric.blur=function(){var b=a.data(this,"numeric.decimal");var e=a.data(this,"numeric.callback");var d=a(this).val();if(d!=""){var c=new RegExp("^\\d+$|\\d*"+b+"\\d+");if(!c.exec(d)){e.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(g){var k=true,s=false,C=null,h,r,q,c,B={},l="ui-tooltip",e="ui-widget",f="ui-state-disabled",t="div.qtip."+l,m=l+"-default",D=l+"-focus",d=l+"-hover",y=l+"-fluid",p="-31000px",A="_replacedByqTip",o="oldtitle",n;function j(){j.history=j.history||[];j.history.push(arguments);if("object"===typeof console){var H=console[console.warn?"warn":"log"],G=Array.prototype.slice.call(arguments),F;if(typeof arguments[0]==="string"){G[0]="qTip2: "+G[0]}F=H.apply?H.apply(console,G):H(G)}}function a(G){var F;if(!G||"object"!==typeof G){return s}if(G.metadata===C||"object"!==typeof G.metadata){G.metadata={type:G.metadata}}if("content" in G){if(G.content===C||"object"!==typeof G.content||G.content.jquery){G.content={text:G.content}}F=G.content.text||s;if(!g.isFunction(F)&&((!F&&!F.attr)||F.length<1||("object"===typeof F&&!F.jquery))){G.content.text=s}if("title" in G.content){if(G.content.title===C||"object"!==typeof G.content.title){G.content.title={text:G.content.title}}F=G.content.title.text||s;if(!g.isFunction(F)&&((!F&&!F.attr)||F.length<1||("object"===typeof F&&!F.jquery))){G.content.title.text=s}}}if("position" in G){if(G.position===C||"object"!==typeof G.position){G.position={my:G.position,at:G.position}}}if("show" in G){if(G.show===C||"object"!==typeof G.show){if(G.show.jquery){G.show={target:G.show}}else{G.show={event:G.show}}}}if("hide" in G){if(G.hide===C||"object"!==typeof G.hide){if(G.hide.jquery){G.hide={target:G.hide}}else{G.hide={event:G.hide}}}}if("style" in G){if(G.style===C||"object"!==typeof G.style){G.style={classes:G.style}}}g.each(q,function(){if(this.sanitize){this.sanitize(G)}});return G}function z(ab,H,V,W){var U=this,Q=document.body,N=l+"-"+V,I=0,aa=0,J=g(),R=".qtip-"+V,S,T;U.id=V;U.rendered=s;U.elements=S={target:ab};U.timers={img:{}};U.options=H;U.checks={};U.plugins={};U.cache=T={event:{},target:g(),disabled:s,attr:W,onTarget:s};function K(ae){var ac=0,ag,ad=H,af=ae.split(".");while(ad=ad[af[ac++]]){if(ac<af.length){ag=ad}}return[ag||H,af.pop()]}function Z(){var ac=H.style.widget;J.toggleClass(e,ac).toggleClass(m,H.style.def&&!ac);S.content.toggleClass(e+"-content",ac);if(S.titlebar){S.titlebar.toggleClass(e+"-header",ac)}if(S.button){S.button.toggleClass(l+"-icon",!ac)}}function F(ac){if(S.title){S.titlebar.remove();S.titlebar=S.title=S.button=C;if(ac!==s){U.reposition()}}}function X(){var ad=H.content.title.button,ac=typeof ad==="string",ae=ac?ad:"Close tooltip";if(S.button){S.button.remove()}if(ad.jquery){S.button=ad}else{S.button=g("<a />",{"class":"ui-state-default ui-tooltip-close "+(H.style.widget?"":l+"-icon"),title:ae,"aria-label":ae}).prepend(g("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"}))}S.button.appendTo(S.titlebar).attr("role","button").click(function(af){if(!J.hasClass(f)){U.hide(af)}return s});U.redraw()}function M(){var ac=N+"-title";if(S.titlebar){F()}S.titlebar=g("<div />",{"class":l+"-titlebar "+(H.style.widget?"ui-widget-header":"")}).append(S.title=g("<div />",{id:ac,"class":l+"-title","aria-atomic":k})).insertBefore(S.content).delegate(".ui-tooltip-close","mousedown keydown mouseup keyup mouseout",function(ad){g(this).toggleClass("ui-state-active ui-state-focus",ad.type.substr(-4)==="down")}).delegate(".ui-tooltip-close","mouseover mouseout",function(ad){g(this).toggleClass("ui-state-hover",ad.type==="mouseover")});if(H.content.title.button){X()}else{if(U.rendered){U.redraw()}}}function P(ac){var ad=S.button,ae=S.title;if(!U.rendered){return s}if(!ac){ad.remove()}else{if(!ae){M()}X()}}function Y(ae,ac){var ad=S.title;if(!U.rendered||!ae){return s}if(g.isFunction(ae)){ae=ae.call(ab,T.event,U)}if(ae===s||(!ae&&ae!=="")){return F(s)}else{if(ae.jquery&&ae.length>0){ad.empty().append(ae.css({display:"block"}))}else{ad.html(ae)}}U.redraw();if(ac!==s&&U.rendered&&J.is(":visible")){U.reposition(T.event)}}function O(ae,ac){var ad=S.content;if(!U.rendered||!ae){return s}if(g.isFunction(ae)){ae=ae.call(ab,T.event,U)||""}if(ae.jquery&&ae.length>0){ad.empty().append(ae.css({display:"block"}))}else{ad.html(ae)}function af(ah){var ag,ai={};function aj(ak){if(ak){delete ai[ak.src];clearTimeout(U.timers.img[ak.src]);g(ak).unbind(R)}if(g.isEmptyObject(ai)){U.redraw();if(ac!==s){U.reposition(T.event)}ah()}}if((ag=ad.find("img[src]:not([height]):not([width])")).length===0){return aj()}ag.each(function(al,an){if(ai[an.src]!==h){return}var am=0,ak=3;(function ao(){if(an.height||an.width||(am>ak)){return aj(an)}am+=1;U.timers.img[an.src]=setTimeout(ao,700)}());g(an).bind("error"+R+" load"+R,function(){aj(this)});ai[an.src]=an})}if(U.rendered<0){J.queue("fx",af)}else{aa=0;af(g.noop)}return U}function G(){var af=H.position,ad={show:H.show.target,hide:H.hide.target,viewport:g(af.viewport),document:g(document),body:g(document.body),window:g(window)},ae={show:g.trim(""+H.show.event).split(" "),hide:g.trim(""+H.hide.event).split(" ")},ac=g.browser.msie&&parseInt(g.browser.version,10)===6;function ah(ak){if(J.hasClass(f)){return s}clearTimeout(U.timers.show);clearTimeout(U.timers.hide);var al=function(){U.toggle(k,ak)};if(H.show.delay>0){U.timers.show=setTimeout(al,H.show.delay)}else{al()}}function ag(an){if(J.hasClass(f)||I||aa){return s}var al=g(an.relatedTarget||an.target),ak=al.closest(t)[0]===J[0],am=al[0]===ad.show[0];clearTimeout(U.timers.show);clearTimeout(U.timers.hide);if((af.target==="mouse"&&ak)||(H.hide.fixed&&((/mouse(out|leave|move)/).test(an.type)&&(ak||am)))){try{an.preventDefault();an.stopImmediatePropagation()}catch(ao){}return}if(H.hide.delay>0){U.timers.hide=setTimeout(function(){U.hide(an)},H.hide.delay)}else{U.hide(an)}}function ai(ak){if(J.hasClass(f)){return s}clearTimeout(U.timers.inactive);U.timers.inactive=setTimeout(function(){U.hide(ak)},H.hide.inactive)}function aj(ak){if(J.is(":visible")){U.reposition(ak)}}J.bind("mouseenter"+R+" mouseleave"+R,function(ak){var al=ak.type==="mouseenter";if(al){U.focus(ak)}J.toggleClass(d,al)});if(H.hide.fixed){ad.hide=ad.hide.add(J);J.bind("mouseover"+R,function(){if(!J.hasClass(f)){clearTimeout(U.timers.hide)}})}if(/mouse(out|leave)/i.test(H.hide.event)){if(H.hide.leave==="window"){ad.window.bind("mouseout"+R+" blur"+R,function(ak){if(/select|option/.test(ak.target)&&!ak.relatedTarget){U.hide(ak)}})}}else{if(/mouse(over|enter)/i.test(H.show.event)){ad.hide.bind("mouseleave"+R,function(ak){clearTimeout(U.timers.show)})}}if((""+H.hide.event).indexOf("unfocus")>-1){af.container.closest("html").bind("mousedown"+R,function(an){var am=g(an.target),al=!J.hasClass(f)&&J.is(":visible"),ak=am.parents(t).filter(J[0]).length>0;if(am[0]!==ab[0]&&am[0]!==J[0]&&!ak&&!ab.has(am[0]).length&&!am.attr("disabled")){U.hide(an)}})}if("number"===typeof H.hide.inactive){ad.show.bind("qtip-"+V+"-inactive",ai);g.each(r.inactiveEvents,function(ak,al){ad.hide.add(S.tooltip).bind(al+R+"-inactive",ai)})}g.each(ae.hide,function(al,am){var ak=g.inArray(am,ae.show),an=g(ad.hide);if((ak>-1&&an.add(ad.show).length===an.length)||am==="unfocus"){ad.show.bind(am+R,function(ao){if(J.is(":visible")){ag(ao)}else{ah(ao)}});delete ae.show[ak]}else{ad.hide.bind(am+R,ag)}});g.each(ae.show,function(ak,al){ad.show.bind(al+R,ah)});if("number"===typeof H.hide.distance){ad.show.add(J).bind("mousemove"+R,function(an){var am=T.origin||{},al=H.hide.distance,ak=Math.abs;if(ak(an.pageX-am.pageX)>=al||ak(an.pageY-am.pageY)>=al){U.hide(an)}})}if(af.target==="mouse"){ad.show.bind("mousemove"+R,function(ak){c={pageX:ak.pageX,pageY:ak.pageY,type:"mousemove"}});if(af.adjust.mouse){if(H.hide.event){J.bind("mouseleave"+R,function(ak){if((ak.relatedTarget||ak.target)!==ad.show[0]){U.hide(ak)}});S.target.bind("mouseenter"+R+" mouseleave"+R,function(ak){T.onTarget=ak.type==="mouseenter"})}ad.document.bind("mousemove"+R,function(ak){if(T.onTarget&&!J.hasClass(f)&&J.is(":visible")){U.reposition(ak||c)}})}}if(af.adjust.resize||ad.viewport.length){(g.event.special.resize?ad.viewport:ad.window).bind("resize"+R,aj)}if(ad.viewport.length||(ac&&J.css("position")==="fixed")){ad.viewport.bind("scroll"+R,aj)}}function L(){var ac=[H.show.target[0],H.hide.target[0],U.rendered&&S.tooltip[0],H.position.container[0],H.position.viewport[0],window,document];if(U.rendered){g([]).pushStack(g.grep(ac,function(ad){return typeof ad==="object"})).unbind(R)}else{H.show.target.unbind(R+"-create")}}U.checks.builtin={"^id$":function(ae,af,ac){var ag=ac===k?r.nextid:ac,ad=l+"-"+ag;if(ag!==s&&ag.length>0&&!g("#"+ad).length){J[0].id=ad;S.content[0].id=ad+"-content";S.title[0].id=ad+"-title"}},"^content.text$":function(ad,ae,ac){O(ac)},"^content.title.text$":function(ad,ae,ac){if(!ac){return F()}if(!S.title&&ac){M()}Y(ac)},"^content.title.button$":function(ad,ae,ac){P(ac)},"^position.(my|at)$":function(ad,ae,ac){if("string"===typeof ac){ad[ae]=new q.Corner(ac)}},"^position.container$":function(ad,ae,ac){if(U.rendered){J.appendTo(ac)}},"^show.ready$":function(){if(!U.rendered){U.render(1)}else{U.toggle(k)}},"^style.classes$":function(ad,ae,ac){J.attr("class",l+" qtip ui-helper-reset "+ac)},"^style.widget|content.title":Z,"^events.(render|show|move|hide|focus|blur)$":function(ad,ae,ac){J[(g.isFunction(ac)?"":"un")+"bind"]("tooltip"+ae,ac)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var ac=H.position;J.attr("tracking",ac.target==="mouse"&&ac.adjust.mouse);L();G()}};g.extend(U,{render:function(ac){if(U.rendered){return U}var af=H.content.text,ae=H.content.title.text,ad=H.position,ag=g.Event("tooltiprender");g.attr(ab[0],"aria-describedby",N);J=S.tooltip=g("<div/>",{id:N,"class":l+" qtip ui-helper-reset "+m+" "+H.style.classes+" "+l+"-pos-"+H.position.my.abbrev(),width:H.style.width||"",height:H.style.height||"",tracking:ad.target==="mouse"&&ad.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":s,"aria-describedby":N+"-content","aria-hidden":k}).toggleClass(f,T.disabled).data("qtip",U).appendTo(H.position.container).append(S.content=g("<div />",{"class":l+"-content",id:N+"-content","aria-atomic":k}));U.rendered=-1;aa=1;I=1;if(ae){M();if(!g.isFunction(ae)){Y(ae,s)}}if(!g.isFunction(af)){O(af,s)}U.rendered=k;Z();g.each(H.events,function(ah,ai){if(g.isFunction(ai)){J.bind(ah==="toggle"?"tooltipshow tooltiphide":"tooltip"+ah,ai)}});g.each(q,function(){if(this.initialize==="render"){this(U)}});G();J.queue("fx",function(ah){ag.originalEvent=T.event;J.trigger(ag,[U]);aa=0;I=0;U.redraw();if(H.show.ready||ac){U.toggle(k,T.event,s)}ah()});return U},get:function(ad){var ac,ae;switch(ad.toLowerCase()){case"dimensions":ac={height:J.outerHeight(),width:J.outerWidth()};break;case"offset":ac=q.offset(J,H.position.container);break}return ac},set:function(af,ag){var ae=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,ah=/^content\.(title|attr)|style/i,ai=s,ak=s,ad=U.checks,ac;function aj(ao,am){var an,ap,al;for(an in ad){for(ap in ad[an]){if(al=(new RegExp(ap,"i")).exec(ao)){am.push(al);ad[an][ap].apply(U,am)}}}}if("string"===typeof af){ac=af;af={};af[ac]=ag}else{af=g.extend(k,{},af)}g.each(af,function(am,an){var ao=K(am.toLowerCase()),al;al=ao[0][ao[1]];ao[0][ao[1]]="object"===typeof an&&an.nodeType?g(an):an;af[am]=[ao[0],ao[1],an,al];ai=ae.test(am)||ai;ak=ah.test(am)||ak});a(H);I=aa=1;g.each(af,aj);I=aa=0;if(J.is(":visible")&&U.rendered){if(ai){U.reposition(H.position.target==="mouse"?C:T.event)}if(ak){U.redraw()}}return U},toggle:function(ae,af){if(!U.rendered){return ae?U.render(1):U}var ak=ae?"show":"hide",ac=H[ak],ag=J.is(":visible"),ah=!af||H[ak].target.length<2||T.target[0]===af.target,am=H.position,ai=H.content,aj,al;if((typeof ae).search("boolean|number")){ae=!ag}if(!J.is(":animated")&&ag===ae&&ah){return U}if(af){if((/over|enter/).test(af.type)&&(/out|leave/).test(T.event.type)&&af.target===H.show.target[0]&&J.has(af.relatedTarget).length){return U}T.event=g.extend({},af)}al=g.Event("tooltip"+ak);al.originalEvent=af?T.event:C;J.trigger(al,[U,90]);if(al.isDefaultPrevented()){return U}g.attr(J[0],"aria-hidden",!!!ae);if(ae){T.origin=g.extend({},c);U.focus(af);if(g.isFunction(ai.text)){O(ai.text,s)}if(g.isFunction(ai.title.text)){Y(ai.title.text,s)}if(!n&&am.target==="mouse"&&am.adjust.mouse){g(document).bind("mousemove.qtip",function(an){c={pageX:an.pageX,pageY:an.pageY,type:"mousemove"}});n=k}U.reposition(af,arguments[2]);if((al.solo=!!ac.solo)){g(t,ac.solo).not(J).qtip("hide",al)}}else{clearTimeout(U.timers.show);delete T.origin;if(n&&!g(t+'[tracking="true"]:visible',ac.solo).not(J).length){g(document).unbind("mousemove.qtip");n=s}U.blur(af)}function ad(){if(ae){if(g.browser.msie){J[0].style.removeAttribute("filter")}J.css("overflow","");if("string"===typeof ac.autofocus){g(ac.autofocus,J).focus()}al=g.Event("tooltipvisible");al.originalEvent=af?T.event:C;J.trigger(al,[U]);ac.target.trigger("qtip-"+V+"-inactive")}else{J.css({display:"",visibility:"",opacity:"",left:"",top:""})}}if(ah){J.stop(0,1)}if(ac.effect===s){J[ak]();ad.call(J)}else{if(g.isFunction(ac.effect)){ac.effect.call(J,U);J.queue("fx",function(an){ad();an()})}else{J.fadeTo(90,ae?1:0,ad)}}if(ae){ac.target.trigger("qtip-"+V+"-inactive")}return U},show:function(ac){return U.toggle(k,ac)},hide:function(ac){return U.toggle(s,ac)},focus:function(ag){if(!U.rendered){return U}var ah=g(t),ae=parseInt(J[0].style.zIndex,10),ad=r.zindex+ah.length,af=g.extend({},ag),ac,ai;if(!J.hasClass(D)){ai=g.Event("tooltipfocus");ai.originalEvent=af;J.trigger(ai,[U,ad]);if(!ai.isDefaultPrevented()){if(ae!==ad){ah.each(function(){if(this.style.zIndex>ae){this.style.zIndex=this.style.zIndex-1}});ah.filter("."+D).qtip("blur",af)}J.addClass(D)[0].style.zIndex=ad}}return U},blur:function(ad){var ac=g.extend({},ad),ae;J.removeClass(D);ae=g.Event("tooltipblur");ae.originalEvent=ac;J.trigger(ae,[U]);return U},reposition:function(ar,ao){if(!U.rendered||I){return U}I=1;var ax=H.position.target,aw=H.position,am=aw.my,an=aw.at,ap=aw.adjust,ad=ap.method.split(" "),au=J.outerWidth(),aq=J.outerHeight(),ai=0,aj=0,ah=g.Event("tooltipmove"),af=J.css("position")==="fixed",av=aw.viewport,ay={left:0,top:0},ak=aw.container,ae=s,al=U.plugins.tip,ac={horizontal:ad[0],vertical:(ad[1]=ad[1]||ad[0]),enabled:av.jquery&&ax[0]!==window&&ax[0]!==Q&&ap.method!=="none",left:function(aD){var az=ac.horizontal==="shift",aC=-ak.offset.left+av.offset.left+av.scrollLeft,aA=am.x==="left"?au:am.x==="right"?-au:-au/2,at=an.x==="left"?ai:an.x==="right"?-ai:-ai/2,aF=al&&al.size?al.size.width||0:0,aI=al&&al.corner&&al.corner.precedance==="x"&&!az?aF:0,aH=aC-aD+aI,aB=aD+au-av.width-aC+aI,aE=aA-(am.precedance==="x"||am.x===am.y?at:0)-(an.x==="center"?ai/2:0),aG=am.x==="center";if(az){aI=al&&al.corner&&al.corner.precedance==="y"?aF:0;aE=(am.x==="left"?1:-1)*aA-aI;ay.left+=aH>0?aH:aB>0?-aB:0;ay.left=Math.max(-ak.offset.left+av.offset.left+(aI&&al.corner.x==="center"?al.offset:0),aD-aE,Math.min(Math.max(-ak.offset.left+av.offset.left+av.width,aD+aE),ay.left))}else{if(aH>0&&(am.x!=="left"||aB>0)){ay.left-=aE}else{if(aB>0&&(am.x!=="right"||aH>0)){ay.left-=aG?-aE:aE}}if(ay.left!==aD&&aG){ay.left-=ap.x}if(ay.left<aC&&-ay.left>aB){ay.left=aD}}return ay.left-aD},top:function(aF){var az=ac.vertical==="shift",aD=-ak.offset.top+av.offset.top+av.scrollTop,aA=am.y==="top"?aq:am.y==="bottom"?-aq:-aq/2,aG=an.y==="top"?aj:an.y==="bottom"?-aj:-aj/2,at=al&&al.size?al.size.height||0:0,aI=al&&al.corner&&al.corner.precedance==="y"&&!az?at:0,aB=aD-aF+aI,aC=aF+aq-av.height-aD+aI,aE=aA-(am.precedance==="y"||am.x===am.y?aG:0)-(an.y==="center"?aj/2:0),aH=am.y==="center";if(az){aI=al&&al.corner&&al.corner.precedance==="x"?at:0;aE=(am.y==="top"?1:-1)*aA-aI;ay.top+=aB>0?aB:aC>0?-aC:0;ay.top=Math.max(-ak.offset.top+av.offset.top+(aI&&al.corner.x==="center"?al.offset:0),aF-aE,Math.min(Math.max(-ak.offset.top+av.offset.top+av.height,aF+aE),ay.top))}else{if(aB>0&&(am.y!=="top"||aC>0)){ay.top-=aE}else{if(aC>0&&(am.y!=="bottom"||aB>0)){ay.top-=aH?-aE:aE}}if(ay.top!==aF&&aH){ay.top-=ap.y}if(ay.top<0&&-ay.top>aC){ay.top=aF}}return ay.top-aF}},ag;if(g.isArray(ax)&&ax.length===2){an={x:"left",y:"top"};ay={left:ax[0],top:ax[1]}}else{if(ax==="mouse"&&((ar&&ar.pageX)||T.event.pageX)){an={x:"left",y:"top"};ar=(ar&&(ar.type==="resize"||ar.type==="scroll")?T.event:ar&&ar.pageX&&ar.type==="mousemove"?ar:c&&c.pageX&&(ap.mouse||!ar||!ar.pageX)?{pageX:c.pageX,pageY:c.pageY}:!ap.mouse&&T.origin&&T.origin.pageX&&H.show.distance?T.origin:ar)||ar||T.event||c||{};ay={top:ar.pageY,left:ar.pageX}}else{if(ax==="event"){if(ar&&ar.target&&ar.type!=="scroll"&&ar.type!=="resize"){ax=T.target=g(ar.target)}else{ax=T.target}}else{ax=T.target=g(ax.jquery?ax:S.target)}ax=g(ax).eq(0);if(ax.length===0){return U}else{if(ax[0]===document||ax[0]===window){ai=q.iOS?window.innerWidth:ax.width();aj=q.iOS?window.innerHeight:ax.height();if(ax[0]===window){ay={top:(av||ax).scrollTop(),left:(av||ax).scrollLeft()}}}else{if(ax.is("area")&&q.imagemap){ay=q.imagemap(ax,an,ac.enabled?ad:s)}else{if(ax[0].namespaceURI==="http://www.w3.org/2000/svg"&&q.svg){ay=q.svg(ax,an)}else{ai=ax.outerWidth();aj=ax.outerHeight();ay=q.offset(ax,ak)}}}}if(ay.offset){ai=ay.width;aj=ay.height;ae=ay.flipoffset;ay=ay.offset}if((q.iOS<4.1&&q.iOS>3.1)||q.iOS==4.3||(!q.iOS&&af)){ag=g(window);ay.left-=ag.scrollLeft();ay.top-=ag.scrollTop()}ay.left+=an.x==="right"?ai:an.x==="center"?ai/2:0;ay.top+=an.y==="bottom"?aj:an.y==="center"?aj/2:0}}ay.left+=ap.x+(am.x==="right"?-au:am.x==="center"?-au/2:0);ay.top+=ap.y+(am.y==="bottom"?-aq:am.y==="center"?-aq/2:0);if(ac.enabled){av={elem:av,height:av[(av[0]===window?"h":"outerH")+"eight"](),width:av[(av[0]===window?"w":"outerW")+"idth"](),scrollLeft:af?0:av.scrollLeft(),scrollTop:af?0:av.scrollTop(),offset:av.offset()||{left:0,top:0}};ak={elem:ak,scrollLeft:ak.scrollLeft(),scrollTop:ak.scrollTop(),offset:ak.offset()||{left:0,top:0}};ay.adjusted={left:ac.horizontal!=="none"?ac.left(ay.left):0,top:ac.vertical!=="none"?ac.top(ay.top):0};if(ay.adjusted.left+ay.adjusted.top){J.attr("class",J[0].className.replace(/ui-tooltip-pos-\w+/i,l+"-pos-"+am.abbrev()))}if(ae&&ay.adjusted.left){ay.left+=ae.left}if(ae&&ay.adjusted.top){ay.top+=ae.top}}else{ay.adjusted={left:0,top:0}}ah.originalEvent=g.extend({},ar);J.trigger(ah,[U,ay,av.elem||av]);if(ah.isDefaultPrevented()){return U}delete ay.adjusted;if(ao===s||isNaN(ay.left)||isNaN(ay.top)||ax==="mouse"||!g.isFunction(aw.effect)){J.css(ay)}else{if(g.isFunction(aw.effect)){aw.effect.call(J,U,g.extend({},ay));J.queue(function(at){g(this).css({opacity:"",height:""});if(g.browser.msie){this.style.removeAttribute("filter")}at()})}}I=0;return U},redraw:function(){if(U.rendered<1||aa){return U}var ad=H.position.container,af,ag,ac,ae;aa=1;if(H.style.height){J.css("height",H.style.height)}if(H.style.width){J.css("width",H.style.width)}else{J.css("width","").addClass(y);ag=J.width()+1;ac=J.css("max-width")||"";ae=J.css("min-width")||"";af=(ac+ae).indexOf("%")>-1?ad.width()/100:0;ac=((ac.indexOf("%")>-1?af:1)*parseInt(ac,10))||ag;ae=((ae.indexOf("%")>-1?af:1)*parseInt(ae,10))||0;ag=ac+ae?Math.min(Math.max(ag,ae),ac):ag;J.css("width",Math.round(ag)).removeClass(y)}aa=0;return U},disable:function(ac){if("boolean"!==typeof ac){ac=!(J.hasClass(f)||T.disabled)}if(U.rendered){J.toggleClass(f,ac);g.attr(J[0],"aria-disabled",ac)}else{T.disabled=!!ac}return U},enable:function(){return U.disable(s)},destroy:function(){var ac=ab[0],ad=g.attr(ac,o),ae=ab.data("qtip");if(U.rendered){J.stop(1,0).remove();g.each(U.plugins,function(){if(this.destroy){this.destroy()}})}clearTimeout(U.timers.show);clearTimeout(U.timers.hide);L();if(!ae||U===ae){g.removeData(ac,"qtip");if(H.suppress&&ad){g.attr(ac,"title",ad);ab.removeAttr(o)}ab.removeAttr("aria-describedby")}ab.unbind(".qtip-"+V);delete B[U.id];return ab}})}function u(G,F){var J,S,N,H,Q,I=g(this),K=g(document.body),P=this===document?K:I,O=(I.metadata)?I.metadata(F.metadata):C,R=F.metadata.type==="html5"&&O?O[F.metadata.name]:C,L=I.data(F.metadata.name||"qtipopts");try{L=typeof L==="string"?(new Function("return "+L))():L}catch(M){j("Unable to parse HTML5 attribute data: "+L)}H=g.extend(k,{},r.defaults,F,typeof L==="object"?a(L):C,a(R||O));S=H.position;H.id=G;if("boolean"===typeof H.content.text){N=I.attr(H.content.attr);if(H.content.attr!==s&&N){H.content.text=N}else{j("Unable to locate content for tooltip! Aborting render of tooltip on element: ",I);return s}}if(!S.container.length){S.container=K}if(S.target===s){S.target=P}if(H.show.target===s){H.show.target=P}if(H.show.solo===k){H.show.solo=S.container.closest("body")}if(H.hide.target===s){H.hide.target=P}if(H.position.viewport===k){H.position.viewport=S.container}S.at=new q.Corner(S.at);S.my=new q.Corner(S.my);if(g.data(this,"qtip")){if(H.overwrite){I.qtip("destroy")}else{if(H.overwrite===s){return s}}}if(H.suppress&&(Q=g.attr(this,"title"))){g(this).removeAttr("title").attr(o,Q)}J=new z(I,H,G,!!N);g.data(this,"qtip",J);I.bind("remove.qtip-"+G+" removeqtip.qtip-"+G,function(){J.destroy()});return J}r=g.fn.qtip=function(G,K,L){var M=(""+G).toLowerCase(),J=C,F=g.makeArray(arguments).slice(1),I=F[F.length-1],H=this[0]?g.data(this[0],"qtip"):C;if((!arguments.length&&H)||M==="api"){return H}else{if("string"===typeof G){this.each(function(){var N=g.data(this,"qtip");if(!N){return k}if(I&&I.timeStamp){N.cache.event=I}if((M==="option"||M==="options")&&K){if(g.isPlainObject(K)||L!==h){N.set(K,L)}else{J=N.get(K);return s}}else{if(N[M]){N[M].apply(N[M],F)}}});return J!==C?J:this}else{if("object"===typeof G||!arguments.length){H=a(g.extend(k,{},G));return r.bind.call(this,H,I)}}}};r.bind=function(G,F){return this.each(function(K){var I,H,J,M,L,O;O=g.isArray(G.id)?G.id[K]:G.id;O=!O||O===s||O.length<1||B[O]?r.nextid++:(B[O]=O);M=".qtip-"+O+"-create";L=u.call(this,O,G);if(L===s){return k}I=L.options;g.each(q,function(){if(this.initialize==="initialize"){this(L)}});H={show:I.show.target,hide:I.hide.target};J={show:g.trim(""+I.show.event).replace(/ /g,M+" ")+M,hide:g.trim(""+I.hide.event).replace(/ /g,M+" ")+M};if(/mouse(over|enter)/i.test(J.show)&&!/mouse(out|leave)/i.test(J.hide)){J.hide+=" mouseleave"+M}H.show.bind("mousemove"+M,function(P){c={pageX:P.pageX,pageY:P.pageY,type:"mousemove"};L.cache.onTarget=k});function N(Q){function P(){L.render(typeof Q==="object"||I.show.ready);H.show.add(H.hide).unbind(M)}if(L.cache.disabled){return s}L.cache.event=g.extend({},Q);L.cache.target=Q?g(Q.target):[h];if(I.show.delay>0){clearTimeout(L.timers.show);L.timers.show=setTimeout(P,I.show.delay);if(J.show!==J.hide){H.hide.bind(J.hide,function(){clearTimeout(L.timers.show)})}}else{P()}}H.show.bind(J.show,N);if(I.show.ready||I.prerender){N(F)}})};q=r.plugins={Corner:function(F){F=(""+F).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(F.match(/left|right/i)||F.match(/center/)||["inherit"])[0].toLowerCase();this.y=(F.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();var G=F.charAt(0);this.precedance=(G==="t"||G==="b"?"y":"x");this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbrev=function(){var H=this.x.substr(0,1),I=this.y.substr(0,1);return H===I?H:(H==="c"||(H!=="c"&&I!=="c"))?I+H:H+I};this.clone=function(){return{x:this.x,y:this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:this.clone}}},offset:function(I,F){var L=I.offset(),K=I.closest("body")[0],N=F,G,H,J;function M(P,O){L.left+=O*P.scrollLeft();L.top+=O*P.scrollTop()}if(N){do{if(N.css("position")!=="static"){H=N.position();L.left-=H.left+(parseInt(N.css("borderLeftWidth"),10)||0)+(parseInt(N.css("marginLeft"),10)||0);L.top-=H.top+(parseInt(N.css("borderTopWidth"),10)||0)+(parseInt(N.css("marginTop"),10)||0);if(!G&&(J=N.css("overflow"))!=="hidden"&&J!=="visible"){G=N}}}while((N=g(N[0].offsetParent)).length);if(G&&G[0]!==K){M(G,1)}}return L},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_","."))||s,fn:{attr:function(F,J){if(this.length){var G=this[0],I="title",H=g.data(G,"qtip");if(F===I&&H&&"object"===typeof H&&H.options.suppress){if(arguments.length<2){return g.attr(G,o)}else{if(H&&H.options.content.attr===I&&H.cache.attr){H.set("content.text",J)}return this.attr(o,J)}}}return g.fn["attr"+A].apply(this,arguments)},clone:function(G){var I=g([]),H="title",F=g.fn["clone"+A].apply(this,arguments);if(!G){F.filter("["+o+"]").attr("title",function(){return g.attr(this,o)}).removeAttr(o)}return F}}};g.each(q.fn,function(G,H){if(!H||g.fn[G+A]){return k}var F=g.fn[G+A]=g.fn[G];g.fn[G]=function(){return H.apply(this,arguments)||F.apply(this,arguments)}});if(!g.ui){g["cleanData"+A]=g.cleanData;g.cleanData=function(F){for(var G=0,H;(H=F[G])!==h;G++){try{g(H).triggerHandler("removeqtip")}catch(I){}}g["cleanData"+A](F)}}r.version="2.0.0pre";r.nextid=0;r.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");r.zindex=15000;r.defaults={prerender:s,id:s,overwrite:k,suppress:k,content:{text:k,attr:"title",title:{text:s,button:s}},position:{my:"top left",at:"bottom right",target:s,container:s,viewport:s,adjust:{x:0,y:0,mouse:k,resize:k,method:"flip flip"},effect:function(G,H,F){g(this).animate(H,{duration:200,queue:s})}},show:{target:s,event:"mouseenter",effect:k,delay:90,solo:s,ready:s,autofocus:s},hide:{target:s,event:"mouseleave",effect:k,delay:0,fixed:s,inactive:s,leave:"window",distance:s},style:{classes:"",widget:s,width:s,height:s,def:k},events:{render:C,move:C,show:C,hide:C,toggle:C,visible:C,focus:C,blur:C}};function v(I){var M=this,N=I.elements.tooltip,F=I.options.content.ajax,G=".qtip-ajax",J=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,H=k,L=s,K;I.checks.ajax={"^content.ajax":function(Q,P,O){if(P==="ajax"){F=O}if(P==="once"){M.init()}else{if(F&&F.url){M.load()}else{N.unbind(G)}}}};g.extend(M,{init:function(){if(F&&F.url){N.unbind(G)[F.once?"one":"bind"]("tooltipshow"+G,M.load)}return M},load:function(P,T){var S=F.url.indexOf(" "),Q=F.url,R,X=F.once&&!F.loading&&T;if(X){try{P.preventDefault()}catch(W){}}else{if(P&&P.isDefaultPrevented()){return M}}if(K&&K.abort){K.abort()}if(S>-1){R=Q.substr(S);Q=Q.substr(0,S)}function O(){if(L){return}if(X){I.show(P.originalEvent);T=s}if(g.isFunction(F.complete)){F.complete.apply(this,arguments)}}function V(Y){if(L){return}if(R){Y=g("<div/>").append(Y.replace(J,"")).find(R)}I.set("content.text",Y)}function U(aa,Y,Z){if(L||aa.status===0){return}I.set("content.text",Y+": "+Z)}K=g.ajax(g.extend({success:V,error:U,context:I},F,{url:Q,complete:O}))},destroy:function(){if(K&&K.abort){K.abort()}L=k}});M.init()}q.ajax=function(G){var F=G.plugins.ajax;return"object"===typeof F?F:(G.plugins.ajax=new v(G))};q.ajax.initialize="render";q.ajax.sanitize=function(F){var H=F.content,G;if(H&&"ajax" in H){G=H.ajax;if(typeof G!=="object"){G=F.content.ajax={url:G}}if("boolean"!==typeof G.once&&G.once){G.once=!!G.once}}};g.extend(k,r.defaults,{content:{ajax:{loading:k,once:k}}});function E(I){var G=this,F=I.elements,J=F.tooltip,H=".bgiframe-"+I.id;g.extend(G,{init:function(){F.bgiframe=g('<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>');F.bgiframe.appendTo(J);J.bind("tooltipmove"+H,G.adjust)},adjust:function(){var M=I.get("dimensions"),L=I.plugins.tip,N=F.tip,K,O;O=parseInt(J.css("border-left-width"),10)||0;O={left:-O,top:-O};if(L&&N){K=(L.corner.precedance==="x")?["width","left"]:["height","top"];O[K[1]]-=N[K[0]]()}F.bgiframe.css(O).css(M)},destroy:function(){F.bgiframe.remove();J.unbind(H)}});G.init()}q.bgiframe=function(H){var G=g.browser,F=H.plugins.bgiframe;if(g("select, object").length<1||!(G.msie&&(""+G.version).charAt(0)==="6")){return s}return"object"===typeof F?F:(H.plugins.bgiframe=new E(H))};q.bgiframe.initialize="render";q.imagemap=function(G,P,M){if(!G.jquery){G=g(G)}var N=(G[0].shape||G.attr("shape")).toLowerCase(),I=(G[0].coords||G.attr("coords")).split(","),O=[],J=g('img[usemap="#'+G.parent("map").attr("name")+'"]'),R=J.offset(),Q={width:0,height:0,offset:{top:10000000000,right:0,bottom:0,left:10000000000}},K=0,L=0,F;function H(ab,Z,aa){var W=0,Y=1,X=1,V=0,T=0,U=ab.width,S=ab.height;while(U>0&&S>0&&Y>0&&X>0){U=Math.floor(U/2);S=Math.floor(S/2);if(aa.x==="left"){Y=U}else{if(aa.x==="right"){Y=ab.width-U}else{Y+=Math.floor(U/2)}}if(aa.y==="top"){X=S}else{if(aa.y==="bottom"){X=ab.height-S}else{X+=Math.floor(S/2)}}W=Z.length;while(W--){if(Z.length<2){break}V=Z[W][0]-ab.offset.left;T=Z[W][1]-ab.offset.top;if((aa.x==="left"&&V>=Y)||(aa.x==="right"&&V<=Y)||(aa.x==="center"&&(V<Y||V>(ab.width-Y)))||(aa.y==="top"&&T>=X)||(aa.y==="bottom"&&T<=X)||(aa.y==="center"&&(T<X||T>(ab.height-X)))){Z.splice(W,1)}}}return{left:Z[0][0],top:Z[0][1]}}R.left+=Math.ceil((J.outerWidth()-J.width())/2);R.top+=Math.ceil((J.outerHeight()-J.height())/2);if(N==="poly"){K=I.length;while(K--){L=[parseInt(I[--K],10),parseInt(I[K+1],10)];if(L[0]>Q.offset.right){Q.offset.right=L[0]}if(L[0]<Q.offset.left){Q.offset.left=L[0]}if(L[1]>Q.offset.bottom){Q.offset.bottom=L[1]}if(L[1]<Q.offset.top){Q.offset.top=L[1]}O.push(L)}}else{O=g.map(I,function(S){return parseInt(S,10)})}switch(N){case"rect":Q={width:Math.abs(O[2]-O[0]),height:Math.abs(O[3]-O[1]),offset:{left:Math.min(O[0],O[2]),top:Math.min(O[1],O[3])}};break;case"circle":Q={width:O[2]+2,height:O[2]+2,offset:{left:O[0],top:O[1]}};break;case"poly":g.extend(Q,{width:Math.abs(Q.offset.right-Q.offset.left),height:Math.abs(Q.offset.bottom-Q.offset.top)});if(P.string()==="centercenter"){Q.offset={left:Q.offset.left+(Q.width/2),top:Q.offset.top+(Q.height/2)}}else{Q.offset=H(Q,O.slice(),P);if(M&&(M[0]==="flip"||M[1]==="flip")){Q.flipoffset=H(Q,O.slice(),{x:P.x==="left"?"right":P.x==="right"?"left":"center",y:P.y==="top"?"bottom":P.y==="bottom"?"top":"center"});Q.flipoffset.left-=Q.offset.left;Q.flipoffset.top-=Q.offset.top}}Q.width=Q.height=0;break}Q.offset.left+=R.left;Q.offset.top+=R.top;return Q};function b(L){var N=this,P=L.options.show.modal,F=L.elements,O=F.tooltip,H="#qtip-overlay",G=".qtipmodal",I=G+L.id,M="is-modal-qtip",K=g(document.body),J;L.checks.modal={"^show.modal.(on|blur)$":function(){N.init();F.overlay.toggle(O.is(":visible"))}};g.extend(N,{init:function(){if(!P.on){return N}J=N.create();O.attr(M,k).css("z-index",q.modal.zindex+g(t+"["+M+"]").length).unbind(G).unbind(I).bind("tooltipshow"+G+" tooltiphide"+G,function(S,R,U){var Q=S.originalEvent;if(S.target===O[0]){if(Q&&S.type==="tooltiphide"&&/mouse(leave|enter)/.test(Q.type)&&g(Q.relatedTarget).closest(J[0]).length){try{S.preventDefault()}catch(T){}}else{if(!Q||(Q&&!Q.solo)){N[S.type.replace("tooltip","")](S,U)}}}}).bind("tooltipfocus"+G,function(S){if(S.isDefaultPrevented()||S.target!==O[0]){return}var T=g(t).filter("["+M+"]"),R=q.modal.zindex+T.length,Q=parseInt(O[0].style.zIndex,10);J[0].style.zIndex=R-1;T.each(function(){if(this.style.zIndex>Q){this.style.zIndex-=1}});T.end().filter("."+D).qtip("blur",S.originalEvent);O.addClass(D)[0].style.zIndex=R;try{S.preventDefault()}catch(U){}}).bind("tooltiphide"+G,function(Q){if(Q.target===O[0]){g("["+M+"]").filter(":visible").not(O).last().qtip("focus",Q)}});if(P.escape){g(window).unbind(I).bind("keydown"+I,function(Q){if(Q.keyCode===27&&O.hasClass(D)){L.hide(Q)}})}if(P.blur){F.overlay.unbind(I).bind("click"+I,function(Q){if(O.hasClass(D)){L.hide(Q)}})}return N},create:function(){var R=g(H);if(R.length){return(F.overlay=R.insertAfter(g(t).last()))}J=F.overlay=g("<div />",{id:H.substr(1),html:"<div></div>",mousedown:function(){return s}}).insertAfter(g(t).last());function Q(){J.css({height:g(window).height(),width:g(window).width()})}g(window).unbind(G).bind("resize"+G,Q);Q();return J},toggle:function(U,V,W){if(U&&U.isDefaultPrevented()){return N}var T=P.effect,S=V?"show":"hide",X=J.is(":visible"),R=g("["+M+"]").filter(":visible").not(O),Q;if(!J){J=N.create()}if((J.is(":animated")&&X===V)||(!V&&R.length)){return N}if(V){J.css({left:0,top:0});J.toggleClass("blurs",P.blur);K.bind("focusin"+I,function(Z){var aa=g(Z.target),Y=aa.closest(".qtip"),ab=Y.length<1?s:(parseInt(Y[0].style.zIndex,10)>parseInt(O[0].style.zIndex,10));if(!ab&&(g(Z.target).closest(t)[0]!==O[0])){O.find("input:visible").filter(":first").focus()}})}else{K.undelegate("*","focusin"+I)}J.stop(k,s);if(g.isFunction(T)){T.call(J,V)}else{if(T===s){J[S]()}else{J.fadeTo(parseInt(W,10)||90,V?1:0,function(){if(!V){g(this).hide()}})}}if(!V){J.queue(function(Y){J.css({left:"",top:""});Y()})}return N},show:function(Q,R){return N.toggle(Q,k,R)},hide:function(Q,R){return N.toggle(Q,s,R)},destroy:function(){var Q=J;if(Q){Q=g("["+M+"]").not(O).length<1;if(Q){F.overlay.remove();g(window).unbind(G)}else{F.overlay.unbind(G+L.id)}K.undelegate("*","focusin"+I)}return O.removeAttr(M).unbind(G)}});N.init()}q.modal=function(G){var F=G.plugins.modal;return"object"===typeof F?F:(G.plugins.modal=new b(G))};q.modal.initialize="render";q.modal.sanitize=function(F){if(F.show){if(typeof F.show.modal!=="object"){F.show.modal={on:!!F.show.modal}}else{if(typeof F.show.modal.on==="undefined"){F.show.modal.on=k}}}};q.modal.zindex=r.zindex+1000;g.extend(k,r.defaults,{show:{modal:{on:s,effect:k,blur:k,escape:k}}});q.svg=function(J,N){var M=g(document),H=J[0],O={width:0,height:0,offset:{top:10000000000,left:10000000000}},I,F,K,L,G;if(H.getBBox&&H.parentNode){I=H.getBBox();F=H.getScreenCTM();K=H.farthestViewportElement||H;if(!K.createSVGPoint){return O}L=K.createSVGPoint();L.x=I.x;L.y=I.y;G=L.matrixTransform(F);O.offset.left=G.x;O.offset.top=G.y;L.x+=I.width;L.y+=I.height;G=L.matrixTransform(F);O.width=G.x-O.offset.left;O.height=G.y-O.offset.top;O.offset.left+=M.scrollLeft();O.offset.top+=M.scrollTop()}return O};function w(K,I,G){var H=Math.ceil(I/2),J=Math.ceil(G/2),F={bottomright:[[0,0],[I,G],[I,0]],bottomleft:[[0,0],[I,0],[0,G]],topright:[[0,G],[I,0],[I,G]],topleft:[[0,0],[0,G],[I,G]],topcenter:[[0,G],[H,0],[I,G]],bottomcenter:[[0,0],[I,0],[H,G]],rightcenter:[[0,0],[I,J],[0,G]],leftcenter:[[I,0],[I,G],[0,J]]};F.lefttop=F.bottomright;F.righttop=F.bottomleft;F.leftbottom=F.topright;F.rightbottom=F.topleft;return F[K.string()]}function x(Q,P){var S=this,H=Q.options.style.tip,J=Q.elements,T=J.tooltip,I={top:0,left:0},U={width:H.width,height:H.height},O={},N=H.border||0,M=".qtip-tip",L=!!(g("<canvas />")[0]||{}).getContext;S.corner=C;S.mimic=C;S.border=N;S.offset=H.offset;S.size=U;Q.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){if(!S.init()){S.destroy()}Q.reposition()},"^style.tip.(height|width)$":function(){U={width:H.width,height:H.height};S.create();S.update();Q.reposition()},"^content.title.text|style.(classes|widget)$":function(){if(J.tip){S.update()}}};function R(W,ac,af,ad){if(!J.tip){return}var ah=S.corner.clone(),ag=af.adjusted,V=Q.options.position.adjust.method.split(" "),X=V[0],Z=V[1]||V[0],Y={left:s,top:s,x:0,y:0},aa,ab={},ae;if(S.corner.fixed!==k){if(X==="shift"&&ah.precedance==="x"&&ag.left&&ah.y!=="center"){ah.precedance=ah.precedance==="x"?"y":"x"}else{if(X==="flip"&&ag.left){ah.x=ah.x==="center"?(ag.left>0?"left":"right"):(ah.x==="left"?"right":"left")}}if(Z==="shift"&&ah.precedance==="y"&&ag.top&&ah.x!=="center"){ah.precedance=ah.precedance==="y"?"x":"y"}else{if(Z==="flip"&&ag.top){ah.y=ah.y==="center"?(ag.top>0?"top":"bottom"):(ah.y==="top"?"bottom":"top")}}if(ah.string()!==I.corner.string()&&(I.top!==ag.top||I.left!==ag.left)){S.update(ah,s)}}aa=S.position(ah,ag);if(aa.right!==h){aa.left=-aa.right}if(aa.bottom!==h){aa.top=-aa.bottom}aa.user=Math.max(0,H.offset);if(Y.left=(X==="shift"&&!!ag.left)){if(ah.x==="center"){ab["margin-left"]=Y.x=aa["margin-left"]-ag.left}else{ae=aa.right!==h?[ag.left,-aa.left]:[-ag.left,aa.left];if((Y.x=Math.max(ae[0],ae[1]))>ae[0]){af.left-=ag.left;Y.left=s}ab[aa.right!==h?"right":"left"]=Y.x}}if(Y.top=(Z==="shift"&&!!ag.top)){if(ah.y==="center"){ab["margin-top"]=Y.y=aa["margin-top"]-ag.top}else{ae=aa.bottom!==h?[ag.top,-aa.top]:[-ag.top,aa.top];if((Y.y=Math.max(ae[0],ae[1]))>ae[0]){af.top-=ag.top;Y.top=s}ab[aa.bottom!==h?"bottom":"top"]=Y.y}}J.tip.css(ab).toggle(!((Y.x&&Y.y)||(ah.x==="center"&&Y.y)||(ah.y==="center"&&Y.x)));af.left-=aa.left.charAt?aa.user:X!=="shift"||Y.top||!Y.left&&!Y.top?aa.left:0;af.top-=aa.top.charAt?aa.user:Z!=="shift"||Y.left||!Y.left&&!Y.top?aa.top:0;I.left=ag.left;I.top=ag.top;I.corner=ah.clone()}function G(aa,Y,W){Y=!Y?aa[aa.precedance]:Y;var ab=T.hasClass(y),V=J.titlebar&&aa.y==="top",Z=V?J.titlebar:J.content,X="border-"+Y+"-width",ac;T.addClass(y);ac=parseInt(Z.css(X),10);ac=(W?ac||parseInt(T.css(X),10):ac)||0;T.toggleClass(y,ab);return ac}function K(aa){var V=J.titlebar&&aa.y==="top",Z=V?J.titlebar:J.content,Y=g.browser.mozilla,ab=Y?"-moz-":g.browser.webkit?"-webkit-":"",X=aa.y+(Y?"":"-")+aa.x,W=ab+(Y?"border-radius-"+X:"border-"+X+"-radius");return parseInt(Z.css(W),10)||parseInt(T.css(W),10)||0}function F(ae){var ac=ae.precedance==="y",W=U[ac?"width":"height"],af=U[ac?"height":"width"],ab=ae.string().indexOf("center")>-1,V=W*(ab?0.5:1),Y=Math.pow,ag=Math.round,ad,aa,ah,X=Math.sqrt(Y(V,2)+Y(af,2)),Z=[(N/V)*X,(N/af)*X];Z[2]=Math.sqrt(Y(Z[0],2)-Y(N,2));Z[3]=Math.sqrt(Y(Z[1],2)-Y(N,2));ad=X+Z[2]+Z[3]+(ab?0:Z[0]);aa=ad/X;ah=[ag(aa*af),ag(aa*W)];return{height:ah[ac?0:1],width:ah[ac?1:0]}}g.extend(S,{init:function(){var V=S.detectCorner()&&(L||g.browser.msie);if(V){S.create();S.update();T.unbind(M).bind("tooltipmove"+M,R)}return V},detectCorner:function(){var X=H.corner,W=Q.options.position,V=W.at,Y=W.my.string?W.my.string():W.my;if(X===s||(Y===s&&V===s)){return s}else{if(X===k){S.corner=new q.Corner(Y)}else{if(!X.string){S.corner=new q.Corner(X);S.corner.fixed=k}}}I.corner=new q.Corner(S.corner.string());return S.corner.string()!=="centercenter"},detectColours:function(ai){var ab,ak,Z,ag=J.tip.css("cssText",""),ah=ai||S.corner,W=ah[ah.precedance],V="border-"+W+"-color",ac="border"+W.charAt(0)+W.substr(1)+"Color",ad=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,af="background-color",al="transparent",Y=" !important",aa=g(document.body).css("color"),aj=Q.elements.content.css("color"),ae=J.titlebar&&(ah.y==="top"||(ah.y==="center"&&ag.position().top+(U.height/2)+H.offset<J.titlebar.outerHeight(1))),X=ae?J.titlebar:J.content;T.addClass(y);O.fill=ak=ag.css(af);O.border=Z=ag[0].style[ac]||ag.css(V)||T.css(V);if(!ak||ad.test(ak)){O.fill=X.css(af)||al;if(ad.test(O.fill)){O.fill=T.css(af)||ak}}if(!Z||ad.test(Z)||Z===aa){O.border=X.css(V)||al;if(ad.test(O.border)){O.border=Z}}g("*",ag).add(ag).css("cssText",af+":"+al+Y+";border:0"+Y+";");T.removeClass(y)},create:function(){var X=U.width,W=U.height,V;if(J.tip){J.tip.remove()}J.tip=g("<div />",{"class":"ui-tooltip-tip"}).css({width:X,height:W}).prependTo(T);if(L){g("<canvas />").appendTo(J.tip)[0].getContext("2d").save()}else{V='<vml:shape coordorigin="0,0" style="display:inline-block; position:absolute; behavior:url(#default#VML);"></vml:shape>';J.tip.html(V+V);g("*",J.tip).bind("click mousedown",function(Y){Y.stopPropagation()})}},update:function(ae,aa){var ad=J.tip,aj=ad.children(),X=U.width,af=U.height,Y="px solid ",ai="px dashed transparent",ah=H.mimic,ag=Math.round,V,W,ac,Z,ab;if(!ae){ae=I.corner||S.corner}if(ah===s){ah=ae}else{ah=new q.Corner(ah);ah.precedance=ae.precedance;if(ah.x==="inherit"){ah.x=ae.x}else{if(ah.y==="inherit"){ah.y=ae.y}else{if(ah.x===ah.y){ah[ae.precedance]=ae[ae.precedance]}}}}V=ah.precedance;S.detectColours(ae);if(O.border!=="transparent"&&O.border!=="#123456"){N=G(ae,C,k);if(H.border===0&&N>0){O.fill=O.border}S.border=N=H.border!==k?H.border:N}else{S.border=N=0}ac=w(ah,X,af);S.size=ab=F(ae);ad.css(ab);if(ae.precedance==="y"){Z=[ag(ah.x==="left"?N:ah.x==="right"?ab.width-X-N:(ab.width-X)/2),ag(ah.y==="top"?ab.height-af:0)]}else{Z=[ag(ah.x==="left"?ab.width-X:0),ag(ah.y==="top"?N:ah.y==="bottom"?ab.height-af-N:(ab.height-af)/2)]}if(L){aj.attr(ab);W=aj[0].getContext("2d");W.restore();W.save();W.clearRect(0,0,3000,3000);W.translate(Z[0],Z[1]);W.beginPath();W.moveTo(ac[0][0],ac[0][1]);W.lineTo(ac[1][0],ac[1][1]);W.lineTo(ac[2][0],ac[2][1]);W.closePath();W.fillStyle=O.fill;W.strokeStyle=O.border;W.lineWidth=N*2;W.lineJoin="miter";W.miterLimit=100;if(N){W.stroke()}W.fill()}else{ac="m"+ac[0][0]+","+ac[0][1]+" l"+ac[1][0]+","+ac[1][1]+" "+ac[2][0]+","+ac[2][1]+" xe";Z[2]=N&&/^(r|b)/i.test(ae.string())?parseFloat(g.browser.version,10)===8?2:1:0;aj.css({antialias:""+(ah.string().indexOf("center")>-1),left:Z[0]-(Z[2]*Number(V==="x")),top:Z[1]-(Z[2]*Number(V==="y")),width:X+N,height:af+N}).each(function(ak){var al=g(this);al[al.prop?"prop":"attr"]({coordsize:(X+N)+" "+(af+N),path:ac,fillcolor:O.fill,filled:!!ak,stroked:!!!ak}).css({display:N||ak?"block":"none"});if(!ak&&al.html()===""){al.html('<vml:stroke weight="'+(N*2)+'px" color="'+O.border+'" miterlimit="1000" joinstyle="miter"  style="behavior:url(#default#VML); display:inline-block;" />')}})}if(aa!==s){S.position(ae)}},position:function(aa){var ab=J.tip,W={},V=Math.max(0,H.offset),X,Z,Y;if(H.corner===s||!ab){return s}aa=aa||S.corner;X=aa.precedance;Z=F(aa);Y=[aa.x,aa.y];if(X==="x"){Y.reverse()}g.each(Y,function(af,ae){var ac,ad;if(ae==="center"){ac=X==="y"?"left":"top";W[ac]="50%";W["margin-"+ac]=-Math.round(Z[X==="y"?"width":"height"]/2)+V}else{ac=G(aa,ae,k);ad=K(aa);W[ae]=af?N?G(aa,ae):0:V+(ad>ac?ad:0)}});W[aa[X]]-=Z[X==="x"?"width":"height"];ab.css({top:"",bottom:"",left:"",right:"",margin:""}).css(W);return W},destroy:function(){if(J.tip){J.tip.remove()}T.unbind(M)}});S.init()}q.tip=function(G){var F=G.plugins.tip;return"object"===typeof F?F:(G.plugins.tip=new x(G))};q.tip.initialize="render";q.tip.sanitize=function(F){var G=F.style,H;if(G&&"tip" in G){H=F.style.tip;if(typeof H!=="object"){F.style.tip={corner:H}}if(!(/string|boolean/i).test(typeof H.corner)){H.corner=k}if(typeof H.width!=="number"){delete H.width}if(typeof H.height!=="number"){delete H.height}if(typeof H.border!=="number"&&H.border!==k){delete H.border}if(typeof H.offset!=="number"){delete H.offset}}};g.extend(k,r.defaults,{style:{tip:{corner:k,mimic:s,width:6,height:6,border:k,offset:0}}})}));(function(h,f){var j={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href"},k=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"],e={anchor:"fragment"},a={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},c=/(?:^|&|;)([^&=;]*)=?([^&;]*)/g,b=/(?:^|&|;)([^&=;]*)=?([^&;]*)/g;function g(l,o){var q=decodeURI(l),n=a[o||false?"strict":"loose"].exec(q),p={attr:{},param:{},seg:{}},m=14;while(m--){p.attr[k[m]]=n[m]||""}p.param.query={};p.param.fragment={};p.attr.query.replace(c,function(s,r,t){if(r){p.param.query[r]=t}});p.attr.fragment.replace(b,function(s,r,t){if(r){p.param.fragment[r]=t}});p.seg.path=p.attr.path.replace(/^\/+|\/+$/g,"").split("/");p.seg.fragment=p.attr.fragment.replace(/^\/+|\/+$/g,"").split("/");p.attr.base=p.attr.host?p.attr.protocol+"://"+p.attr.host+(p.attr.port?":"+p.attr.port:""):"";return p}function d(m){var l=m.tagName;if(l!==f){return j[l.toLowerCase()]}return l}h.fn.url=function(m){var l="";if(this.length){l=h(this).attr(d(this[0]))||""}return h.url(l,m)};h.url=function(l,m){if(arguments.length===1&&l===true){m=true;l=f}m=m||false;l=l||window.location.toString();return{data:g(l,m),attr:function(n){n=e[n]||n;return n!==f?this.data.attr[n]:this.data.attr},param:function(n){return n!==f?this.data.param.query[n]:this.data.param.query},fparam:function(n){return n!==f?this.data.param.fragment[n]:this.data.param.fragment},segment:function(n){if(n===f){return this.data.seg.path}else{n=n<0?this.data.seg.path.length+n:n-1;return this.data.seg.path[n]}},fsegment:function(n){if(n===f){return this.data.seg.fragment}else{n=n<0?this.data.seg.fragment.length+n:n-1;return this.data.seg.fragment[n]}}}}})(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 c=a.data(this[0],"validator");if(c){return c}this.attr("novalidate","novalidate");c=new a.validator(b,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){var d=this.find("input, button");d.filter(".cancel").click(function(){c.cancelSubmit=true});if(c.settings.submitHandler){d.filter(":submit").click(function(){c.submitButton=this})}this.submit(function(e){if(c.settings.debug){e.preventDefault()}function f(){if(c.settings.submitHandler){if(c.submitButton){var g=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)}c.settings.submitHandler.call(c,c.currentForm);if(c.submitButton){g.remove()}return false}return true}if(c.cancelSubmit){c.cancelSubmit=false;return f()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return f()}else{c.focusInvalid();return false}})}return c},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var c=true;var b=a(this[0].form).validate();this.each(function(){c&=b.element(this)});return c}},removeAttrs:function(d){var b={},c=this;a.each(d.split(/\s/),function(e,f){b[f]=c.attr(f);c.removeAttr(f)});return b},rules:function(e,b){var g=this[0];if(e){var d=a.data(g.form,"validator").settings;var j=d.rules;var k=a.validator.staticRules(g);switch(e){case"add":a.extend(k,a.validator.normalizeRule(b));j[g.name]=k;if(b.messages){d.messages[g.name]=a.extend(d.messages[g.name],b.messages)}break;case"remove":if(!b){delete j[g.name];return k}var h={};a.each(b.split(/\s/),function(l,m){h[m]=k[m];delete k[m]});return h}}var f=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(g),a.validator.classRules(g),a.validator.attributeRules(g),a.validator.staticRules(g)),g);if(f.required){var c=f.required;delete f.required;f=a.extend({required:c},f)}return f}});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,c){this.settings=a.extend(true,{},a.validator.defaults,b);this.currentForm=c;this.init()};a.validator.format=function(b,c){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(b);return a.validator.format.apply(this,d)}}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1)}if(c.constructor!=Array){c=[c]}a.each(c,function(d,e){b=b.replace(new RegExp("\\{"+d+"\\}","g"),e)});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,c){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,c){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b,c){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b,c){if(b.name in this.submitted){this.element(b)}else{if(b.parentNode.name in this.submitted){this.element(b.parentNode)}}},highlight:function(d,b,c){if(d.type==="radio"){this.findByName(d.name).addClass(b).removeClass(c)}else{a(d).addClass(b).removeClass(c)}},unhighlight:function(d,b,c){if(d.type==="radio"){this.findByName(d.name).removeClass(b).addClass(c)}else{a(d).removeClass(b).addClass(c)}}},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(e,f){a.each(f.split(/\s/),function(h,g){b[g]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function c(g){var f=a.data(this[0].form,"validator"),e="on"+g.type.replace(/^validate/,"");f.settings[e]&&f.settings[e].call(f,this[0],g)}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",c).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",c);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,c=(this.currentElements=this.elements());c[b];b++){this.check(c[b])}return this.valid()},element:function(c){c=this.validationTargetFor(this.clean(c));this.lastElement=c;this.prepareElement(c);this.currentElements=a(c);var b=this.check(c);if(b){delete this.invalid[c.name]}else{this.invalid[c.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return b},showErrors:function(c){if(c){a.extend(this.errorMap,c);this.errorList=[];for(var b in c){this.errorList.push({message:c[b],element:this.findByName(b)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in c)})}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(d){var c=0;for(var b in d){c++}return c},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};var d=a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true});return d},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(c){c=this.validationTargetFor(this.clean(c));var h=a(c).rules();var d=false;for(var j in h){var g={method:j,parameters:h[j]};try{var b=a.validator.methods[j].call(this,c.value.replace(/\r/g,""),c,g.parameters);if(b=="dependency-mismatch"){d=true;continue}d=false;if(b=="pending"){this.toHide=this.toHide.not(this.errorsFor(c));return}if(!b){this.formatAndAdd(c,g);return false}}catch(f){this.settings.debug&&window.console&&console.log("exception occured when checking element "+c.id+", check the '"+g.method+"' method",f);throw f}}if(d){return}if(this.objectLength(h)){this.successList.push(c)}return true},customMetaMessage:function(b,d){if(!a.metadata){return}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d]},customMessage:function(c,d){var b=this.settings.messages[c];return b&&(b.constructor==String?b:b[d])},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b]}}return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(c,e){var d=this.defaultMessage(c,e.method),b=/\$?\{(\d+)\}/g;if(typeof d=="function"){d=d.call(this,e.parameters,c)}else{if(b.test(d)){d=jQuery.format(d.replace(b,"{$1}"),e.parameters)}}this.errorList.push({message:d,element:c});this.errorMap[c.name]=d;this.submitted[c.name]=d},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parent(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var c=0;this.errorList[c];c++){var b=this.errorList[c];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 c=0;this.successList[c];c++){this.showLabel(this.successList[c])}}if(this.settings.unhighlight){for(var c=0,d=this.validElements();d[c];c++){this.settings.unhighlight.call(this,d[c],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(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass(this.settings.validClass).addClass(this.settings.errorClass);b.attr("generated")&&b.html(d)}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(c),generated:true}).addClass(this.settings.errorClass).html(d||"");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(c)):b.insertAfter(c)}}if(!d&&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(c){var b=this.idOrName(c);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 c=this.currentForm;return a(document.getElementsByName(b)).map(function(d,e){return e.form==c&&e.name==b&&e||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,b.form).length},"function":function(c,b){return c(b)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();this.formSubmitted=false}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}});return d},attributeRules:function(c){var e={};var b=a(c);for(var f in a.validator.methods){var d;if(f==="required"&&typeof a.fn.prop==="function"){d=b.prop(f)}else{d=b.attr(f)}if(d){e[f]=d}else{if(b[0].getAttribute("type")===f){e[f]=true}}}if(e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)){delete e.maxlength}return e},metadataRules:function(b){if(!a.metadata){return{}}var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(c){var d={};var b=a.data(c.form,"validator");if(b.settings.rules){d=a.validator.normalizeRule(b.settings.rules[c.name])||{}}return d},normalizeRules:function(c,b){a.each(c,function(f,e){if(e===false){delete c[f];return}if(e.param||e.depends){var d=true;switch(typeof e.depends){case"string":d=!!a(e.depends,b.form).length;break;case"function":d=e.depends.call(b,b);break}if(d){c[f]=e.param!==undefined?e.param:true}else{delete c[f]}}});a.each(c,function(d,e){c[d]=a.isFunction(e)?e(b):e});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])]}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}if(c.messages){delete c.messages}return c},normalizeRule:function(c){if(typeof c=="string"){var b={};a.each(c.split(/\s/),function(){b[this]=true});c=b}return c},addMethod:function(b,d,c){a.validator.methods[b]=d;a.validator.messages[b]=c!=undefined?c:a.validator.messages[b];if(d.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b))}},methods:{required:function(c,b,e){if(!this.depend(e,b)){return"dependency-mismatch"}switch(b.nodeName.toLowerCase()){case"select":var d=a(b).val();return d&&d.length>0;case"input":if(this.checkable(b)){return this.getLength(c,b)>0}default:return a.trim(c).length>0}},remote:function(f,c,g){if(this.optional(c)){return"dependency-mismatch"}var d=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}d.originalMessage=this.settings.messages[c.name].remote;this.settings.messages[c.name].remote=d.message;g=typeof g=="string"&&{url:g}||g;if(this.pending[c.name]){return"pending"}if(d.old===f){return d.valid}d.old=f;var b=this;this.startRequest(c);var e={};e[c.name]=f;a.ajax(a.extend(true,{url:g,mode:"abort",port:"validate"+c.name,dataType:"json",data:e,success:function(j){b.settings.messages[c.name].remote=d.originalMessage;var l=j===true;if(l){var h=b.formSubmitted;b.prepareElement(c);b.formSubmitted=h;b.successList.push(c);b.showErrors()}else{var m={};var k=j||b.defaultMessage(c,"remote");m[c.name]=d.message=a.isFunction(k)?k(f):k;b.showErrors(m)}d.valid=l;b.stopRequest(c,l)}},g));return"pending"},minlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)>=d},maxlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)<=d},rangelength:function(d,b,e){var c=this.getLength(a.trim(d),b);return this.optional(b)||(c>=e[0]&&c<=e[1])},min:function(c,b,d){return this.optional(b)||c>=d},max:function(c,b,d){return this.optional(b)||c<=d},range:function(c,b,d){return this.optional(b)||(c>=d[0]&&c<=d[1])},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(c)},url:function(c,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c))},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},creditcard:function(f,c){if(this.optional(c)){return"dependency-mismatch"}if(/[^0-9 -]+/.test(f)){return false}var g=0,e=0,b=false;f=f.replace(/\D/g,"");for(var h=f.length-1;h>=0;h--){var d=f.charAt(h);var e=parseInt(d,10);if(b){if((e*=2)>9){e-=9}}g+=e;b=!b}return(g%10)==0},accept:function(c,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp(".("+d+")$","i"))},equalTo:function(c,b,e){var d=a(e).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(b).valid()});return c==d.val()}}});a.format=a.validator.format})(jQuery);(function(c){var a={};if(c.ajaxPrefilter){c.ajaxPrefilter(function(f,e,g){var d=f.port;if(f.mode=="abort"){if(a[d]){a[d].abort()}a[d]=g}})}else{var b=c.ajax;c.ajax=function(e){var f=("mode" in e?e:c.ajaxSettings).mode,d=("port" in e?e:c.ajaxSettings).port;if(f=="abort"){if(a[d]){a[d].abort()}return(a[d]=b.apply(this,arguments))}return b.apply(this,arguments)}}})(jQuery);(function(a){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(c,b){a.event.special[b]={setup:function(){this.addEventListener(c,d,true)},teardown:function(){this.removeEventListener(c,d,true)},handler:function(f){arguments[0]=a.event.fix(f);arguments[0].type=b;return a.event.handle.apply(this,arguments)}};function d(f){f=a.event.fix(f);f.type=b;return a.event.handle.call(this,f)}})}a.extend(a.fn,{validateDelegate:function(d,c,b){return this.bind(c,function(e){var f=a(e.target);if(f.is(d)){return b.apply(f,arguments)}})}})})(jQuery);(function(a){if(window.XDomainRequest){jQuery.ajaxTransport(function(c){if(c.crossDomain&&c.async){if(c.timeout){c.xdrTimeout=c.timeout;delete c.timeout}var b;return{send:function(e,d){function f(g,k,j,h){b.onload=b.onerror=b.ontimeout=jQuery.noop;b=null;d(g,k,j,h)}b=new XDomainRequest();if(c.type==="DELETE"){c.url=c.url+(/\?/.test(c.url)?"&":"?")+"_method=DELETE";c.type="POST"}else{if(c.type==="PUT"){c.url=c.url+(/\?/.test(c.url)?"&":"?")+"_method=PUT";c.type="POST"}}b.open(c.type,c.url);b.onload=function(){f(200,"OK",{text:b.responseText},"Content-Type: "+b.contentType)};b.onerror=function(){f(404,"Not Found")};if(c.xdrTimeout){b.ontimeout=function(){f(0,"timeout")};b.timeout=c.xdrTimeout}b.send((c.hasContent&&c.data)||null)},abort:function(){if(b){b.onerror=jQuery.noop();b.abort()}}}}})}})(jQuery);(function(a){a.fn.xBreadcrumbs=function(f){var e=a(this);var f=a.extend({},a.fn.xBreadcrumbs.defaults,f);function d(){if(f.collapsible){var h=e.children("LI").length;e.children("LI").children("A").css("white-space","nowrap").css("float","left");e.children("LI").children("A").each(function(j,k){if(j!=h-1){a(this).css("overflow","hidden");a(this).attr("init-width",a(this).width());a(this).width(f.collapsedWidth)}})}e.children("LI").mouseenter(function(){if(a(this).hasClass("hover")){return}g();if(!b(a(this))){return}var k=a(this).children("UL");c(k,true);if(f.collapsible&&!a(this).hasClass("current")){var j=a(this).children("A").attr("init-width");a(this).children("A").animate({width:j},"normal")}});e.children("LI").mouseleave(function(){var j=a(this).children("UL");c(j,false);if(f.collapsible&&!a(this).hasClass("current")){a(this).children("A").animate({width:f.collapsedWidth},"fast")}})}function g(){e.children("LI").children("UL").each(function(){a(this).hide();a(this).parent().removeClass("hover")})}function c(k,h){if(h){k.parent().addClass("hover");if(a.browser.msie){var j=k.parent().position();k.css("left",parseInt(j.left))}if(f.showSpeed!=""){k.fadeIn(f.showSpeed)}else{k.show()}}else{k.parent().removeClass("hover");if(f.hideSpeed!=""){k.fadeOut(f.hideSpeed)}else{k.hide()}}}function b(h){return h.children("UL").length>0}d()};a.fn.xBreadcrumbs.defaults={showSpeed:"fast",hideSpeed:"",collapsible:false,collapsedWidth:10}})(jQuery);"use strict";(function(){if(jQuery&&jQuery.jstree){return}var c=false,b=false,a=false;(function(g){g.vakata={};g.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(k,j){if(g.jstree.css.get_css(k,false,j)){return false}if(j.insertRule){j.insertRule(k+" { }",0)}else{j.addRule(k,null,0)}return g.vakata.css.get_css(k)},remove_css:function(k,j){return g.vakata.css.get_css(k,true,j)},add_sheet:function(k){var j=false,m=true;if(k.str){if(k.title){j=g("style[id='"+k.title+"-stylesheet']")[0]}if(j){m=false}else{j=document.createElement("style");j.setAttribute("type","text/css");if(k.title){j.setAttribute("id",k.title+"-stylesheet")}}if(j.styleSheet){if(m){document.getElementsByTagName("head")[0].appendChild(j);j.styleSheet.cssText=k.str}else{j.styleSheet.cssText=j.styleSheet.cssText+" "+k.str}}else{j.appendChild(document.createTextNode(k.str));document.getElementsByTagName("head")[0].appendChild(j)}return j.sheet||j.styleSheet}if(k.url){if(document.createStyleSheet){try{j=document.createStyleSheet(k.url)}catch(l){}}else{j=document.createElement("link");j.rel="stylesheet";j.type="text/css";j.media="all";j.href=k.url;document.getElementsByTagName("head")[0].appendChild(j);return j.styleSheet}}}};var h=[],f=-1,e={},d={};g.fn.jstree=function(m){var j=(typeof m=="string"),k=Array.prototype.slice.call(arguments,1),l=this;if(j){if(m.substring(0,1)=="_"){return l}this.each(function(){var n=h[g.data(this,"jstree_instance_id")],o=(n&&g.isFunction(n[m]))?n[m].apply(n,k):n;if(typeof o!=="undefined"&&(m.indexOf("is_")===0||(o!==true&&o!==false))){l=o;return false}})}else{this.each(function(){var r=g.data(this,"jstree_instance_id"),o=[],n=m?g.extend({},true,m):{},u=g(this),q=false,p=[];o=o.concat(k);if(u.data("jstree")){o.push(u.data("jstree"))}n=o.length?g.extend.apply(null,[true,n].concat(o)):n;if(typeof r!=="undefined"&&h[r]){h[r].destroy()}r=parseInt(h.push({}),10)-1;g.data(this,"jstree_instance_id",r);n.plugins=g.isArray(n.plugins)?n.plugins:g.jstree.defaults.plugins.slice();n.plugins.unshift("core");n.plugins=n.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");q=g.extend(true,{},g.jstree.defaults,n);q.plugins=n.plugins;g.each(e,function(s,t){if(g.inArray(s,q.plugins)===-1){q[s]=null;delete q[s]}else{p.push(s)}});q.plugins=p;h[r]=new g.jstree._instance(r,g(this).addClass("jstree jstree-"+r),q);g.each(h[r]._get_settings().plugins,function(s,t){h[r].data[t]={}});g.each(h[r]._get_settings().plugins,function(s,t){if(e[t]){e[t].__init.apply(h[r])}});setTimeout(function(){if(h[r]){h[r].init()}},0)})}return l};g.jstree={defaults:{plugins:[]},_focused:function(){return h[f]||null},_reference:function(j){if(h[j]){return h[j]}var k=g(j);if(!k.length&&typeof j==="string"){k=g("#"+j)}if(!k.length){return null}return h[k.closest(".jstree").data("jstree_instance_id")]||null},_instance:function(k,j,l){this.data={core:{}};this.get_settings=function(){return g.extend(true,{},l)};this._get_settings=function(){return l};this.get_index=function(){return k};this.get_container=function(){return j};this.get_container_ul=function(){return j.children("ul:eq(0)")};this._set_settings=function(m){l=g.extend(true,{},l,m)}},_fn:{},plugin:function(j,k){k=g.extend({},{__init:g.noop,__destroy:g.noop,_fn:{},defaults:false},k);e[j]=k;g.jstree.defaults[j]=k.defaults;g.each(k._fn,function(l,m){m.plugin=j;m.old=g.jstree._fn[l];g.jstree._fn[l]=function(){var n,p=m,o=Array.prototype.slice.call(arguments),r=new g.Event("before.jstree"),q=false;if(this.data.core.locked===true&&l!=="unlock"&&l!=="is_locked"){return}do{if(p&&p.plugin&&g.inArray(p.plugin,this._get_settings().plugins)!==-1){break}p=p.old}while(p);if(!p){return}if(l.indexOf("_")===0){n=p.apply(this,o)}else{n=this.get_container().triggerHandler(r,{func:l,inst:this,args:o,plugin:p.plugin});if(n===false){return}if(typeof n!=="undefined"){o=n}n=p.apply(g.extend({},this,{__callback:function(s){this.get_container().triggerHandler(l+".jstree",{inst:this,args:o,rslt:s,rlbk:q})},__rollback:function(){q=this.get_rollback();return q},__call_old:function(s){return p.old.apply(this,(s?Array.prototype.slice.call(arguments,1):o))}}),o)}return n};g.jstree._fn[l].old=m.old;g.jstree._fn[l].plugin=j})},rollback:function(j){if(j){if(!g.isArray(j)){j=[j]}g.each(j,function(k,l){h[l.i].set_rollback(l.h,l.d)})}}};g.jstree._fn=g.jstree._instance.prototype={};g(function(){var l=navigator.userAgent.toLowerCase(),k=(l.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],j=".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(l)&&parseInt(k,10)==6){c=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(m){}j+=".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(l)&&parseInt(k,10)==7){b=true;j+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "}if(!/compatible/.test(l)&&/mozilla/.test(l)&&parseFloat(k,10)<1.9){a=true;j+=".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; } "}g.vakata.css.add_sheet({str:j,title:"jstree"})});g.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",g.proxy(function(k){var j=g(k.target);this.toggle_node(j)},this)).bind("mousedown.jstree",g.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(k){var l;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){l=window.getSelection();try{l.removeAllRanges();l.collapse()}catch(j){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",g.proxy(function(l,k){var m=this._get_node(k.rslt.obj),j=this;if(m===-1){m=this.get_container_ul()}if(!m.length){return}m.find("li").each(function(){var n=g(this);if(n.data("jstree")){g.each(n.data("jstree"),function(p,o){if(j.data[p]&&g.isFunction(j["_"+p+"_notify"])){j["_"+p+"_notify"].call(j,n,o)}})}})},this))}if(this._get_settings().core.load_open){this.get_container().bind("load_node.jstree",g.proxy(function(l,k){var m=this._get_node(k.rslt.obj),j=this;if(m===-1){m=this.get_container_ul()}if(!m.length){return}m.find("li.jstree-open:not(:has(ul))").each(function(){j.load_node(this,g.noop,g.noop)})},this))}this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var j,m=this.get_index(),k=this._get_settings(),l=this;g.each(k.plugins,function(n,p){try{e[p].__destroy.apply(l)}catch(o){}});this.__callback();if(this.is_focused()){for(j in h){if(h.hasOwnProperty(j)&&j!=m){h[j].set_focus();break}}}if(m===f){f=-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,"")});g(document).unbind(".jstree-"+m).undelegate(".jstree-"+m);h[m]=null;delete h[m]},_core_notify:function(k,j){if(j.opened){this.open_node(k,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 j=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){j.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(j.data.core.to_open)},save_loaded:function(){},reload_nodes:function(k){var n=this,j=true,m=[],l=[];if(!k){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=g.map(g.makeArray(this.data.core.to_open),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.data.core.to_load=g.map(g.makeArray(this.data.core.to_load),function(o){return"#"+o.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){g.each(this.data.core.to_load,function(o,p){if(p=="#"){return true}if(g(p).length){m.push(p)}else{l.push(p)}});if(m.length){this.data.core.to_load=l;g.each(m,function(o,p){if(!n._is_loaded(p)){n.load_node(p,function(){n.reload_nodes(true)},function(){n.reload_nodes(true)});j=false}})}}if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(o,p){n.open_node(p,false,true)})}if(j){if(this.data.core.reopen){clearTimeout(this.data.core.reopen)}this.data.core.reopen=setTimeout(function(){n.__callback({},n)},50);this.data.core.refreshing=false;this.reopen()}},reopen:function(){var j=this;if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(k,l){j.open_node(l,false,true)})}this.__callback({})},refresh:function(j){var k=this;this.save_opened();if(!j){j=-1}j=this._get_node(j);if(!j){j=-1}if(j!==-1){j.children("UL").remove()}else{this.get_container_ul().empty()}this.load_node(j,function(){k.__callback({obj:j});k.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused()){return}var j=g.jstree._focused();if(j){j.unset_focus()}this.get_container().addClass("jstree-focused");f=this.get_index();this.__callback()},is_focused:function(){return f==this.get_index()},unset_focus:function(){if(this.is_focused()){this.get_container().removeClass("jstree-focused");f=-1}this.__callback()},_get_node:function(j){var k=g(j,this.get_container());if(k.is(".jstree")||j==-1){return -1}k=k.closest("li",this.get_container());return k.length?k:false},_get_next:function(k,j){k=this._get_node(k);if(k===-1){return this.get_container().find("> ul > li:first-child")}if(!k.length){return false}if(j){return(k.nextAll("li").size()>0)?k.nextAll("li:eq(0)"):false}if(k.hasClass("jstree-open")){return k.find("li:eq(0)")}else{if(k.nextAll("li").size()>0){return k.nextAll("li:eq(0)")}else{return k.parentsUntil(".jstree","li").next("li").eq(0)}}},_get_prev:function(k,j){k=this._get_node(k);if(k===-1){return this.get_container().find("> ul > li:last-child")}if(!k.length){return false}if(j){return(k.prevAll("li").length>0)?k.prevAll("li:eq(0)"):false}if(k.prev("li").length){k=k.prev("li").eq(0);while(k.hasClass("jstree-open")){k=k.children("ul:eq(0)").children("li:last")}return k}else{var l=k.parentsUntil(".jstree","li:eq(0)");return l.length?l:false}},_get_parent:function(j){j=this._get_node(j);if(j==-1||!j.length){return false}var k=j.parentsUntil(".jstree","li:eq(0)");return k.length?k:-1},_get_children:function(j){j=this._get_node(j);if(j===-1){return this.get_container().children("ul:eq(0)").children("li")}if(!j.length){return false}return j.children("ul:eq(0)").children("li")},get_path:function(l,j){var k=[],m=this;l=this._get_node(l);if(l===-1||!l||!l.length){return false}l.parentsUntil(".jstree","li").each(function(){k.push(j?this.id:m.get_text(this))});k.reverse();k.push(j?l.attr("id"):this.get_text(l));return k},_get_string:function(j){return this._get_settings().core.strings[j]||j},is_open:function(j){j=this._get_node(j);return j&&j!==-1&&j.hasClass("jstree-open")},is_closed:function(j){j=this._get_node(j);return j&&j!==-1&&j.hasClass("jstree-closed")},is_leaf:function(j){j=this._get_node(j);return j&&j!==-1&&j.hasClass("jstree-leaf")},correct_state:function(j){j=this._get_node(j);if(!j||j===-1){return false}j.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:j})},open_node:function(m,n,k){m=this._get_node(m);if(!m.length){return false}if(!m.hasClass("jstree-closed")){if(n){n.call()}return false}var l=k||c?0:this._get_settings().core.animation,j=this;if(!this._is_loaded(m)){m.children("a").addClass("jstree-loading");this.load_node(m,function(){j.open_node(m,n,k)},n)}else{if(this._get_settings().core.open_parents){m.parentsUntil(".jstree",".jstree-closed").each(function(){j.open_node(this,false,true)})}if(l){m.children("ul").css("display","none")}m.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");if(l){m.children("ul").stop(true,true).slideDown(l,function(){this.style.display="";j.after_open(m)})}else{j.after_open(m)}this.__callback({obj:m});if(n){n.call()}}},after_open:function(j){this.__callback({obj:j})},close_node:function(m,k){m=this._get_node(m);var l=k||c?0:this._get_settings().core.animation,j=this;if(!m.length||!m.hasClass("jstree-open")){return false}if(l){m.children("ul").attr("style","display:block !important")}m.removeClass("jstree-open").addClass("jstree-closed");if(l){m.children("ul").stop(true,true).slideUp(l,function(){this.style.display="";j.after_close(m)})}else{j.after_close(m)}this.__callback({obj:m})},after_close:function(j){this.__callback({obj:j})},toggle_node:function(j){j=this._get_node(j);if(j.hasClass("jstree-closed")){return this.open_node(j)}if(j.hasClass("jstree-open")){return this.close_node(j)}},open_all:function(l,k,j){l=l?this._get_node(l):-1;if(!l||l===-1){l=this.get_container_ul()}if(j){l=l.find("li.jstree-closed")}else{j=l;if(l.is(".jstree-closed")){l=l.find("li.jstree-closed").andSelf()}else{l=l.find("li.jstree-closed")}}var m=this;l.each(function(){var n=this;if(!m._is_loaded(this)){m.open_node(this,function(){m.open_all(n,k,j)},!k)}else{m.open_node(this,false,!k)}});if(j.find("li.jstree-closed").length===0){this.__callback({obj:j})}},close_all:function(k,j){var l=this;k=k?this._get_node(k):this.get_container();if(!k||k===-1){k=this.get_container_ul()}k.find("li.jstree-open").andSelf().each(function(){l.close_node(this,!j)});this.__callback({obj:k})},clean_node:function(j){j=j&&j!=-1?g(j):this.get_container_ul();j=j.is("li")?j.find("li").andSelf():j.find("li");j.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");j.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:j})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(j,k){this.get_container().empty().append(j);this.data=k;this.__callback()},load_node:function(l,j,k){this.__callback({obj:l})},_is_loaded:function(j){return true},create_node:function(o,j,n,q,k){o=this._get_node(o);j=typeof j==="undefined"?"last":j;var p=g("<li />"),m=this._get_settings().core,l;if(o!==-1&&!o.length){return false}if(!k&&!this._is_loaded(o)){this.load_node(o,function(){this.create_node(o,j,n,q,true)});return false}this.__rollback();if(typeof n==="string"){n={data:n}}if(!n){n={}}if(n.attr){p.attr(n.attr)}if(n.metadata){p.data(n.metadata)}if(n.state){p.addClass("jstree-"+n.state)}if(!n.data){n.data=this._get_string("new_node")}if(!g.isArray(n.data)){l=n.data;n.data=[];n.data.push(l)}g.each(n.data,function(s,r){l=g("<a />");if(g.isFunction(r)){r=r.call(this,n)}if(typeof r=="string"){l.attr("href","#")[m.html_titles?"html":"text"](r)}else{if(!r.attr){r.attr={}}if(!r.attr.href){r.attr.href="#"}l.attr(r.attr)[m.html_titles?"html":"text"](r.title);if(r.language){l.addClass(r.language)}}l.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!r.icon&&n.icon){r.icon=n.icon}if(r.icon){if(r.icon.indexOf("/")===-1){l.children("ins").addClass(r.icon)}else{l.children("ins").css("background","url('"+r.icon+"') center center no-repeat")}}p.append(l)});p.prepend("<ins class='jstree-icon'>&#160;</ins>");if(o===-1){o=this.get_container();if(j==="before"){j="first"}if(j==="after"){j="last"}}switch(j){case"before":o.before(p);l=this._get_parent(o);break;case"after":o.after(p);l=this._get_parent(o);break;case"inside":case"first":if(!o.children("ul").length){o.append("<ul />")}o.children("ul").prepend(p);l=o;break;case"last":if(!o.children("ul").length){o.append("<ul />")}o.children("ul").append(p);l=o;break;default:if(!o.children("ul").length){o.append("<ul />")}if(!j){j=0}l=o.children("ul").children("li").eq(j);if(l.length){l.before(p)}else{o.children("ul").append(p)}l=o;break}if(l===-1||l.get(0)===this.get_container().get(0)){l=-1}this.clean_node(l);this.__callback({obj:p,parent:l});if(q){q.call(this,p)}return p},get_text:function(k){k=this._get_node(k);if(!k.length){return false}var j=this._get_settings().core.html_titles;k=k.children("a:eq(0)");if(j){k=k.clone();k.children("INS").remove();return k.html()}else{k=k.contents().filter(function(){return this.nodeType==3})[0];return k.nodeValue}},set_text:function(k,l){k=this._get_node(k);if(!k.length){return false}k=k.children("a:eq(0)");if(this._get_settings().core.html_titles){var j=k.children("INS").clone();k.html(l).prepend(j);this.__callback({obj:k,name:l});return true}else{k=k.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:k,name:l});return(k.nodeValue=l)}},rename_node:function(j,k){j=this._get_node(j);this.__rollback();if(j&&j.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))){this.__callback({obj:j,name:k})}},delete_node:function(m){m=this._get_node(m);if(!m.length){return false}this.__rollback();var l=this._get_parent(m),k=g([]),j=this;m.each(function(){k=k.add(j._get_prev(this))});m=m.detach();if(l!==-1&&l.find("> ul > li").length===0){l.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}this.clean_node(l);this.__callback({obj:m,prev:k,parent:l});return m},prepare_move:function(n,l,q,j,k){var m={};m.ot=g.jstree._reference(n)||this;m.o=m.ot._get_node(n);m.r=l===-1?-1:this._get_node(l);m.p=(typeof q==="undefined"||q===false)?"last":q;if(!k&&d.o&&d.o[0]===m.o[0]&&d.r[0]===m.r[0]&&d.p===m.p){this.__callback(d);if(j){j.call(this,d)}return}m.ot=g.jstree._reference(m.o)||this;m.rt=g.jstree._reference(m.r)||this;if(m.r===-1||!m.r){m.cr=-1;switch(m.p){case"first":case"before":case"inside":m.cp=0;break;case"after":case"last":m.cp=m.rt.get_container().find(" > ul > li").length;break;default:m.cp=m.p;break}}else{if(!/^(before|after)$/.test(m.p)&&!this._is_loaded(m.r)){return this.load_node(m.r,function(){this.prepare_move(n,l,q,j,true)})}switch(m.p){case"before":m.cp=m.r.index();m.cr=m.rt._get_parent(m.r);break;case"after":m.cp=m.r.index()+1;m.cr=m.rt._get_parent(m.r);break;case"inside":case"first":m.cp=0;m.cr=m.r;break;case"last":m.cp=m.r.find(" > ul > li").length;m.cr=m.r;break;default:m.cp=m.p;m.cr=m.r;break}}m.np=m.cr==-1?m.rt.get_container():m.cr;m.op=m.ot._get_parent(m.o);m.cop=m.o.index();if(m.op===-1){m.op=m.ot?m.ot.get_container():this.get_container()}if(!/^(before|after)$/.test(m.p)&&m.op&&m.np&&m.op[0]===m.np[0]&&m.o.index()<m.cp){m.cp++}m.or=m.np.find(" > ul > li:nth-child("+(m.cp+1)+")");d=m;this.__callback(d);if(j){j.call(this,d)}},check_move:function(){var l=d,j=true,k=l.r===-1?this.get_container():l.r;if(!l||!l.o||l.or[0]===l.o[0]){return false}if(!l.cy){if(l.op&&l.np&&l.op[0]===l.np[0]&&l.cp-1===l.o.index()){return false}l.o.each(function(){if(k.parentsUntil(".jstree","li").andSelf().index(this)!==-1){j=false;return false}})}return j},move_node:function(q,m,j,l,k,p){if(!k){return this.prepare_move(q,m,j,function(o){this.move_node(o,false,false,l,true,p)})}if(l){d.cy=true}if(!p&&!this.check_move()){return false}this.__rollback();var r=false;if(l){r=q.o.clone(true);r.find("*[id]").andSelf().each(function(){if(this.id){this.id="copy_"+this.id}})}else{r=q.o}if(q.or.length){q.or.before(r)}else{if(!q.np.children("ul").length){g("<ul />").appendTo(q.np)}q.np.children("ul:eq(0)").append(r)}try{q.ot.clean_node(q.op);q.rt.clean_node(q.np);if(!q.op.find("> ul > li").length){q.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}}catch(n){}if(l){d.cy=true;d.oc=r}this.__callback(d);return d},_get_move:function(){return d}}})})(jQuery);(function(d){var g,f,e;d(function(){if(/msie/.test(navigator.userAgent.toLowerCase())){f=d('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");e=d('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");g=f.width()-e.width();f.add(e).remove()}else{f=d("<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});g=100-f.width();f.parent().remove()}});d.jstree.plugin("ui",{__init:function(){this.data.ui.selected=d();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",d.proxy(function(h){h.preventDefault();h.currentTarget.blur();if(!d(h.currentTarget).hasClass("jstree-loading")){this.select_node(h.currentTarget,true,h)}},this)).delegate("a","mouseenter.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.hover_node(h.target)}},this)).delegate("a","mouseleave.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.dehover_node(h.target)}},this)).bind("reopen.jstree",d.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",d.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",d.proxy(function(){this.reselect()},this)).bind("close_node.jstree",d.proxy(function(j,k){var h=this._get_settings().ui,l=this._get_node(k.rslt.obj),m=(l&&l.length)?l.children("ul").find("a.jstree-clicked"):d(),n=this;if(h.selected_parent_close===false||!m.length){return}m.each(function(){n.deselect_node(this);if(h.selected_parent_close==="select_parent"){n.select_node(l)}})},this)).bind("delete_node.jstree",d.proxy(function(j,k){var h=this._get_settings().ui.select_prev_on_delete,l=this._get_node(k.rslt.obj),m=(l&&l.length)?l.find("a.jstree-clicked"):[],n=this;m.each(function(){n.deselect_node(this)});if(h&&m.length){k.rslt.prev.each(function(){if(this.parentNode){n.select_node(this);return false}})}},this)).bind("move_node.jstree",d.proxy(function(h,j){if(j.rslt.cy){j.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(h,j){if(typeof h==="undefined"||h===null){return j?this.data.ui.selected:this.data.ui.last_selected}var k=d(h,this.get_container());if(k.is(".jstree")||h==-1){return -1}k=k.closest("li",this.get_container());return k.length?k:false},_ui_notify:function(j,h){if(h.selected){this.select_node(j,false)}},save_selected:function(){var h=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){if(this.id){h.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 j=this,h=this.data.ui.to_select;h=d.map(d.makeArray(h),function(k){return"#"+k.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});d.each(h,function(k,l){if(l&&l!=="#"){j.select_node(l)}});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(h){this.save_selected();return this.__call_old()},hover_node:function(h){h=this._get_node(h);if(!h.length){return false}if(!h.hasClass("jstree-hovered")){this.dehover_node()}this.data.ui.hovered=h.children("a").addClass("jstree-hovered").parent();this._fix_scroll(h);this.__callback({obj:h})},dehover_node:function(){var j=this.data.ui.hovered,h;if(!j||!j.length){return false}h=j.children("a").removeClass("jstree-hovered").parent();if(this.data.ui.hovered[0]===h[0]){this.data.ui.hovered=null}this.__callback({obj:j})},select_node:function(l,h,m){l=this._get_node(l);if(l==-1||!l||!l.length){return false}var q=this._get_settings().ui,o=(q.select_multiple_modifier=="on"||(q.select_multiple_modifier!==false&&m&&m[q.select_multiple_modifier+"Key"])),j=(q.select_range_modifier!==false&&m&&m[q.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==l[0]&&this.data.ui.last_selected.parent()[0]===l.parent()[0]),k=this.is_selected(l),n=true,p=this;if(h){if(q.disable_selecting_children&&o&&((l.parentsUntil(".jstree","li").children("a.jstree-clicked").length)||(l.children("ul").find("a.jstree-clicked:eq(0)").length))){return false}n=false;switch(!0){case (j):this.data.ui.last_selected.addClass("jstree-last-selected");l=l[l.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();if(q.select_limit==-1||l.length<q.select_limit){this.data.ui.last_selected.removeClass("jstree-last-selected");this.data.ui.selected.each(function(){if(this!==p.data.ui.last_selected[0]){p.deselect_node(this)}});k=false;n=true}else{n=false}break;case (k&&!o):this.deselect_all();k=false;n=true;break;case (!k&&!o):if(q.select_limit==-1||q.select_limit>0){this.deselect_all();n=true}break;case (k&&o):this.deselect_node(l);break;case (!k&&o):if(q.select_limit==-1||this.data.ui.selected.length+1<=q.select_limit){n=true}break}}if(n&&!k){if(!j){this.data.ui.last_selected=l}l.children("a").addClass("jstree-clicked");if(q.selected_parent_open){l.parents(".jstree-closed").each(function(){p.open_node(this,false,true)})}this.data.ui.selected=this.data.ui.selected.add(l);this._fix_scroll(l.eq(0));this.__callback({obj:l,e:m})}},_fix_scroll:function(j){var k=this.get_container()[0],h;if(k.scrollHeight>k.offsetHeight){j=this._get_node(j);if(!j||j===-1||!j.length||!j.is(":visible")){return}h=j.offset().top-this.get_container().offset().top;if(h<0){k.scrollTop=k.scrollTop+h-1}if(h+this.data.core.li_height+(k.scrollWidth>k.offsetWidth?g:0)>k.offsetHeight){k.scrollTop=k.scrollTop+(h-k.offsetHeight+this.data.core.li_height+1+(k.scrollWidth>k.offsetWidth?g:0))}}},deselect_node:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){h.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(h);if(this.data.ui.last_selected.get(0)===h.get(0)){this.data.ui.last_selected=this.data.ui.selected.eq(0)}this.__callback({obj:h})}},toggle_select:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){this.deselect_node(h)}else{this.select_node(h)}},is_selected:function(h){return this.data.ui.selected.index(this._get_node(h))>=0},get_selected:function(h){return h?d(h).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(j){var h=j?d(j).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();h.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=d([]);this.data.ui.last_selected=false;this.__callback({obj:h})}}});d.jstree.defaults.plugins.push("ui")})(jQuery);(function(d){d.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",d.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(e){return true}}},_fn:{_show_input:function(e,m){e=this._get_node(e);var k=this._get_settings().core.rtl,l=this._get_settings().crrm.input_width_limit,g=e.children("ins").width(),f=e.find("> a:visible > ins").width()*e.find("> a:visible > ins").length,n=this.get_text(e),j=d("<div />",{css:{position:"absolute",top:"-200px",left:(k?"0px":"-1000px"),visibility:"hidden"}}).appendTo("body"),h=e.css("position","relative").append(d("<input />",{value:n,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:(k?"auto":(g+f+4)+"px"),right:(k?(g+f+4)+"px":"auto"),top:"0px",height:(this.data.core.li_height-2)+"px",lineHeight:(this.data.core.li_height-2)+"px",width:"150px"},blur:d.proxy(function(){var p=e.children(".jstree-rename-input"),o=p.val();if(o===""){o=n}j.remove();p.remove();this.set_text(e,n);this.rename_node(e,o);m.call(this,e,o,n);e.css("position","")},this),keyup:function(p){var o=p.keyCode||p.which;if(o==27){this.value=n;this.blur();return}else{if(o==13){this.blur();return}else{h.width(Math.min(j.text("pW"+this.value).width(),l))}}},keypress:function(p){var o=p.keyCode||p.which;if(o==13){return false}}})).children(".jstree-rename-input");this.set_text(e,"");j.css({fontFamily:h.css("fontFamily")||"",fontSize:h.css("fontSize")||"",fontWeight:h.css("fontWeight")||"",fontStyle:h.css("fontStyle")||"",fontStretch:h.css("fontStretch")||"",fontVariant:h.css("fontVariant")||"",letterSpacing:h.css("letterSpacing")||"",wordSpacing:h.css("wordSpacing")||""});h.width(Math.min(j.text("pW"+h[0].value).width(),l))[0].select()},rename:function(g){g=this._get_node(g);this.__rollback();var e=this.__callback;this._show_input(g,function(j,h,f){e.call(this,{obj:j,new_name:h,old_name:f})})},create:function(j,f,h,l,e){var g,k=this;j=this._get_node(j);if(!j){j=-1}this.__rollback();g=this.create_node(j,f,h,function(m){var n=this._get_parent(m),o=d(m).index();if(l){l.call(this,m)}if(n.length&&n.hasClass("jstree-closed")){this.open_node(n,false,true)}if(!e){this._show_input(m,function(r,q,p){k.__callback({obj:r,name:q,parent:n,position:o})})}else{k.__callback({obj:m,name:this.get_text(m),parent:n,position:o})}});return g},remove:function(g){g=this._get_node(g,true);var f=this._get_parent(g),e=this._get_prev(g);this.__rollback();g=this.delete_node(g);if(g!==false){this.__callback({obj:g,prev:e,parent:f})}},check_move:function(){if(!this.__call_old()){return false}var e=this._get_settings().crrm.move;if(!e.check_move.call(this,this._get_move())){return false}return true},move_node:function(l,j,e,g,f,k){var h=this._get_settings().crrm.move;if(!f){if(typeof e==="undefined"){e=h.default_position}if(e==="inside"&&!h.default_position.match(/^(before|after)$/)){e=h.default_position}return this.__call_old(true,l,j,e,g,false,k)}if(h.always_copy===true||(h.always_copy==="multitree"&&l.rt.get_index()!==l.ot.get_index())){g=true}this.__call_old(true,l,j,e,g,true,k)},cut:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=e;this.__callback({obj:e})},copy:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.ct_nodes=false;this.data.crrm.cp_nodes=e;this.__callback({obj:e})},paste:function(f){f=this._get_node(f);if(!f||!f.length){return false}var e=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,f);this.data.crrm.ct_nodes=false}if(this.data.crrm.cp_nodes){this.move_node(this.data.crrm.cp_nodes,f,false,true)}this.__callback({obj:f,nodes:e})}}})})(jQuery);(function(d){var e=[];d.jstree._themes=false;d.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",d.proxy(function(){var f=this._get_settings().themes;this.data.themes.dots=f.dots;this.data.themes.icons=f.icons;this.set_theme(f.theme,f.url)},this)).bind("loaded.jstree",d.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(g,f){if(!g){return false}if(!f){f=d.jstree._themes+g+"/style.css"}if(d.inArray(f,e)==-1){d.vakata.css.add_sheet({url:f});e.push(f)}if(this.data.themes.theme!=g){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=g}this.get_container().addClass("jstree-"+g);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()}}}});d(function(){if(d.jstree._themes===false){d("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){d.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}})}if(d.jstree._themes===false){d.jstree._themes="themes/"}});d.jstree.defaults.plugins.push("themes")})(jQuery);(function(f){var e=[];function d(h,j){var k=f.jstree._focused(),g;if(k&&k.data&&k.data.hotkeys&&k.data.hotkeys.enabled){g=k._get_settings().hotkeys[h];if(g){return g.call(k,j)}}}f.jstree.plugin("hotkeys",{__init:function(){if(typeof f.hotkeys==="undefined"){throw"jsTree hotkeys: jQuery hotkeys plugin not included."}if(!this.data.ui){throw"jsTree hotkeys: jsTree UI plugin not included."}f.each(this._get_settings().hotkeys,function(h,g){if(g!==false&&f.inArray(h,e)==-1){f(document).bind("keydown",h,function(j){return d(h,j)});e.push(h)}});this.get_container().bind("lock.jstree",f.proxy(function(){if(this.data.hotkeys.enabled){this.data.hotkeys.enabled=false;this.data.hotkeys.revert=true}},this)).bind("unlock.jstree",f.proxy(function(){if(this.data.hotkeys.revert){this.data.hotkeys.enabled=true}},this));this.enable_hotkeys()},defaults:{up:function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},"ctrl+up":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},"shift+up":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_prev(g));return false},down:function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},"ctrl+down":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},"shift+down":function(){var g=this.data.ui.hovered||this.data.ui.last_selected||-1;this.hover_node(this._get_next(g));return false},left:function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},"ctrl+left":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},"shift+left":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g){if(g.hasClass("jstree-open")){this.close_node(g)}else{this.hover_node(this._get_prev(g))}}return false},right:function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},"ctrl+right":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},"shift+right":function(){var g=this.data.ui.hovered||this.data.ui.last_selected;if(g&&g.length){if(g.hasClass("jstree-closed")){this.open_node(g)}else{this.hover_node(this._get_next(g))}}return false},space:function(){if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").click()}return false},"ctrl+space":function(g){g.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(g)}return false},"shift+space":function(g){g.type="click";if(this.data.ui.hovered){this.data.ui.hovered.children("a:eq(0)").trigger(g)}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(d){d.jstree.plugin("json_data",{__init:function(){var e=this._get_settings().json_data;if(e.progressive_unload){this.get_container().bind("after_close.jstree",function(g,f){f.rslt.obj.children("ul").remove()})}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(g,e,f){var h=this;this.load_node_json(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(f){var e=this._get_settings().json_data;f=this._get_node(f);return f==-1||!f||(!e.ajax&&!e.progressive_render&&!d.isFunction(e.data))||f.is(".jstree-open, .jstree-leaf")||f.children("ul").children("li").length>0},refresh:function(f){f=this._get_node(f);var e=this._get_settings().json_data;if(f&&f!==-1&&e.progressive_unload&&(d.isFunction(e.data)||!!e.ajax)){f.removeData("jstree_children")}return this.__call_old()},load_node_json:function(j,e,g){var h=this.get_settings().json_data,l,f=function(){},k=function(){};j=this._get_node(j);if(j&&j!==-1&&(h.progressive_render||h.progressive_unload)&&!j.is(".jstree-open, .jstree-leaf")&&j.children("ul").children("li").length===0&&j.data("jstree_children")){l=this._parse_json(j.data("jstree_children"),j);if(l){j.append(l);if(!h.progressive_unload){j.removeData("jstree_children")}}this.clean_node(j);if(e){e.call(this)}return}if(j&&j!==-1){if(j.data("jstree_is_loading")){return}else{j.data("jstree_is_loading",true)}}switch(!0){case (!h.data&&!h.ajax):throw"Neither data nor ajax settings supplied.";case (d.isFunction(h.data)):h.data.call(this,j,d.proxy(function(m){m=this._parse_json(m,j);if(!m){if(j===-1||!j){if(h.correct_state){this.get_container().children("ul").empty()}}else{j.children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(j)}}if(g){g.call(this)}}else{if(j===-1||!j){this.get_container().children("ul").empty().append(m.children())}else{j.append(m).children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading")}this.clean_node(j);if(e){e.call(this)}}},this));break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!j||j===-1)):if(!j||j==-1){l=this._parse_json(h.data,j);if(l){this.get_container().children("ul").empty().append(l.children());this.clean_node()}else{if(h.correct_state){this.get_container().children("ul").empty()}}}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&j&&j!==-1):f=function(n,o,p){var m=this.get_settings().json_data.ajax.error;if(m){m.call(this,n,o,p)}if(j!=-1&&j.length){j.children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading");if(o==="success"&&h.correct_state){this.correct_state(j)}}else{if(o==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};k=function(p,n,m){var o=this.get_settings().json_data.ajax.success;if(o){p=o.call(this,p,n,m)||p}if(p===""||(p&&p.toString&&p.toString().replace(/^[\s\n]+$/,"")==="")||(!d.isArray(p)&&!d.isPlainObject(p))){return f.call(this,m,n,"")}p=this._parse_json(p,j);if(p){if(j===-1||!j){this.get_container().children("ul").empty().append(p.children())}else{j.append(p).children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading")}this.clean_node(j);if(e){e.call(this)}}else{if(j===-1||!j){if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}else{j.children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(j);if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=k;if(!h.ajax.dataType){h.ajax.dataType="json"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,j)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,j)}d.ajax(h.ajax);break}},_parse_json:function(e,k,q){var m=false,f=this._get_settings(),u=f.json_data,r=f.core.html_titles,l,h,g,o,n;if(!e){return m}if(u.progressive_unload&&k&&k!==-1){k.data("jstree_children",m)}if(d.isArray(e)){m=d();if(!e.length){return false}for(h=0,g=e.length;h<g;h++){l=this._parse_json(e[h],k,true);if(l.length){m=m.add(l)}}}else{if(typeof e=="string"){e={data:e}}if(!e.data&&e.data!==""){return m}m=d("<li />");if(e.attr){m.attr(e.attr)}if(e.metadata){m.data(e.metadata)}if(e.state){m.addClass("jstree-"+e.state)}if(!d.isArray(e.data)){l=e.data;e.data=[];e.data.push(l)}d.each(e.data,function(p,j){l=d("<a />");if(d.isFunction(j)){j=j.call(this,e)}if(typeof j=="string"){l.attr("href","#")[r?"html":"text"](j)}else{if(!j.attr){j.attr={}}if(!j.attr.href){j.attr.href="#"}l.attr(j.attr)[r?"html":"text"](j.title);if(j.language){l.addClass(j.language)}}l.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!j.icon&&e.icon){j.icon=e.icon}if(j.icon){if(j.icon.indexOf("/")===-1){l.children("ins").addClass(j.icon)}else{l.children("ins").css("background","url('"+j.icon+"') center center no-repeat")}}m.append(l)});m.prepend("<ins class='jstree-icon'>&#160;</ins>");if(e.children){if(u.progressive_render&&e.state!=="open"){m.addClass("jstree-closed").data("jstree_children",e.children)}else{if(u.progressive_unload){m.data("jstree_children",e.children)}if(d.isArray(e.children)&&e.children.length){l=this._parse_json(e.children,k,true);if(l.length){n=d("<ul />");n.append(l);m.append(n)}}}}}if(!q){o=d("<ul />");o.append(m);m=o}return m},get_json:function(k,g,e,o){var r=[],q=this._get_settings(),l=this,j,h,n,m,p,f;k=this._get_node(k);if(!k||k===-1){k=this.get_container().find("> ul > li")}g=d.isArray(g)?g:["id","class"];if(!o&&this.data.types){g.push(q.types.type_attr)}e=d.isArray(e)?e:[];k.each(function(){n=d(this);j={data:[]};if(g.length){j.attr={}}d.each(g,function(t,s){h=n.attr(s);if(h&&h.length&&h.replace(/jstree[^ ]*/ig,"").length){j.attr[s]=(" "+h).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}});if(n.hasClass("jstree-open")){j.state="open"}if(n.hasClass("jstree-closed")){j.state="closed"}if(n.data()){j.metadata=n.data()}m=n.children("a");m.each(function(){p=d(this);if(e.length||d.inArray("languages",q.plugins)!==-1||p.children("ins").get(0).style.backgroundImage.length||(p.children("ins").get(0).className&&p.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length)){f=false;if(d.inArray("languages",q.plugins)!==-1&&d.isArray(q.languages)&&q.languages.length){d.each(q.languages,function(s,t){if(p.hasClass(t)){f=t;return false}})}h={attr:{},title:l.get_text(p,f)};d.each(e,function(s,t){h.attr[t]=(" "+(p.attr(t)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});if(d.inArray("languages",q.plugins)!==-1&&d.isArray(q.languages)&&q.languages.length){d.each(q.languages,function(s,t){if(p.hasClass(t)){h.language=t;return true}})}if(p.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){h.icon=p.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}if(p.children("ins").get(0).style.backgroundImage.length){h.icon=p.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}}else{h=l.get_text(p)}if(m.length>1){j.data.push(h)}else{j.data=h}});n=n.find("> ul > li");if(n.length){j.children=l.get_json(n,g,e,true)}r.push(j)});return r}}})})(jQuery);(function(e){var d=false;e.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(h){var j=this._get_settings().languages,g=false,f=".jstree-"+this.get_index()+" a";if(!e.isArray(j)||j.length===0){return false}if(e.inArray(h,j)==-1){if(!!j[h]){h=j[h]}else{return false}}if(h==this.data.languages.current_language){return true}g=e.vakata.css.get_css(f+"."+this.data.languages.current_language,false,d);if(g!==false){g.style.display="none"}g=e.vakata.css.get_css(f+"."+h,false,d);if(g!==false){g.style.display=""}this.data.languages.current_language=h;this.__callback(h);return true},get_lang:function(){return this.data.languages.current_language},_get_string:function(f,j){var h=this._get_settings().languages,g=this._get_settings().core.strings;if(e.isArray(h)&&h.length){j=(j&&e.inArray(j,h)!=-1)?j:this.data.languages.current_language}if(g[j]&&g[j][f]){return g[j][f]}if(g[f]){return g[f]}return f},get_text:function(h,j){h=this._get_node(h)||this.data.ui.last_selected;if(!h.size()){return false}var g=this._get_settings().languages,f=this._get_settings().core.html_titles;if(e.isArray(g)&&g.length){j=(j&&e.inArray(j,g)!=-1)?j:this.data.languages.current_language;h=h.children("a."+j)}else{h=h.children("a:eq(0)")}if(f){h=h.clone();h.children("INS").remove();return h.html()}else{h=h.contents().filter(function(){return this.nodeType==3})[0];return h.nodeValue}},set_text:function(j,l,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,f;if(e.isArray(h)&&h.length){k=(k&&e.inArray(k,h)!=-1)?k:this.data.languages.current_language;j=j.children("a."+k)}else{j=j.children("a:eq(0)")}if(g){f=j.children("INS").clone();j.html(l).prepend(f);this.__callback({obj:j,name:l,lang:k});return true}else{j=j.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:j,name:l,lang:k});return(j.nodeValue=l)}},_load_css:function(){var h=this._get_settings().languages,j="/* languages css */",f=".jstree-"+this.get_index()+" a",g;if(e.isArray(h)&&h.length){this.data.languages.current_language=h[0];for(g=0;g<h.length;g++){j+=f+"."+h[g]+" {";if(h[g]!=this.data.languages.current_language){j+=" display:none; "}j+=" } "}d=e.vakata.css.add_sheet({str:j,title:"jstree-languages"})}},create_node:function(j,f,h,k){var g=this.__call_old(true,j,f,h,function(m){var o=this._get_settings().languages,l=m.children("a"),n;if(e.isArray(o)&&o.length){for(n=0;n<o.length;n++){if(!l.is("."+o[n])){m.append(l.eq(0).clone().removeClass(o.join(" ")).addClass(o[n]))}}l.not("."+o.join(", .")).remove()}if(k){k.call(this,m)}});return g}}})})(jQuery);(function(d){d.jstree.plugin("cookies",{__init:function(){if(typeof d.cookie==="undefined"){throw"jsTree cookie: jQuery cookie plugin not included."}var f=this._get_settings().cookies,e;if(!!f.save_loaded){e=d.cookie(f.save_loaded);if(e&&e.length){this.data.core.to_load=e.split(",")}}if(!!f.save_opened){e=d.cookie(f.save_opened);if(e&&e.length){this.data.core.to_open=e.split(",")}}if(!!f.save_selected){e=d.cookie(f.save_selected);if(e&&e.length&&this.data.ui){this.data.ui.to_select=e.split(",")}}this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",d.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",d.proxy(function(g){if(this._get_settings().cookies.auto_save){this.save_cookie((g.handleObj.namespace+g.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(f){if(this.data.core.refreshing){return}var e=this._get_settings().cookies;if(!f){if(e.save_loaded){this.save_loaded();d.cookie(e.save_loaded,this.data.core.to_load.join(","),e.cookie_options)}if(e.save_opened){this.save_opened();d.cookie(e.save_opened,this.data.core.to_open.join(","),e.cookie_options)}if(e.save_selected&&this.data.ui){this.save_selected();d.cookie(e.save_selected,this.data.ui.to_select.join(","),e.cookie_options)}return}switch(f){case"open_node":case"close_node":if(!!e.save_opened){this.save_opened();d.cookie(e.save_opened,this.data.core.to_open.join(","),e.cookie_options)}if(!!e.save_loaded){this.save_loaded();d.cookie(e.save_loaded,this.data.core.to_load.join(","),e.cookie_options)}break;case"select_node":case"deselect_node":if(!!e.save_selected&&this.data.ui){this.save_selected();d.cookie(e.save_selected,this.data.ui.to_select.join(","),e.cookie_options)}break}}}})})(jQuery);(function(d){d.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",d.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",d.proxy(function(g,f){this.sort(f.rslt.obj.parent())},this)).bind("move_node.jstree",d.proxy(function(h,g){var f=g.rslt.np==-1?this.get_container():g.rslt.np;this.sort(f.children("ul"))},this))},defaults:function(f,e){return this.get_text(f)>this.get_text(e)?1:-1},_fn:{sort:function(g){var f=this._get_settings().sort,e=this;g.append(d.makeArray(g.children("li")).sort(d.proxy(f,e)));g.find("> li > ul").each(function(){e.sort(d(this))});this.clean_node(g)}}})})(jQuery);(function(k){var f=false,d=false,g=false,h=false,l=false,e=false,p=false,n=false,j=false;k.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(r,q,m){if(k.vakata.dnd.is_drag){k.vakata.drag_stop({})}try{r.currentTarget.unselectable="on";r.currentTarget.onselectstart=function(){return false};if(r.currentTarget.style){r.currentTarget.style.MozUserSelect="none"}}catch(o){}k.vakata.dnd.init_x=r.pageX;k.vakata.dnd.init_y=r.pageY;k.vakata.dnd.user_data=q;k.vakata.dnd.is_down=true;k.vakata.dnd.helper=k("<div id='vakata-dragged' />").html(m);k(document).bind("mousemove",k.vakata.dnd.drag);k(document).bind("mouseup",k.vakata.dnd.drag_stop);return false},drag:function(q){if(!k.vakata.dnd.is_down){return}if(!k.vakata.dnd.is_drag){if(Math.abs(q.pageX-k.vakata.dnd.init_x)>5||Math.abs(q.pageY-k.vakata.dnd.init_y)>5){k.vakata.dnd.helper.appendTo("body");k.vakata.dnd.is_drag=true;k(document).triggerHandler("drag_start.vakata",{event:q,data:k.vakata.dnd.user_data})}else{return}}if(q.type==="mousemove"){var r=k(document),o=r.scrollTop(),m=r.scrollLeft();if(q.pageY-o<20){if(e&&p==="down"){clearInterval(e);e=false}if(!e){p="up";e=setInterval(function(){k(document).scrollTop(k(document).scrollTop()-k.vakata.dnd.scroll_spd)},150)}}else{if(e&&p==="up"){clearInterval(e);e=false}}if(k(window).height()-(q.pageY-o)<20){if(e&&p==="up"){clearInterval(e);e=false}if(!e){p="down";e=setInterval(function(){k(document).scrollTop(k(document).scrollTop()+k.vakata.dnd.scroll_spd)},150)}}else{if(e&&p==="down"){clearInterval(e);e=false}}if(q.pageX-m<20){if(l&&n==="right"){clearInterval(l);l=false}if(!l){n="left";l=setInterval(function(){k(document).scrollLeft(k(document).scrollLeft()-k.vakata.dnd.scroll_spd)},150)}}else{if(l&&n==="left"){clearInterval(l);l=false}}if(k(window).width()-(q.pageX-m)<20){if(l&&n==="left"){clearInterval(l);l=false}if(!l){n="right";l=setInterval(function(){k(document).scrollLeft(k(document).scrollLeft()+k.vakata.dnd.scroll_spd)},150)}}else{if(l&&n==="right"){clearInterval(l);l=false}}}k.vakata.dnd.helper.css({left:(q.pageX+k.vakata.dnd.helper_left)+"px",top:(q.pageY+k.vakata.dnd.helper_top)+"px"});k(document).triggerHandler("drag.vakata",{event:q,data:k.vakata.dnd.user_data})},drag_stop:function(m){if(l){clearInterval(l)}if(e){clearInterval(e)}k(document).unbind("mousemove",k.vakata.dnd.drag);k(document).unbind("mouseup",k.vakata.dnd.drag_stop);k(document).triggerHandler("drag_stop.vakata",{event:m,data:k.vakata.dnd.user_data});k.vakata.dnd.helper.remove();k.vakata.dnd.init_x=0;k.vakata.dnd.init_y=0;k.vakata.dnd.user_data={};k.vakata.dnd.is_down=false;k.vakata.dnd.is_drag=false}};k(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; } ";k.vakata.css.add_sheet({str:m,title:"vakata"})});k.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",k.proxy(function(r){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree){if(this.data.themes){g.attr("class","jstree-"+this.data.themes.theme);if(h){h.attr("class","jstree-"+this.data.themes.theme)}k.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}if(r.currentTarget===r.target&&k.vakata.dnd.user_data.obj&&k(k.vakata.dnd.user_data.obj).length&&k(k.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==r.target){var q=k.jstree._reference(r.target),o;if(q.data.dnd.foreign){o=q._get_settings().dnd.drag_check.call(this,{o:f,r:q.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){k.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}else{q.prepare_move(f,q.get_container(),"last");if(q.check_move()){k.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}}}},this)).bind("mouseup.jstree",k.proxy(function(r){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree&&r.currentTarget===r.target&&k.vakata.dnd.user_data.obj&&k(k.vakata.dnd.user_data.obj).length&&k(k.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==r.target){var q=k.jstree._reference(r.currentTarget),o;if(q.data.dnd.foreign){o=q._get_settings().dnd.drag_check.call(this,{o:f,r:q.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){q._get_settings().dnd.drag_finish.call(this,{o:f,r:q.get_container(),is_root:true})}}else{q.move_node(f,q.get_container(),"last",r[q._get_settings().dnd.copy_modifier+"Key"])}}},this)).bind("mouseleave.jstree",k.proxy(function(o){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(k.vakata.dnd.is_drag&&k.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(k.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){k.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}}},this)).bind("mousemove.jstree",k.proxy(function(q){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree){var o=this.get_container()[0];if(q.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(k.proxy(function(){this.scrollLeft+=k.vakata.dnd.scroll_spd},o),100)}else{if(q.pageX-24<this.data.dnd.cof.left){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(k.proxy(function(){this.scrollLeft-=k.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}}}if(q.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(k.proxy(function(){this.scrollTop+=k.vakata.dnd.scroll_spd},o),100)}else{if(q.pageY-24<this.data.dnd.cof.top){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(k.proxy(function(){this.scrollTop-=k.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}}}}},this)).bind("scroll.jstree",k.proxy(function(o){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree&&g&&h){g.hide();h.hide()}},this)).delegate("a","mousedown.jstree",k.proxy(function(o){if(o.which===1){this.start_drag(o.currentTarget,o);return false}},this)).delegate("a","mouseenter.jstree",k.proxy(function(o){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree){this.dnd_enter(o.currentTarget)}},this)).delegate("a","mousemove.jstree",k.proxy(function(o){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree){if(!d||!d.length||d.children("a")[0]!==o.currentTarget){this.dnd_enter(o.currentTarget)}if(typeof this.data.dnd.off.top==="undefined"){this.data.dnd.off=k(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",k.proxy(function(o){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(g){g.hide()}if(h){h.hide()}this.data.dnd.mto=setTimeout((function(q){return function(){q.dnd_leave(o)}})(this),0)}},this)).delegate("a","mouseup.jstree",k.proxy(function(o){if(k.vakata.dnd.is_drag&&k.vakata.dnd.user_data.jstree){this.dnd_finish(o)}},this));k(document).bind("drag_stop.vakata",k.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(g){g.css({top:"-2000px"})}if(h){h.css({top:"-2000px"})}},this)).bind("drag_start.vakata",k.proxy(function(r,o){if(o.data.jstree){var q=k(o.event.target);if(q.closest(".jstree").hasClass("jstree-"+this.get_index())){this.dnd_enter(q)}}},this));var m=this._get_settings().dnd;if(m.drag_target){k(document).delegate(m.drag_target,"mousedown.jstree-"+this.get_index(),k.proxy(function(q){f=q.target;k.vakata.dnd.drag_start(q,{jstree:true,obj:q.target},"<ins class='jstree-icon'></ins>"+k(q.target).text());if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}k.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}k.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;q.preventDefault()},this))}if(m.drop_target){k(document).delegate(m.drop_target,"mouseenter.jstree-"+this.get_index(),k.proxy(function(o){if(this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:f,r:k(o.target),e:o})){k.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}},this)).delegate(m.drop_target,"mouseleave.jstree-"+this.get_index(),k.proxy(function(o){if(this.data.dnd.active){k.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}},this)).delegate(m.drop_target,"mouseup.jstree-"+this.get_index(),k.proxy(function(o){if(this.data.dnd.active&&k.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){this._get_settings().dnd.drop_finish.call(this,{o:f,r:k(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:k.noop,drag_target:".jstree-draggable",drag_finish:k.noop,drag_check:function(m){return{after:false,before:false,inside:true}}},_fn:{dnd_prepare:function(){if(!d||!d.length){return}this.data.dnd.off=d.offset();if(this._get_settings().core.rtl){this.data.dnd.off.right=this.data.dnd.off.left+d.width()}if(this.data.dnd.foreign){var m=this._get_settings().dnd.drag_check.call(this,{o:f,r:d});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(f,d,"before");this.data.dnd.before=this.check_move();this.prepare_move(f,d,"after");this.data.dnd.after=this.check_move();if(this._is_loaded(d)){this.prepare_move(f,d,"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 s=["before","inside","after"],m=false,q=this._get_settings().core.rtl,t;if(this.data.dnd.w<this.data.core.li_height/3){s=["before","inside","after"]}else{if(this.data.dnd.w<=this.data.core.li_height*2/3){s=this.data.dnd.w<this.data.core.li_height/2?["inside","before","after"]:["inside","after","before"]}else{s=["after","inside","before"]}}k.each(s,k.proxy(function(o,r){if(this.data.dnd[r]){k.vakata.dnd.helper.children("ins").attr("class","jstree-ok");m=r;return false}},this));if(m===false){k.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}t=q?(this.data.dnd.off.right-18):(this.data.dnd.off.left+10);switch(m){case"before":g.css({left:t+"px",top:(this.data.dnd.off.top-6)+"px"}).show();if(h){h.css({left:(t+8)+"px",top:(this.data.dnd.off.top-1)+"px"}).show()}break;case"after":g.css({left:t+"px",top:(this.data.dnd.off.top+this.data.core.li_height-6)+"px"}).show();if(h){h.css({left:(t+8)+"px",top:(this.data.dnd.off.top+this.data.core.li_height-1)+"px"}).show()}break;case"inside":g.css({left:t+(q?-4:4)+"px",top:(this.data.dnd.off.top+this.data.core.li_height/2-5)+"px"}).show();if(h){h.hide()}break;default:g.hide();if(h){h.hide()}break}j=m;return m},dnd_open:function(){this.data.dnd.to2=false;this.open_node(d,k.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:f,r:d,p:j})}}else{this.dnd_prepare();this.move_node(f,d,j,m[this._get_settings().dnd.copy_modifier+"Key"])}f=false;d=false;g.hide();if(h){h.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;d=this._get_node(o);if(m.check_timeout){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}this.data.dnd.to1=setTimeout(k.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(d&&d.length&&d.hasClass("jstree-closed")){this.data.dnd.to2=setTimeout(k.proxy(this.dnd_open,this),m.open_timeout)}}else{if(d&&d.length&&d.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;k.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");g.hide();if(h){h.hide()}if(d&&d[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(r,q){f=this._get_node(r);if(this.data.ui&&this.is_selected(f)){f=this._get_node(null,true)}var o=f.length>1?this._get_string("multiple_selection"):this.get_text(f),m=this.get_container();if(!this._get_settings().core.html_titles){o=o.replace(/</ig,"&lt;").replace(/>/ig,"&gt;")}k.vakata.dnd.drag_start(q,{jstree:true,obj:f},"<ins class='jstree-icon'></ins>"+o);if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}k.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}}});k(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; }";k.vakata.css.add_sheet({str:m,title:"jstree"});g=k("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(o){g.hide();h.hide();o.preventDefault();o.stopImmediatePropagation();return false}).appendTo("body");h=k("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(o){if(d&&d.length){d.children("a").trigger(o);o.preventDefault();o.stopImmediatePropagation();return false}}).bind("mouseleave",function(q){var o=k(q.relatedTarget);if(o.is(".jstree")||o.closest(".jstree").length===0){if(d&&d.length){d.children("a").trigger(q);g.hide();h.hide();q.preventDefault();q.stopImmediatePropagation();return false}}}).appendTo("body");k(document).bind("drag_start.vakata",function(q,o){if(o.data.jstree){g.show();if(h){h.show()}}});k(document).bind("drag_stop.vakata",function(q,o){if(o.data.jstree){g.hide();if(h){h.hide()}}})})})(jQuery);(function(d){d.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=d.noop;this.get_selected=this.get_checked}this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",d.proxy(function(g,f){this._prepare_checkboxes(f.rslt.obj)},this)).bind("loaded.jstree",d.proxy(function(f){this._prepare_checkboxes()},this)).delegate((this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox"),"click.jstree",d.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(e){return[("check_"+(e[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(f,e){if(e.checked){this.check_node(f,false)}},_prepare_checkboxes:function(j){j=!j||j==-1?this.get_container().find("> ul > li"):this._get_node(j);if(j===false){return}var l,k=this,e,g=this._get_settings().checkbox.two_state,h=this._get_settings().checkbox.real_checkboxes,f=this._get_settings().checkbox.real_checkboxes_names;j.each(function(){e=d(this);l=e.is("li")&&(e.hasClass("jstree-checked")||(h&&e.children(":checked").length))?"jstree-checked":"jstree-unchecked";e.find("li").andSelf().each(function(){var n=d(this),m;n.children("a"+(k.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(g?"jstree-unchecked":l);if(h){if(!n.children(":checkbox").length){m=f.call(k,n);n.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+m[0]+"' name='"+m[0]+"' value='"+m[1]+"' />")}else{n.children(":checkbox").addClass("jstree-real-checkbox")}}if(!g){if(l==="jstree-checked"||n.hasClass("jstree-checked")||n.children(":checked").length){n.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",true)}}else{if(n.hasClass("jstree-checked")||n.children(":checked").length){n.addClass("jstree-checked").children(":checkbox").prop("checked",true)}}})});if(!g){j.find(".jstree-checked").parent().parent().each(function(){k._repair_state(this)})}},change_state:function(h,g){h=this._get_node(h);var e=false,f=this._get_settings().checkbox.real_checkboxes;if(!h||h===-1){return false}g=(g===false||g===true)?g:h.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(g){h.removeClass("jstree-checked").addClass("jstree-unchecked");if(f){h.children(":checkbox").prop("checked",false)}}else{h.removeClass("jstree-unchecked").addClass("jstree-checked");if(f){h.children(":checkbox").prop("checked",true)}}}else{if(g){e=h.find("li").andSelf();if(!e.filter(".jstree-checked, .jstree-undetermined").length){return false}e.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){e.children(":checkbox").prop("checked",false)}}else{e=h.find("li").andSelf();if(!e.filter(".jstree-unchecked, .jstree-undetermined").length){return false}e.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){e.children(":checkbox").prop("checked",true)}if(this.data.ui){this.data.ui.last_selected=h}this.data.checkbox.last_selected=h}h.parentsUntil(".jstree","li").each(function(){var j=d(this);if(g){if(j.children("ul").children("li.jstree-checked, li.jstree-undetermined").length){j.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){j.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{j.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){j.children(":checkbox").prop("checked",false)}}}else{if(j.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){j.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){j.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{j.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){j.children(":checkbox").prop("checked",true)}}}})}if(this.data.ui&&this.data.checkbox.noui){this.data.ui.selected=this.get_checked()}this.__callback(h);return true},check_node:function(f){if(this.change_state(f,false)){f=this._get_node(f);if(this._get_settings().checkbox.checked_parent_open){var e=this;f.parents(".jstree-closed").each(function(){e.open_node(this,false,true)})}this.__callback({obj:f})}},uncheck_node:function(e){if(this.change_state(e,true)){this.__callback({obj:this._get_node(e)})}},check_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,false)});this.__callback()},uncheck_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,true)});this.__callback()},is_checked:function(e){e=this._get_node(e);return e.length?e.is(".jstree-checked"):false},get_checked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-checked"):f.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-unchecked"):f.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(h){h=this._get_node(h);if(!h.length){return}if(this._get_settings().checkbox.two_state){h.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",true);return}var g=this._get_settings().checkbox.real_checkboxes,f=h.find("> ul > .jstree-checked").length,e=h.find("> ul > .jstree-undetermined").length,j=h.find("> ul > li").length;if(j===0){if(h.hasClass("jstree-undetermined")){this.change_state(h,false)}}else{if(f===0&&e===0){this.change_state(h,true)}else{if(f===j){this.change_state(h,false)}else{h.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(g){h.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}}}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var f=this,e=this.data.ui.to_select;e=d.map(d.makeArray(e),function(g){return"#"+g.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();d.each(e,function(g,h){f.check_node(h)});this.__callback()}else{this.__call_old()}},save_loaded:function(){var e=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){if(this.id){e.data.core.to_load.push("#"+this.id)}})}}});d(function(){var e=".jstree .jstree-real-checkbox { display:none; } ";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(f){f.vakata.xslt=function(g,h,o){var k=false,n,l,j;if(k===false&&window.ActiveXObject){try{k=new ActiveXObject("Msxml2.XSLTemplate");l=new ActiveXObject("Msxml2.DOMDocument");l.loadXML(g);j=new ActiveXObject("Msxml2.FreeThreadedDOMDocument");j.loadXML(h);k.stylesheet=j;n=k.createProcessor();n.input=l;n.transform();k=n.output}catch(m){}}g=f.parseXML(g);h=f.parseXML(h);if(k===false&&typeof(XSLTProcessor)!=="undefined"){n=new XSLTProcessor();n.importStylesheet(h);k=n.transformToFragment(g,document);k=f("<div />").append(k).html()}if(k===false&&typeof(g.transformNode)!=="undefined"){k=g.transformNode(h)}o.call(null,k)};var e={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>'},d=function(g){return g.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};f.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(j,g,h){var k=this;this.load_node_xml(j,function(){k.__callback({obj:k._get_node(j)});g.call(this)},h)},_is_loaded:function(h){var g=this._get_settings().xml_data;h=this._get_node(h);return h==-1||!h||(!g.ajax&&!f.isFunction(g.data))||h.is(".jstree-open, .jstree-leaf")||h.children("ul").children("li").size()>0},load_node_xml:function(l,g,j){var k=this.get_settings().xml_data,h=function(){},m=function(){};l=this._get_node(l);if(l&&l!==-1){if(l.data("jstree_is_loading")){return}else{l.data("jstree_is_loading",true)}}switch(!0){case (!k.data&&!k.ajax):throw"Neither data nor ajax settings supplied.";case (f.isFunction(k.data)):k.data.call(this,l,f.proxy(function(n){this.parse_xml(n,f.proxy(function(o){if(o){o=o.replace(/ ?xmlns="[^"]*"/ig,"");if(o.length>10){o=f(o);if(l===-1||!l){this.get_container().children("ul").empty().append(o.children())}else{l.children("a.jstree-loading").removeClass("jstree-loading");l.append(o);l.removeData("jstree_is_loading")}if(k.clean_node){this.clean_node(l)}if(g){g.call(this)}}else{if(l&&l!==-1){l.children("a.jstree-loading").removeClass("jstree-loading");l.removeData("jstree_is_loading");if(k.correct_state){this.correct_state(l);if(g){g.call(this)}}}else{if(k.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}}}},this))},this));break;case (!!k.data&&!k.ajax)||(!!k.data&&!!k.ajax&&(!l||l===-1)):if(!l||l==-1){this.parse_xml(k.data,f.proxy(function(n){if(n){n=n.replace(/ ?xmlns="[^"]*"/ig,"");if(n.length>10){n=f(n);this.get_container().children("ul").empty().append(n.children());if(k.clean_node){this.clean_node(l)}if(g){g.call(this)}}}else{if(k.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}},this))}break;case (!k.data&&!!k.ajax)||(!!k.data&&!!k.ajax&&l&&l!==-1):h=function(o,p,q){var n=this.get_settings().xml_data.ajax.error;if(n){n.call(this,o,p,q)}if(l!==-1&&l.length){l.children("a.jstree-loading").removeClass("jstree-loading");l.removeData("jstree_is_loading");if(p==="success"&&k.correct_state){this.correct_state(l)}}else{if(p==="success"&&k.correct_state){this.get_container().children("ul").empty()}}if(j){j.call(this)}};m=function(q,o,n){q=n.responseText;var p=this.get_settings().xml_data.ajax.success;if(p){q=p.call(this,q,o,n)||q}if(q===""||(q&&q.toString&&q.toString().replace(/^[\s\n]+$/,"")==="")){return h.call(this,n,o,"")}this.parse_xml(q,f.proxy(function(r){if(r){r=r.replace(/ ?xmlns="[^"]*"/ig,"");if(r.length>10){r=f(r);if(l===-1||!l){this.get_container().children("ul").empty().append(r.children())}else{l.children("a.jstree-loading").removeClass("jstree-loading");l.append(r);l.removeData("jstree_is_loading")}if(k.clean_node){this.clean_node(l)}if(g){g.call(this)}}else{if(l&&l!==-1){l.children("a.jstree-loading").removeClass("jstree-loading");l.removeData("jstree_is_loading");if(k.correct_state){this.correct_state(l);if(g){g.call(this)}}}else{if(k.correct_state){this.get_container().children("ul").empty();if(g){g.call(this)}}}}}},this))};k.ajax.context=this;k.ajax.error=h;k.ajax.success=m;if(!k.ajax.dataType){k.ajax.dataType="xml"}if(f.isFunction(k.ajax.url)){k.ajax.url=k.ajax.url.call(this,l)}if(f.isFunction(k.ajax.data)){k.ajax.data=k.ajax.data.call(this,l)}f.ajax(k.ajax);break}},parse_xml:function(g,j){var h=this._get_settings().xml_data;f.vakata.xslt(g,e[h.xsl],j)},get_xml:function(p,m,j,g,r){var u="",t=this._get_settings(),n=this,l,k,q,o,h;if(!p){p="flat"}if(!r){r=0}m=this._get_node(m);if(!m||m===-1){m=this.get_container().find("> ul > li")}j=f.isArray(j)?j:["id","class"];if(!r&&this.data.types&&f.inArray(t.types.type_attr,j)===-1){j.push(t.types.type_attr)}g=f.isArray(g)?g:[];if(!r){if(t.xml_data.get_include_preamble){u+='<?xml version="1.0" encoding="UTF-8"?>'}u+="<root>"}m.each(function(){u+="<item";q=f(this);f.each(j,function(x,s){var w=q.attr(s);if(!t.xml_data.get_skip_empty||typeof w!=="undefined"){u+=" "+s+'="'+d((" "+(w||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}});if(q.hasClass("jstree-open")){u+=' state="open"'}if(q.hasClass("jstree-closed")){u+=' state="closed"'}if(p==="flat"){u+=' parent_id="'+d(r)+'"'}u+=">";u+="<content>";o=q.children("a");o.each(function(){l=f(this);h=false;u+="<name";if(f.inArray("languages",t.plugins)!==-1){f.each(t.languages,function(s,v){if(l.hasClass(v)){u+=' lang="'+d(v)+'"';h=v;return false}})}if(g.length){f.each(g,function(s,w){var v=l.attr(w);if(!t.xml_data.get_skip_empty||typeof v!=="undefined"){u+=" "+w+'="'+d((" "+v||"").replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}})}if(l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){u+=' icon="'+d(l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'}if(l.children("ins").get(0).style.backgroundImage.length){u+=' icon="'+d(l.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,""))+'"'}u+=">";u+="<![CDATA["+n.get_text(l,h)+"]]>";u+="</name>"});u+="</content>";k=q[0].id||true;q=q.find("> ul > li");if(q.length){k=n.get_xml(p,q,j,g,k)}else{k=""}if(p=="nest"){u+=k}u+="</item>";if(p=="flat"){u+=k}});if(!r){u+="</root>"}return u}}})})(jQuery);(function(d){if(d().jquery.split(".")[1]>=8){d.expr[":"].jstree_contains=d.expr.createPseudo(function(e){return function(f){return(f.textContent||f.innerText||"").toLowerCase().indexOf(e.toLowerCase())>=0}});d.expr[":"].jstree_title_contains=d.expr.createPseudo(function(e){return function(f){return(f.getAttribute("title")||"").toLowerCase().indexOf(e.toLowerCase())>=0}})}else{d.expr[":"].jstree_contains=function(f,g,e){return(f.textContent||f.innerText||"").toLowerCase().indexOf(e[3].toLowerCase())>=0};d.expr[":"].jstree_title_contains=function(f,g,e){return(f.getAttribute("title")||"").toLowerCase().indexOf(e[3].toLowerCase())>=0}}d.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=d();if(this._get_settings().search.show_only_matches){this.get_container().bind("search.jstree",function(g,f){d(this).children("ul").find("li").hide().removeClass("jstree-last");f.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){d(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){d(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(k,e){if(d.trim(k)===""){this.clear_search();return}var h=this.get_settings().search,g=this,f=function(){},j=function(){};this.data.search.str=k;if(!e&&h.ajax!==false&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0){this.search.supress_callback=true;f=function(){};j=function(o,m,l){var n=this.get_settings().search.ajax.success;if(n){o=n.call(this,o,m,l)||o}this.data.search.to_open=o;this._search_open()};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,k)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,k)}if(!h.ajax.data){h.ajax.data={search_string:k}}if(!h.ajax.dataType||/^json/.exec(h.ajax.dataType)){h.ajax.dataType="json"}d.ajax(h.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():"")+":"+(h.search_method)+"("+this.data.search.str+")");this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){g.open_node(this,false,true)});this.__callback({nodes:this.data.search.result,str:k})},clear_search:function(e){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=d()},_search_open:function(f){var j=this,e=true,h=[],g=[];if(this.data.search.to_open.length){d.each(this.data.search.to_open,function(k,l){if(l=="#"){return true}if(d(l).length&&d(l).is(".jstree-closed")){h.push(l)}else{g.push(l)}});if(h.length){this.data.search.to_open=g;d.each(h,function(k,l){j.open_node(l,function(){j._search_open(true)})});e=false}}if(e){this.search(this.data.search.str,true)}}}})})(jQuery);(function(d){d.vakata.context={hide_on_mouseleave:false,cnt:d("<div id='vakata-contextmenu' />"),vis:false,tgt:false,par:false,func:false,data:false,rtl:false,show:function(q,o,m,k,j,e,l){d.vakata.context.rtl=!!l;var g=d.vakata.context.parse(q),f,n;if(!g){return}d.vakata.context.vis=true;d.vakata.context.tgt=o;d.vakata.context.par=e||o||null;d.vakata.context.data=j||null;d.vakata.context.cnt.html(g).css({visibility:"hidden",display:"block",left:0,top:0});if(d.vakata.context.hide_on_mouseleave){d.vakata.context.cnt.one("mouseleave",function(h){d.vakata.context.hide()})}f=d.vakata.context.cnt.height();n=d.vakata.context.cnt.width();if(m+n>d(document).width()){m=d(document).width()-(n+5);d.vakata.context.cnt.find("li > ul").addClass("right")}if(k+f>d(document).height()){k=k-(f+o[0].offsetHeight);d.vakata.context.cnt.find("li > ul").addClass("bottom")}d.vakata.context.cnt.css({left:m,top:k}).find("li:has(ul)").bind("mouseenter",function(t){var p=d(document).width(),s=d(document).height(),r=d(this).children("ul").show();if(p!==d(document).width()){r.toggleClass("right")}if(s!==d(document).height()){r.toggleClass("bottom")}}).bind("mouseleave",function(h){d(this).children("ul").hide()}).end().css({visibility:"visible"}).show();d(document).triggerHandler("context_show.vakata")},hide:function(){d.vakata.context.vis=false;d.vakata.context.cnt.attr("class","").css({visibility:"hidden"});d(document).triggerHandler("context_hide.vakata")},parse:function(h,g){if(!h){return false}var j="",f=false,e=true;if(!g){d.vakata.context.func={}}j+="<ul>";d.each(h,function(k,l){if(!l){return true}d.vakata.context.func[k]=l.action;if(!e&&l.separator_before){j+="<li class='vakata-separator vakata-separator-before'></li>"}e=false;j+="<li class='"+(l._class||"")+(l._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";if(l.icon&&l.icon.indexOf("/")===-1){j+=" class='"+l.icon+"' "}if(l.icon&&l.icon.indexOf("/")!==-1){j+=" style='background:url("+l.icon+") center center no-repeat;' "}j+=">&#160;</ins><a href='#' rel='"+k+"'>";if(l.submenu){j+="<span style='float:"+(d.vakata.context.rtl?"left":"right")+";'>&raquo;</span>"}j+=l.label+"</a>";if(l.submenu){f=d.vakata.context.parse(l.submenu,true);if(f){j+=f}}j+="</li>";if(l.separator_after){j+="<li class='vakata-separator vakata-separator-after'></li>";e=true}});j=j.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");j+="</ul>";d(document).triggerHandler("context_parse.vakata");return j.length>10?j:false},exec:function(e){if(d.isFunction(d.vakata.context.func[e])){d.vakata.context.func[e].call(d.vakata.context.data,d.vakata.context.par);return true}else{return false}}};d(function(){var e="#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; } ";d.vakata.css.add_sheet({str:e,title:"vakata"});d.vakata.context.cnt.delegate("a","click",function(f){f.preventDefault()}).delegate("a","mouseup",function(f){if(!d(this).parent().hasClass("jstree-contextmenu-disabled")&&d.vakata.context.exec(d(this).attr("rel"))){d.vakata.context.hide()}else{d(this).blur()}}).delegate("a","mouseover",function(){d.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");d(document).bind("mousedown",function(f){if(d.vakata.context.vis&&!d.contains(d.vakata.context.cnt[0],f.target)){d.vakata.context.hide()}});if(typeof d.hotkeys!=="undefined"){d(document).bind("keydown","up",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","down",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","right",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","left",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","esc",function(f){d.vakata.context.hide();f.preventDefault()}).bind("keydown","space",function(f){d.vakata.context.cnt.find(".vakata-hover").last().children("a").click();f.preventDefault()})}});d.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",d.proxy(function(f){f.preventDefault();if(!d(f.currentTarget).hasClass("jstree-loading")){this.show_contextmenu(f.currentTarget,f.pageX,f.pageY)}},this)).delegate("a","click.jstree",d.proxy(function(f){if(this.data.contextmenu){d.vakata.context.hide()}},this)).bind("destroy.jstree",d.proxy(function(){if(this.data.contextmenu){d.vakata.context.hide()}},this));d(document).bind("context_hide.vakata",d.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(e){this.create(e)}},rename:{separator_before:false,separator_after:false,label:"Rename",action:function(e){this.rename(e)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(e){if(this.is_selected(e)){this.remove()}else{this.remove(e)}}},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(e){this.cut(e)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(e){this.copy(e)}},paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(e){this.paste(e)}}}}}},_fn:{show_contextmenu:function(j,e,l){j=this._get_node(j);var h=this.get_settings().contextmenu,f=j.children("a:visible:eq(0)"),k=false,g=false;if(h.select_node&&this.data.ui&&!this.is_selected(j)){this.deselect_all();this.select_node(j,true)}if(h.show_at_node||typeof e==="undefined"||typeof l==="undefined"){k=f.offset();e=k.left;l=k.top+this.data.core.li_height}g=j.data("jstree")&&j.data("jstree").contextmenu?j.data("jstree").contextmenu:h.items;if(d.isFunction(g)){g=g.call(this,j)}this.data.contextmenu=true;d.vakata.context.show(g,f,e,l,this,j,this._get_settings().core.rtl);if(this.data.themes){d.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}}})})(jQuery);(function(d){d.jstree.plugin("types",{__init:function(){var e=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",d.proxy(function(){var h=e.types,g=e.type_attr,f="",j=this;d.each(h,function(k,l){d.each(l,function(n,m){if(!/^(max_depth|max_children|icon|valid_children)$/.test(n)){j.data.types.attach_to.push(n)}});if(!l.icon){return true}if(l.icon.image||l.icon.position){if(k=="default"){f+=".jstree-"+j.get_index()+" a > .jstree-icon { "}else{f+=".jstree-"+j.get_index()+" li["+g+'="'+k+'"] > a > .jstree-icon { '}if(l.icon.image){f+=" background-image:url("+l.icon.image+"); "}if(l.icon.position){f+=" background-position:"+l.icon.position+"; "}else{f+=" background-position:0 0; "}f+="} "}});if(f!==""){d.vakata.css.add_sheet({str:f,title:"jstree-types"})}},this)).bind("before.jstree",d.proxy(function(j,h){var g,f,l=this._get_settings().types.use_data?this._get_node(h.args[0]):false,k=l&&l!==-1&&l.length?l.data("jstree"):false;if(k&&k.types&&k.types[h.func]===false){j.stopImmediatePropagation();return false}if(d.inArray(h.func,this.data.types.attach_to)!==-1){if(!h.args[0]||(!h.args[0].tagName&&!h.args[0].jquery)){return}g=this._get_settings().types.types;f=this._get_type(h.args[0]);if(((g[f]&&typeof g[f][h.func]!=="undefined")||(g["default"]&&typeof g["default"][h.func]!=="undefined"))&&this._check(h.func,h.args[0])===false){j.stopImmediatePropagation();return false}}},this));if(c){this.get_container().bind("load_node.jstree set_type.jstree",d.proxy(function(j,h){var g=h&&h.rslt&&h.rslt.obj&&h.rslt.obj!==-1?this._get_node(h.rslt.obj).parent():this.get_container_ul(),k=false,f=this._get_settings().types;d.each(f.types,function(l,m){if(m.icon&&(m.icon.image||m.icon.position)){k=l==="default"?g.find("li > a > .jstree-icon"):g.find("li["+f.type_attr+"='"+l+"'] > a > .jstree-icon");if(m.icon.image){k.css("backgroundImage","url("+m.icon.image+")")}k.css("backgroundPosition",m.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(f,e){if(e.type&&this._get_settings().types.use_data){this.set_type(e.type,f)}},_get_type:function(e){e=this._get_node(e);return(!e||!e.length)?false:e.attr(this._get_settings().types.type_attr)||"default"},set_type:function(g,f){f=this._get_node(f);var e=(!f.length||!g)?false:f.attr(this._get_settings().types.type_attr,g);if(e){this.__callback({obj:f,type:g})}return e},_check:function(k,g,e){g=this._get_node(g);var l=false,m=this._get_type(g),j=0,h=this,n=this._get_settings().types,f=false;if(g===-1){if(!!n[k]){l=n[k]}else{return}}else{if(m===false){return}f=n.use_data?g.data("jstree"):false;if(f&&f.types&&typeof f.types[k]!=="undefined"){l=f.types[k]}else{if(!!n.types[m]&&typeof n.types[m][k]!=="undefined"){l=n.types[m][k]}else{if(!!n.types["default"]&&typeof n.types["default"][k]!=="undefined"){l=n.types["default"][k]}}}}if(d.isFunction(l)){l=l.call(this,g)}if(k==="max_depth"&&g!==-1&&e!==false&&n.max_depth!==-2&&l!==0){g.children("a:eq(0)").parentsUntil(".jstree","li").each(function(o){if(n.max_depth!==-1&&n.max_depth-(o+1)<=0){l=0;return false}j=(o===0)?l:h._check(k,this,false);if(j!==-1&&j-(o+1)<=0){l=0;return false}if(j>=0&&(j-(o+1)<l||l<0)){l=j-(o+1)}if(n.max_depth>=0&&(n.max_depth-(o+1)<l||l<0)){l=n.max_depth-(o+1)}})}return l},check_move:function(){if(!this.__call_old()){return false}var e=this._get_move(),j=e.rt._get_settings().types,l=e.rt._check("max_children",e.cr),k=e.rt._check("max_depth",e.cr),g=e.rt._check("valid_children",e.cr),h=0,n=1,f;if(g==="none"){return false}if(d.isArray(g)&&e.ot&&e.ot._get_type){e.o.each(function(){if(d.inArray(e.ot._get_type(this),g)===-1){n=false;return false}});if(n===false){return false}}if(j.max_children!==-2&&l!==-1){h=e.cr===-1?this.get_container().find("> ul > li").not(e.o).length:e.cr.find("> ul > li").not(e.o).length;if(h+e.o.length>l){return false}}if(j.max_depth!==-2&&k!==-1){n=0;if(k===0){return false}if(typeof e.o.d==="undefined"){f=e.o;while(f.length>0){f=f.find("> ul > li");n++}e.o.d=n}if(k-e.o.d<0){return false}}return true},create_node:function(h,j,f,q,l,o){if(!o&&(l||this._is_loaded(h))){var g=(typeof j=="string"&&j.match(/^before|after$/i)&&h!==-1)?this._get_parent(h):this._get_node(h),r=this._get_settings().types,n=this._check("max_children",g),m=this._check("max_depth",g),k=this._check("valid_children",g),e;if(typeof f==="string"){f={data:f}}if(!f){f={}}if(k==="none"){return false}if(d.isArray(k)){if(!f.attr||!f.attr[r.type_attr]){if(!f.attr){f.attr={}}f.attr[r.type_attr]=k[0]}else{if(d.inArray(f.attr[r.type_attr],k)===-1){return false}}}if(r.max_children!==-2&&n!==-1){e=g===-1?this.get_container().find("> ul > li").length:g.find("> ul > li").length;if(e+1>n){return false}}if(r.max_depth!==-2&&m!==-1&&(m-1)<0){return false}}return this.__call_old(true,h,j,f,q,l,o)}}})})(jQuery);(function(d){d.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(g,e,f){var h=this;this.load_node_html(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(e){e=this._get_node(e);return e==-1||!e||(!this._get_settings().html_data.ajax&&!d.isFunction(this._get_settings().html_data.data))||e.is(".jstree-open, .jstree-leaf")||e.children("ul").children("li").size()>0},load_node_html:function(j,e,g){var l,h=this.get_settings().html_data,f=function(){},k=function(){};j=this._get_node(j);if(j&&j!==-1){if(j.data("jstree_is_loading")){return}else{j.data("jstree_is_loading",true)}}switch(!0){case (d.isFunction(h.data)):h.data.call(this,j,d.proxy(function(m){if(m&&m!==""&&m.toString&&m.toString().replace(/^[\s\n]+$/,"")!==""){m=d(m);if(!m.is("ul")){m=d("<ul />").append(m)}if(j==-1||!j){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")}else{j.children("a.jstree-loading").removeClass("jstree-loading");j.append(m).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");j.removeData("jstree_is_loading")}this.clean_node(j);if(e){e.call(this)}}else{if(j&&j!==-1){j.children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(j);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}},this));break;case (!h.data&&!h.ajax):if(!j||j==-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(e){e.call(this)}break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!j||j===-1)):if(!j||j==-1){l=d(h.data);if(!l.is("ul")){l=d("<ul />").append(l)}this.get_container().children("ul").empty().append(l.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(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&j&&j!==-1):j=this._get_node(j);f=function(n,o,p){var m=this.get_settings().html_data.ajax.error;if(m){m.call(this,n,o,p)}if(j!=-1&&j.length){j.children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading");if(o==="success"&&h.correct_state){this.correct_state(j)}}else{if(o==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};k=function(p,n,m){var o=this.get_settings().html_data.ajax.success;if(o){p=o.call(this,p,n,m)||p}if(p===""||(p&&p.toString&&p.toString().replace(/^[\s\n]+$/,"")==="")){return f.call(this,m,n,"")}if(p){p=d(p);if(!p.is("ul")){p=d("<ul />").append(p)}if(j==-1||!j){this.get_container().children("ul").empty().append(p.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{j.children("a.jstree-loading").removeClass("jstree-loading");j.append(p).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");j.removeData("jstree_is_loading")}this.clean_node(j);if(e){e.call(this)}}else{if(j&&j!==-1){j.children("a.jstree-loading").removeClass("jstree-loading");j.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(j);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=k;if(!h.ajax.dataType){h.ajax.dataType="html"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,j)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,j)}d.ajax(h.ajax);break}}}});d.jstree.defaults.plugins.push("html_data")})(jQuery);(function(d){d.jstree.plugin("themeroller",{__init:function(){var e=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a","mouseenter.jstree",function(f){if(!d(f.currentTarget).hasClass("jstree-loading")){d(this).addClass(e.item_h)}}).delegate("a","mouseleave.jstree",function(){d(this).removeClass(e.item_h)}).bind("init.jstree",d.proxy(function(g,f){f.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(f.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",d.proxy(function(f){this._themeroller()},this)).bind("close_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.obj)},this)).bind("delete_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.parent)},this)).bind("correct_state.jstree",d.proxy(function(g,f){f.rslt.obj.children("ins.jstree-icon").removeClass(e.opened+" "+e.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_open+" "+e.item_clsd).addClass(e.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",d.proxy(function(g,f){f.rslt.obj.children("a").addClass(e.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",d.proxy(function(g,f){this.get_container().find("a."+e.item_a).removeClass(e.item_a).end().find("a.jstree-clicked").addClass(e.item_a)},this)).bind("dehover_node.jstree",d.proxy(function(g,f){f.rslt.obj.children("a").removeClass(e.item_h)},this)).bind("hover_node.jstree",d.proxy(function(g,f){this.get_container().find("a."+e.item_h).not(f.rslt.obj).removeClass(e.item_h);f.rslt.obj.children("a").addClass(e.item_h)},this)).bind("move_node.jstree",d.proxy(function(g,f){this._themeroller(f.rslt.o);this._themeroller(f.rslt.op)},this))},__destroy:function(){var e=this._get_settings().themeroller,f=["ui-icon"];d.each(e,function(h,g){g=g.split(" ");if(g.length){f=f.concat(g)}});this.get_container().removeClass("ui-widget-content").find("."+f.join(", .")).removeClass(f.join(" "))},_fn:{_themeroller:function(f){var e=this._get_settings().themeroller;f=(!f||f==-1)?this.get_container_ul():this._get_node(f);f=(!f||f==-1)?this.get_container_ul():f.parent();f.find("li.jstree-closed").children("ins.jstree-icon").removeClass(e.opened).addClass("ui-icon "+e.closed).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_leaf+" "+e.item_open).addClass(e.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(e.closed).addClass("ui-icon "+e.opened).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_leaf+" "+e.item_clsd).addClass(e.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(e.closed+" ui-icon "+e.opened).end().children("a").addClass(e.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return this.className.toString().replace(e.item_clsd,"").replace(e.item_open,"").replace(e.item_leaf,"").indexOf("ui-icon-")===-1}).removeClass(e.item_clsd+" "+e.item_open).addClass(e.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"}});d(function(){var e=".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){d.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",d.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(d(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:d.noop},_fn:{_check_unique:function(f,j,h){var e=[],g=true;j.children("a").each(function(){e.push(d(this).text().replace(/^\s+/g,""))});if(!e.length||!f.length){return true}d.each(f,function(l,k){if(d.inArray(k,e)!==-1){g=false;return false}});if(!g){this._get_settings().unique.error_callback.call(null,f,j,h)}return g},check_move:function(){if(!this.__call_old()){return false}var f=this._get_move(),e=[];if(f.o&&f.o.length){f.o.children("a").each(function(){e.push(d(this).text().replace(/^\s+/g,""))});return this._check_unique(e,f.np.find("> ul > li").not(f.o),"check_move")}return true}}})})(jQuery);(function(d){d.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",d.proxy(function(g,f){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",d.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",d.proxy(function(g,f){if(this.data.to){clearTimeout(this.data.to)}this.data.to=setTimeout((function(e,h){return function(){e._prepare_wholerow_ul(h)}})(this,f&&f.rslt&&f.rslt.obj?f.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",d.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 ",d.proxy(function(g,f){f.rslt.obj.each(function(){var e=f.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+(parseInt(((d(this).offset().top-f.inst.get_container().offset().top+f.inst.get_container()[0].scrollTop)/f.inst.data.core.li_height),10))+")");e.children("a").attr("class",f.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",d.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=d(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",d.proxy(function(f){f.stopImmediatePropagation();if(d(f.currentTarget).children(".jstree-hovered, .jstree-clicked").length){return false}this.hover_node(f.currentTarget);return false},this)).delegate("li","mouseleave.jstree",d.proxy(function(f){if(d(f.currentTarget).children("a").hasClass("jstree-hovered").length){return}this.dehover_node(f.currentTarget)},this));if(b||c){d.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(e){e=!e||e==-1?this.get_container().find("> ul > li"):this._get_node(e);if(e===false){return}e.each(function(){d(this).find("li").andSelf().each(function(){var f=d(this);if(f.children(".jstree-wholerow-span").length){return true}f.prepend("<span class='jstree-wholerow-span' style='width:"+(f.parentsUntil(".jstree","li").length*18)+"px;'>&#160;</span>")})})},_prepare_wholerow_ul:function(){var f=this.get_container().children("ul").eq(0),e=f.html();f.addClass("jstree-wholerow-real");if(this.data.wholerow.last_html!==e){this.data.wholerow.last_html=e;this.get_container().children(".jstree-wholerow").remove();this.get_container().append(f.clone().removeClass("jstree-wholerow-real").wrapAll("<div class='jstree-wholerow' />").parent().width(f.parent()[0].scrollWidth).css("top",(f.height()+(b?5:0))*-1).find("li[id]").each(function(){this.removeAttribute("id")}).end())}}}});d(function(){var e=".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){e+=".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||c){e+=".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; } "}d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){var e=["getChildren","getChildrenCount","getAttr","getName","getProps"],f=function(j,g){var h=true;j=j||{};g=[].concat(g);d.each(g,function(l,k){if(!d.isFunction(j[k])){h=false;return false}});return h};d.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(j,g){var h=(j==-1)?this._get_settings().model.object:j.data("jstree_model");if(!f(h,e)){return g.call(null,false)}if(this._get_settings().model.async){h.getChildren(d.proxy(function(k){this.model_done(k,g)},this))}else{this.model_done(h.getChildren(),g)}}},defaults:{object:false,id_prefix:false,async:false},_fn:{model_done:function(j,l){var g=[],h=this._get_settings(),k=this;if(!d.isArray(j)){j=[j]}d.each(j,function(m,o){var n=o.getProps()||{};n.attr=o.getAttr()||{};if(o.getChildrenCount()){n.state="closed"}n.data=o.getName();if(!d.isArray(n.data)){n.data=[n.data]}if(k.data.types&&d.isFunction(o.getType)){n.attr[h.types.type_attr]=o.getType()}if(n.attr.id&&h.model.id_prefix){n.attr.id=h.model.id_prefix+n.attr.id}if(!n.metadata){n.metadata={}}n.metadata.jstree_model=o;g.push(n)});l.call(null,g)}}})})(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(d){if(typeof d.data!=="string"){return}var c=d.handler,e=d.data.toLowerCase().split(" ");d.handler=function(n){if(this!==n.target&&(/textarea|select/i.test(n.target.nodeName)||n.target.type==="text")){return}var h=n.type!=="keypress"&&b.hotkeys.specialKeys[n.which],o=String.fromCharCode(n.which).toLowerCase(),k,m="",g={};if(n.altKey&&h!=="alt"){m+="alt+"}if(n.ctrlKey&&h!=="ctrl"){m+="ctrl+"}if(n.metaKey&&!n.ctrlKey&&h!=="meta"){m+="meta+"}if(n.shiftKey&&h!=="shift"){m+="shift+"}if(h){g[m+h]=true}else{g[m+o]=true;g[m+b.hotkeys.shiftNums[o]]=true;if(m==="shift+"){g[b.hotkeys.shiftNums[o]]=true}}for(var j=0,f=e.length;j<f;j++){if(g[e[j]]){return c.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(c,d){c.support.htmlMenuitem=("HTMLMenuItemElement" in window);c.support.htmlCommand=("HTMLCommandElement" in window);c.support.eventSelectstart=("onselectstart" in document.documentElement);if(!c.ui||!c.ui.widget){var r=c.cleanData;c.cleanData=function(t){for(var u=0,v;(v=t[u])!=null;u++){try{c(v).triggerHandler("remove")}catch(w){}}r(t)}}var q=null,b=false,o=c(window),h=0,g={},m={},l={},j={selector:null,appendTo:null,trigger:"right",autoHide:false,delay:200,reposition:true,determinePosition:function(t){if(c.ui&&c.ui.position){t.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none")}else{var u=this.offset();u.top+=this.outerHeight();u.left+=this.outerWidth()/2-t.outerWidth()/2;t.css(u)}},position:function(v,B,A){var z=this,w;if(!B&&!A){v.determinePosition.call(this,v.$menu);return}else{if(B==="maintain"&&A==="maintain"){w=v.$menu.position()}else{w={top:A,left:B}}}var t=o.scrollTop()+o.height(),C=o.scrollLeft()+o.width(),D=v.$menu.height(),u=v.$menu.width();if(w.top+D>t){w.top-=D}if(w.left+u>C){w.left-=u}v.$menu.css(w)},positionSubmenu:function(t){if(c.ui&&c.ui.position){t.css("display","block").position({my:"left top",at:"right top",of:this,collision:"flipfit fit"}).css("display","")}else{var u={top:0,left:this.outerWidth()};t.css(u)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:c.noop,hide:c.noop},callback:null,items:{}},k={timer:null,pageX:null,pageY:null},e=function(v){var u=0,t=v;while(true){u=Math.max(u,parseInt(t.css("z-index"),10)||0);t=t.parent();if(!t||!t.length||"html body".indexOf(t.prop("nodeName").toLowerCase())>-1){break}}return u},s={abortevent:function(t){t.preventDefault();t.stopImmediatePropagation()},contextmenu:function(v){var u=c(this);v.preventDefault();v.stopImmediatePropagation();if(v.data.trigger!="right"&&v.originalEvent){return}if(u.hasClass("context-menu-active")){return}if(!u.hasClass("context-menu-disabled")){q=u;if(v.data.build){var t=v.data.build(q,v);if(t===false){return}v.data=c.extend(true,{},j,v.data,t||{});if(!v.data.items||c.isEmptyObject(v.data.items)){if(window.console){(console.error||console.log)("No items specified to show in contextMenu")}throw new Error("No Items sepcified")}v.data.$trigger=q;f.create(v.data)}f.show.call(u,v.data,v.pageX,v.pageY)}},click:function(t){t.preventDefault();t.stopImmediatePropagation();c(this).trigger(c.Event("contextmenu",{data:t.data,pageX:t.pageX,pageY:t.pageY}))},mousedown:function(u){var t=c(this);if(q&&q.length&&!q.is(t)){q.data("contextMenu").$menu.trigger("contextmenu:hide")}if(u.button==2){q=t.data("contextMenuActive",true)}},mouseup:function(u){var t=c(this);if(t.data("contextMenuActive")&&q&&q.length&&q.is(t)&&!t.hasClass("context-menu-disabled")){u.preventDefault();u.stopImmediatePropagation();q=t;t.trigger(c.Event("contextmenu",{data:u.data,pageX:u.pageX,pageY:u.pageY}))}t.removeData("contextMenuActive")},mouseenter:function(v){var u=c(this),t=c(v.relatedTarget),w=c(document);if(t.is(".context-menu-list")||t.closest(".context-menu-list").length){return}if(q&&q.length){return}k.pageX=v.pageX;k.pageY=v.pageY;k.data=v.data;w.on("mousemove.contextMenuShow",s.mousemove);k.timer=setTimeout(function(){k.timer=null;w.off("mousemove.contextMenuShow");q=u;u.trigger(c.Event("contextmenu",{data:k.data,pageX:k.pageX,pageY:k.pageY}))},v.data.delay)},mousemove:function(t){k.pageX=t.pageX;k.pageY=t.pageY},mouseleave:function(u){var t=c(u.relatedTarget);if(t.is(".context-menu-list")||t.closest(".context-menu-list").length){return}try{clearTimeout(k.timer)}catch(u){}k.timer=null},layerClick:function(w){var A=c(this),C=A.data("contextMenuRoot"),u=false,v=w.button,D=w.pageX,B=w.pageY,z,t,E;w.preventDefault();w.stopImmediatePropagation();setTimeout(function(){var G,F,y;var x=((C.trigger=="left"&&v===0)||(C.trigger=="right"&&v===2));if(document.elementFromPoint){C.$layer.hide();z=document.elementFromPoint(D-o.scrollLeft(),B-o.scrollTop());C.$layer.show()}if(C.reposition&&x){if(document.elementFromPoint){if(C.$trigger.is(z)||C.$trigger.has(z).length){C.position.call(C.$trigger,C,D,B);return}}else{t=C.$trigger.offset();G=c(window);t.top+=G.scrollTop();if(t.top<=w.pageY){t.left+=G.scrollLeft();if(t.left<=w.pageX){t.bottom=t.top+C.$trigger.outerHeight();if(t.bottom>=w.pageY){t.right=t.left+C.$trigger.outerWidth();if(t.right>=w.pageX){C.position.call(C.$trigger,C,D,B);return}}}}}}if(z&&x){C.$trigger.one("contextmenu:hidden",function(){c(z).contextMenu({x:D,y:B})})}C.$menu.trigger("contextmenu:hide")},50)},keyStop:function(u,t){if(!t.isInput){u.preventDefault()}u.stopPropagation()},key:function(x){var v=q.data("contextMenu")||{};switch(x.keyCode){case 9:case 38:s.keyStop(x,v);if(v.isInput){if(x.keyCode==9&&x.shiftKey){x.preventDefault();v.$selected&&v.$selected.find("input, textarea, select").blur();v.$menu.trigger("prevcommand");return}else{if(x.keyCode==38&&v.$selected.find("input, textarea, select").prop("type")=="checkbox"){x.preventDefault();return}}}else{if(x.keyCode!=9||x.shiftKey){v.$menu.trigger("prevcommand");return}}case 40:s.keyStop(x,v);if(v.isInput){if(x.keyCode==9){x.preventDefault();v.$selected&&v.$selected.find("input, textarea, select").blur();v.$menu.trigger("nextcommand");return}else{if(x.keyCode==40&&v.$selected.find("input, textarea, select").prop("type")=="checkbox"){x.preventDefault();return}}}else{v.$menu.trigger("nextcommand");return}break;case 37:s.keyStop(x,v);if(v.isInput||!v.$selected||!v.$selected.length){break}if(!v.$selected.parent().hasClass("context-menu-root")){var w=v.$selected.parent().parent();v.$selected.trigger("contextmenu:blur");v.$selected=w;return}break;case 39:s.keyStop(x,v);if(v.isInput||!v.$selected||!v.$selected.length){break}var u=v.$selected.data("contextMenu")||{};if(u.$menu&&v.$selected.hasClass("context-menu-submenu")){v.$selected=null;u.$selected=null;u.$menu.trigger("nextcommand");return}break;case 35:case 36:if(v.$selected&&v.$selected.find("input, textarea, select").length){return}else{(v.$selected&&v.$selected.parent()||v.$menu).children(":not(.disabled, .not-selectable)")[x.keyCode==36?"first":"last"]().trigger("contextmenu:focus");x.preventDefault();return}break;case 13:s.keyStop(x,v);if(v.isInput){if(v.$selected&&!v.$selected.is("textarea, select")){x.preventDefault();return}break}v.$selected&&v.$selected.trigger("mouseup");return;case 32:case 33:case 34:s.keyStop(x,v);return;case 27:s.keyStop(x,v);v.$menu.trigger("contextmenu:hide");return;default:var t=(String.fromCharCode(x.keyCode)).toUpperCase();if(v.accesskeys[t]){v.accesskeys[t].$node.trigger(v.accesskeys[t].$menu?"contextmenu:focus":"mouseup");return}break}x.stopPropagation();v.$selected&&v.$selected.trigger(x)},prevItem:function(x){x.stopPropagation();var w=c(this).data("contextMenu")||{};if(w.$selected){var t=w.$selected;w=w.$selected.parent().data("contextMenu")||{};w.$selected=t}var v=w.$menu.children(),u=!w.$selected||!w.$selected.prev().length?v.last():w.$selected.prev(),z=u;while(u.hasClass("disabled")||u.hasClass("not-selectable")){if(u.prev().length){u=u.prev()}else{u=v.last()}if(u.is(z)){return}}if(w.$selected){s.itemMouseleave.call(w.$selected.get(0),x)}s.itemMouseenter.call(u.get(0),x);var y=u.find("input, textarea, select");if(y.length){y.focus()}},nextItem:function(x){x.stopPropagation();var w=c(this).data("contextMenu")||{};if(w.$selected){var t=w.$selected;w=w.$selected.parent().data("contextMenu")||{};w.$selected=t}var v=w.$menu.children(),u=!w.$selected||!w.$selected.next().length?v.first():w.$selected.next(),z=u;while(u.hasClass("disabled")||u.hasClass("not-selectable")){if(u.next().length){u=u.next()}else{u=v.first()}if(u.is(z)){return}}if(w.$selected){s.itemMouseleave.call(w.$selected.get(0),x)}s.itemMouseenter.call(u.get(0),x);var y=u.find("input, textarea, select");if(y.length){y.focus()}},focusInput:function(x){var w=c(this).closest(".context-menu-item"),v=w.data(),u=v.contextMenu,t=v.contextMenuRoot;t.$selected=u.$selected=w;t.isInput=u.isInput=true},blurInput:function(x){var w=c(this).closest(".context-menu-item"),v=w.data(),u=v.contextMenu,t=v.contextMenuRoot;t.isInput=u.isInput=false},menuMouseenter:function(u){var t=c(this).data().contextMenuRoot;t.hovering=true},menuMouseleave:function(u){var t=c(this).data().contextMenuRoot;if(t.$layer&&t.$layer.is(u.relatedTarget)){t.hovering=false}},itemMouseenter:function(x){var w=c(this),v=w.data(),u=v.contextMenu,t=v.contextMenuRoot;t.hovering=true;if(x&&t.$layer&&t.$layer.is(x.relatedTarget)){x.preventDefault();x.stopImmediatePropagation()}(u.$menu?u:t).$menu.children(".hover").trigger("contextmenu:blur");if(w.hasClass("disabled")||w.hasClass("not-selectable")){u.$selected=null;return}w.trigger("contextmenu:focus")},itemMouseleave:function(x){var w=c(this),v=w.data(),u=v.contextMenu,t=v.contextMenuRoot;if(t!==u&&t.$layer&&t.$layer.is(x.relatedTarget)){t.$selected&&t.$selected.trigger("contextmenu:blur");x.preventDefault();x.stopImmediatePropagation();t.$selected=u.$selected=u.$node;return}w.trigger("contextmenu:blur")},itemClick:function(y){var x=c(this),w=x.data(),v=w.contextMenu,t=w.contextMenuRoot,u=w.contextMenuKey,z;if(!v.items[u]||x.is(".disabled, .context-menu-submenu, .context-menu-separator, .not-selectable")){return}y.preventDefault();y.stopImmediatePropagation();if(c.isFunction(t.callbacks[u])&&Object.prototype.hasOwnProperty.call(t.callbacks,u)){z=t.callbacks[u]}else{if(c.isFunction(t.callback)){z=t.callback}else{return}}if(z.call(t.$trigger,u,t)!==false){t.$menu.trigger("contextmenu:hide")}else{if(t.$menu.parent().length){f.update.call(t.$trigger,t)}}},inputClick:function(t){t.stopImmediatePropagation()},hideMenu:function(v,u){var t=c(this).data("contextMenuRoot");f.hide.call(t.$trigger,t,u&&u.force)},focusItem:function(x){x.stopPropagation();var w=c(this),v=w.data(),u=v.contextMenu,t=v.contextMenuRoot;w.addClass("hover").siblings(".hover").trigger("contextmenu:blur");u.$selected=t.$selected=w;if(u.$node){t.positionSubmenu.call(u.$node,u.$menu)}},blurItem:function(x){x.stopPropagation();var w=c(this),v=w.data(),u=v.contextMenu,t=v.contextMenuRoot;w.removeClass("hover");u.$selected=null}},f={show:function(w,u,A){var t=c(this),z,v={};c("#context-menu-layer").trigger("mousedown");w.$trigger=t;if(w.events.show.call(t,w)===false){q=null;return}f.update.call(t,w);w.position.call(t,w,u,A);if(w.zIndex){v.zIndex=e(t)+w.zIndex}f.layer.call(w.$menu,w,v.zIndex);w.$menu.find("ul").css("zIndex",v.zIndex+1);w.$menu.css(v)[w.animation.show](w.animation.duration,function(){t.trigger("contextmenu:visible")});t.data("contextMenu",w).addClass("context-menu-active");c(document).off("keydown.contextMenu").on("keydown.contextMenu",s.key);if(w.autoHide){c(document).on("mousemove.contextMenuAutoHide",function(x){var y=t.offset();y.right=y.left+t.outerWidth();y.bottom=y.top+t.outerHeight();if(w.$layer&&!w.hovering&&(!(x.pageX>=y.left&&x.pageX<=y.right)||!(x.pageY>=y.top&&x.pageY<=y.bottom))){w.$menu.trigger("contextmenu:hide")}})}},hide:function(u,v){var t=c(this);if(!u){u=t.data("contextMenu")||{}}if(!v&&u.events&&u.events.hide.call(t,u)===false){return}t.removeData("contextMenu").removeClass("context-menu-active");if(u.$layer){setTimeout((function(x){return function(){x.remove()}})(u.$layer),10);try{delete u.$layer}catch(w){u.$layer=null}}q=null;u.$menu.find(".hover").trigger("contextmenu:blur");u.$selected=null;c(document).off(".contextMenuAutoHide").off("keydown.contextMenu");u.$menu&&u.$menu[u.animation.hide](u.animation.duration,function(){if(u.build){u.$menu.remove();c.each(u,function(x,y){switch(x){case"ns":case"selector":case"build":case"trigger":return true;default:u[x]=d;try{delete u[x]}catch(z){}return true}})}setTimeout(function(){t.trigger("contextmenu:hidden")},10)})},create:function(u,t){if(t===d){t=u}u.$menu=c('<ul class="context-menu-list"></ul>').addClass(u.className||"").data({contextMenu:u,contextMenuRoot:t});c.each(["callbacks","commands","inputs"],function(w,v){u[v]={};if(!t[v]){t[v]={}}});t.accesskeys||(t.accesskeys={});c.each(u.items,function(x,y){var C=c('<li class="context-menu-item"></li>').addClass(y.className||""),v=null,B=null;C.on("click",c.noop);y.$node=C.data({contextMenu:u,contextMenuRoot:t,contextMenuKey:x});if(y.accesskey){var z=n(y.accesskey);for(var w=0,A;A=z[w];w++){if(!t.accesskeys[A]){t.accesskeys[A]=y;y._name=y.name.replace(new RegExp("("+A+")","i"),'<span class="context-menu-accesskey">$1</span>');break}}}if(typeof y=="string"){C.addClass("context-menu-separator not-selectable")}else{if(y.type&&l[y.type]){l[y.type].call(C,y,u,t);c.each([u,t],function(E,D){D.commands[x]=y;if(c.isFunction(y.callback)){D.callbacks[x]=y.callback}})}else{if(y.type=="html"){C.addClass("context-menu-html not-selectable")}else{if(y.type){v=c("<label></label>").appendTo(C);c("<span></span>").html(y._name||y.name).appendTo(v);C.addClass("context-menu-input");u.hasTypes=true;c.each([u,t],function(E,D){D.commands[x]=y;D.inputs[x]=y})}else{if(y.items){y.type="sub"}}}switch(y.type){case"text":B=c('<input type="text" value="1" name="" value="">').attr("name","context-menu-input-"+x).val(y.value||"").appendTo(v);break;case"textarea":B=c('<textarea name=""></textarea>').attr("name","context-menu-input-"+x).val(y.value||"").appendTo(v);if(y.height){B.height(y.height)}break;case"checkbox":B=c('<input type="checkbox" value="1" name="" value="">').attr("name","context-menu-input-"+x).val(y.value||"").prop("checked",!!y.selected).prependTo(v);break;case"radio":B=c('<input type="radio" value="1" name="" value="">').attr("name","context-menu-input-"+y.radio).val(y.value||"").prop("checked",!!y.selected).prependTo(v);break;case"select":B=c('<select name="">').attr("name","context-menu-input-"+x).appendTo(v);if(y.options){c.each(y.options,function(D,E){c("<option></option>").val(D).text(E).appendTo(B)});B.val(y.selected)}break;case"sub":c("<span></span>").html(y._name||y.name).appendTo(C);y.appendTo=y.$node;f.create(y,t);C.data("contextMenu",y).addClass("context-menu-submenu");y.callback=null;break;case"html":c(y.html).appendTo(C);break;default:c.each([u,t],function(E,D){D.commands[x]=y;if(c.isFunction(y.callback)){D.callbacks[x]=y.callback}});c("<span></span>").html(y._name||y.name||"").appendTo(C);break}if(y.type&&y.type!="sub"&&y.type!="html"){B.on("focus",s.focusInput).on("blur",s.blurInput);if(y.events){B.on(y.events,u)}}if(y.icon){C.addClass("icon icon-"+y.icon)}}}y.$input=B;y.$label=v;C.appendTo(u.$menu);if(!u.hasTypes&&c.support.eventSelectstart){C.on("selectstart.disableTextSelect",s.abortevent)}});if(!u.$node){u.$menu.css("display","none").addClass("context-menu-root")}u.$menu.appendTo(u.appendTo||document.body)},resize:function(t,u){t.css({position:"absolute",display:"block"});t.data("width",Math.ceil(t.width())+1);t.css({position:"static",minWidth:"0px",maxWidth:"100000px"});t.find("> li > ul").each(function(){f.resize(c(this),true)});if(!u){t.find("ul").andSelf().css({position:"",display:"",minWidth:"",maxWidth:""}).width(function(){return c(this).data("width")})}},update:function(v,u){var t=this;if(u===d){u=v;f.resize(v.$menu)}v.$menu.children().each(function(){var w=c(this),x=w.data("contextMenuKey"),z=v.items[x],y=(c.isFunction(z.disabled)&&z.disabled.call(t,x,u))||z.disabled===true;w[y?"addClass":"removeClass"]("disabled");if(z.type){w.find("input, select, textarea").prop("disabled",y);switch(z.type){case"text":case"textarea":z.$input.val(z.value||"");break;case"checkbox":case"radio":z.$input.val(z.value||"").prop("checked",!!z.selected);break;case"select":z.$input.val(z.selected||"");break}}if(z.$menu){f.update.call(t,z,u)}})},layer:function(u,v){var t=u.$layer=c('<div id="context-menu-layer" style="position:fixed; z-index:'+v+'; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>').css({height:o.height(),width:o.width(),display:"block"}).data("contextMenuRoot",u).insertBefore(this).on("contextmenu",s.abortevent).on("mousedown",s.layerClick);if(!c.support.fixedPosition){t.css({position:"absolute",height:c(document).height()})}return t}};function n(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}c.fn.contextMenu=function(t){if(t===d){this.first().trigger("contextmenu")}else{if(t.x&&t.y){this.first().trigger(c.Event("contextmenu",{pageX:t.x,pageY:t.y}))}else{if(t==="hide"){var u=this.data("contextMenu").$menu;u&&u.trigger("contextmenu:hide")}else{if(t==="destroy"){c.contextMenu("destroy",{context:this})}else{if(c.isPlainObject(t)){t.context=this;c.contextMenu("create",t)}else{if(t){this.removeClass("context-menu-disabled")}else{if(!t){this.addClass("context-menu-disabled")}}}}}}}return this};c.contextMenu=function(x,B){if(typeof x!="string"){B=x;x="create"}if(typeof B=="string"){B={selector:B}}else{if(B===d){B={}}}var v=c.extend(true,{},j,B||{});var w=c(document);var z=w;var A=false;if(!v.context||!v.context.length){v.context=document}else{z=c(v.context).first();v.context=z.get(0);A=v.context!==document}switch(x){case"create":if(!v.selector){throw new Error("No selector specified")}if(v.selector.match(/.context-menu-(list|item|input)($|\s)/)){throw new Error('Cannot bind to selector "'+v.selector+'" as it contains a reserved className')}if(!v.build&&(!v.items||c.isEmptyObject(v.items))){throw new Error("No Items sepcified")}h++;v.ns=".contextMenu"+h;if(!A){g[v.selector]=v.ns}m[v.ns]=v;if(!v.trigger){v.trigger="right"}if(!b){w.on({"contextmenu:hide.contextMenu":s.hideMenu,"prevcommand.contextMenu":s.prevItem,"nextcommand.contextMenu":s.nextItem,"contextmenu.contextMenu":s.abortevent,"mouseenter.contextMenu":s.menuMouseenter,"mouseleave.contextMenu":s.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",s.inputClick).on({"mouseup.contextMenu":s.itemClick,"contextmenu:focus.contextMenu":s.focusItem,"contextmenu:blur.contextMenu":s.blurItem,"contextmenu.contextMenu":s.abortevent,"mouseenter.contextMenu":s.itemMouseenter,"mouseleave.contextMenu":s.itemMouseleave},".context-menu-item");b=true}z.on("contextmenu"+v.ns,v.selector,v,s.contextmenu);if(A){z.on("remove"+v.ns,function(){c(this).contextMenu("destroy")})}switch(v.trigger){case"hover":z.on("mouseenter"+v.ns,v.selector,v,s.mouseenter).on("mouseleave"+v.ns,v.selector,v,s.mouseleave);break;case"left":z.on("click"+v.ns,v.selector,v,s.click);break}if(!v.build){f.create(v)}break;case"destroy":var t;if(A){var u=v.context;c.each(m,function(C,E){if(E.context!==u){return true}t=c(".context-menu-list").filter(":visible");if(t.length&&t.data().contextMenuRoot.$trigger.is(c(E.context).find(E.selector))){t.trigger("contextmenu:hide",{force:true})}try{if(m[E.ns].$menu){m[E.ns].$menu.remove()}delete m[E.ns]}catch(D){m[E.ns]=null}c(E.context).off(E.ns);return true})}else{if(!v.selector){w.off(".contextMenu .contextMenuAutoHide");c.each(m,function(C,D){c(D.context).off(D.ns)});g={};m={};h=0;b=false;c("#context-menu-layer, .context-menu-list").remove()}else{if(g[v.selector]){t=c(".context-menu-list").filter(":visible");if(t.length&&t.data().contextMenuRoot.$trigger.is(v.selector)){t.trigger("contextmenu:hide",{force:true})}try{if(m[g[v.selector]].$menu){m[g[v.selector]].$menu.remove()}delete m[g[v.selector]]}catch(y){m[g[v.selector]]=null}w.off(g[v.selector])}}}break;case"html5":if((!c.support.htmlCommand&&!c.support.htmlMenuitem)||(typeof B=="boolean"&&B)){c('menu[type="context"]').each(function(){if(this.id){c.contextMenu({selector:"[contextmenu="+this.id+"]",items:c.contextMenu.fromMenu(this)})}}).css("display","none")}break;default:throw new Error('Unknown operation "'+x+'"')}return this};c.contextMenu.setInputValues=function(t,u){if(u===d){u={}}c.each(t.inputs,function(v,w){switch(w.type){case"text":case"textarea":w.value=u[v]||"";break;case"checkbox":w.selected=u[v]?true:false;break;case"radio":w.selected=(u[w.radio]||"")==w.value?true:false;break;case"select":w.selected=u[v]||"";break}})};c.contextMenu.getInputValues=function(t,u){if(u===d){u={}}c.each(t.inputs,function(v,w){switch(w.type){case"text":case"textarea":case"select":u[v]=w.$input.val();break;case"checkbox":u[v]=w.$input.prop("checked");break;case"radio":if(w.$input.prop("checked")){u[w.radio]=w.value}break}});return u};function p(t){return(t.id&&c('label[for="'+t.id+'"]').val())||t.name}function a(v,u,t){if(!t){t=0}u.each(function(){var w=c(this),z=this,A=this.nodeName.toLowerCase(),x,y;if(A=="label"&&w.find("input, textarea, select").length){x=w.text();w=w.children().first();z=w.get(0);A=z.nodeName.toLowerCase()}switch(A){case"menu":y={name:w.attr("label"),items:{}};t=a(y.items,w.children(),t);break;case"a":case"button":y={name:w.text(),disabled:!!w.attr("disabled"),callback:(function(){return function(){w.click()}})()};break;case"menuitem":case"command":switch(w.attr("type")){case d:case"command":case"menuitem":y={name:w.attr("label"),disabled:!!w.attr("disabled"),callback:(function(){return function(){w.click()}})()};break;case"checkbox":y={type:"checkbox",disabled:!!w.attr("disabled"),name:w.attr("label"),selected:!!w.attr("checked")};break;case"radio":y={type:"radio",disabled:!!w.attr("disabled"),name:w.attr("label"),radio:w.attr("radiogroup"),value:w.attr("id"),selected:!!w.attr("checked")};break;default:y=d}break;case"hr":y="-------";break;case"input":switch(w.attr("type")){case"text":y={type:"text",name:x||p(z),disabled:!!w.attr("disabled"),value:w.val()};break;case"checkbox":y={type:"checkbox",name:x||p(z),disabled:!!w.attr("disabled"),selected:!!w.attr("checked")};break;case"radio":y={type:"radio",name:x||p(z),disabled:!!w.attr("disabled"),radio:!!w.attr("name"),value:w.val(),selected:!!w.attr("checked")};break;default:y=d;break}break;case"select":y={type:"select",name:x||p(z),disabled:!!w.attr("disabled"),selected:w.val(),options:{}};w.children().each(function(){y.options[this.value]=c(this).text()});break;case"textarea":y={type:"textarea",name:x||p(z),disabled:!!w.attr("disabled"),value:w.val()};break;case"label":break;default:y={type:"html",html:w.clone(true)};break}if(y){t++;v["key"+t]=y}});return t}c.contextMenu.fromMenu=function(u){var v=c(u),t={};a(t,v.children());return t};c.contextMenu.defaults=j;c.contextMenu.types=l;c.contextMenu.handle=s;c.contextMenu.op=f;c.contextMenu.menus=m})(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(c,d){if(d!==undefined){b(this).accordion("option",c,d)}else{b(this).accordion("option",c)}},widget:function(){b(this).accordion("widget")},activate:function(c){b(this).accordion("activate",c)},resize:function(){b(this).accordion("resize")}});b.fn.rup_accordion("extend",{_init:function(d){if(d.length>1){b.rup.errorGestor(b.rup.i18n.base.rup_global.initError+b(this).attr("id"))}else{var g=this.children(),f=(g.length)/2,e=b.extend({},b.fn.rup_accordion.defaults,d[0]);this.removeClass("rup_accordion");this.data("settings",e);createUserEvent=e.create;e.create=function(h,j){if(createUserEvent!==undefined){if(createUserEvent(h,j)===false){return false}}c(h,j)};function c(h,j){b(h.target).addClass("rup_accordion_create")}if(e.validation){if(parseInt(f)!==f){b.rup.errorGestor(b.rup.i18n.base.rup_accordion.strucPairError);return false}else{g.each(function(j,h){if((parseInt(j/2)===j/2)&&(b(h).find("a").length===0)){b.rup.errorGestor(b.rup.i18n.base.rup_accordion.headFormatError);return false}})}}this.accordion(e)}}});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.ui.autocomplete.prototype,{_renderMenu:function(f,e){var g=this.options;if(g.category){var h=this,d="";b.each(e,function(k,l){var j;if(l.category!=d){f.append("<li class='ui-autocomplete-category'>"+l.category+"</li>");d=l.category}j=h._renderItem(f,l);if(l.category){j.attr("aria-label",l.category+" : "+l.label)}})}else{var c=this;b.each(e,function(j,k){c._renderItem(f,k)})}}});b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_autocomplete",a));b.fn.rup_autocomplete("extend",{getRupValue:function(){return b(this).val()},setRupValue:function(c){b(this).val(c)},destroy:function(){var c;if(b(this).attr("id").indexOf("_label")>=0){c=b(this)}else{c=b("#"+b(this).attr("id")+"_label")}c.autocomplete("destroy")},off:function(){var c;if(b(this).attr("id").indexOf("_label")>=0){c=b(this)}else{c=b("#"+b(this).attr("id")+"_label")}c.storeEvents()},on:function(){var c;if(b(this).attr("id").indexOf("_label")>=0){c=b(this)}else{c=b("#"+b(this).attr("id")+"_label")}c.restoreEvents()},disable:function(){var c;if(b(this).attr("id").indexOf("_label")>=0){c=b(this)}else{c=b("#"+b(this).attr("id")+"_label")}if(b("#"+this.attr("id")+"_label").has(".rup-combobox-input")){b("span").has(b("#"+this.attr("id")+"_label")).find("a").attr("style","display:none")}c.attr("disabled","disabled")},enable:function(){var c;if(b(this).attr("id").indexOf("_label")>=0){c=b(this)}else{c=b("#"+b(this).attr("id")+"_label")}if(b("#"+this.attr("id")+"_label").has(".rup-combobox-input")){b("span").has(b("#"+this.attr("id")+"_label")).find("a").removeAttr("style")}c.removeAttr("disabled")},option:function(e,g,c){var d;if(b(this).attr("id").indexOf("_label")>=0){d=b(this)}else{d=b("#"+b(this).attr("id")+"_label")}var f=d.data("settings");if(e==="source"){if(typeof g==="object"){if(c!==undefined){f.i18nId=c}else{f.i18nId=f.id}d.autocomplete("option",e,this._sourceLOCAL);d.autocomplete("option","minLength",f.minLength!==undefined?f.minLength:0)}else{if(c!==undefined){if(e=="data"){d.autocomplete("option","data",c)}else{f.sourceParam=c;d.autocomplete("option",e,this._sourceREMOTE);d.autocomplete("option","minLength",f.minLength>3?f.minLength:3)}}else{return undefined}}f.data=g;d.data("settings",f)}else{f[e]=g;d.data("settings",f);d.autocomplete("option",e,g)}},search:function(c){if(b._data(b(this)[0],"events")!==undefined){b(this).focus();b(this).val(c);b(this).autocomplete("search",c)}},close:function(){b(this).autocomplete("close")},val:function(){return b("#"+b(this).attr("id")).val()},set:function(f,c){var h=b(this),e=jQuery("[id='"+h.attr("id")+"_label']"),g,d={};h.val(f);h.attr("rup_autocomplete_label",c);e.val(c);g=e.data("loadObjects");d[c]=f;e.data("loadObjects",jQuery.extend(true,{},g,d))}});b.fn.rup_autocomplete("extend",{_parseResponse:function(d,c,f,e){if(e===undefined){return{label:c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.ui.autocomplete.escapeRegex(d)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>"),value:f}}else{return{label:c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.ui.autocomplete.escapeRegex(d)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>"),value:f,category:e}}},_sourceLOCAL:function(f,c){var e,j={},d,k;if(this.element.data("settings")!==undefined){e=this.element.data("settings")}else{e=this.options}if(e.loadObjects!==undefined){k=e.loadObjects}else{k=e.id}var h=e.contains?b.ui.autocomplete.escapeRegex(f.term):"^"+b.ui.autocomplete.escapeRegex(f.term),g=b.rup.i18n.app[e.i18nId];h=new RegExp(h,"i");data=b.map(e.data,function(n){var l=n,o=n,m;if(typeof n==="object"){if(n.i18nCaption!==undefined){l=b.rup.i18nParse(g,n.i18nCaption)}else{if(n.label!==undefined){l=n.label}else{l=n.value}}o=n.value;if(e.category){m=n.category}}if(!f.term||h.test(l)){if(e.category){d=e._parseResponse(f.term,l,o,m)}else{d=e._parseResponse(f.term,l,o)}j[d.label.replace(/<strong>/g,"").replace(/<\/strong>/g,"")]=d.value;return d}});b("#"+k).data("loadObjects",j);data=b.grep(data,function(l){return l!=undefined});c(data)},_sourceREMOTE:function(h,g){var n=this.element,e,l={},c,m,f,j,d,o,k;if(this.element.data("settings")!==undefined){e=this.element.data("settings")}else{e=this.options}if(e.loadObjects!==undefined){m=e.loadObjects}else{m=e.id}k=jQuery("#"+m);f=h.term.replace(/%/g,"\\%").replace(/_/g,"\\_");j=b.extend({q:f,c:this.options.contains},this.options.extraParams);d=k.data("tmp.loadObjects.term");if(f.indexOf(d)===0){k.data("tmp.loadObjects.term",f);o=e.data;e.data=k.data("tmp.data");jQuery.proxy(e.$self._sourceLOCAL,this,h,g)();e.data=o}else{b.rup_ajax({url:e.data,data:j,dataType:"json",contentType:"application/json",beforeSend:function(p){b("#"+e.id+"_label").addClass("rup-autocomplete_loading");p.setRequestHeader("RUP",b.toJSON(e.sourceParam))},success:function(p){n.triggerHandler("rupAutocomplete_beforeLoadComplete",[p]);if(p.length==0){jQuery("#"+e.id+"_label").autocomplete("close");return null}g(b.map(p,function(q){if(e.category==true){c=e._parseResponse(h.term,q.label,q.value,q.category)}else{c=e._parseResponse(h.term,q.label,q.value)}l[c.label.replace(/<strong>/g,"").replace(/<\/strong>/g,"")]=c.value;return c}));k.data("loadObjects",l);k.data("tmp.loadObjects.term",f);k.data("tmp.data",p);n.triggerHandler("rupAutocomplete_loadComplete",[p])},error:function(q,r,p){if(e.onLoadError!==null&&typeof e.onLoadError==="function"){jQuery(e.onLoadError(q,r,p))}else{b.rup.showErrorToUser(b.rup.i18n.base.rup_autocomplete.ajaxError)}},complete:function(p,q){b("#"+e.id+"_label").removeClass("rup-autocomplete_loading")}})}},_createShowAllButton:function(){var c=this,f=false;c.wrap(jQuery("<span>").addClass("rup-combobox"));var e=c.parent();var d=b("<a>").attr("tabIndex",-1).attr("title",b.rup.i18n.base.rup_autocomplete.showAllItems).rup_tooltip().button({icons:{primary:"ui-icon-triangle-1-s"},text:false}).removeClass("ui-corner-all").addClass("rup-combobox-toggle ui-corner-right").mousedown(function(){f=c.autocomplete("widget").is(":visible")}).click(function(){c.focus();if(f){return true}c.autocomplete("search","")});d.appendTo(e)},_init:function(d){var h;if(d.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var g=b(this),f=b.extend({},b.fn.rup_autocomplete.defaults,d[0]),c=b(this).attr("name"),e;b(this).attr("ruptype","autocomplete");f.id=b(this).attr("id");f.loadObjects=f.id;f.data=f.source;f._parseResponse=this._parseResponse;f._sourceLOCAL=this._sourceLOCAL;f.$self=this;f.loadValue=b("#"+f.id).attr("value");if(!f.i18nId){f.i18nId=f.id}f._change=f.change;f._select=f.select;f._focus=f.focus;f.change=function(j,k){if(e!=null){b("#"+j.target.id).val(e);b("#"+j.target.id).focus()}e=null;if(f._change!==undefined){f._change(j,k)}g.triggerHandler("rupAutocomplete_change")};f.select=function(j,k){e=k.item.label.replace(/<strong>/g,"").replace(/<\/strong>/g,"");if(f._select!==undefined){f._select(j,k)}b("#"+f.id).attr("rup_autocomplete_label",e);b("#"+f.id).data("selected",true);g.triggerHandler("rupAutocomplete_select",[k])};f.focus=function(j,k){b("#"+j.target.id).val(k.item.label.replace(/<strong>/g,"").replace(/<\/strong>/g,""));if(f._focus!==undefined){f._focus(j,k)}return false};b("#"+f.id).after(b("<input>").attr({type:"hidden",id:f.id+"_value",name:(f.valueName===null?c:f.valueName),ruptype:"autocomplete"})).attr("name",(f.labelName===null?c+"_label":f.labelName)).addClass("rup-autocomplete_label");if(typeof f.source==="object"){f.source=this._sourceLOCAL}else{f.minLength=f.minLength>3?f.minLength:3;f.source=this._sourceREMOTE}b("#"+f.id).data("loadObjects",{});if(f.combobox===true){b("#"+f.id).addClass("rup-combobox-input ui-corner-left");f.minLength=0}jQuery(f.appendTo).addClass("ui-front");jQuery("#"+f.id).autocomplete(f);f.$menu=jQuery("#"+f.id).data("autocomplete").menu.element.attr("id",f.id+"_menu");f.$menu.off("mousedown");f.$menu.on("mousedown",function(j){var k=jQuery("#"+f.id+"_menu")[0];if(!b(j.target).closest(".ui-menu-item").length){setTimeout(function(){b(document).one("mousedown",function(l){if(l.target!==jQuery("#"+f.id+"_label")&&l.target!==k&&!b.ui.contains(k,l.target)){jQuery("#"+f.id+"_label").autocomplete("close")}})},1)}else{b("#"+f.id+"_label").triggerHandler("blur")}setTimeout(function(){clearTimeout(b("#"+f.id+"_label").data("autocomplete").closing)},13)});if(f.combobox===true){this._createShowAllButton()}if(f.menuMaxHeight!==false){jQuery("#"+f.id).on("autocompleteopen",function(){f.$menu.css("overflow-y","auto").css("overflow-x","hidden").css("max-height",f.menuMaxHeight).css("width",jQuery("#"+f.id+"_label").innerWidth())})}if(f.menuAppendTo!==null){if(jQuery(f.menuAppendTo).length===0){alert("Es necesario especificar un selector válido para la propiedad menuAppendTo")}else{jQuery(f.menuAppendTo).append(f.$menu)}}else{if(b.rup_utils.aplicatioInPortal()){b("div.r01gContainer").append(f.$menu)}}if(f.disabled===true){b("#"+f.id).rup_autocomplete("disable");if(f.combobox){b("span").has("#"+f.id+"_label").find("a").attr("style","display:none")}}else{if(f.disabled===false){b("#"+f.id).rup_autocomplete("enable");if(f.combobox){b("span").has("#"+f.id+"_label").find("a").removeAttr("style")}}}if(f.defaultValue){b("#"+f.id).rup_autocomplete("search",f.defaultValue)}if(f.loadValue){b("#"+f.id).val(f.loadValue);b("#"+f.id+"_value").val(f.loadValue)}f.loadObjects=f.id+"_label";b("#"+f.id).attr("id",f.id+"_label");b("#"+f.id+"_value").attr("id",f.id);b("#"+f.id+"_menu").on("mousedown",function(l){var k=b("#"+f.id).data("selected"),j=b(".ui-autocomplete:visible").length>0?true:false;if(!k&&j){h=true;l.preventDefault()}});b("#"+f.id+"_label").bind("blur keydown",function(l){var k=b("#"+f.id).data("selected"),j=b(".ui-autocomplete:visible").length>0?true:false;b("#"+f.id).data("selected",false);if(l.type==="keydown"&&l.keyCode!==13){return true}if(h===true){b("#"+f.id).focus();l.stopPropagation();h=false;return true}var m=b(l.currentTarget),n=b("#"+f.loadObjects).data("loadObjects");if(f.getText==true){if(n[m.val()]!==undefined){b("#"+f.id).val(m.val());b("#"+f.id).attr("rup_autocomplete_label",m.val())}else{b("#"+f.id).val(m.val());b("#"+f.id).attr("rup_autocomplete_label",m.val())}}else{if(n[m.val()]!==undefined){b("#"+f.id).val(n[m.val()]);b("#"+f.id).attr("rup_autocomplete_label",n[m.val()])}else{b("#"+f.id).val("");b("#"+f.id).attr("rup_autocomplete_label","");m.val("");m.autocomplete("close")}}if(l.type==="keydown"&&l.keyCode===13&&(k||j)){return false}})}b("#"+f.id+"_label").data("settings",f)}});b.fn.rup_autocomplete.defaults={onLoadError:null,contains:true,valueName:null,labelName:null,getText:false,combobox:false,menuMaxHeight:false,menuAppendTo:null,disabled: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,c=b.substring(a.rup.CTX_PATH.length),f=c.split("/"),h=a("<ul>").attr("id","rup_breadCrumbs_ul").addClass("rup-breadCrumb_main"),j=null,d=null,k=(this.options.initUrl!==undefined)?a.rup.CTX_PATH+this.options.initUrl:a.rup.CTX_PATH,g=(this.options.i18nId===undefined)?this.element.attr("id"):this.options.i18nId;if(this.options.breadCrumb instanceof Object){j=this.options.breadCrumb}else{a.rup.getFile(this.options.breadCrumb);j=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(l){a(this).find("span").removeClass("rup-breadCrumb_logoutImg").addClass("rup-breadCrumb_logoutImg_active")}).mouseleave(function(l){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)}h.append(this._createLI(a.rup.i18nParse(a.rup.i18n.base,"rup_breadCrumb.start"),k));for(var e=0;e<f.length;e++){if(j[f[e]]){j=this._createBreadCrumb(j[f[e]],f[e],h,g)}}a(h.children()[h.children().length-1]).addClass("rup-breadCrumb_current").find("img.rup-icon, span.rup-icon").remove();d=a("a:first",a(h.children()[h.children().length-1]));d.replaceWith(a("<span>").text(d.text()).css({"font-weight":"bold",color:"#333333"}));delete d;this.element.append(h);h.xBreadcrumbs()},_createLI:function(c,e,f){var b=a("<li>"),d=a("<a>").attr("href",e).text(c);b.append(d);if(f!==false){b.append(a("<span>").addClass("ui-icon rup-icon rup-icon-separator-arrow"))}return b},_createBreadCrumb:function(f,g,d,b){var h,e=a("<ul>");if(f.i18nCaption){h=this._createLI(a.rup.i18nParse(a.rup.i18n.app[b],f.i18nCaption),(f.url?a.rup.CTX_PATH+f.url:"#"))}if(f.subLevel){for(var c=0;c<f.subLevel.length;c++){e.append(this._createLI(a.rup.i18nParse(a.rup.i18n.app[b],f.subLevel[c].i18nCaption),(f.subLevel[c].url?f.subLevel[c].url:"#"),false).css("background","none"))}h.append(e);a(h).bind("mouseover",function(j){a(this).find("a:eq(1)").focus()});h.bind("keydown",function(l){switch(l.keyCode){case a.ui.keyCode.UP:var k=a(this).find("li > a");for(var j=0;j<=k.length;j++){if(k[j].text===a(l.target).text()){break}}if(a(k[j-1]).length>0){a(k[j-1]).focus()}else{a(this).find("li > a").last().focus()}break;case a.ui.keyCode.DOWN:var k=a(this).find("li > a");for(var j=0;j<=k.length;j++){if(k[j].text===a(l.target).text()){break}}if(a(k[j+1]).length>0){a(k[j+1]).focus()}else{a(this).find("li > a").first().focus()}break;case a.ui.keyCode.ESCAPE:a(this).children("ul").hide();break;default:}})}d.append(h);return f},_setOption:function(b,c){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(f){var m=a(this),h=m.data("settings"),j,k,d,l,e,n,g={},c;c=m.attr("name");if(c){k=m.attr("name").split(".")}if(h.submitAsJSON){return jQuery.rup_utils.getRupValueAsJson(c,m.rup_combo("value"))}j=h.submitAsString?m.rup_combo("value").toString():m.rup_combo("value");if(k!==undefined&&k!==null&&h.multiselect){g[k[k.length-1]]=j}return(h.multiselect===true&&k!==undefined&&k.length>1)&&h.legacyWrapMode===false?g:j},setRupValue:function(e){var d=a(this),c=d.data("settings");if(this.length===0||!a(this).data("settings").multiselect){a.data(this[0],"setRupValue",e.toString());a(this).rup_combo("select",e.toString())}else{a(this).rup_combo("select",(c.readAsString===true?e.split(","):e))}},clear:function(){if(this.length===0||!a(this).data("settings").multiselect){a(this).rup_combo("select")}else{a(this).multiselect("uncheckAll")}},reset:function(){var c=a(this);c.rup_combo("select",c.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(f){if(this.length===0||!a(this).data("settings").multiselect){var d=this._setElement(a(this),f);if(d){var c=a(this).data("childs");if(c!==undefined){for(var e=0;e<c.length;e=e+1){a("#"+c[e]).rup_combo("reload",c[e])}}}}else{this._setElement(a(this),f,true)}},selectLabel:function(f){if(this.length===0||!a(this).data("settings").multiselect){var d=this._selectLabel(a(this),f,true);if(d){var c=a(this).data("childs");if(c!==undefined){for(var e=0;e<c.length;e=e+1){a("#"+c[e]).rup_combo("reload",c[e])}}}}else{for(var e=0;e<f.length;e++){a("input[name='multiselect_"+a(this).attr("id")+"'][title='"+f[e]+"']").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 e=new Array(),d=a(this).multiselect("getChecked");for(var c=0;c<d.size();c++){e.push(a(d[c]).val())}return e}},label:function(){if(this.length===0||!a(this).data("settings").multiselect){return(this[0].options[a(this).selectmenu("index")].text)}else{var e=new Array(),d=a(this).multiselect("getChecked");for(var c=0;c<d.size();c++){e.push(a(d[c]).next().text())}return e}},index:function(){if(this.length===0||!a(this).data("settings").multiselect){return(a(this).selectmenu("index"))}else{var f=new Array(),e=a(this).rup_combo("value"),c=a(this).find("option");for(var d=0;d<c.size();d++){if(a.inArray(a(c[d]).val(),e)!==-1){f.push(d)}}return f}},disable:function(){var c=a(this);a("#"+a(this).attr("id")+"-button").attr("tabindex",-1);a("#"+a(this).attr("id")+"-button").on("focus.rup_combo",function(d){a("#"+c.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 d=a(this),c=a(this).data("settings");a("#"+a(this).attr("id")+"-button").off("focus.rup_combo");a("#"+a(this).attr("id")+"-button").attr("tabindex",(c.tabindex?c.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 c=a(this).data("childs");if(c!==undefined){for(var d=0;d<c.length;d=d+1){a("#"+c[d]).rup_combo("disableChild")}}},disableOpt:function(h){if(a(this).data("settings").multiselect){this.find("[value='"+h+"']").attr("disabled","disabled");var g=a("#rup-multiCombo_"+a(this).attr("id")).find("[value='"+h+"']");g.attr("disabled","disabled");g.parent().css("color","grey");if(a(this).data("settings").sourceGroup!=undefined){var c=g.parentsUntil("ul").last().prevAll("li.ui-multiselect-optgroup-label").first(),d=c.nextUntil("li.ui-multiselect-optgroup-label").find("input"),e=true;for(var f=0;f<d.length;f++){if(!d[f].disabled){e=false;break}}if(e){c.css("color","grey");c.children("a").remove();c.children("span").not(".rup-combo_multiOptgroupLabel").remove()}}}else{alert("Función no soportada.")}},disableOptArr:function(d){if(a(this).data("settings").multiselect){for(var c=0;c<d.length;c++){a(this).rup_combo("disableOpt",d[c])}}else{alert("Función no soportada.")}},enableOpt:function(e){if(a(this).data("settings").multiselect){this.find("[value='"+e+"']").removeAttr("disabled");var d=a("#rup-multiCombo_"+a(this).attr("id")).find("[value='"+e+"']");d.removeAttr("disabled");d.parent().css("color","black");if(a(this).data("settings").sourceGroup!=undefined){var c=d.parentsUntil("ul").last().prevAll("li.ui-multiselect-optgroup-label").first();if(c.children("a").length===0){c.css("color","black");this._generateOptGroupLabel(c,a(this).data("settings").multiOptgroupIconText)}}}else{alert("Función no soportada.")}},enableOptArr:function(d){if(a(this).data("settings").multiselect){for(var c=0;c<d.length;c++){a(this).rup_combo("enableOpt",d[c])}}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 d=a(this).data("settings").multiOptgroupIconText,c=this;a.each(a("#rup-multiCombo_"+a(this).attr("id")).find(".ui-multiselect-optgroup-label"),function(f,e){c._generateOptGroupLabel(e,d)});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(h){if(this.length!==0){var d=a(this).data("settings"),g,e;a("#"+d.id).rup_combo("disableChild");if(typeof d.source==="object"||typeof d.sourceGroup==="object"){g=d.source[this._getParentsValues(d.parent,false,d.multiValueToken)];if(g!==undefined){this._parseLOCAL(g,d,a("#"+d.id));this._makeCombo(d);if(d.onLoadSuccess!==null){jQuery(d.onLoadSuccess(a("#"+d.id)))}a("#"+d.id).selectmenu("change");e=a.data(a("#"+d.id)[0],"setRupValue");if(e){a("#"+d.id).rup_combo("select",e)}}}else{if(typeof d.source==="string"||typeof d.sourceGroup==="string"){var f=this._getParentsValues(d.parent,true),c=this;if(f===null){return false}a.rup_ajax({url:d.source?d.source:d.sourceGroup,data:f,dataType:"json",contentType:"application/json",beforeSend:function(j){c._ajaxBeforeSend(j,d)},success:function(k,l,j){c._ajaxSuccess(k,d,a("#"+d.id));if(d.onLoadSuccess!==null){jQuery(d.onLoadSuccess(a("#"+d.id)))}},error:function(k,l,j){if(d.onLoadError!==null){jQuery(d.onLoadError(k,l,j))}else{self._ajaxError(k,l,j)}}});delete c}else{if(typeof d.source==="function"||typeof d.sourceGroup==="function"){jQuery(d.source);this._makeCombo(d)}}}}},order:function(h,n,k){var c=a(this),m=a("option",c),g=[],e=null;if(c.length>0){var j=c.rup_combo("value");m.each(function(){if(k){k=false;e={val:a(this).val(),text:a(this).text()};return true}g.push({val:a(this).val(),text:a(this).text(),clazz:a(this).attr("class")})});if(!h){if(!n){g.sort(function(o,l){return o.text.localeCompare(l.text)})}else{g.sort(function(o,l){return o.text-l.text})}}else{if(!n){g.sort(function(o,l){if(o.val>l.val){return 1}else{if(o.val==l.val){return 0}else{return -1}}})}else{g.sort(function(o,l){return o.val-l.val})}}for(var f=0,d=g.length;f<d;f++){a(m[f]).val(g[f].val).text(g[f].text);if(g[f].clazz){a(m[f]).attr("class",g[f].clazz)}}if(e){c.prepend(a("<option>").attr("value",e.val).text(e.text));a(m[g.length]).remove()}c.rup_combo("refresh");this._setElement(a(this),j,a(this).data("settings").multiselect);delete c;delete m;delete g}}});a.fn.rup_combo("extend",{_setElement:function(c,g,d,f){if(d!==true){if(typeof g==="string"){if(a("option[value='"+g+"']",c).length>0){if(f===true){a("option[value='"+g+"']",c).attr("selected","selected")}a(c).selectmenu("value",g)}else{return false}}else{if(typeof g==="number"){if(a("option",c).length>=g){if(f===true){a("option:eq("+g+")",c).attr("selected","selected")}a(c).selectmenu("index",g)}else{return false}}else{a(c).selectmenu("index",0)}}return true}else{if(g!==null&&typeof g==="object"){for(var e=0;e<g.length;e++){if(typeof g[e]==="number"){a(a("input[name='multiselect_"+a(this).attr("id")+"']")[g[e]]).attr("checked",true)}else{if(typeof g[e]==="string"){a("input[name='multiselect_"+a(this).attr("id")+"'][value='"+g[e]+"']").attr("checked",true)}}}a(c).val(g);a(c).multiselect("update")}return true}},_selectLabel:function(c,f){var e;for(var d=0;d<a("option",c).length;d=d+1){e=jQuery("option:eq("+d+")",c);if(jQuery("option:eq("+d+")",c).text()===f){a(c).selectmenu("index",e.prop("index"));return true}}return false},_getBlankLabel:function(d){var c=a.rup.i18n.app;if(c[d]&&c[d]["_blank"]){return c[d]["_blank"]}return a.rup.i18n.base.rup_combo["blankNotDefined"]},_defaultFormatting:function(e){var c=[{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 d in c){e=e.replace(c[d].find,c[d].rep)}return e},_getParentsValues:function(k,h,e){var g="",j,c,e=e!=null?e:"",d;if(k===undefined){return g}for(var f=0;f<k.length;f=f+1){j=k[f];if(a("#"+j).rup_combo("index")===0){c=a("#"+j+"-button span:first-child").text();if(c===a.rup.i18n.base.rup_combo["blankNotDefined"]||((a.rup.i18n.app[j]!==undefined)&&(c===a.rup.i18n.app[k[f]]["_blank"]))){return null}}if(a("#"+j).data("settings").blank!==undefined&&a("#"+j).data("settings").blank!==null){d=a("#"+j).data("settings").blank}else{d=""}if(a("#"+j).val()===null||a("#"+j).val()===d){return null}if(h){g+=a("#"+j).attr("name")+"="+a("#"+j).val()+"&"}else{g+=a("#"+j).val()+e}}if(g!==""){if(h){g=g.substring(0,g.length-1)}else{g=g.substring(0,g.length-e.length)}}return g},_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).data("multiselect").button.attr("id",g.id+"-button");a("#"+g.id).rup_combo("refresh");a("#"+g.id).attr("multiple","multiple");var d=this;a("#"+g.id).data("multiselect").button.on("keypress.selectmenu",function(h){if(h.which>0){d._typeAheadMultiselect(h.which,"focus",g)}return true});a("#"+g.id).data("multiselect").menu.delegate("label","keydown.multiselect",function(h){if(h.which>0){d._typeAheadMultiselect(h.which,"focus",g)}return true})}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){if(jQuery.isArray(g.inputValue)===false){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 c=g.parent;if(c!==undefined){a.each(c,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(j,f,e){var h=f.imgs?f.imgs:[],c,g;for(var d=0;d<j.length;d=d+1){c=g=j[d];if(typeof j[d]==="object"){if(j[d]["i18nCaption"]){c=a.rup.i18nParse(a.rup.i18n.app[f.i18nId],j[d]["i18nCaption"])}else{c=j[d]["label"]}g=j[d]["value"]}if(j[d]!=undefined&&j[d]["style"]){h[h.length]={};h[h.length-1][g]=j[d]["style"];f.imgs=h}e.append(a("<option>").attr("value",g).text(f.showValue?g+f.token+c:c))}},_parseOptGroupLOCAL:function(g,f,e){var h,c=this;for(var d=0;d<g.length;d=d+1){h=g[d];a.each(h,function(j,k){if(typeof(k[0])!=="string"){e.append(a("<optgroup>").attr("label",a.rup.i18nParse(a.rup.i18n.app[f.i18nId],j)))}else{e.append(a("<optgroup>").attr("label",j))}e=a(e).children("optgroup:last-child");c._parseLOCAL(k,f,e);e=a(e).parent()})}},_parseREMOTE:function(k,f,e,j){var d=f.imgs?f.imgs:[],h,g;for(var c=0;c<k.length;c=c+1){h=k[c];if(h.style){d[d.length]={};if(j==null){d[d.length-1][h.value]=h.style}else{d[d.length-1][j+"###"+h.value]=h.style}f.imgs=d}e.append(a("<option>").attr("value",h.value).text(f.showValue?h.value+f.token+h.label:h.label))}},_parseOptGroupREMOTE:function(g,f,e){var h,c=this;for(var d=0;d<g.length;d=d+1){h=g[d];a.each(h,function(j,k){e.append(a("<optgroup>").attr("label",j));e=a(e).children("optgroup:last-child");c._parseREMOTE(k,f,e,j);e=a(e).parent()})}},_ajaxBeforeSend:function(f,e,c){if(c!==undefined){a("#"+e.id).replaceWith(c)}this._makeCombo(e);a("#"+e.id).rup_combo("disable");a("#"+e.id+"-button span:first-child").addClass("rup-combo_loadingText").text(a.rup.i18n.base.rup_combo["loadingText"]);var d=a("#"+e.id+"-button span:last-child");a(d).removeClass("ui-icon-triangle-1-s");a(d).addClass("rup-combo_loading");f.setRequestHeader("RUP",a.toJSON(e.sourceParam))},_ajaxSuccess:function(f,e,c){a("#"+e.id+"-button span:first-child").removeClass("rup-combo_loadingText").text("");var d=a("#"+e.id+"-button span:last-child");a(d).removeClass("rup-combo_loading");a(d).addClass("ui-icon-triangle-1-s");a("#"+e.id).empty();if(f.length>0){if(e.source){this._parseREMOTE(f,e,c)}else{e.ordered=false;this._parseOptGroupREMOTE(f,e,c)}this._makeCombo(e);setRupValue=a.data(a("#"+e.id)[0],"setRupValue");if(setRupValue){a("#"+e.id).rup_combo("select",setRupValue)}else{a("#"+e.id).selectmenu("change")}}else{a("#"+e.id).append("<option></option>")}},_ajaxError:function(e,f,d,c){if(e.responseText!==null){a.rup.showErrorToUser(e.responseText)}else{a.rup.showErrorToUser(a.rup.i18n.base.rup_combo.ajaxError)}},_generateOptGroupLabel:function(c,d){a(c).append(a("<span />").text(a(c).children("a").text()).addClass("rup-combo_multiOptgroupLabel"));a(c).children("a").remove();a(c).append(a("<span />").text(" ["));a(c).append(a("<a />").text(d?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 e=a(c).nextUntil("li.ui-multiselect-optgroup-label").find("input");for(var f=0;f<e.length;f++){if(!e[f].disabled){e[f].checked=false}}}));a(c).append(a("<span />").text(" | "));a(c).append(a("<a />").text(d?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 e=a(c).nextUntil("li.ui-multiselect-optgroup-label").find("input");for(var f=0;f<e.length;f++){if(!e[f].disabled){e[f].checked=true}}}));a(c).append(a("<span />").text(" ]"))},_selectedOptionLiMultiselect:function(d){var c=a("#"+d.id).data("multiselect");return this._optionLis.eq(this._selectedIndex())},_focusedOptionLiMultiselect:function(e){var d=a("#"+e.id).data("multiselect");var c=undefined;jQuery.each(d.inputs,function(f,g){if(a(g).parent().has(".ui-state-hover")){c=a(g)}});return c},_typeAheadMultiselect:function(f,g,h){var o=this,m=String.fromCharCode(f).toLowerCase(),e=null,l=null;if(o._typeAhead_timer){window.clearTimeout(o._typeAhead_timer);o._typeAhead_timer=undefined}o._typeAhead_chars=(o._typeAhead_chars===undefined?"":o._typeAhead_chars).concat(m);if(o._typeAhead_chars.length<2||(o._typeAhead_chars.substr(-2,1)===m&&o._typeAhead_cycling)){o._typeAhead_cycling=true;e=m}else{o._typeAhead_cycling=false;e=o._typeAhead_chars}var j=(g!=="focus"?this._selectedOptionLiMultiselect(h).data("index"):this._focusedOptionLiMultiselect(h).data("index"))||0;var n=a("#"+h.id).data("multiselect");for(var k=0;k<n.inputs.length;k++){var d=n.inputs.eq(k).next("span").text().substr(0,e.length).toLowerCase();if(d===e){if(o._typeAhead_cycling){if(l===null){l=k}if(k>j){l=k;break}}else{l=k}}}if(l!==null){n.inputs.eq(k).parent().trigger("mouseover");n.inputs.eq(k).trigger(g)}o._typeAhead_timer=window.setTimeout(function(){o._typeAhead_timer=undefined;o._typeAhead_chars=undefined;o._typeAhead_cycling=undefined},h.typeAhead)},_init:function(l){if(l.length>1){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_global.initError")+a(this).attr("id"))}else{var e=a.extend({},a.fn.rup_combo.defaults,l[0]),j,g=false,d=false;e.tabindex=a(this).attr("tabindex");a.extend(a.ech.multiselect.prototype.options,a.rup.i18n.base.rup_combo["multiselect"]);e.id=a.rup_utils.escapeId(a(this).attr("id"));e.name=a(this).attr("name");if(!e.i18nId){e.i18nId=e.id}e.inputValue=a("#"+e.id).attr("value");j=a("<select>").attr({id:a(this).attr("id"),name:e.name,ruptype:"combo","class":a(this).attr("class")}).addClass("rup_combo");if(a(this).hasClass("validableElem")){d=true;j.addClass("validableElem")}if(a(this).hasClass("customelement")){d=true;j.addClass("customelement")}if(e.firstLoad===null&&(a(this).is("select")&&e.loadFromSelect)){g=true}if(e.parent){a.map(e.parent,function(p){var o=a("#"+p).data("childs")===undefined?[]:a("#"+p).data("childs");o[o.length]=e.id;a("#"+p).data("childs",o)});if(e.loadFromSelect===false){if(e.firstLoad!==null){this._parseLOCAL(e.firstLoad,e,j)}a("#"+e.id).replaceWith(j)}else{a("#"+e.id).attr("ruptype","combo").removeClass().addClass("rup_combo");if(d){a("#"+e.id).removeClass().addClass("validableElem")}}this._makeCombo(e);if(!(a(this).is("select")&&e.loadFromSelect)){a("#"+e.id).rup_combo("disable")}else{var n=a(this).find("option");var k=true;for(var h=0;h<n.size();h=h+1){if(a(n[h]).attr("value")!==""){k=false;break}}if(k){a("#"+e.id).rup_combo("disable")}}a("#"+e.id).data("settings",e);if(this._getParentsValues(e.parent)!==null&&(e.firstLoad===null&&e.loadFromSelect===false)){a("#"+e.id).rup_combo("reload",e.id)}}else{if(typeof e.source==="object"||typeof e.sourceGroup==="object"||g){if(e.loadFromSelect===false){if(e.source){this._parseLOCAL((e.firstLoad!==null?e.firstLoad:e.source),e,j)}else{e.ordered=false;this._parseOptGroupLOCAL((e.firstLoad!==null?e.firstLoad:e.sourceGroup),e,j)}a("#"+e.id).replaceWith(j)}else{a("#"+e.id).attr("ruptype","combo").removeClass().addClass("rup_combo");if(d){a("#"+e.id).removeClass().addClass("validableElem")}}this._makeCombo(e);if(e.onLoadSuccess!==null){jQuery(e.onLoadSuccess(a("#"+e.id)))}a("#"+e.id).data("settings",e)}else{if(typeof e.source==="string"||typeof e.sourceGroup==="string"){var c=e.source?e.source:e.sourceGroup,f=this,m=this;a.rup_ajax({url:c,dataType:"json",contentType:"application/json",beforeSend:function(o){f._ajaxBeforeSend(o,e,j)},success:function(p,q,o){f._ajaxSuccess(p,e,j);if(e.onLoadSuccess!==null){jQuery(e.onLoadSuccess(a("#"+e.id)))}},error:function(p,q,o){if(e.onLoadError!==null){jQuery(e.onLoadError(p,q,o))}else{m._ajaxError(p,q,o)}}});delete f;a("#"+e.id).data("settings",e)}else{if(typeof e.source==="function"||typeof e.sourceGroup==="function"){jQuery(e.source);this._makeCombo(e);a("#"+e.id).data("settings",e)}}}}a("#"+e.id).bind("change",function(o,p){if(!e.multiselect){a("#"+e.id).rup_combo("select",a("#"+e.id).val())}else{a("#"+e.id).rup_combo("select",a("#"+e.id).rup_combo("getRupvalue"))}});delete j;a("#"+e.id).next("a").click(function(o){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,readAsString:false,rowStriping:false,typeAhead:1000,legacyWrapMode: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(c){b(this).contextMenu(c)},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(d){if(d.length>1){b.rup.errorGestor(b.rup.i18nParse(b.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var g=this,f=b.extend({},b.fn.rup_contextMenu.defaults,d[0]),e,c;f.selector=g.selector;jQuery.contextMenu(f);g.addClass("context-menu-cursor");if(jQuery.rup.browser.isIE){g.css("cursor",f.msieCursorCss)}b.each(b(".context-menu-list.context-menu-root"),function(j,k){var h=jQuery(k);if(h.data("contextMenuRoot").selector===f.selector){b.each(b(".context-menu-item"),function(m,n){var l=jQuery(n),q=l.data("contextMenuKey"),p,o;if(q!==undefined){o=f.items[q];if(o!==undefined){p=o.cssSprite;if(p!==undefined&&!l.hasClass("rup-css-sprite")){l.addClass("rup-css-sprite");l.prepend(b("<span>").addClass(p))}if(o.id!==undefined){l.attr("id",o.id)}}}})}})}}});b.fn.rup_contextMenu.defaults={autoHide:true,showCursor:true,msieCursorCss:"url("+b.rup.RUP+"/basic-theme/cursors/context-menu.cur),default"}})(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 c={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_date",a));b.extend(b.rup.iniRup,b.rup.rupObjectConstructor("rup_date",c));b.fn.rup_date("extend",{getRupValue:function(){if(b(this).data("datepicker").settings.datetimepicker){var f=b(this).datepicker("getDate");if(f===null||f.toString()==="Invalid Date"){return""}var e={hour:f.getHours(),minute:f.getMinutes(),second:f.getSeconds()};var g=b.timepicker._formatTime(e,"hh:mm:ss");var d=b(this).data("datepicker").settings.dateFormat;return b.datepicker.formatDate(d,f)+" "+b.timepicker._formatTime(e,"hh:mm:ss")}else{return b(this).rup_date("getDate")}},setRupValue:function(j){if(b(this).data("datepicker").settings.datetimepicker){var g=j.split(" ");var e=new Date(g[0]);var h=g[1];var e=new Date(j);if(e.toString()==="Invalid Date"){return""}var d={hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()};var f=b.timepicker._formatTime(d,b(this).data("datepicker").settings.timeFormat);b(this).datepicker("setTime",j);b(this).val(g[0]+" "+f)}else{b(this).val(j)}},destroy:function(){var d=b(this).data("datepicker").settings.labelMaskId;if(d){b("#"+d).text("")}delete d;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(d){b(this).datepicker("setDate",d)},refresh:function(){b(this).datepicker("refresh")},option:function(d,e){b(this).datepicker("option",d,e)}});b.fn.rup_date("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 g=b.extend({},b.fn.rup_date.defaults,d[0]);g._onClose=g.onClose;g.onClose=function(j,k){if(g._onClose!==undefined){g._onClose(j,k)}if(!b.rup.browser.isIE){b(this).focus()}};if(g.multiSelect){g._beforeShow=g.beforeShow;g.beforeShow=function(l,n){if(g._beforeShow!==undefined){g._beforeShow(l,n)}var k=b(l),j=k.attr("value"),m;if(j!==undefined&&j!==""){m=j.split(",");if(m.length>1){k.multiDatesPicker("addDates",m)}}}}g.id=b(this).attr("id");(this).attr("ruptype","date");var h=b.rup.i18n.base.rup_date;for(var f in h){g[f]=h[f]}if(g.labelMaskId){if(g.datetimepicker){if(g.showSecond){b("#"+g.labelMaskId).text(b.rup.i18nParse(b.rup.i18n.base,"rup_date.maskDateTimeSec")+" ")}else{b("#"+g.labelMaskId).text(b.rup.i18nParse(b.rup.i18n.base,"rup_date.maskDateTime")+" ")}}else{b("#"+g.labelMaskId).text(b.rup.i18nParse(b.rup.i18n.base,"rup_date.mask")+" ")}}if(b("#"+g.id).is("div")&&g.numberOfMonths[1]===1){if(!g.showWeek){b("#"+g.id).css("width","15.4em")}else{b("#"+g.id).css("width","17.1em")}}g.buttonImage=b.rup.STATICS+(g.buttonImage?g.buttonImage:"/rup/basic-theme/images/calendario.png");if(g.noWeekend){g.beforeShowDay=b.datepicker.noWeekends}g.buttonImageOnly=true;g.constrainInput=true;g.showOn="both";if(!g.multiSelect){if(g.datetimepicker){(this).attr("maxlength","16");b("#"+g.id).datetimepicker(g)}else{(this).attr("maxlength","10");b("#"+g.id).datepicker(g)}}else{var e=0;if(typeof g.multiSelect==="number"){g.mode={modeName:"normal",options:{maxPicks:g.multiSelect}};e=(10*g.multiSelect)+(g.multiSelect-1)}else{if(typeof g.multiSelect==="object"){g.mode={modeName:"daysRange",options:{autoselectRange:g.multiSelect}};e=g.multiSelect[1]-g.multiSelect[0];e=(10*e)+(e-1)}}(this).attr("maxlength",e);b.datepicker._defaults.dateFormat=g.dateFormat;b("#"+g.id).multiDatesPicker(g);b(this).keypress(function(k){if(k.charCode===44){var l=b(k.currentTarget).val(),m=k.originalEvent.originalTarget.selectionStart,j=k.originalEvent.originalTarget.selectionEnd;begin=l.substring(0,m),end=l.substring(j);if(l.length<b(k.currentTarget).attr("maxlength")||m!==j){b(k.currentTarget).val(begin+","+end);k.originalEvent.originalTarget.selectionStart=m+1;k.originalEvent.originalTarget.selectionEnd=m+1}}})}if(b.rup_utils.aplicatioInPortal()&&!b("#"+g.id).is("div")){b(".r01gContainer").append(b(".ui-datepicker:not(.r01gContainer .ui-datepicker)"))}b(this).parent().find("[title]").rup_tooltip({applyToPortal:true});if(g.disabled){b("#"+g.id).rup_date("disable")}}}});b.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 f=b.extend({},b.fn.rup_date.defaults,e[0]),d=b.extend(true,{},f),g=b.extend(true,{},f);d.onClose=function(p,n){var m=b("#"+f.to),o=n.input,j,l,k,h;if(m.attr("value")!=""){j=o.data("datepicker");l=m.data("datepicker");if(j.settings.timepicker!==undefined){k=new Date(j.selectedYear,j.selectedMonth,j.selectedDay,j.settings.hour,j.settings.minute,j.settings.second)}else{k=new Date(j.selectedYear,j.selectedMonth,j.selectedDay)}if(l.settings.timepicker!==undefined){h=new Date(l.selectedYear,l.selectedMonth,l.selectedDay,l.settings.hour,l.settings.minute,l.settings.second)}else{h=new Date(l.selectedYear,l.selectedMonth,l.selectedDay)}if(k>h){m.attr("value",p)}}else{m.attr("value",p)}if(f.onClose!==undefined){f.onClose(p,n)}};d.onSelect=g.beforeShow=function(j){var k=b("#"+f.from).datetimepicker("getDate"),h;h=k!==null?new Date(k.getTime()):null;b("#"+f.to).datetimepicker("option","minDate",h);if(f.datetimepicker){b("#"+f.to).datetimepicker("option","minDateTime",h)}if(f.onSelect!==undefined){f.onSelect(j)}};g.onClose=function(p,n){var o=b("#"+f.from),m=n.input,j,l,k,h;if(o.attr("value")!=""){j=o.data("datepicker");l=m.data("datepicker");if(j.settings.timepicker!==undefined){k=new Date(j.selectedYear,j.selectedMonth,j.selectedDay,j.settings.hour,j.settings.minute,j.settings.second)}else{k=new Date(j.selectedYear,j.selectedMonth,j.selectedDay)}if(l.settings.timepicker!==undefined){h=new Date(l.selectedYear,l.selectedMonth,l.selectedDay,l.settings.hour,l.settings.minute,l.settings.second)}else{h=new Date(l.selectedYear,l.selectedMonth,l.selectedDay)}if(k>h){o.attr("value",p)}}else{o.attr("value",p)}if(f.onClose!==undefined){f.onClose(p,n)}};g.onSelect=d.beforeShow=function(j){var h=b("#"+f.to).datetimepicker("getDate"),k;k=h!==null?new Date(h.getTime()):null;b("#"+f.from).datetimepicker("option","maxDate",k);if(f.datetimepicker){b("#"+f.from).datetimepicker("option","maxDateTime",k)}if(f.onClose!==undefined){f.onSelect(j)}};b("#"+f.from).rup_date(d);b("#"+f.to).rup_date(g)}}});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(a){jQuery.rup_dav={};a.extend(jQuery.rup_dav,{editOnline:function(c){var b,d;if(typeof c==="string"){d=jQuery.extend({},jQuery.rup_dav.defaults,{url:c})}else{d=jQuery.extend({},jQuery.rup_dav.defaults,c)}jQuery.rup_dav._checkUrl(d);if(d.xlnetsAuth){jQuery.rup_dav._xlnetsAuth(d)}if(a.browser.msie===true){jQuery.rup_dav._editOnlineIE(d)}else{jQuery.rup_dav._editOnlineFF(d)}}});a.extend(jQuery.rup_dav,{_checkUrl:function(c){var b="";if(c.url.indexOf(location.protocol)===-1){b+=location.protocol+"//";if(c.url.indexOf(location.host)===-1){b+=location.host}if(c.url.indexOf(CTX_PATH)===-1){b+=CTX_PATH}c.url=b+c.url}},_xlnetsAuth:function(d){var c=a.rup_utils.readCookie("n38UidSesion"),e=a.rup_utils.readCookie("n38DominioUid"),b={};if(c!==undefined&&c!==null&&c!==""){jQuery.extend(true,b,{n38UidSesion:c})}if(e!==undefined&&e!==null&&e!==""){jQuery.extend(true,b,{n38DominioUid:e})}if(!jQuery.isEmptyObject(b)){d.url+="?"+d.xlnetsAuthParam+"="+jQuery.rup_utils.base64.encode(jQuery.param(b))}},_editOnlineIE:function(b){var d;try{d=new ActiveXObject("SharePoint.OpenDocuments.3");d.EditDocument(encodeURI(b.url))}catch(c){try{d=new ActiveXObject("Word.Application");d.Visible=true;d.Documents.Open(encodeURI(b.url))}catch(c){if(b.downloadOnError===true){window.open(encodeURI(b.alternateDownloadURL),"_blank")}if(jQuery.isFunction(b.fncErrorOnEditOnline)){jQuery.proxy(b.fncErrorOnEditOnline)(b)}}}},_editOnlineFF:function(c){var f,b;try{f=document.getElementById("winFirefoxPlugin");b=f.GetOfficeVersion();f.EditDocument(c.url,b)}catch(d){if(c.downloadOnError===true){window.open(encodeURI(c.alternateDownloadURL),"_blank")}if(jQuery.isFunction(c.fncErrorOnEditOnline)){jQuery.proxy(c.fncErrorOnEditOnline)(c)}}}});a.rup_dav.defaults={xlnetsAuth:false,xlnetsAuthParam:"c",downloadOnError:false,alternateDownloadURL:null,fncErrorOnEditOnline: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){b.extend(b.rup,{dialog:{DIV:"dialogDIV",TEXT:"textDialog",AJAX:"ajaxDialog",LINK:"linkButton"}});var a={};b.extend(b.rup.iniRup,b.rup.rupSelectorObjectConstructor("rup_dialog",a));b.fn.rup_dialog("extend",{open:function(){var e=b.extend({},b(this).dialog("option")),f;b(this).data("focus",b(document.activeElement));var c=b(document).height(),d=b(document).width();if(b(this).dialog("option","ajaxCache")===false){e.id=b(this).attr("id");e.autoOpen=true;this._ajaxLoad(e)}else{b(this).dialog("open")}if(b.rup_utils.aplicatioInPortal()){if(b(this).data("dialog").overlay!==null){f=b(this).data("dialog").overlay.$el;b(".r01gContainer").append(f);f.css("height",c).css("width",d)}if(e.position===undefined||e.position===null){b(this).data("dialog").uiDialog.css("position","absolute").css("top",(c/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(c){return b(this).dialog("option",c)},setOption:function(k,l){if(k==="buttons"){var f=l.length,c,h,e,d=[],g;if(f>1){c=l;for(h=0;h<l.length;h++){if(l[h].btnType===b.rup.dialog.LINK){d.push(l.splice(h,1));h--}}h=null}g=d.length;if(f>1&&g===0){b.rup.msgAlert({message:b.rup.i18nParse(b.rup.i18n,"base.rup_global.rupCheckStyleError")});return false}b(this).dialog("option",k,l);if(g>0){for(e=0;e<g;e++){this.createBtnLinks(d[e][0],this[0].id)}e=null}return}if(k!=="title"){if(l!==undefined){b(this).dialog("option",k,l)}else{b(this).dialog("option",k)}}else{b("#ui-dialog-title-"+b(this).attr("id")).html(l)}},createBtnLinks:function(c,e){var d=b("<a href='#'></a>").attr("role","button").attr("id","rup_dialog"+c.text).addClass("rup-enlaceCancelar").html(c.text).click(c.click);b("div[aria-labelledby=ui-dialog-title-"+e+"] .ui-dialog-buttonset ").append(d)}});b.fn.rup_dialog("extend",{_init:function(c){if(c.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_dialog.defaults,c[0]),h,d=this,f,e=undefined;g._close=g.close;g.close=function(j,k){if(b(this).data("focus")!==undefined){b(this).data("focus").focus()}if(g._close!==undefined){g._close(j,k)}};if(g.type!==null&&b(this).length>0){b.each(b(this),function(t,o){if(b(this).attr("id")!==undefined){g.id=b(this).attr("id")}else{g.id="rup_"+g.type+"DIV";f=b("<div/>").attr("id",g.id);f.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-"+g.id+"]").length>0){n=true}else{if(b("body #"+g.id).not(".ui-dialog-content").length>1){b(b("body #"+g.id).not(".ui-dialog-content")[1]).remove()}if(g.specificLocation!==""){x=function(j,y){b("#"+g.id).parent(".ui-dialog").insertAfter(b("#"+g.specificLocation))}}else{if(b.rup_utils.aplicatioInPortal()){x=function(j,y){b(".r01gContainer").append(b(".ui-dialog"))}}}}if(x!==undefined){var k=g.create;g.create=function(j,y){if(k!==undefined&&k!==null){if(k.call(j,y)===false){return false}}x(j,y)}}switch(g.type){case b.rup.dialog.DIV:if(g.clone!==undefined){b("#"+g.id).clone(true).attr("id",g.clone).insertAfter("#"+g.id);g.id=g.clone}break;case b.rup.dialog.TEXT:b("#"+g.id).html(g.message);break;case b.rup.dialog.AJAX:d._ajaxLoad(g);break}if(g.autoOpen===true){w=true;g.autoOpen=false}if(g.buttons&&g.buttons!==null){r=g.buttons.length;if(r>1){l=g.buttons;for(q=0;q<g.buttons.length;q++){if(g.buttons[q].btnType===b.rup.dialog.LINK){u.push(g.buttons.splice(q,1));q--}}q=null}v=u.length;if(r>1&&v===0&&g.rupCheckStyle){b(document).rup().msgAlert({message:b.rup.i18nParse(b.rup.i18n.base,"rup_global.rupCheckStyleError")});g.stack=false;g.modal=false;g.zIndex=9999}}if(!n){b("#"+g.id).dialog(g);m="<span id='closeText_"+g.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(j){b("#"+g.id).dialog("close");return false}).hover(function(j){b("div[aria-labelledby=ui-dialog-title-"+g.id+"] .ui-dialog-titlebar-close").addClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+g.id+"] .ui-dialog-titlebar-close").css("padding","0px")},function(j){b("div[aria-labelledby=ui-dialog-title-"+g.id+"] .ui-dialog-titlebar-close").removeClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+g.id+"] .ui-dialog-titlebar-close").attr("style","")}).insertAfter("#ui-dialog-title-"+g.id);b("div[aria-labelledby=ui-dialog-title-"+g.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-"+g.id+"] .ui-dialog-buttonset a").remove();if(g.title){b("#ui-dialog-title-"+g.id).text(g.title)}}if(v>0){for(p=0;p<v;p++){b(this).rup_dialog("createBtnLinks",u[p][0],g.id)}p=null}if(w){if(g.type!==b.rup.dialog.AJAX){b("#"+g.id).rup_dialog("open");b("div[aria-labelledby=ui-dialog-title-"+g.id+"] .ui-dialog-buttonpane button:first").focus()}else{g.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"))}}}},_ajaxLoad: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>"})}var c=b.extend({},d.ajaxOptions);c.success=function(f,g,e){if(f!==""||f!==null){b("#"+d.id).html(f);b.unblockUI();if(d.autoOpen===true){b("#"+d.id).rup_dialog("open");b("div[aria-labelledby=ui-dialog-title-"+d.id+"] .ui-dialog-buttonpane button:first").focus()}}if(d.ajaxOptions&&d.ajaxOptions.success!==undefined&&d.ajaxOptions.success!==null&&typeof d.ajaxOptions.success==="function"){d.ajaxOptions.success(f,g,e)}};c.error=function(e,g,f){b.unblockUI();b(document).rup().msgAlert({message:b.rup.i18nParse(b.rup.i18n.base,"rup_dialog.errorLoadingData")});if(d.ajaxOptions.error!==undefined&&d.ajaxOptions.error!==null&&typeof d.ajaxOptions.error==="function"){d.ajaxOptions.error(e,g,f)}};c.url=b.rup_utils.setNoPortalParam(d.url);c.type="GET";c.cache=false;c.dataType="text";b.rup_ajax(c)}});b.fn.rup_dialog.defaults={rupCheckStyle:true,type:null,url:null,minHeight:100,ajaxCache:true,specificLocation:"",clone:undefined}})(jQuery);
/*
 * Copyright 2014 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_button",a));b.fn.rup_button("extend",{foo:function(){return this}});b.fn.rup_button("extend",{_bar:function(){return this}});b.fn.rup_button("extend",{_init:function(f){var g=b.extend(true,{},b.fn.rup_button.defaults,f[0]),k=this,e,j,h;if(g.dropdown===false){k.button(g);k.addClass("rup-button")}else{b.extend(true,g.dropdown,b.fn.rup_button.dropdown_defaults,f[0].dropdown);h=g.dropdown;k.addClass("rup-button rup-dropdown");j=jQuery("<div>").attr("class","rup-dropdown-btn-group");j=k.wrap(j).parent();h.$container=j;k.button({});k.addClass("rup-dropdown");var d=jQuery("<button>").attr({type:"button",id:k.prop("id")+"_dropdown"}).text("Administración de filtros").button({icons:{primary:h.dropdownIcon},text:false}).addClass("rup-dropdown-button");k.after(d);if(h.dropdownListId){e=jQuery("#"+h.dropdownListId);h.$dropdownList=e;j.append(e);d.on("click.rup_dopdown",function(l){e.toggleClass("open");l.stopPropagation()});e.on("click.rup_dopdown",function(l){l.stopPropagation()});jQuery(document).on("click.rup_dopdown.close",function(){e.removeClass("open")})}else{if(h.dropdownDialog){jQuery.extend(h.dropdownDialogConfig,{autoOpen:false,position:{my:"right top",at:"right bottom",of:j}});var c=jQuery("#"+h.dropdownDialog).rup_dialog(h.dropdownDialogConfig);c.parent().addClass("rup-dropdown-dialog");d.on("click",function(){c.rup_dialog("open")})}}}}});b.fn.rup_button.defaults={dropdown:false};b.fn.rup_button.dropdown_defaults={dropdownIcon:"ui-icon-triangle-1-s",dropdownListId:undefined,dropdownDialog:undefined,dropdownDialogConfig:{type:b.rup.dialog.DIV}}})(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($){$.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(this.element).triggerHandler("rupFeedback_show")}})})(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(c){var d=this;b.set_uda_ajax_mode_on();d.ajaxSubmit(c)},ajaxSubmit:function(d){var e=this,c=b.extend(true,{},b.fn.rup_form.defaults,d);b.set_uda_ajax_mode_on();e.rup_form("configureOptions",c);if(c.formValidationRequired){e.rup_validate(c.validate);if(e.valid()){b(this).ajaxSubmit(c)}}else{b(this).ajaxSubmit(c)}},destroy:function(){var c=this;b.removeData(c[0]);c.ajaxFormUnbind();c.unbind()},formSerialize:function(){var e=this,f,d,c,f=[];b.each(e.formToArray(),function(g,h){d=b("[name='"+h.name+"']",self);c=d.attr("ruptype");if(c!==undefined){h.value=d["rup_"+c]("getRupValue");f.push(h)}else{f.push(h)}});return b.param(f)},formToJson:function(){return form2object(this[0])},fieldSerialize:function(){var c=[];this.each(function(){var g=b(this).attr("name");if(!g){return}var e=b(this).rup_form("fieldValue");if(e&&e.constructor==Array){for(var f=0,d=e.length;f<d;f++){c.push({name:g,value:e[f]})}}else{if(e!==null&&typeof e!="undefined"){c.push({name:b(this).attr("name"),value:e})}}});return b.param(c)},fieldValue:function(){var c=[],d;this.each(function(){var e=b(this).attr("ruptype");if(e!==undefined){d=b(this)["rup_"+e]("getRupValue");c.push(d)}else{b.merge(c,b(this).fieldValue())}});return c},resetForm:function(){return this.each(function(){b(this).resetForm()})},clearForm:function(c){return this.each(function(){b("input,select,textarea",this).rup_form("clearFields",c)})},clearFields:function(c){return this.each(function(){var d=b(this).attr("ruptype");if(d===undefined||d!=="combo"){b(this).clearFields(c)}else{b(this).rup_combo("clear")}})},configureOptions:function(d){var g=this,e,c,f;if(d.url!==null){g.attr("action",d.url)}e=b("input:file",g).length>0;if(d.useJsonIfPossible&&!e){d.contentType="application/json"}c=d.beforeSend;d.beforeSend=function(l,h){var j=true;if(b.isFunction(c)){j=c.call(this,l,h)}if(j===false){return false}else{if(j!=="skip"){if(h.contentType.indexOf("application/json")!==-1){var k=g.rup_form("formToJson");if(d.multimodel!==null){l.setRequestHeader("RUP_MULTI_ENTITY","true");k.rupEntityMapping=d.multimodel}if(h.extraData!==undefined&&h.extraData!==null){b.extend(k,h.extraData)}h.data=b.toJSON(k)}}}};f=d.beforeSubmit;d.beforeSubmit=function(h,k,l){var j,n,m;if(b.isFunction(f)){if(f.call(this,h,k,l)===false){return false}}m=jQuery("input:file",k).length>0;if((!b.rup.browser.xhrFileUploadSupport&&m)||l.iframe===true){j=d.type!==undefined?d.type:l.type;if(b.inArray(j.toUpperCase(),b.rup.IFRAME_ONLY_SUPPORTED_METHODS)===-1){l.extraData=b.extend({},l.extraData,{_method:j.toUpperCase()})}l.url=b.rup_utils.setNoPortalParam(l.url);l.extraData=b.extend({},l.extraData,{_emulate_iframe_http_status:"true"});l.url=l.url+(l.url.match("\\?")===null?"?":"&")+"_emulate_iframe_http_status=true";n=l.error;l.error=function(q,r,p){var o=b.rup.rupAjaxDefaultError(q,r,p);if(n!=null){b(n(q,r,p))}else{if(o){b.rup.showErrorToUser(o)}}}}};d.formValidationRequired=(d.validate!==undefined);if(d.formValidationRequired){if(d.error===undefined){d.error=function(j,h,n,m){try{var l=jQuery.parseJSON(j.responseText);g.validate().invalid=l.rupErrorFields;g.validate().submited=l.rupErrorFields;g.validate().showErrors(l.rupErrorFields);if(l.rupFeedback!==undefined&&g.validate().settings.feedback!==undefined){g.validate().settings.feedback.rup_feedback("set",b.rup_utils.printMsg(l.rupFeedback.message),(l.rupFeedback.imgClass!==undefined?l.rupFeedback.imgClass:null))}}catch(k){g.validate().settings.feedback.rup_feedback("set",j.responseText,"error")}}}d.validate.submitHandler=function(h){jQuery(h).ajaxSubmit(b(h).data("ajaxSettings"))};d.validate.feedback=d.feedback}g.data("ajaxSettings",d);g.data("settings",d)}});b.fn.rup_form("extend",{});b.fn.rup_form("extend",{_init:function(d){var h=this,c,e,f={},g={};e=b.extend(true,{},b.fn.rup_form.defaults,d[0]);h.addClass("rup_form");h.attr("ruptype","form");h.rup_form("configureOptions",e);if(e.formValidationRequired){h.rup_validate(e.validate)}else{h.ajaxForm(e)}h.data(h[0],"settings",e)}});b.fn.rup_form.defaults={ajaxForm:null,feedback:null,multimodel:null,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(f,g,d,c){var e=b(this)[0].id;if(b("#"+e+" #separadorAadidos").html()===null){b("#"+e+" tr:first-child").after(b("#"+e+" tr:first-child").clone(false).css("display","none").css("height","").attr("id","separadorAadidos"));b.each(b("#"+e+" #separadorAadidos td"),function(j,h){b(this).html("").attr("class","tdAddSeparator")});b("#"+e+" #separadorAadidos").addClass("trAddSeparator");b("#"+e+" #separadorAadidos").css("display","")}b(this).jqGrid("addRowData",f,g,d,c);b("#"+e+" #"+f).addClass("addElement")},delRowData:function(c){b(this).jqGrid("delRowData",c);if(b(this).jqGrid("getDataIDs").length===Number(b(this).jqGrid("getGridParam","rowNum"))){b("#"+b(this)[0].id+" #separadorAadidos").remove()}},setRowData:function(c,d,e){b(this).jqGrid("setRowData",c,d,e);this._tooltip(c)},getRowData:function(c){return b(this).jqGrid("getRowData",c)},setSelection:function(d,c){b(this).jqGrid("setSelection",d,c)},resetSelection:function(){var c=this;if(!c[0].rup_gridProps.hasMaint&&c[0].rup_gridProps.multiselect){b(c).data("selectedRows",new Array());b(c).data("selectedRowsCont",0);b(c).data("rowsSelectedPage",0);b(c).data("allSelected",false);b("#"+c[0].rup_gridProps.pagerName+"_left").html(b(c).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(c){return b(this).jqGrid("getGridParam",c)},setGridParam:function(c){b(this).jqGrid("setGridParam",c)},clearGridData:function(c){b(this).jqGrid("clearGridData",c)},getSelectedRows:function(){var d=b(this).jqGrid("getGridParam","multiselect"),c;if(d){c=jQuery.map(this[0].rup_gridProps.allPksArray,function(f,e){if(f.indexOf("/")===0){return f.substring(1)}else{return f}});return c}else{return[b(this).jqGrid("getGridParam","selrow")]}},reloadGrid:function(e,f){var c=this;var d=c[0].rup_gridProps;b("#lui_"+c.attr("id")).show();b("#load_"+c.attr("id")).show();if(e!==undefined){d.systemReloadGridFunction=function(){e.call(this,f);c[0].rup_gridProps.systemReloadGridFunction=undefined}}window.setTimeout(function(){c.trigger("reloadGrid")},0,e,f)},editRow:function(d,k,j,l,c,f,e,g,h){b(this).jqGrid("editRow",d,k,j,l,c,f,e,g,h)},saveRow:function(j,h,f,g,e,d,c){function k(p,n){var m,o=b("tr#"+p+" select.rup_combo",this);for(var l=0;l<o.length;l=l+1){m=b(o[l]).rup_combo("label");b(o[l]).parent().html(m)}if(e){e.call(p,n)}}b(this).jqGrid("saveRow",j,h,f,g,k,d,c);this._tooltip(j)},restoreRow:function(g,c){var e,f=b("tr#"+g+" select.rup_combo",this);var h=b(this).jqGrid("getGridParam","savedRow");for(var d=0;d<f.length;d=d+1){e=b(f[d]).rup_combo("value");h[0][b(f[d]).attr("name")]=e}b(this).jqGrid("restoreRow",g,c);this._tooltip(g)},getColModel:function(){return b(this).jqGrid("getGridParam","colModel")},GridToForm:function(c,d){b(this).jqGrid("GridToForm",c,d)},FormToGrid:function(d,e,f,c){b(this).jqGrid("FormToGrid",d,e,f,c)},isMultiselect:function(){return b(this).jqGrid("getGridParam","multiselect")},getCol:function(d,c){return b(this).jqGrid("getCell",d,c)},isEditable:function(){return this[0].rup_gridProps.editable},getEditingRowData:function(f){var g=this.jqGrid("getInd",f,true),c={},d=this,e;if(g===false){return}b("td",g).each(function(h){if(d.jqGrid("getGridParam","colModel")[h]){e=b(":first",this).attr("type");if(e!=="checkbox"||(e==="checkbox"&&b(":first",this).is(":checked"))){c[d.jqGrid("getGridParam","colModel")[h].name]=b(":first",this).val()}}});return c},isEditing:function(){var d=this.jqGrid("getDataIDs");for(var c=0;c<d.length;c++){if(b(this.jqGrid("getInd",d[c],true)).attr("editable")==="1"){return true}}return false},reorderColumns:function(c){if(b.isFunction(this[0].rup_gridProps.onAfterDragAndDrop)){this[0].rup_gridProps.onAfterDragAndDrop.call(this,c)}}});b.fn.rup_grid("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 F=b.extend(true,{},b.fn.rup_grid.defaults,e[0]);F.groupingView=b.extend({},b.fn.rup_grid.defaults.groupingView,F.groupingView);var t=this,g=[2],s,h,j,D;var u,z,l,w,n,v,p,y,A,k,o,r,m,f,q,x,B,E,C;u=F.beforeRequest;F.beforeRequest=function(){if(u!==undefined&&u!==null){if(typeof u==="function"){if(u()===false){return false}}else{if(typeof u==="object"){if(u.pre!==undefined&&u.pre()===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeRequest_default()===false){return false}if(u.post!==undefined&&u.post()===false){return false}return true}}}return b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeRequest_default()};l=F.serializeGridData;F.serializeGridData=function(G){var H;if(l!==undefined&&l!==null){if(typeof l==="function"){if(l(G)===false){return false}}else{if(typeof l==="object"){if(l.pre!==undefined){H=l.pre(G);if(H===false){return false}}H=b("#"+b(this).attr("id")).data("defaultEventFunctions").serializeGridData_default(G,H);if(H===false){return false}if(l.post!==undefined){H=l.post(G,H)}return H}}}return b("#"+b(this).attr("id")).data("defaultEventFunctions").serializeGridData_default(G)};z=F.loadBeforeSend;F.loadBeforeSend=function(H,G){if(z!==undefined&&z!==null){if(typeof z==="function"){if(z(H,G)===false){return false}}else{if(typeof z==="object"){if(z.pre!==undefined&&z.pre(H,G)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadBeforeSend_default(H,G)===false){return false}if(z.post!==undefined&&z.post(H,G)===false){return false}return true}}}return(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadBeforeSend_default(H,G))};w=F.loadError;F.loadError=function(I,G,H){if(w!==undefined&&w!==null){if(typeof w==="function"){if(w(I,G,H)===false){return false}}else{if(typeof w==="object"){if(w.pre!==undefined&&w.pre(I,G,H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadError_default(I,G,H)===false){return false}if(w.post!==undefined){w.post(I,G,H)}return false}}}b(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadError_default(I,G,H))};n=F.beforeProcessing;F.beforeProcessing=function(H,G,I){if(n!==undefined&&n!==null){if(typeof n==="function"){if(n(H,G,I)===false){return false}}else{if(typeof n==="object"){if(n.pre!==undefined&&n.pre(H,G,I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeProcessing_default(H,G,I)===false){return false}if(n.post!==undefined){n.post(H,G,I)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeProcessing_default(H,G,I)};v=F.gridComplete;F.gridComplete=function(){var G,H=(this);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").gridComplete_default()===false){return false}if(v.post!==undefined){v.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")});G=jQuery("#"+b(this).attr("id")+" tbody:first");G.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:G,adjust:{method:"flip"}}});L.triggerHandler("mouseenter");L.rup_tooltip("option","show.delay",500)}})};p=F.loadComplete;F.loadComplete=function(H){if(p!==undefined&&p!==null){if(typeof p==="function"){if(p(H)===false){return false}}else{if(typeof p==="object"){if(p.pre!==undefined&&p.pre(H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").loadComplete_default(H)===false){return false}if(p.post!==undefined){p.post(H)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").loadComplete_default(H);var G=t[0].rup_gridProps.systemReloadGridFunction;if(G!==undefined){t[0].rup_gridProps.systemReloadGridFunction.call()}};y=F.afterInsertRow;F.afterInsertRow=function(G,I,H){if(y!==undefined&&y!==null){if(typeof y==="function"){if(y(G,I,H)===false){return false}}else{if(typeof y==="object"){if(y.pre!==undefined&&y.pre(G,I,H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").afterInsertRow_default(G,I,H)===false){return false}if(y.post!==undefined){y.post(G,I,H)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").afterInsertRow_default(G,I,H)};A=F.beforeSelectRow;F.beforeSelectRow=function(G,H){if(A!==undefined&&A!==null){if(typeof A==="function"){if(A(G,H)===false){return false}}else{if(typeof A==="object"){if(A.pre!==undefined&&A.pre(G,H)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeSelectRow_default(G,H)===false){return false}if(A.post!==undefined&&A.post(G,H)===false){return false}return true}}}return(b("#"+b(this).attr("id")).data("defaultEventFunctions").beforeSelectRow_default(G,H))};k=F.onCellSelect;F.onCellSelect=function(H,G,I,J){if(k!==undefined&&k!==null){if(typeof k==="function"){if(k(H,G,I,J)===false){return false}}else{if(typeof k==="object"){if(k.pre!==undefined&&k.pre(H,G,I,J)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onCellSelect_default(H,G,I,J)===false){return false}if(k.post!==undefined){k.post(H,G,I,J)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onCellSelect_default(H,G,I,J)};o=F.ondblClickRow;F.ondblClickRow=function(H,J,G,I){if(o!==undefined&&o!==null){if(typeof o==="function"){if(o(H,J,G,I)===false){return false}}else{if(typeof o==="object"){if(o.pre!==undefined&&o.pre(H,J,G,I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").ondblClickRow_default(H,J,G,I)===false){return false}if(o.post!==undefined){o.post(H,J,G,I)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").ondblClickRow_default(H,J,G,I)};r=F.onHeaderClick;F.onHeaderClick=function(G){if(r!==undefined&&r!==null){if(typeof r==="function"){if(r(G)===false){return false}}else{if(typeof r==="object"){if(r.pre!==undefined&&r.pre(G)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onHeaderClick_default(G)===false){return false}if(r.post!==undefined){r.post(G)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onHeaderClick_default(G)};m=F.onPaging;F.onPaging=function(J){b(".ui-tooltip").hide();if(J==="records"&&!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect){if(b(t).data("selectedRows")!==undefined&&b(t).data("selectedRows").length>0){b("#lui_"+t.attr("id")).hide();b("#load_"+t.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(t).data("selectedRows",new Array());b(t).data("selectedRowsCont",0);b(t).data("rowsSelectedPage",0);b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"));t.trigger("reloadGrid")}});return"stop"}}if(J==="user"){var I=parseInt(b("#gbox_"+b(this).attr("id")).find(".pagControls > input").val()),H=parseInt(b("#gbox_"+b(this).attr("id")).find(".pagControls > input").next().text());if(I==0){H=1;I=2}if(I>H){var G=b(this).rup_grid("getGridParam");G.page=H;b(this).rup_grid("setGridParam",G)}}b("#lui_"+t.attr("id")).show();b("#load_"+t.attr("id")).show();if(m!==undefined&&m!==null){if(typeof m==="function"){if(m(J)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}}else{if(typeof m==="object"){if(m.pre!==undefined&&m.pre(J)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onPaging_default(J)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}if(m.post!==undefined&&m.post(J)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}return""}}}window.setTimeout(function(){t.trigger("reloadGrid")},0)};B=F.onRightClickRow;F.onRightClickRow=function(H,J,G,I){if(B!==undefined&&B!==null){if(typeof B==="function"){if(B(H,J,G,I)===false){return false}}else{if(typeof B==="object"){if(B.pre!==undefined&&B.pre(H,J,G,I)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onRightClickRow_default(H,J,G,I)===false){return false}if(B.post!==undefined){B.post(H,J,G,I)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onRightClickRow_default(H,J,G,I)};f=F.onSelectAll;F.onSelectAll=function(H,G){if(f!==undefined&&f!==null){if(typeof f==="function"){if(f(H,G)===false){return false}}else{if(typeof f==="object"){if(f.pre!==undefined&&f.pre(H,G)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectAll_default(H,G)===false){return false}if(f.post!==undefined){f.post(H,G)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectAll_default(H,G)};q=F.onSelectRow;F.onSelectRow=function(H,G){if(q!==undefined&&q!==null){if(typeof q==="function"){if(q(H,G)===false){return false}}else{if(typeof q==="object"){if(q.pre!==undefined&&q.pre(H,G)===false){return false}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectRow_default(H,G)===false){return false}if(q.post!==undefined){q.post(H,G)}return false}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onSelectRow_default(H,G)};x=F.onSortCol;F.onSortCol=function(I,H,G){b("#lui_"+t.attr("id")).show();b("#load_"+t.attr("id")).show();if(x!==undefined&&x!==null){if(typeof x==="function"){if(x(I,H,G)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}}else{if(typeof x==="object"){if(x.pre!==undefined&&x.pre(I,H,G)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}if(b("#"+b(this).attr("id")).data("defaultEventFunctions").onSortCol_default(I,H,G)==="stop"){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return false}if(x.post!==undefined&&x.post(I,H,G)===false){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();return"stop"}return"stop"}}}b("#"+b(this).attr("id")).data("defaultEventFunctions").onSortCol_default(I,H,G);return"stop"};E=F.resizeStart;F.resizeStart=function(H,G){if(E!==undefined&&E!==null){if(typeof E==="function"){if(E(H,G)===false){return false}}else{if(typeof E==="object"){if(E.pre!==undefined&&E.pre(H,G)===false){return false}if(b("#"+b(t).attr("id")).data("defaultEventFunctions").resizeStart_default(H,G)===false){return false}if(E.post!==undefined){E.post(H,G)}return false}}}b("#"+b(t).attr("id")).data("defaultEventFunctions").resizeStart_default(H,G)};C=F.resizeStop;F.resizeStop=function(G,H){if(C!==undefined&&C!==null){if(typeof C==="function"){if(C(G,H)===false){return false}}else{if(typeof C==="object"){if(C.pre!==undefined&&C.pre(G,H)===false){return false}if(b("#"+b(t).attr("id")).data("defaultEventFunctions").resizeStop_default(G,H)===false){return false}if(C.post!==undefined){C.post(G,H)}return false}}}b("#"+b(t).attr("id")).data("defaultEventFunctions").resizeStop_default(G,H)};b("#"+b(this).attr("id")).data("defaultEventFunctions",{beforeRequest_default:function(){var G=b(this).rup_grid("getGridParam","url");b(this).rup_grid("setGridParam",{url:b.rup_utils.setNoPortalParam(G)});return true},serializeGridData_default:function(G){if(G.page!==undefined&&G.page!==null&&Number(G.page)>t.rup_grid("getGridParam","lastpage")&&t.rup_grid("getGridParam","lastpage")>0){G.page=t.rup_grid("getGridParam","lastpage")}return G},loadBeforeSend_default:function(H,G){H.setRequestHeader("JQGridModel","true");H.setRequestHeader("Content-Type","application/json");return true},loadError_default:function(J,G,H){t.rup_grid("clearGridData");if(b.data(t[0],"maintName")&&b.data(t[0],"maintName")!==null&&b.data(t[0],"maintName")!==""){b("#"+b.data(t[0],"maintName"))[0].prop.feedback.rup_feedback("option","closeLink",true);b("#"+b.data(t[0],"maintName"))[0].prop.feedback.rup_feedback("option","delay",null);var I=b.rup.i18nParse(b.rup.i18n.base,"rup_ajax.httpStatus"+J.status);if(I.indexOf("rup_ajax.")!==-1){I=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.errors.errorOnGet")}b("#"+b.data(t[0],"maintName"))[0].prop.feedback.rup_feedback("set",I,"error");b("#"+b.data(t[0],"maintName"))[0].prop.feedback.rup_feedback("option","delay",1000)}else{b("#rup_feedback_"+t[0].id).rup_feedback("option","closeLink",true);b("#rup_feedback_"+t[0].id).rup_feedback("option","delay",null);b("#rup_feedback_"+t[0].id).rup_feedback("set",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.errors.errorOnGet"),"error");b("#rup_feedback_"+t[0].id).rup_feedback("option","delay",1000)}},beforeProcessing_default:function(H,G,I){},gridComplete_default:function(){var H=null,I=true,G;if(b("#rup_feedback_"+t[0].id)){b("#rup_feedback_"+t[0].id).rup_feedback("close")}b("#"+t[0].id+" tr:nth-child(even)").addClass("rup-grid_evenRow");b("#"+t[0].id+" tr:nth-child(odd)").addClass("rup-grid_oddRow");b(".ui-jqgrid tr.jqgrow td").addClass("rup-grid_cellPadding");if(t.jqGrid("getDataIDs").length===0){b(b.find("#cb_"+t.attr("id"))[0]).attr("disabled",true);b(t).prev().remove();b(t.jqGrid("getGridParam","pager")).hide();if(b("#RUP_GRID_"+t[0].id+"_noRecords").length===0){var N='<tr class="ui-widget-content jqgrow ui-row-ltr" role="row" id="RUP_GRID_'+t[0].id+'_noRecords" aria-selected="false">';N+='<td aria-describedby="RUP_GRID_'+t[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(t).attr("id")).width()+'px;background:white;" role="gridcell">';N+=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.noRecordsFound");N+="</td></tr>";t.before(N);b('[aria-describedby="RUP_GRID_'+t[0].id+'_NO_REGISTROS"]').rup_tooltip({position:{my:"center",at:"center"}})}}else{b(b.find("#cb_"+t.attr("id"))[0]).attr("disabled",false);if(b("#RUP_GRID_"+t[0].id+"_noRecords").length){b("#RUP_GRID_"+t[0].id+"_noRecords").remove()}b(t.jqGrid("getGridParam","pager")).show();if(b.isFunction(t[0].rup_gridProps.onAfterGridComplete)){t[0].rup_gridProps.onAfterGridComplete.call(t,H,I)}if(!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect&&!b.isFunction(t[0].rup_gridProps.onAfterGridComplete)){var J=b(t).data("selectedRows"),Q=b(t).data("selectedRowsCont"),R=false,P=t.rup_grid("getDataIDs"),O=t.rup_grid("getGridParam","page"),K=b(t).data("selectedRows"),L=new Array();if(K!==undefined&&K[(O-1)]!==undefined){R=true;L=b(t).data("selectedRows")[(O-1)]}for(var M=0;M<P.length;M++){if(b.inArray(P[M],L)!==-1){t.rup_grid("setSelection",P[M],true)}else{if(!R&&b(t).data("allSelected")===true){t.rup_grid("setSelection",P[M],true)}}}b(t).data("selectedRows",J);b(t).data("selectedRowsCont",Q);b(t).data("rowsSelectedPage",t.find('[aria-describedby="'+t.attr("id")+'_cb"] input:checked').length);b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}}},loadComplete_default:function(H){if(H.rows.length>0&&H.rows[0].id instanceof Object){for(var G=0;G<H.rows.length;G++){if(H.rows[G].id instanceof Object){H.rows[G]["JPA_ID"]=H.rows[G].id;delete H.rows[G].id}}this.addJSONData(H)}},afterInsertRow_default:function(G,I,H){},beforeSelectRow_default:function(G,H){return true},onCellSelect_default:function(H,G,I,J){},ondblClickRow_default:function(H,J,G,I){},onHeaderClick_default:function(G){},onPaging_default:function(I){if(I=="user"){var H=parseInt(b("td.pagControls .ui-pg-input",b("#gbox_"+t[0].id)).val());if(H===0){t.rup_grid("setGridParam",{page:1})}else{var G=parseInt(t.rup_grid("getGridParam","lastpage"));if(H>G){t.rup_grid("setGridParam",{page:G})}}}return""},onRightClickRow_default:function(H,J,G,I){},onSelectAll_default:function(O,Q){var G=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.selectMsg"),S=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.selectRestMsg"),H=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.deselectMsg"),T=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.deselectRestMsg"),V=0;if(Q){var L=t.rup_grid("getGridParam","records"),K=t.rup_grid("getGridParam","reccount"),R=b.data(t[0],"rowsSelectedPage"),I=b.data(t[0],"selectedRowsCont"),N=((L-K)!==0)?L-K-(I-R):0;W=b.jgrid.format(S,N),M=b("<input/>").attr("type","button").attr("id","rup_grid_"+t[0].id+"_selectAll").css("margin-left","1em").addClass("botonElementosRestantes").attr("value",W).attr("alt",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.selectAll"));numFilas="<b>"+O.length+"</b>",J="<b>"+jqGrid.rup_grid("getGridParam","page")+"</b>",msg=b.jgrid.format(G,numFilas,J);if(N!==0){b("#rup_feedback_"+t[0].id).rup_feedback("set",msg+b(M)[0].outerHTML)}else{b("#rup_feedback_"+t[0].id).rup_feedback("set",msg)}b("#rup_grid_"+t[0].id+"_selectAll").bind("click",function(Y){b.data(t[0],"selectedRowsCont",t.rup_grid("getGridParam","records"));b.data(t[0],"allSelected",true);b("#rup_feedback_"+t[0].id).rup_feedback("close");if(b.isFunction(t[0].rup_gridProps.selectAllGetPrimaryKeys)){t[0].rup_gridProps.selectAllGetPrimaryKeys.call(t);t[0].rup_gridProps.onSelectAllRows.call(t)}b.data(t[0],"deSelectedPages",[]);if(!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect&&!b.isFunction(t[0].rup_gridProps.onAfterSelectAll)){b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}});V=b.data(t[0],"selectedRowsCont")+t.rup_grid("getGridParam","reccount")-b.data(t[0],"rowsSelectedPage")}else{b.data(t[0],"rowsSelectedPage",0);var N=Number(b.data(t[0],"selectedRowsCont")-t.rup_grid("getGridParam","reccount"));if(N>0){var W=b.jgrid.format(T,N),M=b("<input/>").attr("type","button").attr("id","rup_grid_"+t[0].id+"_deSelectAll").css("margin-left","1em").addClass("botonElementosRestantes").attr("value",W).attr("alt",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.deSelectAll"));numFilas="<b>"+O.length+"</b>",J="<b>"+jqGrid.rup_grid("getGridParam","page")+"</b>",msg=b.jgrid.format(H,numFilas,J);b("#rup_feedback_"+t[0].id).rup_feedback("set",msg+b(M)[0].outerHTML);b("#rup_grid_"+t[0].id+"_deSelectAll").bind("click",function(Y){b.data(t[0],"selectedRowsCont",0);b.data(t[0],"allSelected",false);b("#rup_feedback_"+t[0].id).rup_feedback("close");if(b.isFunction(t[0].rup_gridProps.onAfterSelectAll)){t[0].rup_gridProps.onDeSelectAllRows.call(t);if(b.isFunction(t[0].rup_gridProps.onDeselectAllGetPKs)){t[0].rup_gridProps.onDeselectAllGetPKs.call(t)}}if(!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect&&!b.isFunction(t[0].rup_gridProps.onAfterSelectAll)){b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}})}else{b("#rup_feedback_"+t[0].id).rup_feedback("close")}V=N}if(b.isFunction(t[0].rup_gridProps.onAfterSelectAll)){t[0].rup_gridProps.onAfterSelectAll.call(t,O,Q,V)}if(!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect&&!b.isFunction(t[0].rup_gridProps.onAfterSelectAll)){var P=(b(t).data("selectedRows")===undefined)?new Array():b(t).data("selectedRows"),X=t.rup_grid("getDataIDs"),J=b(t).rup_grid("getGridParam","page");P[J-1]=(P[J-1]===undefined)?new Array():P[J-1];for(var U=0;U<X.length;U++){if(Q){if(b.inArray(X[U],P[J-1])===-1){P[J-1].push(X[U])}}else{P[J-1].splice(b.inArray(X[U],P[J-1]),1)}}b(t).data("selectedRows",P);b(t).data("selectedRowsCont",V);b(t).data("rowsSelectedPage",(Q)?(t.find('[aria-describedby="'+t.attr("id")+'_cb"] input:checked').length):0);b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"))}},onSelectRow_default:function(H,G){if(b.isFunction(t[0].rup_gridProps.onAfterSelectRow)){t[0].rup_gridProps.onAfterSelectRow.call(t,H,G)}if(!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect&&!b.isFunction(t[0].rup_gridProps.onAfterSelectRow)){var J=(b(t).data("selectedRows")===undefined)?new Array():b(t).data("selectedRows"),I=b(t).rup_grid("getGridParam","page");J[I-1]=(J[I-1]===undefined)?new Array():J[I-1];if(G){if(b.inArray(H,J[I-1])===-1){J[I-1].push(H)}}else{J[I-1].splice(b.inArray(H,J[I-1]),1)}b(t).data("selectedRows",J);b(t).data("selectedRowsCont",(G)?(b(t).data("selectedRowsCont")+1):(b(t).data("selectedRowsCont")-1));b(t).data("rowsSelectedPage",t.find('[aria-describedby="'+t.attr("id")+'_cb"] input:checked').length);b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"));if(t.find('[aria-describedby="'+t.attr("id")+'_cb"] input:checked').length===t.find('[aria-describedby="'+t.attr("id")+'_cb"] input').length){b(b.find("#cb_"+t.attr("id"))[0]).attr("checked",true)}}if(b("#rup_feedback_"+t[0].id)){b("#rup_feedback_"+t[0].id).rup_feedback("close")}},onSortCol_default:function(I,H,G){if(!t[0].rup_gridProps.hasMaint&&t[0].rup_gridProps.multiselect){if(b(t).data("selectedRows")!==undefined&&b(t).data("selectedRows").length>0){b("#lui_"+t.attr("id")).hide();b("#load_"+t.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(t).data("selectedRows",new Array());b(t).data("selectedRowsCont",0);b(t).data("rowsSelectedPage",0);b("#"+t[0].rup_gridProps.pagerName+"_left").html(b(t).data("selectedRowsCont")+" "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected"));t.trigger("reloadGrid")}});return""}}window.setTimeout(function(){b("#lui_"+t.attr("id")).hide();b("#load_"+t.attr("id")).hide();t.trigger("reloadGrid")},0);return""},resizeStart_default:function(H,G){g[0]=b("#gbox_"+t[0].id+" .ui-jqgrid-htable th:eq(1)").css("cursor");if(g[0]==="col-resize"){g[0]="default"}b("#gbox_"+t[0].id+" .ui-jqgrid-htable th").css("cursor","col-resize");g[1]=b("#gbox_"+t[0].id+" .ui-jqgrid-sortable").css("cursor");b("#gbox_"+t[0].id+" .ui-jqgrid-sortable").css("cursor","col-resize");b("#gbox_"+t[0].id+" .ui-jqgrid-sortable div").css("cursor","col-resize");b("#gbox_"+t[0].id+" .ui-grid-ico-sort").css("cssText","cursor: col-resize !important;")},resizeStop_default:function(G,H){b("#gbox_"+t[0].id+" .ui-jqgrid-htable th").css("cursor",g[0]);b("#gbox_"+t[0].id+" .ui-jqgrid-sortable").css("cursor",g[1]);b("#gbox_"+t[0].id+" .ui-jqgrid-sortable div").css("cursor","pointer");b("#gbox_"+t[0].id+" .ui-grid-ico-sort").css("cssText","cursor: pointer !important;")}});if(F.loadOnStartUp&&!F.hasMaint){F.url=b.rup_utils.setNoPortalParam(F.url)}else{null}if(F.sortable!==false){D=F.sortable;F.sortable={update:function(G){t.reorderColumns(G)}}}F.jsonReader={repeatitems:false,id:"rup_id"};F.prmNames={id:"rup_id"};F.loadui="block";F.pager=b("#"+F.pagerName);if(F.datatype===undefined){if(F.loadOnStartUp&&!F.hasMaint){F.datatype="json"}else{F.datatype="clientSide"}}t[0].rup_gridProps=F;t[0].rup_gridProps.allPksArray=[];b.data(t[0],"selectedRowsCont",0);var d=t.jqGrid(F);if(F.fluidBaseLayer===null){F.fluidBaseLayer=b("#gbox_"+d.attr("id")).parent();if(F.fluidBaseLayer.attr("id").indexOf("RUP_GRID_")!==-1){F.fluidBaseLayer=F.fluidBaseLayer.parent()}}b("#"+t[0].id).bind("fluidWidth.resize",function(H,I,G){b(d).setGridWidth(G)});if(F.hasMaint===false&&F.width==="auto"){b("#"+t[0].id).fluidWidth({fluidBaseLayer:F.fluidBaseLayer,minWidth:F.minWidth,maxWidth:F.maxWidth,fluidOffset:F.fluidOffset})}if(!F.loadOnStartUp){t.setGridParam({url:(!F.hasMaint?F.url:null),datatype:(!F.hasMaint?"json":"clientSide")})}b("<div/>").attr("id","rup_feedback_"+t[0].id).insertBefore("#gbox_"+t[0].id);if(b("#"+t[0].id).getGridParam("sortable")){b("#gview_"+t[0].id+" .ui-jqgrid-sortable").css("cursor","move")}else{b("#gview_"+t[0].id+" .ui-jqgrid-sortable").css("cursor","default")}b("#rup_feedback_"+t[0].id).rup_feedback({closeLink:false,gotoTop:false,block:false});b.each(b("#gview_"+t[0].id+" .ui-jqgrid-sortable"),function(G,H){s=b(H).text();h=b(H).children();b(H).text("").prepend(b("<div />").css("cursor","pointer").css("display","inline-table").html(s)).append(h)});if(F.multiselect){b("#gview_"+t[0].id+" thead th").first().attr("title",b.rup.i18nParse(b.rup.i18n.base,"rup_maint.multiselectHeader"))}b("#gview_"+t[0].id+" thead th[title]").rup_tooltip({show:{delay:500},position:{viewport:b("#gview_"+t[0].id),adjust:{method:"flip"}}});b("#"+F.pagerName).css("height","auto");b("#"+F.pagerName+"_left").addClass("pager_left");b("#"+F.pagerName+"_center").addClass("pager_center");b("#"+F.pagerName+"_right").addClass("pager_right");b("#"+F.pagerName+"_left").html("");if(F.multiselect===true){b("#"+F.pagerName+"_left").append(b("<div/>").addClass("ui-paging-selected").html("0 "+b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.selected")))}b("#"+F.pagerName+" .pager_center table td").addClass("pagControls");b("#"+F.pagerName+"_center .ui-pg-table #first_"+F.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.primPag")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("#"+F.pagerName+"_center .ui-pg-table #prev_"+F.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.anterior")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("#"+F.pagerName+"_center .ui-pg-table #next_"+F.pagerName).html(b('<a href="#" />').html(b.rup.i18nParse(b.rup.i18n.base,"rup_grid.pager.siguiente")).addClass("linkPaginacion")).removeClass("ui-pg-button");b("#"+F.pagerName+"_center .ui-pg-table #last_"+F.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_"+t[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(!F.pagerInline){b("#"+F.pagerName+" tr:eq(0)").parent().append(b("<tr/>").attr("id",F.pagerName+"_pagerNewLine"));b("#"+F.pagerName+"_pagerNewLine").append(b("#"+F.pagerName+"_left"));b("#"+F.pagerName+"_pagerNewLine").append(b("#"+F.pagerName+"_right"));b("#"+F.pagerName+"_right").attr("colspan","2");b("#"+F.pagerName+"_center").attr("colspan","3")}if(F.multiselect===true){b("#cb_"+b.jgrid.jqID(t[0].id),"#gbox_"+t[0].id).unbind("click");b("#cb_"+b.jgrid.jqID(t[0].id),"#gbox_"+t[0].id).bind("click",function(){if(this.checked){t[0].p.selarrrow=[];b("[id^=jqg_"+t[0].id+"_]").attr("checked","checked");b(t[0].rows).each(function(G){if(G>0){if(!b(this).hasClass("subgrid")&&!b(this).hasClass("jqgroup")){b(this).addClass("ui-state-highlight").attr("aria-selected","true");t[0].p.selarrrow.push(this.id);t[0].p.selrow=this.id}}});chk=true;emp=[]}else{b("[id^=jqg_"+t[0].p.id+"_]").removeAttr("checked");b(t[0].rows).each(function(G){if(G>0){if(!b(this).hasClass("subgrid")){b(this).removeClass("ui-state-highlight").attr("aria-selected","false");emp.push(this.id)}}});t[0].p.selarrrow=[];t[0].p.selrow=null;chk=false}if(b.isFunction(t[0].p.onSelectAll)){t[0].p.onSelectAll.call(t[0],chk?t[0].p.selarrrow:emp,chk)}});b("#RUP_"+t[0].id).width(this.width())}}var c=b("#gbox_"+b(this).attr("id")).find("table");b(c[0]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.cabecera"));if(F.summary){b(c[1]).attr("sumary",F.summary)}else{b(c[1]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.datos"))}b(c[2]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.paginador"));b(c[3]).attr("sumary",b.rup.i18nParse(b.rup.i18n.base,"rup_grid.summary.paginador_navegar"));b(F.colModel).each(function(H,I){if(I.classes==="ui-ellipsis"){b("[id='jqgh_"+b(t).attr("id")+"_"+I.name+"']").css("display","block").css("text-overflow","ellipsis")}var G=b("[id='jqgh_"+b(t).attr("id")+"_"+I.name+"']").children("div");b(G).replaceWith(b("<span>").text(b(G).text()).css("cursor","pointer"))})},_tooltip:function(c){b("tr#"+c+" > td").each(function(d){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(f){var c={};f.extend(f.rup.iniRup,f.rup.rupSelectorObjectConstructor("rup_grid_jerarquia",c));f.fn.rup_grid_jerarquia("extend",{reset:function(){f(this).data("jerarquia.tree",[]);postData=f(this).getGridParam("postData");delete postData["jerarquia.tree"]},resetMultiselect:function(){var j=this,h=f(j).attr("id");j.data("treeSelection",[]);j.getGridParam("selarrrow").length=0;f.each(j.find("tr[aria-selected='true']"),function(l,k){f(k).removeClass("ui-state-highlight").attr("aria-selected","false");f(k).find("[aria-describedby='"+h+"_cb'] input").removeAttr("checked")});j._refreshFooter.call(j)},getMultiselect:function(){var h=this;if(h.data("settings")!==undefined){var j=h.data("settings").token;return f.map(this.data("treeSelection"),function(l,k){return l.substring(l.lastIndexOf(j)+j.length)})}else{return[]}}});f.fn.rup_grid_jerarquia("extend",{_init:function g(q){if(q.length>1){f.rup.errorGestor(f.rup.i18nParse(f.rup.i18n.base,"rup_global.initError")+f(this).attr("id"))}else{var l=f.extend(true,{},f.fn.rup_grid_jerarquia.defaults,q[0]),v=this,t=null,u=null,o=null,p=null,h=null;l.id=f(this).attr("id");var j=f(v).getGridParam("postData");j["jerarquia.token"]=l.token;t=f(v).getGridParam("colModel");for(var m=0;m<t.length;m++){if(t[m]["name"]===l.expandColName){u=t[m].formatter;t[m].formatter=function(w,x,y){o=((w!==undefined)?w:"");if(u!==undefined){o=u.call(this,w,x,y)}return v._formatter(l,w,x,y)+o};break}}p=f(v).getGridParam("loadComplete");h=function k(w){if(!f.isEmptyObject(w.rows)){p.call(this,w);v._loadComplete(l,w)}v._refreshFooter.call(v)};f(v).setGridParam({loadComplete:h});f.each(l.resetEvents,function(x,w){var A=f.isFunction(w[0])?w.shift():null,z="#"+w.join(", #");f(z).on(x,function(B){if(A===null||A.call(this,B)===false){f(v).rup_grid_jerarquia("reset")}});for(var y=0;y<w.length;y++){f._data(f("#"+w[y])[0],"events")[x]=f._data(f("#"+w[y])[0],"events")[x].reverse()}});f(v).data("jerarquia.tree",[]);f(v).data("settings",l);j=f(v).getGridParam("postData");if(f(v).getGridParam("multiselect")){v._multiselect();var r=v.data("maintName");toolbar=f("#"+r)[0].prop.toolbar.self;function s(){var w=jQuery.extend({},f(v).getGridParam("postData"));w["jerarquia.parentId"]=f(v).data("treeSelection").toString();f.rup_ajax({url:v[0].rup_gridProps.url,dataType:"json",type:"GET",async:false,data:w,contentType:"application/json",beforeSend:function(x){x.setRequestHeader("JQGridModel_selected",true)},success:function(B,x){var A=[],z=[],y=v.data("settings").token;f.map(B,function(D,E){A.push(parseInt(E));var C=[];f.map(D,function(H,F){C.push(parseInt(F));var G=[];G.push(H);z.push(H);G["id_"+H]=y+H;C["l_"+F]=G});A["p_"+E]=C});f("#"+r)[0].prop.selectedRows=A;v[0].rup_gridProps.allPksArray=z;f("#"+r)[0].prop.selectedRowsCont=z.length},error:function(z,x,y){f.rup_messages("msgError",{title:f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.errorTitle"),message:f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.errorMessageSelected")})},complete:function(x,y){}})}if(toolbar.find("[id$='rup-maint_toolbar-"+r+"##edit']").length>0){toolbar.find("[id$='rup-maint_toolbar-"+r+"##edit']").click(s);f._data(toolbar.find("[id$='rup-maint_toolbar-"+r+"##edit']")[0],"events")["click"].reverse()}if(toolbar.find("[id$='rup-maint_toolbar-"+r+"##delete']").length>0){toolbar.find("[id$='rup-maint_toolbar-"+r+"##delete']").click(s);f._data(toolbar.find("[id$='rup-maint_toolbar-"+r+"##delete']")[0],"events")["click"].reverse();toolbar.find("[id$='rup-maint_toolbar-"+r+"##delete']").click(function(){f(".ui-dialog:visible").find("button").click(function(){f(v).rup_grid_jerarquia("resetMultiselect")});f(".ui-dialog:visible").on("dialogclose",function(x){var w=v.data("maintName");f("#"+w)[0].prop.selectedRows=[];v[0].rup_gridProps.allPksArray=[];f("#"+w)[0].prop.selectedRowsCont=0})})}if(toolbar.find("[id$='rup-maint_toolbar-"+r+"##new']").length>0){var n=function(){v.data("treeSelection",[]);v._reloadMultiselect.call(v)};toolbar.find("[id$='rup-maint_toolbar-"+r+"##new']").click(function(w){if(v.data("treeSelection").length>0&&f("#"+r)[0].prop.selectedRows.length===0){f.rup_messages("msgConfirm",{message:f.rup.i18nParse(f.rup.i18n.base,"rup_maint.checkSelectedElems"),title:f.rup.i18nParse(f.rup.i18n.base,"rup_maint.changes"),OKFunction:function(){n.call(v);f("#"+r).rup_maint("newElement")}});w.stopImmediatePropagation()}else{n.call(v)}});f._data(toolbar.find("[id$='rup-maint_toolbar-"+r+"##new']")[0],"events")["click"].reverse()}}}},_formatter:function e(l,j,k,p){if(p.level===undefined){var o=this.getRowData(k.rowId);p.hasChildren=f.parseJSON(o.hasChildren);p.filter=f.parseJSON(o.filter);p.level=o.level}var n=f("<span />").addClass("rup-grid-jerarquia rup-grid-jerarquia_level_"+p.level+" ui-icon");if(p.hasChildren){var h=f("#"+l.id).data("jerarquia.tree"),m=""+p[l.relatedColName];if(f.inArray(m,h)===-1){n.addClass(l.expandedClass).text(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.icons.expanded"))}else{n.addClass(l.unExpandedClass).text(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.icons.unexpanded"))}}else{n.addClass(l.noChildClass).text(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.icons.nochild"))}if(p.filter){n=f(n).before(f("<span />").addClass("rup-grid-jerarquia rup-grid-jerarquia_filter_"+p.level+" ui-icon").addClass("rup-grid-jerarquia_filter").addClass(l.filterClass).text(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.icons.filtered")));return(n[0].outerHTML+n[1].outerHTML)||new XMLSerializer().serializeToString(n[0]+n[1])}return n[0].outerHTML||new XMLSerializer().serializeToString(n[0])},_loadComplete:function d(j,k){f.each(f("td[aria-describedby$='hasChildren']:contains('true')"),function(l,m){f(m).parent().find("span[class^='rup-grid-jerarquia']").click(function(n){if(f(this).hasClass(j.filterClass)){return false}f(this).rup_tooltip("destroy");f(this).parent().rup_tooltip("destroy");var v=f("#"+j.id),t=f(v).getGridParam("colModel"),s=0,u,q,r,o=null;for(var p=0;p<t.length;p++){if(t[p]["name"]===j.relatedColName){s=p;break}}u=f(f(m).parent().children()[s]);parentValue=f.trim(u.contents(":not(span[class^='rup-grid-jerarquia'])").first().text()),r=f(v).data("jerarquia.tree");if(f.inArray(parentValue,r)===-1){r.push(parentValue)}else{r.splice(f.inArray(parentValue,r),1)}f(v).data("jerarquia.tree",r);o=f(v).getGridParam("postData");o["jerarquia.tree"]=r.toString();f(v).trigger("reloadGrid");return false})});if(j.parentNodesTooltip){var h=this;f.each(this.find("span[class^='rup-grid-jerarquia']"),function(m,n){var l=f(h).attr("id"),p=f(n).parentsUntil("tr").siblings("[aria-describedby='"+l+"_parentNodes']").html(),o=f(n).parent();o.rup_tooltip("destroy");o.attr("title",h._parseParentNodes(p));o.rup_tooltip({show:{delay:j.tooltipDelay}})})}if(h.getGridParam("multiselect")){if(f(this).getGridParam("selarrrow").length===f(this).getGridParam("rowNum")){f("#cb_"+f(this).attr("id")).attr("checked","checked")}}},_parseParentNodes:function b(h){var k=this.data("settings")["parentNodesTooltipFnc"];nodes=h.split(this.data("settings").token).slice(1);if(k===null){var m="",l="&nbsp;&nbsp;";for(var j=0;j<nodes.length;j++){if(j!==(nodes.length-1)){m+=nodes[j]+"<br/>"+l+"└&nbsp;";l+="&nbsp;&nbsp;&nbsp;"}else{m+="<b>"+nodes[j]+"</b>"}}return m}else{return k.call(this,nodes)}},_multiselect:function a(){var j=this,h=f(j).attr("id");f(j).data("treeSelection",[]);if(j.data("settings").multiboxonly){f(j).data("defaultEventFunctions").beforeSelectRow_default=function(k,l){return(l.target.type=="checkbox")?true:false};f(j).data("defaultEventFunctions").onCellSelect_default=function(m,k,n,l){if(f(l.target).attr("id")!=="jqg_"+h+"_"+m){return false}}}f(j).data("defaultEventFunctions").onSelectRow_default=function(l,k){j._selectRow.call(j,l,k)};f(j).data("defaultEventFunctions").onSelectAll_default=function(l,k){j._selectAll.call(j,l,k)};f("#"+j.data("maintName"))[0].prop.detailDiv.on("dialogclose",function(l){var k=j.data("maintName");f("#"+k)[0].prop.selectedRows=[];j[0].rup_gridProps.allPksArray=[];f("#"+k)[0].prop.selectedRowsCont=0});f(j).on("jqGridLoadComplete",function(){j._reloadMultiselect.call(j);f("#"+h+"_cb").rup_tooltip("destroy");f("#"+h+"_cb").removeAttr("title");var m=f(),k=j.data("settings").multiMenu,l=function(n){j.data("checkMenuValue",f(this).data("checkMenuValue"));if(m.data("rowId")!==undefined){f("#"+h).setSelection(m.data("rowId"),true)}else{j._selectRow()}j.removeData("checkMenuValue");m.hide()};f.each(f.merge(f("#"+h+"_cb"),f(j).find("[aria-describedby='"+h+"_cb']")),function(p,o){f(o).find("input").css("margin-right","1em").after(f("<a />").attr("href","javascript:void(0)").addClass("ui-icon rup-grid-jerarquia_checkmenu_arrow").click(function(){if((j.getGridParam("records")===0)||m.is(":visible")){m.hide();return false}f("#"+h+"_checkmenu").remove();var q=f(this).parent(),y=q.offset();m=f("<ul />").attr("id",h+"_checkmenu").addClass("rup-grid-jerarquia_checkmenu").on({mouseenter:function(){f(this).show()},mouseleave:function(){f(this).hide()},keydown:function(D){switch(D.keyCode){case 27:f(this).hide();break;case 13:f(this).find(".ui-state-focus").click();break}}}).css({top:y.top+q.height(),left:y.left});if(!f.rup_utils.aplicatioInPortal()){m.appendTo("body")}else{m.appendTo(".r01gContainer")}var s=f(this).parents("tr").attr("id"),v=f(j).getRowData(s),t=f(j).data("treeSelection"),B=t.length,C=function(E,D,F){m.append(f("<a />").text(E).data("checkMenuValue",F).click(function(){l.call(this)}).append(f("<span />").addClass("ui-icon "+D)).wrap(f("<li />")).parent())};if(q.attr("id")===undefined){if(v.hasChildren==="true"){if(k.hijos){C(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.menu.opt_1"),"child_icon",1)}if(k.descendientes){C(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.menu.opt_2"),"hierarchy-down_icon",2)}}var x=false,u=j.data("settings").token;for(var w=0;w<B;w++){var r=t[w];if(r.indexOf(v.treeNodes)===0){r=r.substr(v.treeNodes.length);if(r.split(u).length>=2){x=true;break}}}if(x&&k.hijos){C(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.menu.opt_3"),"child_icon",3)}if(x&&k.descendientes){C(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.menu.opt_4"),"hierarchy-down_icon",4)}}else{var A=f(j).getGridParam("records"),z=f(j).data("treeSelection").length;if(A!==z){C(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.menu.opt_5"),"check_icon",5)}else{C(f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.menu.opt_6"),"uncheck_icon",6)}}m.data("rowId",s);m.rup_menu({display:"vertical"});m.find("a:first").focus()}));if(this.nodeName==="TD"){var n=f(j).getRowData(f(this).parent().attr("id")).hasChildren;if(((k.hijos&&n==="false")&&!k.descendientes)||(!k.hijos&&(k.descendientes&&n==="false"))||((k.hijos&&n==="false")&&(k.descendientes&&n==="false"))){if(j.data("settings").multiMenuDisabled){f(this).find("a").addClass("ui-state-disabled").off("click")}else{f(this).find("a").remove()}}}else{if(j.getGridParam("records")===0){if(j.data("settings").multiMenuDisabled){f(this).find("a").addClass("ui-state-disabled")}else{f(this).find("a").remove()}}}f(o).on("mouseleave",function(){if(m.is(":visible")){m.hide()}})})});f.each(f(j).data("settings").resetMultiEvents,function(l,k){var o=f.isFunction(k[0])?k.shift():null,n="#"+k.join(", #");f(n).on(l,function(p){if(o===null||o.call(this,p)===false){f(j).rup_grid_jerarquia("resetMultiselect")}});for(var m=0;m<k.length;m++){f._data(f("#"+k[m])[0],"events")[l]=f._data(f("#"+k[m])[0],"events")[l].reverse()}})},_selectRow:function(m,k){var l=this,h=f(l).attr("id"),j=f(l).data("treeSelection"),n=f(l).getRowData(m).treeNodes;ajaxData=jQuery.extend({},f(l).getGridParam("postData")),checkMenuValue=l.data("checkMenuValue"),token=l.data("settings").token;switch(checkMenuValue){default:if(l.getGridParam("selarrrow").length===l.getGridParam("rowNum")){f("#cb_"+h).attr("checked","checked")}f("#"+h+"_checkmenu").hide();if(k){if(f.inArray(n,j)===-1){j.push(n)}}else{j.splice(f.inArray(n,j),1)}l._refreshFooter.call(l);break;case 5:case 6:n=token;case 1:case 2:case 3:case 4:l._checkNode.call(l,n,false);ajaxData.page=ajaxData.rows=null;ajaxData["jerarquia.tree"]=null;ajaxData["jerarquia.parentId"]=n.substring(n.lastIndexOf(token)+token.length);f.rup_ajax({url:l[0].rup_gridProps.url,dataType:"json",type:"GET",async:false,data:ajaxData,contentType:"application/json",beforeSend:function(o){o.setRequestHeader("RUP",f.toJSON({treeNodes:"treeNodes"}));o.setRequestHeader("JQGridModel",true);f("#lui_"+h).show();f("#load_"+h).show()},success:function(t,p){t=t.rows;var o=[],s=0,r=l.data("settings").token;switch(checkMenuValue){case 1:case 3:o=f.map(t,function(v,u){var w=v.treeNodes;if(w.split(r).length<3){return n+w}});break;case 5:case 6:n="";case 2:case 4:o=f.map(t,function(v,u){var w=v.treeNodes;return n+w});break}s=o.length;if(checkMenuValue===1||checkMenuValue===2||checkMenuValue===5){for(var q=0;q<s;q++){if(f.inArray(o[q],j)===-1){j.push(o[q])}}}else{for(var q=0;q<s;q++){j.splice(f.inArray(o[q],j),1)}}f(l).data("treeSelection",j);if(checkMenuValue===5||checkMenuValue===6){if(checkMenuValue===5){f("#cb_"+h).attr("checked","checked");feedbackTxt=f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.feedbackTableSelect")}if(checkMenuValue===6){f("#cb_"+h).removeAttr("checked");feedbackTxt=f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.feedbackTableDeselect")}f("#rup_feedback_"+h).rup_feedback("option",{closeLink:true});f("#rup_feedback_"+h).rup_feedback("set",feedbackTxt)}},error:function(q,o,p){f.rup_messages("msgError",{title:f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.errorTitle"),message:f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.errorMessageMulti")})},complete:function(o,p){l._reloadMultiselect.call(l);f("#lui_"+h).hide();f("#load_"+h).hide();if(l.data("settings").multiMenuCallback!==undefined){l.data("settings").multiMenuCallback.call(this)}}});break}},_selectAll:function(h,k){var q=this,o=f(q).attr("id"),p=h.length,j=f(q).data("treeSelection"),l="";if(k){l=f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.feedbackVisualSelect")}else{l=f.rup.i18nParse(f.rup.i18n.base,"rup_grid_jerarquia.feedbackVisualDeselect")}f("#rup_feedback_"+o).rup_feedback("option",{closeLink:true});f("#rup_feedback_"+o).rup_feedback("set",l);for(var m=0;m<p;m++){if(h[m].indexOf("ghead")!==-1){continue}var n=f(q).getRowData(h[m]).treeNodes;if(k){if(f.inArray(n,j)===-1){j.push(n)}}else{j.splice(f.inArray(n,j),1)}}q._refreshFooter.call(q)},_checkNode:function(o,l){var m=this,h=f(m).attr("id"),p=m.getGridParam("selarrrow"),k=f(m).data("treeSelection"),n=m.find("td[aria-describedby='"+h+"_treeNodes']").filter(function(){return f(this).html()===o}),j=f(n).parent().attr("id");if(l){f(n).parent().addClass("ui-state-highlight").attr("aria-selected","true");f(n).parent().find("[aria-describedby='"+h+"_cb'] input").attr("checked","checked");if(f.inArray(j,p)==-1){p.push(j)}}else{f(n).parent().removeClass("ui-state-highlight").attr("aria-selected","false");f(n).parent().find("[aria-describedby='"+h+"_cb'] input").removeAttr("checked");if(f.inArray(j,p)!==-1){p.splice(f.inArray(j,p),1)}}},_reloadMultiselect:function(){var k=this,h=f(k).attr("id"),j=f(k).data("treeSelection");f.each(k.find("td[aria-describedby='"+h+"_treeNodes']"),function(m,l){if(f.inArray(f(l).html(),j)!==-1){k._checkNode.call(k,f(l).html(),true)}else{k._checkNode.call(k,f(l).html(),false)}});if(f(this).getGridParam("multiselect")){if(f(this).getGridParam("selarrrow").length===f(this).getGridParam("rowNum")){f("#cb_"+f(this).attr("id")).attr("checked","checked")}}k._refreshFooter.call(k)},_refreshFooter:function(){var l=this,j=f(l).attr("id"),k=f(l).data("treeSelection");if(l.getGridParam("multiselect")){f("#"+l[0].rup_gridProps.pagerName+"_left").html(k.length+" "+f.rup.i18nParse(f.rup.i18n.base,"rup_grid.pager.selected"));var n=f("#"+l.data("maintName"))[0].prop.toolbar.self,h=f(l).data("jerarquia.tree"),m=[];m=f.grep(k,function(q,o){var p=false;selectionNodes=q.split(l.data("settings").token),selectionNodes_length=selectionNodes.length;f.each(selectionNodes,function(r,s){if((f.inArray(s,h)!==-1)&&(r+1!==selectionNodes_length)){p=true;return false}});return p},true);if(m.length>0){n.enableButton("edit");n.enableButton("delete")}else{n.disableButton("edit");n.disableButton("delete")}}}});f.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 o=this.element,k=a("<a>").attr("id","rup_language_choice").addClass("rup-language_change_option").text(a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguage"));a(o).addClass("ui-widget");if(this.options.modo==="portal"){var j=a("<ul>").addClass("rup-language_portal"),l=a(this.options.languages).size();a.each(this.options.languages,function(r,s){s=s.replace(/^\s*|\s*$/g,"");var q=a.rup.i18nParse(a.rup.i18n.base,"rup_language."+s+"_short");if(s!==active){a("<li>").append(a("<a>").attr("href","?"+a.rup.LOCALE_PARAM_NAME+"="+s).text(q).addClass("rup-language_portal_list ui-corner-all").attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral_"+s)+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+s))).appendTo(j)}else{a("<li>").addClass("ui-state-active").append(a("<a>").attr("href","javascript:void(0);").text(q).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."+s))).appendTo(j)}if(r<l-1){j.append(a("<div>").html("|").addClass("rup-language_portal_separator"))}});o.append(j)}else{var j=a("<ul>").attr("id","ulGeneral"),m,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)),f=a("<li>").addClass("rup-language_change").attr("id","rup_language_link"),h=a("<li>").attr("id","rup_language_list").addClass("rup-language_change_opened").css("visibility","hidden"),p=a("<div>"),c=a("<div>").addClass("rup-language_language_list"),n=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")),g=a("<ul>");j.append(b);a("<a>").attr("href","#").text(a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguage")).appendTo(f);j.append(f);p.append(k);c.append(n);a.each(this.options.languages,function(s,t){t=t.replace(/^\s*|\s*$/g,"");var r=a("<li>").attr("id","rup_language_lng_"+t),q=a.rup.i18nParse(a.rup.i18n.base,"rup_language."+t);if(t!==active){a("<a>").appendTo(r).attr("href","?"+a.rup.LOCALE_PARAM_NAME+"="+t).text(q).attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral_"+t)+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+t))}else{a("<a>").appendTo(r).attr("href","javascript:void(0);").text(q).attr("title",a.rup.i18nParse(a.rup.i18n.base,"rup_language.changeLanguageLiteral")+a.rup.i18nParse(a.rup.i18n.base,"rup_language."+t))}r.appendTo(g)});c.append(g);p.append(c);h.append(p);j.append(h);o.append(j);var d=c.css("width","0.8em").width();var e=f.css("margin-right");f.css("margin-right","0px");c.width((h.position()).left-d);c.css("padding-left","0.6em");c.css("padding-right","0.2em");c.css("top",b.height()-1);h.hide();h.css("visibility","");f.css("margin-right",e);a("#rup_language_lng_"+a.rup.lang).addClass("ui-state-active");f.click(function(){f.hide();h.show();a(".rup-language_language_list").find("li:not(.rup-language_language_list_active)").first().children("a").focus()});k.click(function(){h.hide();f.show()});n.click(function(){h.hide();f.show()});h.mouseenter(function(){o.one("mouseleave",function(){h.hide();f.show()})});o.bind("keydown",function(q){switch(q.keyCode){case a.ui.keyCode.UP:if(a(q.target).parent().prevAll("li:not(.rup-language_language_list_active)").length>0){a(q.target).parent().prevAll("li:not(.rup-language_language_list_active)").first().children().focus()}else{a(q.target).parent().siblings("li:not(.rup-language_language_list_active)").last().children().focus()}break;case a.ui.keyCode.DOWN:if(a(q.target).parent().nextAll("li:not(.rup-language_language_list_active)").length>0){a(q.target).parent().nextAll("li:not(.rup-language_language_list_active)").first().children().focus()}else{a(q.target).parent().siblings("li:not(.rup-language_language_list_active)").first().children().focus()}break;case a.ui.keyCode.ESCAPE:h.hide();f.show();break;default:}})}o.find("[title]").rup_tooltip({applyToPortal:true})},_setOption:function(b,c){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",1000)}})})},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",1000)}}}})});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",1000)}})}})}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",1000)}})}})}}})},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.xhrFileUploadSupport||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",1000)}}}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",1000);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",1000)}}}})})},_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:1000,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:1000,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:1000,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(d,f){var k=this,b=k[0].prop,c=b.jQueryGrid,g,h,j,e;g=b.jQueryGrid.rup_grid("getGridParam","page");h=b.jQueryGrid.rup_grid("getInd",d,false);j=k._getPrimaryKeysForRow(d);if(b.selectedRows["p_"+g]===undefined){b.selectedRows["p_"+g]=[];b.selectedRows.push(Number(g))}if(b.selectedRows["p_"+g]["l_"+h]===undefined){b.selectedRows["p_"+g]["l_"+h]=[];b.selectedRows["p_"+g].push(Number(h))}if(b.selectedRows["p_"+g]["l_"+h]["id_"+d]===undefined){b.selectedRows["p_"+g]["l_"+h]["id_"+d]=j;b.selectedRows["p_"+g]["l_"+h].push(d);if(f===undefined||f===true){b.selectedRowsCont+=1;a.data(c[0],"selectedRowsCont",Number(a.data(c[0],"selectedRowsCont")+1))}c[0].rup_gridProps.allPksArray.push(j);e=a.data(c[0],"deSelectedPages");if(e!=undefined){ind=a.inArray(g,e!=undefined?e:[]);if(ind>-1){e.splice(ind,1);a.data(c[0],"deSelectedPages",e)}}}b.currentSelectedRow=d},deselectRow:function(d){var b=this,h=b[0].prop,c=h.jQueryGrid,f,g,e;f=c.rup_grid("getGridParam","page");g=c.rup_grid("getInd",d,false);e=b._getPrimaryKeysForRow(d);if(b._isSelected(d,null,f,g)){delete h.selectedRows["p_"+f]["l_"+g];h.selectedRows["p_"+f].splice(a.inArray(g,h.selectedRows["p_"+f]),1)}ind=a.inArray(e,c[0].rup_gridProps.allPksArray);c[0].rup_gridProps.allPksArray.splice(ind,1);a.data(c[0],"selectedRowsCont",Number(a.data(c[0],"selectedRowsCont")-1));h.selectedRowsCont-=1}});a.fn.rup_maint("extend",{defineDetailForm:function(){var b=this,c=b[0].prop;if(c.detailForm!==null){c.customDetailForm=true;c.detailForm=a("#"+c.detailForm).ajaxForm();b._createDetailForm(true)}else{c.customDetailForm=false;b._createDetailForm()}c.detailDiv.rup_dialog({type:jQuery.rup.dialog.DIV,autoOpen:false,modal:true,width:(c.detailDivWidth!==undefined?c.detailDivWidth:569),height:(c.detailDivHeight!==undefined?c.detailDivHeight:"auto"),specificLocation:c.name,create:c.eventCreateDetailForm,open:function(){a(this).find(".ui-selectmenu-menu").each(function(d,e){a(e).appendTo(a(e).parents(".ui-dialog"))});a(".ui-dialog").css("overflow","visible");if(a.isFunction(c.onafterDetailShow)){c.onafterDetailShow.call(b[0],c.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)}}});c.detailDiv.parent().find("#closeText_"+c.detailDiv.first()[0].id).parent().unbind("click").bind("click",function(){b._checkDetailFormModifications(function(){c.detailDiv.rup_dialog("close")})});c.detailDiv.parent().find(".ui-dialog-titlebar-close").unbind("click").bind("click",function(){b._checkDetailFormModifications(function(){c.detailDiv.rup_dialog("close")})});b._createDetailButtons(c.detailDiv);if(a.rup_utils.aplicatioInPortal()){c.detailDiv.dialog("widget").appendTo(a("div.r01gContainer"))}else{c.detailDiv.dialog("widget").appendTo("body")}},defineValidationConfig:function(){var d=this,g=d[0].prop,e,c,b,f;if(g.validation!==null&&g.validation.rules!==undefined){f=a.extend({feedback:(jqGrid.rup_grid("isEditable")===true?g.feedback:g.detailFeedback)},g.validation)}else{e=jqGrid.rup_grid("getColModel");c=a.map(e,function(j){var h={};if(j.validationrules!==undefined){return{name:j.name,value:j.validationrules}}else{return null}});b={};a.each(c,function(h,j){b[j.name]=j.value});f={rules:b,feedback:(jqGrid.rup_grid("isEditable")===true?g.feedback:g.detailFeedback)}}if(jqGrid.rup_grid("isEditable")){f=a.extend(f,{errorPlacement:function(h,j){},feedbackErrorConfig:{getFieldName:function(h,m,o){var l=o.attr("name");var j=g.jQueryGrid.rup_grid("getColModel");var n=g.jQueryGrid.rup_grid("getGridParam","colNames");var p=false;for(var k=0;k<j.length&&!p;k=k+1){if(j[k].name==l){errorKey=n[k];return errorKey}}return l}}})}g.detailForm.rup_validate(f)},_isFirstSelectedElement:function(e){var b=this,f=b[0].prop,d,c;d=f.selectedRows.sort(function(h,g){return h-g});c=f.selectedRows["p_"+d[0]].sort(function(h,g){return h-g});if(c["l_"+c[0]][0]===e){return true}else{return false}},_isLastSelectedElement:function(e){var b=this,f=b[0].prop,d,c;d=f.selectedRows.sort(function(h,g){return h-g});c=f.selectedRows["p_"+d[d.length-1]].sort(function(h,g){return h-g});if(c["l_"+c[c.length-1]][0]===e){return true}else{return false}},_isSelected:function(d,j,f,g){var b=this,h=b[0].prop,c=h.jQueryGrid,g,e;if(f===undefined){f=c.rup_grid("getGridParam","page")}if(g===undefined){g=c.rup_grid("getInd",d,false)}if(h.selectedRows["p_"+f]===undefined){return false}if(h.selectedRows["p_"+f]["l_"+g]===undefined){return false}if(h.selectedRows["p_"+f]["l_"+g]["id_"+d]===undefined){return false}return true},_markSelectedRows_multiselect:function(){var d=this,j=d[0].prop,e=j.jQueryGrid,c,h,b=false,g=0;c=e.rup_grid("getDataIDs");h=e.rup_grid("getGridParam","page");if(j.selectedRows["p_"+h]!==undefined){b=true}for(var f=0;f<c.length;f++){rowNum=e.rup_grid("getInd",c[f],false);if(d._isSelected(c[f],null,h,rowNum)){e.rup_grid("setSelection",c[f],true);g++}else{if(!b&&a.data(e[0],"allSelected")===true){d.rup_maint("selectRow",c[f],false);e.rup_grid("setSelection",c[f],true)}}}if(j.selectedRows["p_"+h]&&j.selectedRows["p_"+h].length===e.rup_grid("getDataIDs").length){a("#cb_"+e[0].id).attr("checked",true)}else{a("#cb_"+e[0].id).attr("checked",false)}a.data(e[0],"rowsSelectedPage",g);return false},_onAfterSelectRow_multiselect:function(d,k){var l=this,b=l[0].prop,c=b.jQueryGrid,j=c.rup_grid("getGridParam","page"),h,f=[],e,g;if(k){l.rup_maint("selectRow",d)}else{l.rup_maint("deselectRow",d)}g=b.selectedRowsCont;if(a("#cb_"+c[0].id).is(":checked")){g=Number(a.data(c[0],"selectedRowsCont"))-1;a("#cb_"+c[0].id).attr("checked",false)}g=Number(a.data(c[0],"selectedRowsCont"));if(c.rup_grid("isMultiselect")){if(g>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_"+j]&&b.selectedRows["p_"+j].length===c.rup_grid("getDataIDs").length){a("#cb_"+c[0].id).attr("checked",true)}else{a("#cb_"+c[0].id).attr("checked",false)}a("#"+c[0].rup_gridProps.pagerName+"_left").html(g+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"));a.data(c[0],"rowsSelectedPage",c.rup_grid("getGridParam","selarrrow").length)},_onAfterSelectAll_multiselect:function(d,k,l){var o=this,b=o[0].prop,c=b.jQueryGrid,m,e,f,n,h;m=c.rup_grid("getGridParam","page");if(k){for(var g=0;g<d.length;g++){o.rup_maint("selectRow",d[g])}}else{for(var g=0;g<d.length;g++){o.rup_maint("deselectRow",d[g])}}a.data(c[0],"selectedRowsCont",l);if(l>0){b.toolbar.self.enableButton("edit");b.toolbar.self.enableButton("delete")}else{b.toolbar.self.disableButton("edit");b.toolbar.self.disableButton("delete")}a("#"+c[0].rup_gridProps.pagerName+"_left").html(l+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"))},_onSelectAllRows_multiselect:function(){var b=this,g=b[0].prop,c=g.jQueryGrid,e,f,d;a.data(c[0],"selectedRowsCont",c.rup_grid("getGridParam","records"));a.data(c[0],"allSelected",true);c[0].rup_gridProps.allPksArray=[];g.selectedRows=[];a("#"+c[0].rup_gridProps.pagerName+"_left").html(c.rup_grid("getGridParam","records")+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"))},_onDeSelectAllRows_multiselect:function(){var b=this,g=b[0].prop,c=g.jQueryGrid,e,f,d;a.data(c[0],"selectedRowsCont",0);a.data(c[0],"allSelected",false);c[0].rup_gridProps.allPksArray=[];g.selectedRows=[];a("#"+c[0].rup_gridProps.pagerName+"_left").html("0 "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"))},_onPaging_multiselect:function(g){var c=this,h=c[0].prop,d=h.jQueryGrid;var b=a(this).find(" tr.addElement td input[type='checkbox'].cbox:checked");if(b.length>0){if(h.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(j){c._deselectAddedElements()}})}else{c._deselectAddedElements()}return false}if(g=="user"){var f=parseInt(a("td.pagControls .ui-pg-input",a("#gbox_"+d[0].id)).val());if(f===0){d.setGridParam({page:1})}else{var e=parseInt(d.getGridParam("lastpage"));if(f>e){d.setGridParam({page:e})}}}return""},_onSortCol_multiselect:function(f,e,b){var c=this,h=c[0].prop,d=h.jQueryGrid,g=h.jQueryGrid.data("sorting");if(!g){c._checkSelectedElements(function(){h.jQueryGrid.rup_grid("resetSelection");a.data(d[0],"allSelected",null);a.data(d[0],"deSelectedPages",[]);d.data("sorting",true);d.jqGrid("sortGrid",f,e,b);window.setTimeout(function(){d.trigger("reloadGrid")},0)});d.data("sorting",false);a("#lui_"+d.attr("id")).hide();a("#load_"+d.attr("id")).hide();return"stop"}else{d.data("sorting",false)}},_selectAllGetPrimaryKeys_multiselect:function(){var b=this,e=b[0].prop,c=e.jQueryGrid,d;if(e.searchDivFunc===undefined){d=a.rup_utils.unnestjson(form2object(e.searchForm[0]))}else{d=e.searchDivFunc.call()}a.rup_ajax({url:c.rup_grid("getGridParam","url"),dataType:"json",type:"GET",data:d,contentType:"application/json",success:function(k,h){var g=b.rup_maint("getPrimaryKey").split(";"),o=[],f="";for(var l=0;l<k.length;l++){if(g.length>1){for(var m=0;m<g.length;m++){f=f+"/"+k[l][g[m]]}}else{f="/"+k[l][g[0]]}o.push(f);f=""}c[0].rup_gridProps.allPksArray=o;a("#"+c[0].rup_gridProps.pagerName+"_left").html(o.length+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"));a.data(c[0],"allSelected",true);var n=c.rup_grid("getGridParam","page");for(var m=0;m<e.selectedRows.length;m=m+1){if(!e.selectedRows[m]==="p_"+n){delete e.selectedRows[m]}}e.selectedRowsCont=o.length;o=null},error:function(h,f,g){},beforeSend:function(j){var f=b.rup_maint("getPrimaryKey").split(";"),h={};if(f.length>1){for(var g=0;g<f.length;g++){h[f[g]]=f[g]}}else{h[f[0]]=f[0]}j.setRequestHeader("RUP",a.toJSON(h));f=null;if(a.isFunction(c[0].rup_gridProps.onSelectAllGetPKs)){c[0].rup_gridProps.onSelectAllGetPKs.call(this,j)}else{if(a.isPlainObject(c[0].rup_gridProps.onSelectAllGetPKs)){c[0].rup_gridProps.onSelectAllGetPKs.pre.call(this,j)}}},complete:function(f,g){if(a.isFunction(c[0].rup_gridProps.onSelectAllGetPKs)){c[0].rup_gridProps.onSelectAllGetPKs.call(this,f)}else{if(a.isPlainObject(c[0].rup_gridProps.onSelectAllGetPKs)){c[0].rup_gridProps.onSelectAllGetPKs.post.call(this,f)}}}})},_resetSelection_multiselect:function(){var b=this,d=b[0].prop,c=d.jQueryGrid;d.selectedRows=[];c.jqGrid("resetSelection");d.selectedRowsCont=0;a("#"+c[0].rup_gridProps.pagerName+"_left").html(d.selectedRowsCont+" "+a.rup.i18nParse(a.rup.i18n.base,"rup_grid.pager.selected"));d.toolbar.self.disableButton("edit");d.toolbar.self.disableButton("delete")}})})(jQuery);(function(a){a.fn.rup_maint("extend",{cancelEditing:function(){return this.each(function(){var c=this.prop;if(c.MODO==="new"){c.jQueryGrid.rup_grid("delRowData",c.jQueryGrid.rup_grid("getGridParam","selrow"))}else{c.jQueryGrid.rup_grid("restoreRow",c.lastsel);a(this).rup_maint("ellipsisRestoreOnEdit")}c.lastsel=null;c.toolbar.self.disableButton("cancel");c.toolbar.self.enableButton("new");c.toolbar.self.enableButton("filter");c.toolbar.self.enableButton("delete");c.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"),c=b.length;this.prop.jQueryGrid.rup_grid("addRowData",c,{},"first");this.prop.jQueryGrid.rup_grid("setSelection",c,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("#"+c,jqGrid).children().first().click()})}});a.fn.rup_maint("extend",{_checkValidRowId_editline:function(e,c){var b=this,d=b[0].prop;return b._checkValidRowId(e,function(){d.feedback.rup_feedback("set",a.rup.i18nParse(a.rup.i18n.base,"rup_maint.invalidRowId"),"error");d.toolbar.self.disableButton("cancel");d.toolbar.self.enableButton("filter");d.toolbar.self.enableButton("new");d.toolbar.self.enableButton("delete")})},_onCellSelect_editline:function(f,d,g,h){var b=this,k=b[0].prop,c=k.jQueryGrid,j;k.selectedCell=d;j=c.rup_grid("getColModel");a("#"+f+"_"+j[k.selectedCell].name,c).focus();return true},_onAfterSelectRow_editline:function(d,b){var c=this,e=c[0].prop;if(d!==e.lastsel){c.rup_maint("editElement",d)}},_onAfterDragAndDrop_editline:function(h){var k=this,b=k[0].prop,c=b.jQueryGrid,f,j,e,g=this.rup_grid("getSelectedRows")[0],d=a.data(c,"maintName"),l;if(!c.rup_grid("isEditing")){return false}j=c.rup_grid("getColModel");l=j[j.length-1].name;a(".editable").unbind("keydown");a("input[name='"+l+"']",c).bind("keydown",function(n){var m=0,o=c.rup_grid("getGridParam","page");if(n.keyCode==9){if(!n.shiftKey){if(a(this).hasClass("hasDatepicker")){a(this).datepicker("hide")}c.rup_grid("saveRow",g,rup_maint.saveEditableSucces,"clientArray",null,rup_maint.aftersavefunc,rup_maint.saveEditableError,null);if(g==c.rup_grid("getDataIDs").length){m=c.rup_grid("getGridParam","lastpage");if(parseFloat(o)+1<=m){c[0].p.ajaxGridOptions={async:false};c.rup_grid("setGridParam",{page:parseFloat(o)+1});c.rup_grid("reloadGrid");c[0].p.ajaxGridOptions={async:true};g=0}else{return false}}c.rup_grid("setSelection",Number(g)+1,false);a("#"+d).rup_maint("editElement",Number(g)+1);a("body").data("clicktimer",window.setTimeout(function(){a("#"+Number(g+1)+" .editable:first",relatedGrid).focus()},0));return false}}});firstColName=j[0].name;a("input[name='"+firstColName+"']",relatedGrid).bind("keydown",function(n){var m=0,o=relatedGrid.rup_grid("getGridParam","page");if(n.keyCode==9){if(n.shiftKey){if(a(this).hasClass("hasDatepicker")){a(this).datepicker("hide")}relatedGrid.rup_grid("saveRow",g,rup_maint.saveEditableSucces,"clientArray",null,rup_maint.aftersavefunc,rup_maint.saveEditableError,null);if(g==1){if(parseFloat(o)>1){relatedGrid[0].p.ajaxGridOptions={async:false};relatedGrid.rup_grid("setGridParam",{page:parseFloat(o)-1});relatedGrid.rup_grid("reloadGrid");relatedGrid[0].p.ajaxGridOptions={async:true};g=relatedGrid.rup_grid("getDataIDs").length+1}else{return false}}relatedGrid.rup_grid("setSelection",Number(g-1),false);a("#"+d).rup_maint("editElement",Number(g-1));a("body").data("clicktimer",window.setTimeout(function(){a("#"+Number(g-1)+" .editable:last",relatedGrid).focus()},0));return false}}})}})})(jQuery);(function(a){a.fn.rup_maint("extend",{_editFirstElement:function(){var b=this,g=b[0].prop,c=g.jQueryGrid,d,e;d=b._getFirstElement();e=c.rup_grid("getGridParam","page");if(e!==d.page){c.rup_grid("setGridParam",{page:d.page});c.rup_grid("reloadGrid",f)}else{f()}function f(){if(d.rowId===undefined){d.rowId=c.rup_grid("getDataIDs")[0]}if(!c.rup_grid("isMultiselect")){c.find("#"+d.rowId).click()}g.currentSelectedRow=d.rowId;b.rup_maint("editElement",d.rowId)}},_editLastElement:function(){var c=this,h=c[0].prop,d=h.jQueryGrid,e,f,g;lastElement=c._getLastElement();f=d.rup_grid("getGridParam","page");if(f!==lastElement.page){d.rup_grid("setGridParam",{page:lastElement.page});d.rup_grid("reloadGrid",b)}else{b()}function b(){if(!d.rup_grid("isMultiselect")){g=d.rup_grid("getDataIDs");lastElement.rowId=g[g.length-1];d.find("#"+lastElement.rowId).click()}else{if(lastElement.rowId===undefined){dataIDs=d.rup_grid("getDataIDs");lastElement.rowId=dataIDs[dataIDs.length-1]}}h.currentSelectedRow=lastElement.rowId;c.rup_maint("editElement",lastElement.rowId)}},_editNextElement:function(){var c=this,h=c[0].prop,d=h.jQueryGrid,g=false,e=c._getNextElement(h.currentSelectedRow),f=d.rup_grid("getGridParam","page");if(f!==e.page){g=true;d.rup_grid("setGridParam",{page:e.page});d.rup_grid("reloadGrid",b,e)}else{b(e)}function b(j){if(!d.rup_grid("isMultiselect")){var k=d.rup_grid("getDataIDs");if(g){j.rowId=d.rup_grid("getDataIDs")[0]}else{j.rowId=d.rup_grid("getDataIDs")[j.line-1]}d.find("#"+j.rowId).click()}else{if(j.rowId===undefined){j.rowId=d.rup_grid("getDataIDs")[0]}}h.currentSelectedRow=j.rowId;c.rup_maint("editElement",j.rowId)}},_editPreviousElement:function(){var d=this,j=d[0].prop,f=j.jQueryGrid,h=false,e=d._getPreviousElement(j.currentSelectedRow),g=f.rup_grid("getGridParam","page"),c,h=false;if(g!==e.page){h=true;f.rup_grid("setGridParam",{page:e.page});f.rup_grid("reloadGrid",b)}else{b()}function b(){if(!f.rup_grid("isMultiselect")){if(h){var k=f.rup_grid("getDataIDs");e.rowId=k[k.length-1]}else{e.rowId=f.rup_grid("getDataIDs")[e.line-1]}f.find("#"+e.rowId).click()}else{if(e.rowId===undefined){c=f.rup_grid("getDataIDs");e.rowId=c[c.length-1]}}j.currentSelectedRow=e.rowId;d.rup_maint("editElement",e.rowId)}},_getCurrentDetailIndex:function(e){var n=this,c=n[0].prop,j,o=0,b,h,g,k,d,m,l;j=c.jQueryGrid.rup_grid("getGridParam","page");rowNum=parseInt(c.jQueryGrid.rup_grid("getInd",e,false));d=c.jQueryGrid.rup_grid("getGridParam","rowNum");l=a.data(c.jQueryGrid[0],"allSelected");if(c.jQueryGrid.rup_grid("isMultiselect")){m=c.selectedRowsCont;b=c.selectedRows.sort(function(q,p){return q-p});for(var f=0;f<b.length;f=f+1){if(b[f]<parseInt(j)){o+=c.selectedRows["p_"+b[f]].length}else{if(b[f]===parseInt(j)){h=c.selectedRows["p_"+b[f]].sort(function(q,p){return q-p});if(!isNaN(rowNum)){k=a.inArray(rowNum,h)}else{k=0}o+=k+1}}}if((l!==null)&&(l===true)){g=a.inArray(parseInt(j),b);o+=(parseInt(j)-(g+1))*parseInt(d)}}else{m=c.jQueryGrid.rup_grid("getGridParam","records");o=((parseInt(j)*parseInt(d))-parseInt(d)+rowNum)}return{current:o,total:m}},_getDetailUrl:function(g){var c=this,h=c[0].prop,f=h.jQueryGrid.rup_grid("getSelectedRows"),e=h.jQueryGrid[0].rup_gridProps.url,b=h.primaryKey.split(";");if(h.jQueryGrid.rup_grid("isMultiselect")===false){if(b.length>1){for(var d=0;d<b.length;d++){e=e+"/"+h.jQueryGrid.rup_grid("getCol",f[0],b[d])}}else{if(c._getPrimaryKeysForRow(g)==="/false"){e=e+"/"+g}else{e=e+"/"+h.jQueryGrid.rup_grid("getCol",f[0],b[0])}}}else{if(c._getPrimaryKeysForRow(g)!=="/false"){e=e+c._getPrimaryKeysForRow(g)}else{e=e+"/"+g}return e}return e},_getFirstElement:function(k){var n=this,c=n[0].prop,b,j,o,e,g,f=k,m=a.data(c.jQueryGrid[0],"allSelected"),h=a.data(jqGrid[0],"numPags"),l=false;if(c.jQueryGrid.rup_grid("isMultiselect")){if(k!==undefined){if(c.selectedRows["p_"+k]!==undefined&&c.selectedRows["p_"+k].length>0){return n._getFirstSelectedLine(k)}}if(m){for(var d=1;d<=h;d++){if(c.selectedRows["p_"+d]!==undefined&&c.selectedRows["p_"+d].length>0){return n._getFirstSelectedLine(d);break}else{if(c.selectedRows["p_"+d]===undefined){f=d;o=0;break}}}}else{b=c.selectedRows.sort(function(q,p){return q-p});a.each(b,function(q,r){if(c.selectedRows["p_"+r]!==undefined&&c.selectedRows["p_"+r].length>0){f=r;e=n._getFirstSelectedLine(r);return false}});return e}}else{f=1;o=0}return{page:f.toString(),line:o.toString(),rowId:g}},_getFirstSelectedLine:function(e){var c=this,g=c[0].prop,d,b,f;if(g.selectedRows["p_"+e]!==undefined&&g.selectedRows["p_"+e].length>0){d=g.selectedRows["p_"+e].sort(function(j,h){return j-h});b=d[0];f=g.selectedRows["p_"+e]["l_"+b][0];return{page:e.toString(),line:b.toString(),rowId:f}}else{return{page:e,line:"0",rowId:undefined}}},_getLastElement:function(l){var n=this,e=n[0].prop,b,c,k,o,h,g,m=a.data(e.jQueryGrid[0],"allSelected"),d=e.jQueryGrid,j=a.data(d[0],"numPags");if(e.jQueryGrid.rup_grid("isMultiselect")){if(l!==undefined){if(e.selectedRows["p_"+l]!==undefined&&e.selectedRows["p_"+l].length>0){return n._getLastSelectedLine(l)}}if(m){for(var f=j;f>0;f--){if(e.selectedRows["p_"+f]!==undefined&&e.selectedRows["p_"+f].length>0){return n._getLastSelectedLine(f);break}else{if(e.selectedRows["p_"+f]===undefined){g=f;o=-1;break}}}}else{b=e.selectedRows.sort(function(q,p){return p-q});a.each(b,function(q,r){if(e.selectedRows["p_"+r]!==undefined&&e.selectedRows["p_"+r].length>0){g=r;returnElem=n._getLastSelectedLine(r);return false}});return returnElem}}else{g=j;o=-1}return{page:g.toString(),line:o.toString(),rowId:h}},_getLastSelectedLine:function(e){var c=this,g=c[0].prop,d,b,f;if(g.selectedRows["p_"+e]!==undefined&&g.selectedRows["p_"+e].length>0){d=g.selectedRows["p_"+e].sort(function(j,h){return h-j});b=d[0];f=g.selectedRows["p_"+e]["l_"+b][0];return{page:e.toString(),line:b.toString(),rowId:f}}else{return{page:e,line:"0",rowId:undefined}}},_getNextElement:function(e){var q=this,c=q[0].prop,m,p,f,d,l,e,k,n=a.data(c.jQueryGrid[0],"allSelected"),b,j,o;m=q[0].prop.jQueryGrid.rup_grid("getGridParam","page");d=m;var h=a.data(jqGrid[0],"numPags");if(c.jQueryGrid.rup_grid("isMultiselect")){p=c.jQueryGrid.rup_grid("getInd",e,false);b=c.selectedRows.sort(function(s,r){return s-r});j=c.selectedRows["p_"+m].sort(function(s,r){return s-r});o=a.inArray(p,j);l=p;if(p===j[j.length-1]){posicionPage=a.inArray(parseInt(m),b);for(var g=parseInt(m)+1;g<=h;g++){if(n&&c.selectedRows["p_"+g]===undefined){d=g;l=0;break}else{if(c.selectedRows["p_"+g].length>0){d=g;l=c.selectedRows["p_"+d][0];break}}}}else{l=c.selectedRows["p_"+d][o+1];if(l===undefined){l=c.selectedRows["p_"+d][o]}}if(c.selectedRows["p_"+d]!==undefined&&c.selectedRows["p_"+d]["l_"+l]!==undefined&&c.selectedRows["p_"+d]["l_"+l].length>0){k=c.selectedRows["p_"+d]["l_"+l][0]}}else{f=c.jQueryGrid.rup_grid("getSelectedRows");p=parseInt(c.jQueryGrid.rup_grid("getInd",f[0],false));l=p;rowsPerPage=parseInt(c.jQueryGrid.rup_grid("getGridParam","rowNum"));var h=Math.ceil(c.jQueryGrid.jqGrid("getGridParam","records")/c.jQueryGrid.rup_grid("getGridParam","rowNum"));if(p===rowsPerPage){if(parseInt(m)<h){d=parseInt(d)+1;l=0}}else{l+=1}}return{page:d.toString(),line:l.toString(),rowId:k}},_getPreviousElement:function(e){var o=this,c=o[0].prop,n,e,k,m=a.data(c.jQueryGrid[0],"allSelected");var g=a.data(jqGrid[0],"numPags");var l=o[0].prop.jQueryGrid.rup_grid("getGridParam","page");var d=l;if(c.jQueryGrid.rup_grid("isMultiselect")){n=c.jQueryGrid.rup_grid("getInd",e,false);var l=o[0].prop.jQueryGrid.rup_grid("getGridParam","page");var b=c.selectedRows.sort(function(q,p){return q-p});var h=c.selectedRows["p_"+l].sort(function(q,p){return q-p});posicionLine=a.inArray(n,h);var d=l;var j=n;if(n===h[0]){posicionPage=a.inArray(parseInt(l),b);for(var f=parseInt(l)-1;f>0;f--){if(m&&c.selectedRows["p_"+f]===undefined){d=f;j=-1;break}else{if(c.selectedRows["p_"+f].length>0){d=f;j=c.selectedRows["p_"+d][c.selectedRows["p_"+d].length-1];break}}}}else{j=c.selectedRows["p_"+d][posicionLine-1]}if(c.selectedRows["p_"+d]!==undefined&&c.selectedRows["p_"+d]["l_"+j]!==undefined&&c.selectedRows["p_"+d]["l_"+j].length>0){k=c.selectedRows["p_"+d]["l_"+j][0]}}else{selectedRows=c.jQueryGrid.rup_grid("getSelectedRows");n=parseInt(c.jQueryGrid.rup_grid("getInd",selectedRows[0],false));j=n;rowsPerPage=parseInt(c.jQueryGrid.rup_grid("getGridParam","rowNum"));if(n===1){if(parseInt(l)>1){d=parseInt(d)-1;j=rowsPerPage}}else{j-=1}}return{page:d.toString(),line:j.toString(),rowId:k}},_getPrimaryKeysForRow:function(f){var c=this,g=c[0].prop,b=c.rup_maint("getPrimaryKey").split(";"),e="";if(b.length>1){for(var d=0;d<b.length;d++){e=e+"/"+g.jQueryGrid.rup_grid("getCol",f,b[d])}}else{e=e+"/"+g.jQueryGrid.rup_grid("getCol",f,b[0])}return 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){var b={};a.extend(a.rup.iniRup,a.rup.rupSelectorObjectConstructor("rup_menu",b));a.fn.rup_menu("extend",{disable:function(d){var c=a("#"+d);c.addClass("ui-state-disabled")},enable:function(d){var c=a("#"+d);c.removeClass("ui-state-disabled")}});a.fn.rup_menu("extend",{_init:function(g){if(g.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 e=a.extend({},a.fn.rup_menu.defaults,g[0]),l=this,c=widgetMenu(this),f=l[0].id,k,j;c.removeClass("rup_invisible_menu");if(e.i18nId===undefined){e.i18nId=f}j=a.rup.i18n.app[e.i18nId];if(e.menu!==undefined){k=e.menu}else{if(e.json!==undefined){k=e.json}}widgetMenu.widget("ui.rupMenu",widgetMenu.ui.menu,a.rup.compatibility.menu);if(k!==undefined){l._parseJSON(k,j,c,e.forceAbs);c=widgetMenu("#"+l.attr("id"))}selectUserEvent=e.select;e.select=function(m,o){if(selectUserEvent!==undefined&&selectUserEvent!==null){if(typeof selectUserEvent==="function"){if(selectUserEvent(m,o)===false){return false}}}if(/^keydown/.test(m.originalEvent.type)){m.stopImmediatePropagation();redirectObject=a(o.item.children());if(redirectObject.attr("target")!=="_blank"){a(location).attr("href",redirectObject.attr("href"))}else{if(a.rup.browser.isFF){var n=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);var p=n.getMostRecentWindow("navigator:browser");p.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};c.find("a[target='_blank']").append("<span class='ui-icon ui-icon-extlink rup_external_link'></span>");if(e.display==="horizontal"){c.addClass("rup_menu_horizontal").addClass("ui-widget-header");c.children().addClass("rup_menu_horizontal_children");c.children().children("a").addClass("rup_menu_horizontal_children_entry");c.rupMenu(e);c.children(".ui-menu-divider").remove();c.children(".ui-state-disabled").css({"margin-top":"0em","margin-bottom":"0em"});a("#"+f+" .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");c.children().children("a").css("font-weight","bold");c.children().each(function(m,n){var o=0;a(n).children(".rup_menu_horizontal_children_entry:has(span:not(.rup-menu_horizontalIcon))").each(function(p,q){if(a(q).find("span").size()===1){o=a(q).find("span").width()}else{o=a(q).find("span:not(.rup-menu_horizontalIcon)").width()/2}});a(n).css("width",a(n).width()+o)});c.children().children("a").css("font-weight","");c.children(":has(.rup_menu_horizontal_children_entry span:not(.rup-menu_horizontalIcon))").addClass("rup_menu_horizontal_childrenIcon");c.find(".rup_menu_horizontal_children_entry span:not(.rup-menu_horizontalIcon)").addClass("rup_menu_horizontal_children_icon");c.children(":has(.rup_menu_horizontal_children_entry span.rup-menu_horizontalIcon)").addClass("rup_menu_horizontal_childrenMenuIcon");c.children(":has(.rup_menu_horizontal_children_entry span.rup_menu_horizontal_children_icon):has(span.rup-menu_horizontalIcon)").addClass("rup_menu_horizontal_children_double");c.children(":last-child").addClass("rup_menu_horizontal_children_last");c.children().children("a[aria-haspopup='true']").parent().attr("rupMenu_firsLevel","true");a("#"+f+" [rupmenu_firslevel='true'] [role='menu']").addClass("rup_menu_vertical_horizontal");if(e.verticalWidth===undefined){a("#"+f+" [rupmenu_firslevel='true'] [role='menu']").css("white-space","nowrap")}else{a("#"+f+" [rupmenu_firslevel='true'] [role='menu']").css("width",e.verticalWidth)}c.find("a[target='_blank'] span.rup_menu_horizontal_children_icon").each(function(m,n){if(a(n).is(".ui-icon-extlink")){a(n).addClass("ui-menu-icon").removeClass("rup_menu_horizontal_children_icon")}});var d=c.find("a[target='_blank'] span.rup_menu_horizontal_children_icon").parents("li");d.css("width",d.width()+16);d.find("span.ui-icon-extlink").css("margin-left","-1em")}else{if(e.display==="vertical"){c.addClass("rup_menu_vertical");if(e.verticalWidth===undefined){c.css("white-space","nowrap")}else{c.css("width",e.verticalWidth)}c.children().addClass("rup_menu_vertical_children");c.rupMenu(e);if(e.verticalWidth!==undefined){a("#"+f+" .ui-menu .ui-menu-item").css("width",e.verticalWidth)}}else{a.rup.errorGestor(a.rup.i18n.base.rup_menu.displayMenuError)}}var h=false;a("ul.rup_menu_vertical, ul.rup_menu_vertical ul, ul.rup_menu_vertical_horizontal").each(function(n,m){a(m).children("li").children("a").children("span").each(function(o,p){if(!a(p).is(".ui-icon.ui-icon-extlink, .ui-icon.ui-icon-carat-1-e")){h=true;return false}});if(h){a(m).children("li").children("a").css("padding-left","2em")}h=false});a("#"+f+" [role = 'menuitem']").not(a("[aria-haspopup = 'true']")).css("text-decoration","underline");c.find("a").bind("click",function(m){if(a(m.currentTarget).hasClass("ui-state-disabled")){m.preventDefault();m.stopImmediatePropagation()}})}}},_parseJSON:function(k,j,l,d){var c,g,e="",h;if(l.attr("uda-submenu")==="true"){l.attr("uda-submenu","")}else{l.replaceWith(a("<ul>").attr("id",l.attr("id")).attr("style",l.attr("style")).attr("class",l.attr("class")));l=a("#"+l.attr("id"))}for(var f=k.length;f--;){g=k[f];h=a("<a>");if(g!==undefined){if(g.divider!==null&&g.divider!==true){if((g.pathUrl!==undefined)||(g.url!==undefined)){if(g.pathUrl!==undefined){if((d===true)||(g.forceAbs===true)){e=a.rup_utils.relToAbsUrl(g.pathUrl)}else{e=g.pathUrl}}else{e=a.rup.CTX_PATH+g.url}if(g.newWindow!==true){if(g.icon!==undefined){l.prepend(a("<li>").append(h.text(a.rup.i18nParse(j,g.i18nCaption)).attr("href",e).css("text-decoration","underline").append(a("<span>").addClass("ui-icon").addClass(g.icon))))}else{l.prepend(a("<li>").append(h.text(a.rup.i18nParse(j,g.i18nCaption)).attr("href",e).css("text-decoration","underline")))}}else{if(g.icon!==undefined){l.prepend(a("<li>").append(h.text(a.rup.i18nParse(j,g.i18nCaption)).attr("href",e).attr("target","_blank").css("text-decoration","underline").append(a("<span>").addClass("ui-icon").addClass(g.icon))))}else{l.prepend(a("<li>").append(h.text(a.rup.i18nParse(j,g.i18nCaption)).attr("href",e).attr("target","_blank").css("text-decoration","underline")))}}}else{if(g.icon!==undefined){l.prepend(a("<li>").append(h.text(a.rup.i18nParse(j,g.i18nCaption)).css("cursor","default").append(a("<span>").addClass("ui-icon").addClass(g.icon))).append(a("<ul>").attr("uda-submenu","true")))}else{l.prepend(a("<li>").append(h.text(a.rup.i18nParse(j,g.i18nCaption)).css("cursor","default")).append(a("<ul>").attr("uda-submenu","true")))}c=a("[uda-submenu = 'true']");c.append(this._parseJSON(g.submenu,j,c));delete c}if(g.disabled===true){h.parent().addClass("ui-state-disabled")}}else{if(g.i18nCaption===undefined){l.prepend(a("<li>").addClass("ui-widget-content ui-menu-divider"))}else{l.prepend(a("<li>").append(a("<strong>").text(a.rup.i18nParse(j,g.i18nCaption))))}}}delete g}}});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(c){b.rup_messages("msgAlert",{title:b.rup.i18nParse(b.rup.i18n.base,"rup_message.alert"),message:c})};b.rup_messages("extend",{msgError:function(f){var g=b.extend({},b.rup_messages.defaults,f),d,e,h=b(document.activeElement);this._rupProperties(g,b.rup.i18nParse(b.rup.i18n.base,"rup_message.tituloError"));g._close=g.close;g.close=function(j,k){h.focus();if(g._close!==undefined){g._close(j,k)}};g.buttons=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){c.dialog("close")}}];var c=this._createDiv().appendTo("body");c.dialog(g);this._createCloseLink(c);this._addStyles(c,"error",g.message);d=b(document).height();e=b(document).width();c.dialog("open");this._dialogInPortal(e,d,c,g)},msgConfirm:function(f){var g=b.extend({},b.rup_messages.defaults,f),d,e,j=b(document.activeElement);this._rupProperties(g,b.rup.i18nParse(b.rup.i18n.base,"rup_message.confirmacion"));g._close=g.close;g.close=function(k,l){j.focus();if(g._close!==undefined){g._close(k,l)}};var c=this._createDiv().appendTo("body"),h;c.dialog(g);h=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){g.OKFunction.call(this,c);c.dialog("close")}}];c.dialog("option","buttons",h);this._createCloseLink(c);this._addStyles(c,"confirm",g.message);this._createLinkButton(c,g.CANCELFunction);d=b(document).height();e=b(document).width();c.dialog("open");this._dialogInPortal(e,d,c,g);b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-buttonpane button:first").focus()},msgOK:function(f){var g=b.extend({},b.rup_messages.defaults,f),d,e,h=b(document.activeElement);this._rupProperties(g,b.rup.i18nParse(b.rup.i18n.base,"rup_message.correct"));g._close=g.close;g.close=function(j,k){h.focus();if(g._close!==undefined){g._close(j,k)}};g.buttons=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){c.dialog("close")}}];var c=this._createDiv().appendTo("body");c.dialog(g);this._createCloseLink(c);this._addStyles(c,"ok",g.message);d=b(document).height();e=b(document).width();c.dialog("open");this._dialogInPortal(e,d,c,g)},msgAlert:function(f){var g=b.extend({},b.rup_messages.defaults,f),d,e,h=b(document.activeElement);this._rupProperties(g,b.rup.i18nParse(b.rup.i18n.base,"rup_message.alert"));g._close=g.close;g.close=function(j,k){h.focus();if(g._close!==undefined){g._close(j,k)}};g.buttons=[{text:b.rup.i18nParse(b.rup.i18n.base,"rup_message.aceptar"),click:function(){c.dialog("close")}}];var c=this._createDiv().appendTo("body");c.dialog(g);this._createCloseLink(c);this._addStyles(c,"alert",g.message);d=b(document).height();e=b(document).width();c.dialog("open");this._dialogInPortal(e,d,c,g)}});b.rup_messages("extend",{_createDiv:function(){return b("<div/>").attr("id","rup_msgDIV_"+new Date().getTime()).attr("rup_message","true")},_createCloseLink:function(c){var d="<span id='closeText_"+c[0].id+"' style='float:right;font-size:0.85em;'>"+b.rup.i18nParse(b.rup.i18n.base,"rup_global.cerrar")+"</span>",e=b("<a href='#'></a>").attr("role","button").css("margin-right","0.9em").css("float","right").addClass("ui-dialog-title").html(d).click(function(f){c.dialog("close");return false}).hover(function(f){b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-titlebar-close").addClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-titlebar-close").css("padding","0px")},function(f){b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-titlebar-close").removeClass("ui-state-hover");b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-titlebar-close").attr("style","")}).insertAfter("#ui-dialog-title-"+c[0].id);b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-titlebar-close").hover(function(){e.css("text-decoration","none")},function(){e.css("text-decoration","")})},_addStyles:function(d,e,f){var g=b("<div>").attr("id","rup_msgDIV_msg_icon").addClass("rup-message_icon-"+e),c=b("<div>").attr("id","rup_msgDIV_msg").addClass("rup-message_msg-"+e).html(f);d.append(g);d.append(c)},_createLinkButton:function(c,f){var d=f,e=b("<a href='#'></a>").attr("role","button").attr("id",c[0].id+"_cancel").addClass("rup-enlaceCancelar").html(b.rup.i18nParse(b.rup.i18n.base,"rup_global.cancel")).click(function(g){c.dialog("close");if(d!==undefined){d.call(this,c)}return false});b("div[aria-labelledby=ui-dialog-title-"+c[0].id+"] .ui-dialog-buttonset ").prepend(e)},_dialogInPortal:function(d,c,g,e){var f;if(b.rup_utils.aplicatioInPortal()){if(g.data("dialog").overlay!==null){f=g.data("dialog").overlay.$el;f.css("height",c).css("width",d);b(".r01gContainer").append(g.data("dialog").uiDialog).append(f)}if(e.position===undefined||e.position===null){g.data("dialog").uiDialog.css("position","absolute").css("top",(c/2)-(b(".ui-dialog:visible").height()/2))}}},_rupProperties:function(c,d){c.autoOpen=false;c.modal=true,c.resizable=false,c.title=(c.title===null||c.title===""?d:c.title);c.closeText=b.rup.i18nParse(b.rup.i18n.base,"rup_message.tituloError.cerrar"),c.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(k){if(k.length>1){a.rup.errorGestor(a.rup.i18n.base.rup_global.initError+a(this).attr("id"))}else{var q=this,e=a.extend(true,{},a.rup_report.defaults,k[0]),l=e.buttons,o=e.dialog,f=e.customDialog,p=a.find("[id='"+e.appendTo+"']");if(a.isEmptyObject(p)){alert("No existe objeto al que añadir el componente");return false}p=a(p[0]);p.data("report",e);var m=a("<div />").attr("id","reportFileWait").attr("title",o.wait.title).text(o.wait.msg).addClass("rup_report").hide().append(a("<div />").addClass("ui-progressbar ui-progressbar-value ui-corner-left ui-corner-right")),r=a("<div />").attr("id","reportFileError").attr("title",o.error.title).text(o.error.msg).addClass("rup_report").hide(),j=a("<div />").attr("id","rup_report_dialogsContainer").append(m).append(r);p.after(j);o.waitDiv="reportFileWait";o.errorDiv="reportFileError";var d=false,c;if(p.hasClass("rup-toolbar_menuButtonContainer")){c=a("[id='"+p.attr("id").substring("8")+"']");p=c.parents(".rup-toolbar");d=true;if(a.grep(l,function(t,s){return t.buttons!==undefined}).length>0){alert("No se pueden añadir MButtons a un contenedor MButton");return false}}var n=[];a.each(l,function(t,s){if(s.buttons!==undefined){s.click=p.showMButton;c=p.addMButton(s,s.json_i18n);p.addButtonsToMButton(s.buttons,c,s.json_i18n);a.each(s.buttons,function(v,u){q._checkButton(u,n);q._configureButton(u,o,f,e)})}else{if(!d){p.addButton(s,s.json_i18n);s.id=p.attr("id")+"##"+((s.id)?s.id:s.i18nCaption)}else{p.addButtonsToMButton(new Array(s),c,s.json_i18n);$mbuttonDiv=a("[id='mbutton_"+c.attr("id")+"']");$mbuttonDiv.find("li:first").appendTo($mbuttonDiv.children("ul"))}q._checkButton(s,n);q._configureButton(s,o,f,e)}});if(n.length>0){var h="";for(var g=0;g<n.length;g++){h+=n[g]+"<br/>"}alert(h)}}},_checkButton:function(d,f){var e=d.id.substring(d.id.lastIndexOf("##")+2);if(d.url===undefined){f.push(e+": no tiene URL asociada")}if(d.columns!==undefined){var c=a.find("#"+d.columns.grid);if(a.isEmptyObject(c)){f.push(e+": no existe el Grid asociado")}}},_configureButton:function(g,d,c,h){var e=this,f={};a.extend(f,d);g.isInline=(g.isInline===undefined)?false:g.isInline;if(!g.isInline){a("[id='"+g.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(g.columns!==undefined){var q=a(a.find("#"+g.columns.grid)[0]);if(jQuery.isFunction(h.fncGetGridParam)){l=jQuery.proxy(h.fncGetGridParam,q)()}else{l=q.jqGrid("getGridParam","postData")}l.columns=a.toJSON(e._getColumns(q,g.columns))}var p=true;if(g.customDialog!==undefined){var j=c[g.customDialog];if(j.waitDiv===undefined){f.wait=j.wait}else{f.waitDiv=j.waitDiv;a("#"+f.waitDiv).addClass("rup_report")}if(j.errorDiv===undefined){f.error=j.error}else{f.errorDiv=j.errorDiv;a("#"+f.errorDiv).addClass("rup_report")}f.successCallback=j.successCallback;f.failCallback=j.failCallback}var n=a("#"+f.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",f.wait.title);var o=n.html().split(n.text()),m="";for(var k=0;k<o.length;k++){if(o[k]===""){m+=f.wait.msg}else{m+=o[k]}}n.html(m)}n.rup_dialog("open");a.fileDownload(a.rup_utils.setNoPortalParam(g.url),{httpMethod:"POST",data:jQuery.rup_utils.unnestjson(l),successCallback:function(s){if(f.successCallback!==undefined){f.successCallback()}n.rup_dialog("close")},failCallback:function(s,t){n.rup_dialog("close");var u=a("#"+f.errorDiv);u.rup_dialog({type:a.rup.dialog.TEXT,autoOpen:false,modal:true,resizable:false});if(p){u.rup_dialog("setOption","title",f.error.title);u.rup_dialog("setOption","message",f.error.msg)}u.rup_dialog("open");if(f.failCallback!==undefined){f.failCallback()}}});return false})}else{a("[id='"+g.id+"']").on("click",function(){window.open(g.url+"?isInline=true","_blank")})}},_getColumns:function(k,e){var j=k.jqGrid("getGridParam","colModel"),l=k.jqGrid("getGridParam","colNames"),m=l.length,g=[],d=e.customNames,h=e.hidden===true?true:false;if(d===undefined){for(var f=0;f<m;f++){if(l[f].indexOf("type='checkbox'")!==-1){continue}if(h||!h&&j[f].hidden===false){var c=[];c.push(j[f].name);c.push(l[f]);g.push(c)}}}else{for(var f=0;f<m;f++){if(a.inArray(j[f].name,d)!==-1){var c=[];c.push(j[f].name);c.push(l[f]);g.push(c)}}}return g}});a.rup_report.defaults={fncGetGridParam:null,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 c={};c.plugins=[];jQuery.rup_table=jQuery.rup_table||{};jQuery.extend(jQuery.rup_table,{registerPlugin:function(d,e){if(jQuery.inArray(d,c.plugins)===-1){c.plugins.push(d);c.plugins[d]=e}}});jQuery.extend(jQuery.rup.iniRup,jQuery.rup.rupSelectorObjectConstructor("rup_table",c));jQuery.extend(jQuery.jgrid,{createModal:function(k,h,d,l,n,m,g){var e=jQuery("<div/>").attr("id",k.themodal).append(b(h));var j=e.find("#"+k.scrollelm);e.insertBefore(b(l));e.rup_dialog({type:b.rup.dialog.DIV,autoOpen:false,modal:true,resizable:d.resize,title:d.caption,width:d.width,buttons:d.buttons});if(jQuery.isFunction(d.onClose)){jQuery(".ui-dialog-titlebar-close, a:has(#closeText_"+e.first()[0].id+")",e.parent()).off("click").on("click",function(o){d.onClose.call(o)})}jQuery("#"+k.scrollelm+"_2").addClass("botoneraModal");jQuery(".fm-button","#"+k.scrollelm+"_2").on({focusin:function(){jQuery(this).addClass("ui-state-focus")},focusout:function(){jQuery(this).removeClass("ui-state-focus")}});if(d.linkStyleButtons!==undefined){for(var f=0;f<d.linkStyleButtons.length;f++){jQuery(d.linkStyleButtons[0]).addClass("botonEnlace")}}},hideModal:function(d,e){jQuery(d).rup_dialog("close")},viewModal:function(d,e){jQuery(d).rup_dialog("open")}});jQuery.extend(jQuery.rup_table,{proxyAjax:function(d,e){jQuery.rup_ajax(d)}});jQuery.fn.rup_table("extend",{preConfigureCore:function(h){var j=this,e,g;h.baseUrl=h.url;if(jQuery.inArray("filter",h.usePlugins)===-1){h.url+="/filter"}h.id=j.attr("id");j.attr("ruptype","table");h.core.tableDiv=h.id+"_div";h.core.$tableDiv=jQuery("#"+h.core.tableDiv);jQuery(document).bind("click",function(l){var m=jQuery(l.target);if(m.parents().index(h.core.$tableDiv)===-1){j.triggerHandler("rupTable_checkOutOfGrid",[l,m])}});if(h.pager!==false){h.pager=b.rup_utils.getJQueryId(h.pager!==null?h.pager:h.id+"_pager");h.$pager=jQuery(h.pager);if(h.$pager.length===0){alert("El identificador "+h.pager+" especificado para el paginador no existe.")}}e=h.colModel;if(h.loadOnStartUp===false||h.multifilter!=undefined){j.data("tmp.loadOnStartUp.datatype",h.datatype);h.datatype="clientSide"}for(var f=0;f<e.length;f++){g=e[f];if(g.rupType!==undefined&&g.rupType!==null){g.edittype="custom";if(!jQuery.isFunction(g.editoptions.custom_element)){g.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(g.editoptions.custom_value)){g.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(h.showGridInfoCol){h.colNames=b.merge([""],h.colNames);h.colModel=b.merge([h.defaultGridInfoCol],h.colModel)}if(h.primaryKey!==undefined&&typeof h.primaryKey==="string"){h.primaryKey=[h.primaryKey]}if(h.primaryKey!==undefined&&typeof h.primaryKey==="object"){if(h.primaryKey.length===1){h.primaryKeyCol=h.primaryKey[0];for(var f=0;f<e.length;f++){if(e[f].name===h.primaryKeyCol){e[f].key=true;break}}}else{if(h.primaryKey.length>1){h.colNames=b.merge([""],h.colNames);var d=b.extend({},h.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}});h.primaryKeyCol="pkCol";h.colModel=b.merge([d],h.colModel)}}b.extend(h,{prmNames:{id:h.primaryKeyCol}})}for(var f=0;f<e.length;f++){g=e[f];if(g.editable===true){if(g.editableOnAdd===undefined){g.editableOnAdd=true}if(g.editableOnEdit===undefined){if(jQuery.inArray(e[f].name,h.primaryKey)!==-1){g.editableOnEdit=false}else{g.editableOnEdit=true}}}}h.serializeGridData=function(l){var m,n=parseInt(l.page),o=parseInt(j.rup_grid("getGridParam","lastpage"));if(o!==0&&n>o){l.page=o}jQuery.extend(true,l,{core:{pkToken:h.multiplePkToken,pkNames:h.primaryKey}});m=b.extend({},{filter:{}},l);j.triggerHandler("rupTable_serializeGridData",[m]);return jQuery.toJSON(m)};h.beforeProcessing=function(m,l,n){if(j.triggerHandler("rupTable_beforeProcessing",[m,l,n]===false)){return false}if(h.primaryKey.length>1){b.each(m.rows,function(o,q){var r="";for(var p=0;p<h.primaryKey.length;p++){r+=q[h.primaryKey[p]]+h.multiplePkToken}r=r.substr(0,r.length-1);q.pkCol=r})}return true};var k=h.loadError;h.loadError=function(p,m,n){var o=b(this),l;l=o.triggerHandler("rupTable_loadError",p,m,n);if(l!==false){jQuery.proxy(k,o)(p,m,n)}};h.getActiveLineId=function(){var n=this,m=n.jqGrid("getDataIDs"),l=n.jqGrid("getGridParam","selrow");return b.inArray(l,m)};h.getActiveRowId=function(){var l=this;return l.rup_table("getGridParam","selrow")};h.getSelectedRows=function(){var m=this,l=m.rup_table("getGridParam","selrow");return l===null?[]:[l]};h.getSelectedLines=function(){var m=this,l=m.rup_table("getGridParam","selrow");return l===null?[]:[b.inArray(l,m.jqGrid("getDataIDs"))]};jQuery.each(h.core.operations,function(m,l){h.core.showOperations[m]=true});jQuery.extend(true,h.core.defaultOperations,h.core.operations);j.on({jqGridBeforeRequest:function(){jQuery.set_uda_ajax_mode_on()},"jqGridLoadComplete.rup_table.tooltip":function(l,m){var n=b(this);if(m!==undefined){jQuery(".pagControls input.ui-pg-input",h.$pager).attr({size:m.total.length,maxlength:m.total.length})}},jqGridResizeStart:function(m,l){b("#"+j[0].id+"_search_rowInputs select").each(function(){b(this).selectmenu("close")})},jqGridResizeStop:function(m,l){b("#"+j[0].id+"_search_rowInputs select").each(function(){b("[id='"+this.id+"-menu']").width(b("[id='"+this.id+"-button']").width())})},"jqGridGridComplete.rup_table.core":function(n){var o=b(this),l;if(o.rup_grid("getGridParam","records")===0){o.prev().remove();b(o.jqGrid("getGridParam","pager")).hide();var m='<tr class="ui-widget-content jqgrow ui-row-ltr" role="row" id="'+o[0].id+'_noRecords" aria-selected="false">';m+='<td aria-describedby="'+o[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_"+o.attr("id")).width()+'px;background:white;" role="gridcell">';m+=b.rup.i18nParse(b.rup.i18n.base,"rup_grid.noRecordsFound");m+="</td></tr>";o.before(m);b('[aria-describedby="'+o[0].id+'_NO_REGISTROS"]').rup_tooltip({position:{my:"center",at:"center"}})}else{jQuery("#"+o[0].id+"_noRecords").remove();jQuery(o.jqGrid("getGridParam","pager")).show()}},"jqGridGridComplete.rup_table.tooltip":function(m){var n=b(this),l;b("#"+b(this).attr("id")+" [title]").each(function(p,q){var o=b(q);o.attr("grid_tooltip",o.attr("title")).removeAttr("title")});l=jQuery("tbody:first",n);l.on("mousestop",{delay:500},function(q,o){var r=b.rup_utils.elementFromPoint(o.clientX,o.clientY,true),s=b(r),p;if(!s.attr("rup_tooltip")&&s.attr("grid_tooltip")){s.attr("title",s.attr("grid_tooltip"));p=s.parent().attr("id")+"_"+s.attr("aria-describedby");s.rup_tooltip({show:{delay:0},id:p,position:{viewport:b(window),adjust:{method:"flip"}}});s.triggerHandler("mouseenter.qtip-"+p+"-create");s.rup_tooltip("option","show.delay",500)}})}})},postConfigureCore:function(d){var e=this;if(d.resizable!==false){e.rup_table("gridResize",(jQuery.isPlainObject(d.resizable)?d.resizable:{}))}if(d.pager!==false){e.rup_table("configurePager",d)}b.each(b("#gview_table th:visible"),function(g,h){var f=b(h),j=f.find("div").text();if(j!==""){f.attr("title",j).rup_tooltip({show:{delay:500},position:{viewport:b(window),adjust:{method:"flip"}}})}});jQuery(e.rup_table("getGridParam","colModel")).each(function(f,g){var h;if(g.classes==="ui-ellipsis"){jQuery("[id='jqgh_"+d.id+"_"+g.name+"']").css("display","block").css("text-overflow","ellipsis")}h=jQuery("[id='jqgh_"+d.id+"_"+g.name+"']").children("div");h.replaceWith(jQuery("<span>").text(h.text()).css("cursor","pointer"))});if(d.showGridInfoCol){jQuery("#gview_"+d.id+" table thead th#"+d.id+"_rupInfoCol").css("border-right","0px none")}if(d.loadOnStartUp===false||d.multifilter!=undefined){d.datatype=e.data("tmp.loadOnStartUp.datatype");e.rup_table("setGridParam",{datatype:e.data("tmp.loadOnStartUp.datatype")});e.removeData("tmp.loadOnStartUp.datatype")}}});jQuery.fn.rup_table("extend",{getColModel:function(){return b(this).jqGrid("getGridParam","colModel")},getGridParam:function(d){return b(this).jqGrid("getGridParam",d)},gridResize:function(d){return b(this).jqGrid("gridResize",d)},getSelectedRows:function(){var e=this,d=e.data("settings");return jQuery.proxy(d.getSelectedRows,e)()},getSelectedLines:function(){var e=this,d=e.data("settings");return jQuery.proxy(d.getSelectedLines,e)()},getPkUrl:function(f){var g=this,e=g.data("settings"),d;if(jQuery.isArray(f)){d=f[0]!==undefined?f[0]:""}else{d=f}return d.split(e.multiplePkToken).join("/")},reloadGrid:function(h){var k=this,g=k.data("settings"),j=k.rup_table("getGridParam","page");var d=k.jqGrid("getGridParam","ajaxGridOptions");var e=d.async;d.async=false;k.jqGrid("setGridParam",{ajaxGridOptions:d});k.jqGrid("setGridParam",{page:1});k.trigger("reloadGrid");d.async=true;k.jqGrid("setGridParam",{ajaxGridOptions:d});var f=jQuery.proxy(jQuery.jgrid.getCurrPos,k[0])();k.jqGrid("setSelection",f[1][0])},resetForm:function(e){var g=this,f=g.data("settings");if(e.data("validator")!=undefined){var d=e.data("validator").settings.errorClass;b("."+d,e).removeClass(d)}jQuery("input[type!='button'][type!='checkbox'][type!='radio'], textarea",e).val("");jQuery("input[type='checkbox']",e).not("[name*='jqg_GRID_']",e).not("[disabled='disabled']",e).removeAttr("checked");jQuery.each(b("select.rup_combo",e),function(h,j){if(f.filter&&f.filter.clearSearchFormMode==="reset"){jQuery(j).rup_combo("reset")}else{jQuery(j).rup_combo("clear")}});b("[ruptype='autocomplete']",e).each(function(h,j){b(j).val("")});b("[ruptype='tree']",e).each(function(h,j){b(j).rup_tree("setRupValue","")});if(f.filter&&f.filter.clearSearchFormMode==="reset"){e.resetForm()}else{b("input[type='radio']",e).removeAttr("checked")}return g},setGridParam:function(d){b(this).jqGrid("setGridParam",d);return b(this)},setSelection:function(h,d,j){var k=this,g=k.data("settings"),f;f=k.triggerHandler("rupTable_setSelection",arguments);if(f!==false){k.jqGrid("setSelection",h,d,j)}},showServerValidationFieldErrors:function(d,f){var e=b(this);if(f.rupErrorFields!==undefined||f.rupFeedback!==undefined){d.validate().submitted=b.extend(true,d.validate().submitted,f.rupErrorFields);d.validate().invalid=f.rupErrorFields;d.validate().showErrors(f.rupErrorFields)}else{if(f.rupFeedback!==undefined){e.rup_table("showFeedback",d.validate().settings.feedback,b.rup_utils.printMsg(f.rupFeedback.message),(f.rupFeedback.imgClass!==undefined?f.rupFeedback.imgClass:null))}}},clearHighlightedRowAsSelected:function(d){var j=this,e=j[0],f=e.p,h=d[0],g=f.frozenColumns===true?f.id+"_frozen":"";if(!d.hasClass("ui-subgrid")&&!d.hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(f.id)+"_"+b.jgrid.jqID(h.id))[f.useProp?"prop":"attr"]("checked",false);d.removeClass("ui-state-highlight").attr("aria-selected","false");if(g){b("#jqg_"+b.jgrid.jqID(f.id)+"_"+b.jgrid.jqID(h.id),e.grid.fbDiv)[f.useProp?"prop":"attr"]("checked",false);b("#"+b.jgrid.jqID(h.id),e.grid.fbDiv).removeClass("ui-state-highlight")}}j.trigger("rupTableClearHighlightedRowAsSelected",[d])},highlightRowAsSelected:function(d){var j=this,e=j[0],f=e.p,h=d[0],g=f.frozenColumns===true?f.id+"_frozen":"";if(d.length>0&&!d.hasClass("ui-subgrid")&&!d.hasClass("jqgroup")&&!d.hasClass("ui-state-disabled")){b("#jqg_"+b.jgrid.jqID(f.id)+"_"+b.jgrid.jqID(h.id))[f.useProp?"prop":"attr"]("checked",true);d.addClass("ui-state-highlight").attr("aria-selected","true");f.selarrrow.push(h.id);f.selrow=h.id;if(g){b("#jqg_"+b.jgrid.jqID(f.id)+"_"+b.jgrid.jqID(h.id),e.grid.fbDiv)[f.useProp?"prop":"attr"]("checked",true);b("#"+b.jgrid.jqID(h.id),e.grid.fbDiv).addClass("ui-state-highlight")}j.trigger("rupTableHighlightRowAsSelected",[d])}},updateDetailPagination:function(f,d){var k=this,g=k.data("settings"),h=g.id,j,e;j=(f!==undefined?f:b.proxy(g.getDetailCurrentRowCount,k)());e=(d!==undefined?d:b.proxy(g.getDetailTotalRowCount,k)());if(j===1){b("#first_"+h+", #back_"+h,g.$detailFormDiv).addClass("ui-state-disabled")}else{b("#first_"+h+", #back_"+h,g.$detailFormDiv).removeClass("ui-state-disabled")}if(j===e){b("#forward_"+h+", #last_"+h,g.$detailFormDiv).addClass("ui-state-disabled")}else{b("#forward_"+h+", #last_"+h,g.$detailFormDiv).removeClass("ui-state-disabled")}b("#rup_maint_selectedElements_"+k.attr("id")).text(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.defaults.detailForm_pager"),j,e))},updateSavedData:function(d){var f=this,e=f.data("settings");if(jQuery.isFunction(d)){jQuery.proxy(d,f)(rp_ge[e.id]._savedData)}}});jQuery.fn.rup_table("extend",{configurePager:function(f){var j=this,e,g,h,d;if(f.pager!==undefined&&f.pager!==null){f.$pager=b((f.pager.indexOf("#")===0?f.pager:"#"+f.pager));e=f.$pager.attr("id");f.$pager.css("height","auto");$pagerLeft=b("#"+e+"_left");g=b("#"+e+"_center");$pagerRight=b("#"+e+"_right");$pagerLeft.addClass("pager_left");g.addClass("pager_center");$pagerRight.addClass("pager_right");$pagerLeft.html("");if(f.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",f.$pager).addClass("pagControls");jQuery(".pagControls input.ui-pg-input",g).on("change",function(){var l=parseInt(b(this).val()),k=parseInt(j.rup_grid("getGridParam","lastpage"));if(isNaN(l)===false&&l>k){b(this).val(k)}});jQuery(".pagControls select.ui-pg-selbox",g).attr("title",jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.select")).rup_tooltip();jQuery(".pagControls input.ui-pg-input",g).attr("title",jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.input")).rup_tooltip();jQuery("#first_"+e,g).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_"+e,g).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_"+e,g).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_"+e,g).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(e){if(e.length>1){jQuery.rup.errorGestor(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_global.initError")+b(this).attr("id"))}else{var j=this,f={};var h=(jQuery.isArray(e[0].defaultPlugins)?e[0].defaultPlugins:jQuery.fn.rup_table.defaults.defaultPlugins),g=jQuery.merge([],e[0].usePlugins),d=jQuery.merge(jQuery.merge([],h),g);jQuery.rup_utils.sortArray(d,function(l,k){return c.plugins[k].loadOrder-c.plugins[l].loadOrder});f=b.extend(true,{},f,jQuery.fn.rup_table.plugins.core.defaults);b.each(d,function(l,k){if(c.plugins[k]!==undefined&&jQuery.fn.rup_table.plugins[k]!==undefined){f=b.extend(true,{},f,jQuery.fn.rup_table.plugins[k].defaults)}});f=jQuery.extend(true,{},jQuery.fn.rup_table.defaults,f,e[0]);j.rup_table("preConfigureCore",f);b.each(d,function(l,k){if(jQuery.isFunction(c.plugins[k].preConfiguration)){jQuery.proxy(c.plugins[k].preConfiguration,j)(f)}});j.jqGrid(f);j.rup_table("postConfigureCore",f);b.each(d,function(l,k){if(jQuery.isFunction(c.plugins[k].postConfiguration)){jQuery.proxy(c.plugins[k].postConfiguration,j)(f)}});j.data("settings",f);j.triggerHandler("rupTable_coreConfigFinished")}},_getLineIndex:function(j){var k=this,f=k.data("settings"),h=f.id+"ghead_",g=0,d,l;if(k.rup_table("getGridParam","grouping")===true){for(var e=0;e<k[0].rows.length;e++){d=jQuery(k[0].rows[e]);l=d.attr("id");if(l!==undefined&&l.indexOf(h)===-1){g++;if(l===j){return g}}}}else{return k.jqGrid("getInd",j)}}});jQuery.fn.rup_table("extend",{addRowData:function(f,g,e,d){var h=b(this);return h.jqGrid("addRowData",f,g,e,d)},delRowData:function(d){var e=b(this);e.jqGrid("delRowData",d);return e},getActiveRowId:function(){var e=this,d=e.data("settings");return jQuery.proxy(d.getActiveRowId,e)()},getActiveLineId:function(){var e=this,d=e.data("settings");return jQuery.proxy(d.getActiveLineId,e)()},setRowData:function(d,e,g){var f=b(this);f.jqGrid("setRowData",d,e,g);jQuery("td[title]",f).each(function(h,j){var k=jQuery(j),l=k.prop("title");k.attr({grid_tooltip:l,oldtitle:l}).removeAttr("title")})},getRowData:function(d){var e=b(this);return e.jqGrid("getRowData",d)},getDataIDs:function(){var d=b(this);return d.jqGrid("getDataIDs")},clearGridData:function(d){var e=b(this);return e.jqGrid("clearGridData",d)},getColModel:function(){var d=b(this);return d.jqGrid("getGridParam","colModel")},getCol:function(e,d){var f=b(this);return f.jqGrid("getCell",e,d)},getSerializedForm:function(f,e,d){return form2object(f instanceof jQuery?f[0]:f,d?d:null,e?e:false)}});jQuery.fn.rup_table.plugins={};jQuery.fn.rup_table.plugins.core={};jQuery.fn.rup_table.plugins.core.defaults={core:{operations:{},defaultOperations:{},showOperations:{},defaultLoadErrorTitle:b.rup.i18n.base.rup_ajax.errorTitle}};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",loadError:function(h,d,f){var g=b(this),e=g.data("settings");jQuery.rup_messages("msgError",{title:e.core.defaultLoadErrorTitle,message:h.responseText})},loadOnStartUp:true,loadBeforeSend:function a(e,d){e.setRequestHeader("JQGridModel","true");e.setRequestHeader("Content-Type","application/json")},loadui:"block",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",hidden:true,editable:false,fixed:true,sortable:false,width:25,resizable:false,search:false},multiplePkToken:"~",scrollOffset:0,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 c=this;return c.rup_table("preConfigureContextMenu",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureContextMenu",b)}});jQuery.fn.rup_table("extend",{preConfigureContextMenu:function(c){var d=this,b=c.contextMenu;if(b.createDefaultRowOperations===true){b.showOperations=jQuery.extend(true,{},b.defaultRowOperations,c.core.showOperations,b.showOperations)}},postConfigureContextMenu:function(c){var e=this,b=c.contextMenu;function d(f,g){for(var h=0;h<f.length;h++){if(jQuery(f[h]).attr("id")===c.id+"_"+g){return h+1}}return -1}e.on({"jqGridLoadComplete.rupTable.contextMenu":function(j){var m=jQuery(c.contextMenu.tbodySelector,e),g={},o=false,k=jQuery.isArray(c.contextMenu.colNames),n={},l,f;jQuery.each(c.contextMenu.showOperations,function(q,r){var p;if(r!==false){p=c.core.operations[q];if(p!==undefined){g[q]={name:p.name,id:c.id+"_contextMenu_"+q,cssSprite:p.icon,disabled:function(){return !jQuery.proxy(p.enabled,e)()},callback:function(t,s){jQuery.proxy(p.callback,e)(t,s)},className:p.className};if(jQuery.isArray(r)===true){o=true;g[q].colNames=r}}}});jQuery.each(c.contextMenu.items,function(p,q){if(jQuery.isArray(q.colNames)){o=true}});jQuery.extend(true,g,c.contextMenu.items);f=jQuery(c.contextMenu.theadThSelector,"#gview_"+c.id);if(k&&!o){for(var h=0;h<b.colNames.length;h++){jQuery(b.tbodyTdSelector+":nth-child("+d(f,b.colNames[h])+")",e).rup_contextMenu({items:g})}}else{if(o){if(!jQuery.isArray(b.colNames)){b.colNames=jQuery.map(c.colModel,function(q,p){if(q.hidden!==true){return q.name}})}jQuery.each(g,function(q,t){var p;if(jQuery.isArray(t.colNames)){p=t.colNames}else{p=b.colNames}for(var r=0;r<p.length;r++){l={};l[p[r]]={};jQuery.extend(true,n,l);var s={};s[q]=t;jQuery.extend(true,n[p[r]],s)}});jQuery.each(n,function(p,q){jQuery(b.tbodyTdSelector+":nth-child("+d(f,p)+")",e).rup_contextMenu({items:q})})}else{m.rup_contextMenu({items:g})}}}})}});jQuery.fn.rup_table.plugins.contextMenu={};jQuery.fn.rup_table.plugins.contextMenu.defaults={contextMenu:{colNames:null,createDefaultRowOperations:true,defaultRowOperations:{},rowOperations:{},tbodySelector:"tbody:first tr[role='row'].jqgrow",tbodyTdSelector:"tbody:first tr.jqgrow td",theadThSelector:"thead:first th",items:{}}}})(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 c=this;return c.rup_table("preConfigureFilter",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureFilter",b)}});jQuery.fn.rup_table("extend",{preConfigureFilter:function(t){var s=this,j=t.id,c=t.filter,o,d,e,f,u,l,m,r,k;c.id=(c.id!==undefined?c.id:j+"_filter_form");c.filterToolbarId=(c.filterToolbar!==undefined?c.filterToolbar:j+"_filter_toolbar");c.filterButtonId=(c.filterButtonId!==undefined?c.filterButtonId:j+"_filter_filterButton");c.cleanLinkId=(c.cleanLinkId!==undefined?c.cleanLinkId:j+"_filter_cleanLink");c.collapsableLayerId=(c.collapsableLayerId!==undefined?c.collapsableLayerId:j+"_filter_fieldset");c.toggleIcon1Id=(c.toggleIcon1!==undefined?c.toggleIcon1:j+"_filter_toggle_icon1");c.toggleLabelId=(c.toggleLabelId!==undefined?c.toggleLabelId:j+"_filter_toggle_label");c.filterSummaryId=(c.filterSummaryId!==undefined?c.filterSummaryId:j+"_filter_summary");c.toggleIcon2Id=(c.toggleIcon2!==undefined?c.toggleIcon2:j+"_filter_toggle_icon2");c.$filterContainer=jQuery("#"+c.id);c.$filterToolbar=jQuery("#"+c.filterToolbarId);if(c.$filterContainer.length===0){alert("El identificador especificado para el fomulario de búsqueda no existe.")}else{if(c.$filterToolbar.length===0){alert("El identificador especificado para la barra de controles del formulario de filtrado no existe.")}else{d=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.toggleIcon1");e=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.toggleLabel");f=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.filterSummary");u=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.filter.toggleIcon2");l=a(jQuery.jgrid.format(d,c.toggleIcon1Id));m=a(jQuery.jgrid.format(e,c.toggleLabelId,a.rup.i18n.base.rup_table.plugins.filter.filterCriteria));r=a(jQuery.jgrid.format(f,c.filterSummaryId));k=a(jQuery.jgrid.format(u,c.toggleIcon2Id));c.$filterToolbar.append(l).append(m).append(r).append(k);c.$filterContainer=jQuery("#"+c.id);c.$filterButton=jQuery("#"+c.filterButtonId);c.$cleanLink=jQuery("#"+c.cleanLinkId);c.$collapsableLayer=jQuery("#"+c.collapsableLayerId);c.$toggleIcon1=l;c.$toggleLabel=m;c.$filterSummary=r;c.$toggleIcon2=k;if(c.$filterContainer.prop("tagName")==="FORM"){c.$filterContainer.ajaxForm()}c.$filterContainer.parent().css("width",s.rup_table("getGridParam","width"));if(t.filter.url===null){t.filter.url=t.baseUrl+"/filter"}t.url=t.filter.url;t.searchURL=s.rup_table("getGridParam","url");c.$filterContainer.bind("keydown",function(v){if(v.keyCode==13){s.rup_table("filter")}});c.$filterButton.bind("click",function(){if(t.$firstStartUp){t.$firstStartUp=false}s.rup_table("filter")});c.$cleanLink.bind("click",function(){if(t.$firstStartUp){t.$firstStartUp=false}s.rup_table("cleanFilterForm").rup_table("filter");if(c.validate!==undefined){jQuery(".rup-maint_validateIcon",c.$filterContainer).remove()}});c.$toggleIcon1.add(c.$toggleLabel).add(c.$toggleIcon2).attr("tabindex","0").on({keydown:function(v){if(v.keyCode==13){s.rup_table("toggleFilterForm")}}});c.$filterToolbar.addClass("cursor_pointer").on({click:function(){s.rup_table("toggleFilterForm")}});if(t.filter.showHidden===true){c.$collapsableLayer.hide();c.$toggleIcon1.removeClass("ui-icon-triangle-1-n").addClass("ui-icon-triangle-1-s");c.$filterSummary.parent().addClass("rup-maint_searchCriteria")}if(c.validate!==undefined){c.$filterContainer.rup_validate(c.validate)}}}s.on({"rupTable_serializeGridData.filter":function(y,w){var x=form2object(t.filter.$filterContainer[0]),z=jQuery.param(x),v=s.data("tmp.lastFilterParams");jQuery.extend(w,{filter:x});if(v===undefined||v!==z){jQuery.extend(w,{page:"1"});s.data("tmp.lastFilterParams",z)}}});s.on("jqGridGridComplete",function(v){if(s.data("settings")!==undefined){s.rup_table("showSearchCriteria")}});if(t.multifilter!=undefined&&t.multifilter!=null){var q,g,h;var b=t.multifilter;t.filter.$filterForm=a("#"+t.id+"_filter_form");var p;t.$firstStartUp=true;if(b.idFilter!=null){p=b.idFilter}else{p=t.id}var n;if(b.userFilter!=null){n=b.userFilter}else{n=LOGGED_USER}a.rup_ajax({url:t.baseUrl+"/multiFilter/getDefault?filterSelector="+p+"&user="+n,type:"GET",dataType:"json",showLoading:false,contentType:"application/json",complete:function(v,w){if(t.loadOnStartUp){s.rup_table("filter")}s.triggerHandler("rupTable_multifilter_fillForm",form2object(t.filter.$filterContainer[0]))},success:function(x,v,y){if(x!=null){var w=a.parseJSON(x.filterValue);s._fillForm(w);b.$filterDefaultName=x.filterName}},error:function(x,v,w){}})}},postConfigureFilter:function(d){var e=this,b,c}});jQuery.fn.rup_table("extend",{cleanFilterForm:function(){var c=this,b=c.data("settings");c.rup_table("resetForm",b.filter.$filterContainer);c.triggerHandler("rupTable_filter_beforeClean");return c},filter:function(d){var e=this,c=e.data("settings");var b=e.triggerHandler("rupTable_beforeFilter");if(b===false||b==="stop"){return}if(a.isFunction(c.filter.beforeFilter)){b=c.filter.beforeFilter.call(e);if(b===undefined){b=true}if(b===false){return}}e.rup_table("setGridParam",{page:"1"});e.trigger("reloadGrid")},getFilterParams:function(){var c=this,b=c.data("settings");return form2object(b.filter.$filterContainer[0])},hideFilterForm:function(){var d=a(this),c=d.data("settings"),b=c.filter;b.$collapsableLayer.hide(c.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 d=a(this),c=d.data("settings"),b=c.filter;b.$collapsableLayer.show(a.extend({},c.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 e=a(this),d=e.data("settings"),c=d.filter;if(c.$collapsableLayer.is(":hidden")){e.rup_table("showFilterForm")}else{e.rup_table("hideFilterForm")}return e},showSearchCriteria:function(){var t=this,u=t.data("settings"),g=" ",v="",y,e,b,q,c,h,y=u.filter.$filterContainer.serializeArray();e=u.filter.$filterContainer,filterMulticombo=new Array();var l;var n=a(".jstree",u.filter.$filterContainer);var k=a(".jstree",u.filter.$filterContainer);a.each(k,function(j,z){l=new Object();l.name=a(z).attr("name");l.value=a(z).rup_tree("getRupValue").length;l.type="rup_tree";y.push(l)});for(var s=0;s<y.length;s++){if(y[s].value!==""&&a.inArray(y[s].name,u.filter.excludeSummary)!=0){b=a("[name='"+y[s].name+"']",e);if(a.inArray(b.attr("id"),u.filter.filterExclude)!==-1){continue}if(b.length>1){b=a("[name='"+y[s].name+"']:checked",e)}if(a(b).attr("type")==="hidden"){continue}q=a(b).attr("id");if(a(b).attr("ruptype")==="combo"){if(b.next(".ui-multiselect").length==0){q+="-button"}}if(a(b).attr("ruptype")==="autocomplete"){q=q.substring(0,q.indexOf("_label"))}label=a("label[for^='"+q+"']",e);if(label.length>0){c=label.html()}else{if(a(b).attr("ruptype")!=="combo"){c=a("[name='"+y[s].name+"']",e).prev("div").find("label").first().html()}else{var f=a("[name='"+y[s].name+"']",e),x;x=jQuery("[for='"+f.attr("id")+"']");if(x.length>0){c=x.first().text()}else{c=a("[name='"+y[s].name+"']",e).parent().prev("div").find("label").first().html()}}}if(c===null||c===undefined){c=""}h=" = ";switch(a(b)[0].tagName){case"INPUT":h=h+a(b).val();if(a(b)[0].type==="checkbox"||a(b)[0].type==="radio"){h=""}break;case"DIV":a.each(y,function(j,z){if(z.name==b.attr("id")){if(z.value!=0){h+=" = "+z.value}}else{h=""}});if(h==""){c=""}break;case"SELECT":if(b.next(".ui-multiselect").length==0){h=h+a("option[value='"+y[s].value+"']",b).html()}else{if(a.inArray(a(b).attr("id"),filterMulticombo)===-1){numSelected=b.rup_combo("value").length;if(numSelected!==0){h+=numSelected}else{c="";h=""}filterMulticombo.push(a(b).attr("id"))}else{c="";h=""}}break}var o=new Array(":","=");for(var r=0;r<o.length;r++){if(c!==""&&c.indexOf(o[r])!==-1){c=c.substring(0,c.indexOf(o[r]));break}}while(h.indexOf("&amp;nbsp;")!==-1){h=h.replace("&amp;nbsp;","")}if(c===""&&h.indexOf(" = ")!==-1){h=h.substring(2,h.length)}if(c===""&&a.trim(h)===""){continue}g=g+c+h+", "}}if(jQuery.isFunction(u.filter.fncSearchCriteria)){g=jQuery.proxy(u.filter.fncSearchCriteria,t,g)()}if(a.trim(g).length-1==a.trim(g).lastIndexOf(",")){g=g.substr(0,g.lastIndexOf(","))+" "}if(u.multifilter){if(jQuery.isFunction(u.multifilter.fncFilterName)){g=jQuery.proxy(u.multifilter.fncFilterName,t,g)()}}var p=a("#titleSearch_"+u.id.name).css("height"),m,w=g,d=false;while(true){u.filter.$filterSummary.html(" <i>"+w+"</i>");m=a("#titleSearch_"+u.id.name).css("height");if(m===p){break}w=w.substring(0,w.lastIndexOf(","))+" <b>...</b>";d=true}if(d){u.filter.$filterSummary.rup_tooltip({content:{text:g.substring(1)},position:{my:"bottom center",at:"top center"}})}}});jQuery.fn.rup_table("extend",{_getSearchFormFieldLabel:function(g,f){var e=g.attr("id"),c,b="",d=g.attr("ruptype");if(d!=="combo"){c=jQuery("label[for='"+e+"']",f)}else{c=jQuery("label[for='"+e+"-button']",f)}if(c.length>0){b=c.html()}else{if(g.attr("ruptype")!=="combo"){b=a("[name='"+name+"']",f).prev("div").find("label").first().html()}else{b=a("[name='"+name+"']",f).parent().prev("div").find("label").first().html()}}b=b.replace(/[:=]/g,"");return b},_getSearchFormFieldValue:function(c,b){var e=" = ",d=[],f;switch(c.prop("tagName")){case"INPUT":e=e+c.val();if(c.attr("type")==="checkbox"||c.attr("type")==="radio"){e=""}break;case"SELECT":if(c.next(".ui-multiselect").length==0){e=e+a("option[value='"+c.rup_combo("getRupValue")+"']",c).html()}else{if(a.inArray(c.attr("id"),d)===-1){f=c.rup_combo("value").length;if(f!==0){e+=f}else{fieldName="";e=""}d.push(c.attr("id"))}else{fieldName="";e=""}}break}while(e.indexOf("&amp;nbsp;")!==-1){e=e.replace("&amp;nbsp;","")}return e}});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 c=this;return c.rup_table("preConfigureSearch",b)},postConfiguration:function(b){var c=this;return c.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 c=this;c.rup_table("createSearchRow",b);c._initializeSearchProps(b);c.on({"jqGridLoadComplete.rupTable.search":function(e){var d=parseInt(c.rup_table("getGridParam","page"),10);if(c._hasPageMatchedElements(d)){c.rup_table("highlightMatchedRowsInPage",d)}c.rup_table("updateSearchPagination")},"jqGridSelectRow.rupTable.search rupTable_setSelection.search":function(e,g,d,f){c.rup_table("updateSearchPagination",g)},"jqGridGridComplete.rup_table.search":function(e){var f=a(this),d=f.data("settings");if(f.rup_grid("getGridParam","records")===0){d.search.$searchRow.hide()}else{d.search.$searchRow.show()}},rupTable_searchAfterCreateToolbar:function(d,f){var h=c[0].p,k=h.colModel,m,e,l,g,j;a("th[role='columnheader']",f).each(function(n){m=k[n];g=(m.searchoptions!==undefined&&m.searchoptions.rupType!==undefined)?m.searchoptions.rupType:m.rupType;colModelName=m.name;e=a("[name='"+colModelName+"']",f);e.attr({title:h.colNames[n],"class":"editable customelement"}).removeAttr("readOnly");if(g!==undefined){j=m.searchoptions||m.editoptions;switch(g){case"combo":j=a.extend({},{menuWidth:e.width()},j,{width:"97%"});break}e["rup_"+g](j);switch(g){case"date":e.css("width","86%");break}}})}})}});jQuery.fn.rup_table("extend",{toggleSearchForm:function(){var e=this,c=e.data("settings"),f=e[0].p,b,d;if(!c.search.created){e.rup_table("createSearchToolbar");c.search.$collapseIcon.removeClass("ui-icon-triangle-1-e");c.search.$collapseIcon.addClass("ui-icon-triangle-1-s");jQuery("#searchNavLayer_"+c.id).show();c.search.created=true;jQuery("input","table thead tr.ui-search-toolbar").keypress(function(h){var g=h.charCode||h.keyCode||0;if(g==13){e.rup_table("search");return false}return this})}else{b=jQuery("tr.ui-search-toolbar",e[0].grid.hDiv);d=f.frozenColumns===true?jQuery("tr.ui-search-toolbar",e[0].grid.fhDiv):false;if(jQuery("tr.ui-search-toolbar","#gview_"+c.id).is(":visible")){b.hide(c.search.transitionConfig);if(d){d.hide(c.search.transitionConfig)}jQuery("#searchNavLayer_"+c.id).hide(c.search.transitionConfig);c.search.$collapseIcon.removeClass("ui-icon-triangle-1-s");c.search.$collapseIcon.addClass("ui-icon-triangle-1-e")}else{b.show(c.search.transitionConfig);if(d){d.show(c.search.transitionConfig)}jQuery("#searchNavLayer_"+c.id).show(c.search.transitionConfig);c.search.$collapseIcon.removeClass("ui-icon-triangle-1-e");c.search.$collapseIcon.addClass("ui-icon-triangle-1-s")}}},createSearchToolbar:function(){var c=this,b=c.data("settings"),e=c[0].p,d=jQuery("<tr>").attr({"class":"ui-search-toolbar",role:"rowheader"});if(jQuery("table thead tr:first th[id='"+b.id+"_cb']",c[0].grid.hDiv).length!==0){d.append(jQuery("<th>").attr({role:"columnheader","class":"search_row_header ui-th-column ui-th-"+e.direction}))}d.append(jQuery("<th>").attr({role:"columnheader","class":"search_row_header ui-th-column ui-th-"+e.direction}));a.each(e.colModel,function(h,g){var j=jQuery("<th>").attr({role:"columnheader","class":"search_row_header ui-th-column ui-th-"+e.direction}),k,f;if(g.hidden===true){j.css("display","none")}g.search=g.search===false?false:true;if(g.stype===undefined){g.stype=g.edittype!==undefined?g.edittype:"text";if(g.searchoptions!==undefined&&g.searchoptions.rupType==="combo"){g.stype="text"}}soptions=a.extend({},g.searchoptions||g.editoptions||{},{id:g.name,name:g.name});if(g.search){k=a.jgrid.createEl.call(c[0],g.stype!==undefined?g.stype:g.edittype,soptions,"",true,a.extend({},a.jgrid.ajaxOptions,soptions.ajaxSelectOptions||{}));f=jQuery(k);f.css("width","97%");j.append(f)}if(g.name!==b.defaultGridInfoCol.name&&g.name!==b.defaultGridMultiplePkCol.name&&g.name!=="cb"){d.append(j)}});a("table thead",c[0].grid.hDiv).append(d);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);c.on({"rupTable_beforeSearch.search.validate":function(){return b.search.$searchForm.valid()}})}c.triggerHandler("rupTable_searchAfterCreateToolbar",[d]);c[0].ftoolbar=true},createSearchRow:function(u){var s=this,v=jQuery("table thead","#gview_"+u.id),g,j=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.searchRowHeader"),e=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.collapseLayer"),c=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.collapseIcon"),p=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.collapseLabel"),q=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.matchedLayer"),h=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.matchedLabel"),m=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.navLayer"),k=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"),r=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.navClearLink"),o=a(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.search.searchRow")),n=a(jQuery.jgrid.format(j,v.find("th").length)),t=a(jQuery.jgrid.format(e,"searchCollapseLayer_"+u.id)),d=a(jQuery.jgrid.format(c,"searchCollapseIcon_"+u.id)),f=a(jQuery.jgrid.format(p,"searchCollapsLabel_"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.searchCriteria")));$matchedLayer=a(jQuery.jgrid.format(q,"matchedLayer_"+u.id)),$matchedLabel=a(jQuery.jgrid.format(h,"matchedLabel_"+u.id,jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecords"),0))),$navLayer=a(jQuery.jgrid.format(m,"searchNavLayer_"+u.id)),$firstNavLink=a(jQuery.jgrid.format(k,"search_nav_first_"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.first"))),$backNavLink=a(jQuery.jgrid.format(k,"search_nav_back_"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.previous"))),$forwardNavLink=a(jQuery.jgrid.format(k,"search_nav_forward_"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.next"))),$lastNavLink=a(jQuery.jgrid.format(k,"search_nav_last_"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.last"))),$navSearchButton=a(jQuery.jgrid.format(b,"search_nav_button_"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.search.Find")));$navClearLink=a(jQuery.jgrid.format(r,"search_nav_clear_link"+u.id,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.search.Reset")));t.append(d).append(f);$matchedLayer.append($matchedLabel);$navLayer.append($firstNavLink).append($backNavLink).append($forwardNavLink).append($lastNavLink).append($navSearchButton).append($navClearLink);n.append(t);n.append($matchedLayer);n.append($navLayer);o.append(n);v.append(o);u.search=u.search||{};u.search.created=false;u.search.$collapseIcon=d;u.search.$searchRow=o;u.search.$matchedLabel=$matchedLabel;u.search.$firstNavLink=$firstNavLink;u.search.$backNavLink=$backNavLink;u.search.$forwardNavLink=$forwardNavLink;u.search.$lastNavLink=$lastNavLink;d.add(f).on("click",function(){s.rup_table("toggleSearchForm")});$navSearchButton.on("click",function(){s.rup_table("search")});$navClearLink.on("click",function(){s.rup_table("clearSearch")});$navLayer.hide();function l(w,x){if(!w.hasClass("ui-state-disabled")){s.rup_table("navigateToMatchedRow",x)}}$firstNavLink.on("click",function(){l(jQuery(this),"first")});$backNavLink.on("click",function(){l(jQuery(this),"prev")});$forwardNavLink.on("click",function(){l(jQuery(this),"next")});$lastNavLink.on("click",function(){l(jQuery(this),"last")});$searchForm=jQuery("<form>").attr("id",u.id+"_search_searchForm");u.search.$searchRow.parent().parent().wrap($searchForm);u.search.$searchForm=jQuery("#"+u.id+"_search_searchForm");u.search.$searchRow.hide()},navigateToMatchedRow:function(b){var d=this,c=d.rup_table("fncGetSearchNavigationParams",b);d.rup_table("doSearchNavigation",c)},search:function(){var d=this,c=d.data("settings");var b=d.triggerHandler("rupTable_beforeSearch");if(b===false||b==="stop"){return}if(a.isFunction(c.search.beforeSearch)){b=c.search.beforeSearch.call(d);if(b===undefined){b=true}if(b===false){return}}d.rup_table("doSearch")},doSearch:function(){var g=this,e=g.data("settings"),c,d={},f=parseInt(g.rup_table("getGridParam","page"),10),b=g.rup_table("getGridParam","postData");d.filter=g.rup_table("getFilterParams");d.search=form2object(e.search.$searchRowInputs[0]);g._initializeSearchProps(e);c=g.triggerHandler("rupTable_searchBeforeSubmit.rupTable.masterDetail",[b,d]);if(c===false){return false}jQuery.rup_ajax({url:e.search.url,type:"POST",dataType:"json",data:jQuery.toJSON(a.extend(true,{},b,d)),contentType:"application/json",success:function(j,h,k){rowsPerPage=parseInt(g.rup_table("getGridParam","rowNum"),10);if(j.length===0){g._initializeSearchProps(e);g.rup_table("updateSearchPagination");g.rup_table("clearHighlightedMatchedRows")}else{jQuery.each(j,function(l,n){var o="";for(var m=0;m<e.primaryKey.length;m++){o+=n.pk[e.primaryKey[m]]+e.multiplePkToken}n.id=o.substr(0,o.length-1);n.page=Math.ceil(n.tableLine/rowsPerPage);n.pageLine=n.tableLine-((n.page-1)*rowsPerPage);g._processMatchedRow(e,n)});g.trigger("rupTableSearchSuccess");g.rup_table("goToFirstMatched",f)}}})},goToFirstMatched:function(b){var e=this,c=e.data("settings"),d=(typeof b==="string"?parseInt(b,10):b);if(e._hasPageMatchedElements(d)){e.rup_table("setSelection",c.search.matchedRowsPerPage[d][0],true);e.rup_table("highlightMatchedRowsInPage",d)}else{e.rup_table("navigateToMatchedRow","first")}},fncGetSearchNavigationParams:function(c){var o=this,j=o.data("settings"),n=false,p=false,k=0,g=0,b=jQuery.proxy(jQuery.jgrid.getCurrPos,o[0])(),l=parseInt(o.rup_table("getGridParam","page"),10),f=l,h,e,m,d;o.trigger("rupTableAfterSearchNav",[c]);b[0]=parseInt(b[0],10);h=o.rup_table("getActiveLineId");a("#"+j.formEdit.feedbackId,j.$detailForm).hide();switch(c){case"first":n=true;if(j.search.matchedPages[0]!==l){p=true;f=j.search.matchedPages[0]}k=j.search.matchedLinesPerPage[f][0];g=k;break;case"prev":n=true;m=j.search.matchedLinesPerPage[l]||[];e=a.inArray(h+1,m);if(e===-1){e=a.rup_utils.insertSorted(a.merge([],m),h+1)}if(e===0){p=true;d=a.inArray(l,j.search.matchedPages);if(d===-1){d=a.rup_utils.insertSorted(a.merge([],j.search.matchedPages),l)}f=j.search.matchedPages[d-1];m=j.search.matchedLinesPerPage[f];k=m[m.length-1]}else{k=m[e-1]}g=k;break;case"next":n=true;m=j.search.matchedLinesPerPage[l]||[];e=a.inArray(h+1,m);if(e===-1){e=a.rup_utils.insertSorted(a.merge([],m),h+1);e--}if(e===m.length-1){p=true;d=a.inArray(l,j.search.matchedPages);if(d===-1){d=a.rup_utils.insertSorted(a.merge([],j.search.matchedPages),l)-1}f=j.search.matchedPages[d+1];m=j.search.matchedLinesPerPage[f];k=m[0]}else{k=m[e+1]}g=k;break;case"last":n=true;if(j.search.matchedPages[j.search.matchedPages.length-1]!==l){p=true;f=j.search.matchedPages[j.search.matchedPages.length-1]}k=j.search.matchedLinesPerPage[f][j.search.matchedLinesPerPage[f].length-1];g=k;break}return[c,n,p,k-1,b,f,g-1]},doSearchNavigation:function(o,l,n,h,b,e,d){var m=this,g=m.data("settings"),l,n,h,e,d,k,j,c,f;if(a.isArray(o)){linkType=o[0];l=o[1];n=o[2];h=o[3];b=o[4];e=o[5];d=o[6];if(l){m.rup_table("hideFormErrors",g.$detailForm);pagePos=jQuery.proxy(jQuery.jgrid.getCurrPos,m[0])();c=m.rup_table("getActiveRowId");$row=jQuery(m.jqGrid("getInd",c,true));if($row.data("tmp.search.notToDeselect")!=="true"){m.rup_table("setSelection",c,false);if($row.data("tmp.search.notToDeselect")!==undefined){delete $row.data("tmp.search.notToDeselect")}}if(n){m.trigger("reloadGrid",[{page:e}]);m.on("jqGridAfterLoadComplete.rupTable.serach.pagination",function(p,q){k=jQuery.inArray(d+1,g.search.matchedLinesPerPage[e]);f=g.search.matchedRowsPerPage[parseInt(q.page,10)][k];$row=jQuery(m.jqGrid("getInd",f,true));if($row.attr("aria-selected")==="true"){$row.data("tmp.search.notToDeselect","true")}m.rup_table("setSelection",f,true);m.off("jqGridAfterLoadComplete.rupTable.serach.pagination")})}else{k=jQuery.inArray(h+1,g.search.matchedLinesPerPage[e]);f=g.search.matchedRowsPerPage[e][k];$row=jQuery(m.jqGrid("getInd",f,true));if($row.attr("aria-selected")==="true"){$row.data("tmp.search.notToDeselect","true")}m.rup_table("setSelection",f,true)}}}},clearSearch:function(){var c=this,b=c.data("settings");c._initializeSearchProps(b);c.rup_table("updateSearchPagination");c.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 c=this,b=c.data("settings");c.find("td[aria-describedby='"+b.id+"_rupInfoCol'] span.ui-icon.ui-icon-search").removeClass("ui-icon-search")},highlightMatchedRowsInPage:function(f){var g=this,e=g.data("settings"),d=g[0].p,b;g.rup_table("clearHighlightedMatchedRows");for(var c=0;c<e.search.matchedRowsPerPage[f].length;c++){newIndexPos=e.search.matchedRowsPerPage[f][c];b=a(g.jqGrid("getInd",newIndexPos,true));g.rup_table("highlightMatchedRow",b)}},highlightMatchedRow:function(b){var d=this,c=d.data("settings");b.find("td[aria-describedby='"+c.id+"_rupInfoCol'] span").addClass("ui-icon ui-icon-rupInfoCol ui-icon-search")},updateSearchPagination:function(g){var j=this,e=j.data("settings"),d,k,c,f=parseInt(j.rup_table("getGridParam","page"),10),b,h=a.jgrid.formatter.integer;if(g!==undefined){d=g}else{k=jQuery.proxy(jQuery.jgrid.getCurrPos,j[0])();d=(k[0]!==-1?k[1][k[0]-1]:-1)}if(e.search.numMatched===0){e.search.$firstNavLink.add(e.search.$backNavLink).add(e.search.$forwardNavLink).add(e.search.$lastNavLink).addClass("ui-state-disabled");e.search.$matchedLabel.html(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecords"),"0"))}else{if(d!==-1){if(jQuery.inArray(d,e.search.matchedRowsPerPage[f])!==-1){b=j.rup_table("getSearchCurrentRowCount",d);if(e.search&&e.search.numMatched){e.search.$matchedLabel.html(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecordsCount"),a.fmatter.util.NumberFormat(b,h),a.fmatter.util.NumberFormat(e.search.numMatched,h)))}if(b===1){e.search.$firstNavLink.addClass("ui-state-disabled");e.search.$backNavLink.addClass("ui-state-disabled")}else{e.search.$firstNavLink.removeClass("ui-state-disabled");e.search.$backNavLink.removeClass("ui-state-disabled")}if(b===e.search.numMatched){e.search.$lastNavLink.addClass("ui-state-disabled");e.search.$forwardNavLink.addClass("ui-state-disabled")}else{e.search.$lastNavLink.removeClass("ui-state-disabled");e.search.$forwardNavLink.removeClass("ui-state-disabled")}}else{if(e.search&&e.search.numMatched){e.search.$matchedLabel.html(jQuery.jgrid.format(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.plugins.search.matchedRecords"),a.fmatter.util.NumberFormat(e.search.numMatched,h)))}e.search.$firstNavLink.removeClass("ui-state-disabled");e.search.$backNavLink.removeClass("ui-state-disabled");e.search.$forwardNavLink.removeClass("ui-state-disabled");e.search.$lastNavLink.removeClass("ui-state-disabled");if(jQuery.inArray(e.search.matchedPages,f)>0){e.search.$backNavLink.removeClass("ui-state-disabled")}else{if(jQuery.inArray(f,e.search.matchedPages)===-1&&a.rup_utils.insertSorted(a.merge([],e.search.matchedPages),f)===0){e.search.$backNavLink.addClass("ui-state-disabled");e.search.$firstNavLink.addClass("ui-state-disabled")}else{if(jQuery.inArray(f,e.search.matchedPages)===-1&&a.rup_utils.insertSorted(a.merge([],e.search.matchedPages),f)>=e.search.matchedPages.length){e.search.$forwardNavLink.addClass("ui-state-disabled");e.search.$lastNavLink.addClass("ui-state-disabled")}else{k=j.rup_table("getActiveLineId");c=a.rup_utils.insertSorted(a.merge([],e.search.matchedLinesPerPage[f]),k+1);if(c===0){e.search.$backNavLink.addClass("ui-state-disabled")}if(c===e.search.matchedLinesPerPage[f].length){e.search.$forwardNavLink.addClass("ui-state-disabled")}}}}}}}},getSearchCurrentRowCount:function(l){var h=this,c=h.data("settings"),f=parseInt(h.rup_table("getGridParam","page"),10),e=jQuery.proxy(jQuery.jgrid.getCurrPos,h[0])(),b=h.rup_table("getSelectedRows"),g,j=jQuery.inArray(l!==undefined?l:b[0],e[1]),k=0;g=jQuery.inArray(f,c.search.matchedPages);for(var d=0;d<g;d++){k+=c.search.matchedLinesPerPage[c.search.matchedPages[d]].length}k+=a.inArray(j+1,c.search.matchedLinesPerPage[c.search.matchedPages[g]])+1;return k}});jQuery.fn.rup_table("extend",{_hasPageMatchedElements:function(b){var e=this,c=e.data("settings"),d=(typeof b==="string"?parseInt(b,10):b);return(jQuery.inArray(d,c.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(c,b){var d;if(c.search.matchedRowsPerPage[b.page]===undefined){c.search.matchedRowsPerPage[b.page]=[];c.search.matchedLinesPerPage[b.page]=[]}if(jQuery.inArray(b.id,c.search.matchedIds)===-1){c.search.matchedIds.push(b.id);c.search.matchedRows.push({id:b.id,page:b.page});d=a.rup_utils.insertSorted(c.search.matchedLinesPerPage[b.page],b.pageLine);c.search.matchedRowsPerPage[b.page].splice(d,0,b.id);if(c.search.matchedRowsPerPage[b.page].length>0&&jQuery.inArray(parseInt(b.page,10),c.search.matchedPages)===-1){a.rup_utils.insertSorted(c.search.matchedPages,parseInt(b.page,10))}c.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 c=this;return c.rup_table("preConfigureToolbar",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureToolbar",b)}});jQuery.fn.rup_table("extend",{preConfigureToolbar:function(c){var d=this,b=c.toolbar;b.id=b.id!==null?b.id:c.id+"_toolbar";if(jQuery("#"+b.id).length>0){c.$toolbar=(b.id[0]==="#"?a(b.id):a("#"+b.id));if(!c.$toolbar.hasClass("rup-toolbar")){c.$toolbar.rup_toolbar({width:796})}}else{b={};b.id="rup-maint_toolbar-"+c.id;b.self=a("<div/>").attr("id",b.id);d.prepend(b.self);b.self.rup_toolbar({width:796})}b.$toolbar=c.$toolbar;if(b.autoAjustToolbar){c.$toolbar.css("width",d.rup_table("getGridParam","width")-5)}if(b.createDefaultToolButtons===true){b.showOperations=jQuery.extend(true,{},b.defaultButtons,c.core.showOperations,b.showOperations)}b.buttons=jQuery.extend(true,{},b.newButtons,b.buttons)},postConfigureToolbar:function(d){var e=this,b=d.toolbar,c=1;jQuery.each(d.toolbar.showOperations,function(g,h){var f;if(h===true){f=d.core.operations[g];if(f!==undefined){b["btn"+g.capitalize()]=d.$toolbar.addButton({id:"btn"+g.capitalize(),i18nCaption:f.name,css:f.icon,index:c++},jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table")).bind("click",function(j){jQuery.proxy(f.callback,e)(e,j)})}}});if(b.buttons!==undefined&&b.buttons!==null){jQuery.each(b.buttons,function(h,g){if(g.json_i18n===undefined){g.json_i18n={}}if(g.obj!==undefined&&g.click!==undefined){d.$toolbar.addButton(g.obj,g.json_i18n).bind("click",g.click)}else{if(g.buttons!==undefined){var f=d.$toolbar.addMButton(g,g.json_i18n).bind("click",d.$toolbar.showMButton);d.$toolbar.addButtonsToMButton(g.buttons,f,g.json_i18n)}else{a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_table.toolbarNewButtonError"))}}})}e.on({"jqGridSelectRow.rupTable.toolbar jqGridLoadComplete.rupTable.toolbar jqGridInlineEditRow.rupTable.toolbar jqGridInlineAfterRestoreRow.rupTable.toolbar rupTableHighlightRowAsSelected.rupTable.toolbar rupTableSelectedRowNumberUpdated jqGridInlineAfterSaveRow rupTable_toolbarButtonsStateRefresh rupTable_afterDeleteRow.rupTable.toolbar rupTable_coreConfigFinished.toolbar":function(h,m,f,k){var l=jQuery(this),g=l.data("settings");function j(o,n){if(o!==undefined){if(n){o.button("enable")}else{o.button("disable")}}}jQuery.each(g.core.operations,function(o,n){if(g.toolbar.showOperations[o]===true){if(n!==undefined){j(g.toolbar["btn"+o.capitalize()],jQuery.proxy(n.enabled,l)())}}})},rupTable_internalFeedbackClose:function(){var g=jQuery(this),f=g.data("settings");f.$internalFeedback.rup_feedback("close")}})}});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,defaultButtons:{},showOperations:{}}}})(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 c=this;return c.rup_table("preConfigureFeedback",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureFeedback",b)}});jQuery.fn.rup_table("extend",{preConfigureFeedback:function(c){var d=this,f,b=c.feedback,e;b.id=b.id!==null?b.id:c.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{c.$feedback=e;c.$feedback.rup_feedback(b.config).attr("ruptype","feedback")}if(!jQuery.isFunction(c.loadError)){c.loadError=function(j,g,h){d.rup_table("showFeedback",c.$feedback,j.responseText,"error")}}},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(j,g,e,c){var f=this,d=f.data("settings"),b,h;if(c===false){j.rup_feedback("set",g,e)}else{if(jQuery.isPlainObject(c)){j.rup_feedback("option",c);j.rup_feedback("set",g,e)}else{h=(d.feedback[e+"FeedbackConfig"]!==undefined?d.feedback[e+"FeedbackConfig"]:d.feedback.okFeedbackConfig);j.rup_feedback("option",h);j.rup_feedback("set",g,e)}}}});jQuery.fn.rup_table.plugins.feedback={};jQuery.fn.rup_table.plugins.feedback.defaults={loadError:function(f,b,d){var e=a(this),c=e.data("settings");e.rup_table("showFeedback",c.$feedback,f.responseText,"error")},feedback:{okFeedbackConfig:{closeLink:true,gotoTop:false,delay:1000},errorFeedbackConfig:{closeLink:true,gotoTop:false,delay:null},alertFeedbackConfig:{closeLink:true,gotoTop:false,delay:null},id:null,config:{type:"ok",closeLink:true,gotoTop:false,block:true},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 c=this;return c.rup_table("postConfigureFluid",b)}});jQuery.fn.rup_table("extend",{postConfigureFluid:function(b){var c=this,d;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.fluid.$baseLayer.length===0){alert("El identificador "+b.baseLayer+" especificado para la capa sobre la que se va a aplicar el diseño líquido no existe.");return}d=b.fluid.fluidBaseLayer=b.fluid.$baseLayer;c.bind("fluidWidth.resize",function(h,l,f){if(c.is(":visible")){var k,j,e,g;c.setGridWidth(f);d.children().width(f);if(b.$feedback){k=parseInt(b.$feedback.css("padding-left"));j=parseInt(b.$feedback.css("padding-right"));b.$feedback.width(f-(k+j))}if(b.$toolbar){e=parseInt(b.$toolbar.css("padding-left"));g=parseInt(b.$toolbar.css("padding-right"));b.$toolbar.width(f-(e+g));b.$toolbar.css("width",f-(e+g))}}});c.fluidWidth(b.fluid);c.on("rupTable_fluidUpdate",function(e){c.fluidWidth(b.fluid)})}});jQuery.fn.rup_table.plugins.fluid={};jQuery.fn.rup_table.plugins.fluid.defaults={fluid:{baseLayer:null,minWidth:100,maxWidth:2000,fluidOffset: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("formEdit",{loadOrder:6,preConfiguration:function(b){var c=this;return c.rup_table("preConfigureFormEdit",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureFormEdit",b)}});jQuery.fn.rup_table("extend",{preConfigureFormEdit:function(d){var e=this,b=d.colModel;d.formEdit.navigationBarId=d.formEdit.navigationBarId!==undefined?d.formEdit.navigationBarId:d.id+"_detail_navigation";d.formEdit.saveButtonId=d.formEdit.saveButtonId!==undefined?d.formEdit.saveButtonId:d.id+"_detail_button_save";d.formEdit.saveRepeatButtonId=d.formEdit.saveRepeatButtonId!==undefined?d.formEdit.saveRepeatButtonId:d.id+"_detail_button_save_repeat";d.formEdit.cancelLinkId=d.formEdit.cancelLinkId!==undefined?d.formEdit.cancelLinkId:d.id+"_detail_link_cancel";d.formEdit.feedbackId=d.formEdit.feedbackId!==undefined?d.formEdit.feedbackId:d.id+"_detail_feedback";d.formEdit.$navigationBar=jQuery("#"+d.formEdit.navigationBarId);d.formEdit.$saveButton=jQuery("#"+d.formEdit.saveButtonId);d.formEdit.$saveRepeatButton=jQuery("#"+d.formEdit.saveRepeatButtonId);d.formEdit.$cancelLink=jQuery("#"+d.formEdit.cancelLinkId);d.formEdit.$feedback=jQuery("#"+d.formEdit.feedbackId);if(d.formEdit.editurl===undefined){d.formEdit.editurl=d.baseUrl;d.formEdit.editOptions.ajaxEditOptions.url=d.baseUrl;d.formEdit.addOptions.ajaxEditOptions.url=d.baseUrl}if(d.formEdit.detailOptions.ajaxDetailOptions.url===undefined){d.formEdit.detailOptions.ajaxDetailOptions.url=d.baseUrl}d.ondblClickRow=function(g,j,f,h){e.rup_table("editElement",g);return false};d.formEdit.deleteOptions.ajaxDelOptions=jQuery.extend(true,d.formEdit.deleteOptions.ajaxDelOptions,{success:function(g,f,h){e.triggerHandler("rupTableAfterDelete",[g,f,h]);e.rup_table("showFeedback",d.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.deletedOK"),"ok")}});if(d.formEdit.detailForm===undefined){for(var c=0;c<b.length;c++){colModelObj=b[c];colModelObj.id="detailForm_"+d.id+"_"+colModelObj.name.replace(/[.]/g,"_")}}d.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(g,f){e.rup_table("newElement")}},edit:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.modify"),icon:"rup-icon rup-icon-edit",enabled:function(){var g=this,f=g.data("settings");return jQuery.proxy(f.fncHasSelectedElements,g)()},callback:function(g,f){e.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(d.fncHasSelectedElements,e)()},callback:function(g,f){e.rup_table("cloneElement")}},"delete":{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.delete"),icon:"rup-icon rup-icon-delete",enabled:function(){var g=this,f=g.data("settings");return jQuery.proxy(f.fncHasSelectedElements,g)()},callback:function(g,f){e.rup_table("deleteElement")}}};a.extend(true,d.core.operations,d.core.defaultOperations);d.formEdit.addOptions=a.extend(true,{},d.formEdit.addEditOptions,d.formEdit.addOptions);d.formEdit.editOptions=a.extend(true,{},d.formEdit.addEditOptions,d.formEdit.editOptions)},postConfigureFormEdit:function(c){var g=this,f;if(c.formEdit.detailForm){if(jQuery(c.formEdit.detailForm).length===0){alert("El identificador especificado para el fomulario de detalle no existe.")}else{f=a(c.formEdit.detailForm);if(f.is("form")){if(f.parent().is("div")){c.formEdit.$detailFormDiv=f.parent();c.formEdit.$detailForm=f}else{alert("El fomrmulario no está incluido dentro de un div")}}else{if(f.is("div")){var e=f.find("form");if(e.length===1){c.formEdit.$detailFormDiv=f;c.formEdit.$detailForm=e}else{alert("El div indicado no contiene un único formulario")}}}c.formEdit.$detailForm.rup_form(c.formEdit.editOptions);c.formEdit.ownFormEdit=true}}beforeSendUserEvent=c.beforeSend;var b=function(j,h){h.beforeSend=beforeSendUserEvent;h.validate=c.formEdit.validate;h.feedback=c.$detailFeedback;delete h.contentType;if(jQuery.isPlainObject(h.data)){h.data=a.rup_utils.unnestjson(h.data)}h.beforeSubmit=function(k,l,m){var n=jQuery("input:file",l).length>0;if((!a.rup.browser.xhrFileUploadSupport&&n)||m.iframe===true){m.extraData={}}delete k};h.propperFormSerialization=false;c.formEdit.$detailForm.rup_form("ajaxSubmit",h);rp_ge[c.id].processing=false;return false};c.formEdit.editOptions.ajaxEditOptions.beforeSend=b;c.formEdit.addOptions.ajaxEditOptions.beforeSend=b;c.getDetailTotalRowCount=function(){var h=this;return h.rup_table("getGridParam","records")};c.getDetailCurrentRowCount=function(){var l=this,h,k,j;h=parseInt(l.rup_table("getGridParam","page"),10);j=l.rup_table("getGridParam","selrow");k=jQuery.inArray(j,jQuery.proxy(jQuery.jgrid.getCurrPos,l[0])()[1])+1;rowsPerPage=parseInt(l.rup_table("getGridParam","rowNum"),10);cont=(h*rowsPerPage)-rowsPerPage+k;return cont};c.getRowForEditing=function(){var j=this,h=j.jqGrid("getGridParam","selrow");return(h===null?false:h)};c.fncHasSelectedElements=function(){var h=this;return jQuery.proxy(c.getRowForEditing,h)()!==false};c.fncGetNavigationParams=function d(j){var r=this,q=false,s=false,o=0,m=0,l=0,h=jQuery.proxy(jQuery.jgrid.getCurrPos,r[0])(),p=parseInt(r.rup_table("getGridParam","page"),10),k=parseInt(r.rup_table("getGridParam","rowNum"),10),n=parseInt(Math.ceil(r.rup_table("getGridParam","records")/r.rup_table("getGridParam","rowNum")),10);h[0]=parseInt(h[0],10);switch(j){case"first":if(!(p===1&&h[0]===0)){q=true;o=0;if(p>1){s=true;m=1;l=0}}break;case"prev":if(!(p===1&&h[0]===0)){q=true;o=h[0]-1;if(o<0){s=true;m=p-1;l=k}}break;case"next":if(!(p===n&&h[0]===h[1].length-1)){q=true;o=h[0]+1;if(o>h[1].length-1){s=true;m=p+1;l=0}}break;case"last":if(!(p===n&&h[0]===h[1].length-1)){q=true;o=h[1].length-1;if(p<n){s=true;m=n;l=k}}break}return[j,q,s,o,h,m,l]};c.doNavigation=function(s,p,r,n,j,l,k){var q=this,m=q.data("settings"),o=rp_ge[q.attr("id")],h,p,r,n,j,l,k;if(a.isArray(s)){h=s[0];p=s[1];r=s[2];n=s[3];j=s[4];l=s[5];k=s[6];if(p){q.rup_table("hideFormErrors",m.formEdit.$detailForm);q.triggerHandler("jqGridAddEditClickPgButtons",[h,m.formEdit.$detailForm,j[1][j[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=(k<u[1].length?k:u[1].length-1);q.jqGrid("setSelection",u[1][t]);jQuery.proxy(jQuery.jgrid.fillData,q[0])(u[1][t],q[0],m.formEdit.$detailForm.attr("id"),m.opermode);jQuery.proxy(jQuery.jgrid.updateNav,q[0])(u[1][t],j[1].length-1);q.off("jqGridAfterLoadComplete.pagination")})}else{jQuery.proxy(jQuery.jgrid.fillData,q[0])(j[1][n],q[0],m.formEdit.$detailForm.attr("id"),m.opermode);q.jqGrid("setSelection",j[1][n]);jQuery.proxy(jQuery.jgrid.updateNav,q[0])(j[1][n],j[1].length-1)}q.triggerHandler("jqGridAddEditAfterClickPgButtons",[h,m.formEdit.$detailForm,j[1][j[n]]]);if(jQuery.isFunction(o.afterclickPgButtons)){o.afterclickPgButtons.call(q,"next",m.formEdit.$detailForm,j[1][j[n]])}}}};g.on({"jqGridLoadComplete.rupTable.formEditing":function(k){var l=a(this),h=l.data("settings"),j;if(h.formEdit.autoselectFirstRecord){j=jQuery.proxy(jQuery.jgrid.getCurrPos,l[0])();l.jqGrid("setSelection",j[1][0],false)}},"jqGridAddEditInitializeForm.rupTable.formEditing":function(l,h,n){var m=a(this),k=m.data("settings"),j=k.colModel;if(k.formEdit.ownFormEdit===false){jQuery.each(j,function(o,p){if(p.rupType){if(p.editoptions&&p.editoptions.i18nId===undefined){p.editoptions.i18nId=m.attr("id")+"##"+this.name}a("#"+(p.id!==null?p.id:name),h)["rup_"+p.rupType](p.editoptions)}})}k.$detailFeedback=k.formEdit.$feedback.rup_feedback({closeLink:true,gotoTop:false,block:false,fadeSpeed:500}).attr("ruptype","feedback")},"jqGridAddEditAfterSubmit.rupTable.formEditing":function(h,q,k,l){var m=g.data("settings"),o=g.data("tmp.formEditSaveType"),j,n,r=null;g.removeData("tmp.formEditSaveType");jQuery.each(m.colModel,function(s,t){if(t.rupType==="combo"){n=jQuery("[name='"+t.name+"']",m.$detailForm);if(t.editoptions.labelProperty!==undefined){r=t.editoptions.labelProperty}else{if(t.editoptions.sourceParam!==undefined){r=t.name.substring(0,t.name.lastIndexOf(".")+1)+t.editoptions.sourceParam.label}}if(r!==null){k[r]=n.rup_combo("label")}}});if(o==="SAVE"){if(l==="edit"){g.rup_table("showFeedback",m.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.modifyOK"),"ok")}else{g.rup_table("showFeedback",m.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.insertOK"),"ok")}m.formEdit.$detailFormDiv.rup_dialog("close")}else{if(o==="SAVE_REPEAT"){if(l==="edit"){g.rup_table("showFeedback",m.$detailFeedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.modifyOK"),"ok")}else{g.rup_table("showFeedback",m.$detailFeedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.insertOK"),"ok")}}}try{responseJson=a.parseJSON(q.responseText)}catch(p){responseJson=k}j=responseJson[m.primaryKey?m.primaryKey:g[0].p.prmNames.id];return[true,"",j]},"jqGridAddEditErrorTextFormat.rupTable.formEditing":function(h,j,m){var l;if(j.status===406&&j.responseText!==""){try{l=jQuery.parseJSON(j.responseText);if(l.rupErrorFields){g.rup_table("showServerValidationFieldErrors",c.formEdit.$detailForm,l)}}catch(k){g.rup_table("showFeedback",c.$detailFeedback,j.responseText,"error")}}},"jqGridAddEditBeforeShowForm.rupTable.formEditing":function(m,o,j){var n=a(this),k=n.data("settings"),l=jQuery("#ui-dialog-title-"+k.formEdit.$detailFormDiv.attr("id"),k.formEdit.$detailFormDiv.parent()),h=n[0].p.colModel;n.rup_table("hideFormErrors",k.formEdit.$detailForm);if(j==="add"){l.html(rp_ge[n[0].p.id].addCaption);a("#pagination_"+k.id+",#pag_"+k.id).hide()}else{l.html(rp_ge[n[0].p.id].editCaption);a("#pagination_"+k.id+",#pag_"+k.id).show()}},"jqGridAddEditBeforeShowForm.rupTable.formEditing.readOnlyPks":function(m,o,k){var n=a(this),l=n.data("settings"),h=n[0].p.colModel;for(var j=0;j<h.length;j++){if(l.ownFormEdit!==true||(l.ownFormEdit===true&&jQuery.inArray(colmodel[j].name,l.primaryKey))){if(k==="add"){if(h[j].editableOnAdd===false){jQuery("[name='"+h[j].name+"']",l.formEdit.$detailFormDiv).attr("readonly","readonly")}else{jQuery("[name='"+h[j].name+"']",l.formEdit.$detailFormDiv).removeAttr("readonly")}}else{if(h[j].editableOnEdit===false){jQuery("[name='"+h[j].name+"']",l.formEdit.$detailFormDiv).attr("readonly","readonly")}else{jQuery("[name='"+h[j].name+"']",l.formEdit.$detailFormDiv).removeAttr("readonly")}}}}},"jqGridAddEditAfterShowForm.rupTable.formEditing":function(j,k,h){jQuery(":focusable:enabled:not([readonly]):first",k).focus()}})}});jQuery.fn.rup_table("extend",{createDetailNavigation:function(){var p=a(this),g=p.data("settings"),b=p.attr("id"),q=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.paginationBar"),o=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.paginationLink"),n=jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.elementCounter"),h=a(jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.templates.detailForm.separator")),j=a(jQuery.jgrid.format(n,b,jQuery.rup.STATICS,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.numResult"))),c=a(jQuery.jgrid.format(q,b)),m=a(jQuery.jgrid.format(o,"first_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.first"))),l=a(jQuery.jgrid.format(o,"back_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.previous"))),e=a(jQuery.jgrid.format(o,"forward_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.next"))),f=a(jQuery.jgrid.format(o,"last_"+b,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_table.last"))),k=undefined;c.append(m).append(l).append(e).append(f);function d(t,r){var s=a.proxy(g.fncGetNavigationParams,p)(t);if(!r.hasClass("ui-state-disabled")){if(a.proxy(a.jgrid.checkUpdates,p[0])(k,function(){a.proxy(g.doNavigation,p)(s)})){a.proxy(g.doNavigation,p)(s)}}}m.on("click",function(){d("first",a(this))});l.on("click",function(){d("prev",a(this))});e.on("click",function(){d("next",a(this))});f.on("click",function(){d("last",a(this))});return j.after(c).after(h)},deleteElement:function(f,b){var g=this,c=g.data("settings"),e=jQuery.extend(true,{},c.formEdit.deleteOptions,b),d=(f===undefined?g.rup_table("getSelectedRows"):f);if(d.length===1){if(e.mtype==="DELETE"){e.url=c.formEdit.editurl+"/"+g.rup_table("getPkUrl",d)}}else{e.mtype="POST";e.ajaxDelOptions.contentType="application/json";e.ajaxDelOptions.type="POST";e.ajaxDelOptions.dataType="json";e.url=c.formEdit.editurl+"/deleteAll";e.serializeDelData=function(j,h){return jQuery.toJSON({core:{pkToken:c.multiplePkToken,pkNames:c.primaryKey},multiselection:g.rup_table("getSelectedIds"),filter:g.rup_table("getFilterParams")})}}e.afterSubmit=function(){g.triggerHandler("rupTable_deleteAfterSubmit");return true};e.afterComplete=function(){g.triggerHandler("rupTable_afterDeleteRow")};if(g.triggerHandler("rupTable_beforeDeleteRow",[e,d])!==false){g.jqGrid("delGridRow",d,e)}return g},editElement:function(g,c){var h=this,e=h.data("settings"),f=(g===undefined?a.proxy(e.getRowForEditing,h)():g),b=h[0].p.colModel;if(f!==false){for(var d=0;d<b.length;d++){if(b[d].editable===true&&b[d].editableOnEdit===false){if(b[d].editoptions===undefined){b[d].editoptions={}}b[d].editoptions.readonly="readonly"}else{if(b[d].editoptions!==undefined&&b[d].editoptions.readonly!==undefined){delete b[d].editoptions.readonly}}}if(h.triggerHandler("rupTable_beforeEditRow",[e.formEdit.editOptions,f])!==false){h.jqGrid("editGridRow",f,e.formEdit.editOptions)}}return h},newElement:function(f){var g=this,e=g.data("settings"),c=g[0].p.colModel,b;for(var d=0;d<c.length;d++){if(c[d].editable===true&&c[d].editableOnAdd!==false){if(c[d].editable===true&&c[d].editableOnAdd===false){if(c[d].editoptions===undefined){c[d].editoptions={}}c[d].editoptions.readonly="readonly"}else{if(c[d].editoptions!==undefined&&c[d].editoptions.readonly!==undefined){delete c[d].editoptions.readonly}}}}if(f===false||(f!==false&&g.triggerHandler("rupTable_beforeAddRow",[e.formEdit.addOptions])!==false)){g.jqGrid("editGridRow","new",e.formEdit.addOptions)}return g},cloneElement:function(f,c,b){var g=this,d=g.data("settings"),e=(f===undefined?a.proxy(d.getRowForEditing,g)():f);if(b===false||(b!==false&&g.triggerHandler("rupTable_beforeCloneRow",[d,e])!==false)){g.rup_table("newElement",false);jQuery.proxy(jQuery.jgrid.fillData,g[0])(e,g[0]);jQuery("#id_g",d.formEdit.$detailForm).val("_empty")}return g},hideFormErrors:function(b){var d=this,c=d.data("settings");c.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(e,k,h,r){var c=h.parent();var p=this,q=a(p),s=q.data("settings"),j,b,d,m,n=0,u,v,l,t=[],g=false,f="<label class='CaptionTD'></label>",o;for(o=1;o<=r;o++){h.append(a("<div>").attr("id","col_"+parseInt((parseInt(o,10)||1)*2,10)).addClass("floating_left_pad_right").width((100/r)*0.95+"%"))}if(e!="_empty"){g=a(k).jqGrid("getInd",e)}a(k.p.colModel).each(function(A){b=this.name;j=this.id;if(this.editrules&&this.editrules.edithidden===true){d=false}else{d=this.hidden===true?true:false}v=d?"style='display:none'":"";if(b!=="cb"&&b!=="subgrid"&&this.editable===true&&b!=="rn"){if(g===false){u=""}else{if(b==k.p.ExpandColumn&&k.p.treeGrid===true){u=a("td[role='gridcell']:eq("+A+")",k.rows[g]).text()}else{try{u=a.unformat.call(k,a("td[role='gridcell']:eq("+A+")",k.rows[g]),{rowId:e,colModel:this},A)}catch(x){u=(this.edittype&&this.edittype=="textarea")?a("td[role='gridcell']:eq("+A+")",k.rows[g]).text():a("td[role='gridcell']:eq("+A+")",k.rows[g]).html()}if(!u||u=="&nbsp;"||u=="&#160;"||(u.length==1&&u.charCodeAt(0)==160)){u=""}}}var z=a.extend({},this.editoptions||{},{id:j,name:b}),E=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:false,rowcontent:""},this.formoptions||{}),B=parseInt(E.rowpos,10)||n+1,D=parseInt((parseInt(E.colpos,10)||1)*2,10);if(e=="_empty"&&z.defaultValue){u=a.isFunction(z.defaultValue)?z.defaultValue.call(p):z.defaultValue}if(!this.edittype){this.edittype="text"}if(p.p.autoencode){u=a.jgrid.htmlDecode(u)}l=a.jgrid.createEl.call(p,this.edittype,z,u,false,a.extend({},a.jgrid.ajaxOptions,k.p.ajaxSelectOptions||{}));if(u===""&&this.edittype=="checkbox"){u=a(l).attr("offval")}if(u===""&&this.edittype=="select"){u=a("option:eq(0)",l).text()}if(this.edittype==="custom"){l=a(l).children()[0]}a(l).addClass("FormElement");m=a(h).find("tr[rowpos="+B+"]");if(E.rowabove){var C=a("<div><span class='contentinfo'>"+E.rowcontent+"</span></div>");a(h).append(C);C[0].rp=B}if(m.length===0){m=a("<div "+v+" rowpos='"+B+"'></div>").addClass("FormData floating_left_pad_right one-column").attr("id","tr_"+b);a(m).append(f);a(h).find("#col_"+D).append(m);m[0].rp=B}var y=a("label",m[0]).attr("for",j).html(typeof E.label==="undefined"?k.p.colNames[A]:E.label);y.parent().append(E.elmprefix).append(l).append(E.elmsuffix);t[n]=A;n++}});if(n>0){var w=a("<div class='FormData' style='display:none'><span class='CaptionTD'></span><span class='DataTD '><input class='FormElement' id='id_g' type='text' name='"+k.p.id+"_id' value='"+e+"'/></span></div>");w[0].rp=n+999;a(h).append(w);if(rp_ge[p.p.id].checkOnSubmit||rp_ge[p.p.id].checkOnUpdate){rp_ge[p.p.id]._savedData[k.p.id+"_id"]=e}}return t},fillDataClientSide:function(h,l,d,g){var p=this,q=a(p),s=q.data("settings"),k=p.p.id,t=a.fn.jqGrid.rup.edit.detail.detailFormId+k,f=a.fn.jqGrid.rup.edit.detail.detailBodyId+k,m="#"+a.jgrid.jqID(f),e,n,o=0,v,b,c,u,w;if(rp_ge[p.p.id].checkOnSubmit||rp_ge[p.p.id].checkOnUpdate){rp_ge[p.p.id]._savedData={};rp_ge[p.p.id]._savedData[l.p.id+"_id"]=h}var j=l.p.colModel;if(h=="_empty"){q.rup_table("resetForm",s.formEdit.$detailForm);a(j).each(function(){e=this.name;n=this.id!==undefined?this.id:e;c=a.extend({},this.editoptions||{});b=a("#"+a.jgrid.jqID(n),s.formEdit.$detailForm);if(b.length===0){b=a("[name='"+n+"']",s.formEdit.$detailForm)}if(b&&b.length&&b[0]!==null){u="";if(c.defaultValue){u=a.isFunction(c.defaultValue)?c.defaultValue.call(p):c.defaultValue;if(b[0].type=="checkbox"||b[0].type=="radio"){w=u.toLowerCase();if(w.search(/(false|0|no|off|undefined)/i)<0&&w!==""){b[0].checked=true;b[0].defaultChecked=true;b[0].value=u}else{b[0].checked=false;b[0].defaultChecked=false}}else{b.val(u)}}else{if(b[0].type=="checkbox"||b[0].type=="radio"){b[0].checked=false;b[0].defaultChecked=false;u=a(b).attr("offval")}else{if(b[0].type&&b[0].type.substr(0,6)=="select"){if(b.attr("ruptype")==="combo"){b.rup_combo("reset")}else{b[0].selectedIndex=0}}else{b.val(u)}}}if(rp_ge[p.p.id].checkOnSubmit===true||rp_ge[p.p.id].checkOnUpdate){rp_ge[p.p.id]._savedData[e]=u}}});a("#id_g",s.formEdit.$detailForm).val(h);return}var r=a(l).jqGrid("getInd",h,true);if(!r){return}a('td[role="gridcell"]',r).each(function(A){e=j[A].name;n=this.id!==undefined?this.id:e;if(e!=="cb"&&e!=="subgrid"&&e!=="rn"&&j[A].editable===true){if(e==l.p.ExpandColumn&&l.p.treeGrid===true){v=a(this).text()}else{try{v=a.unformat.call(l,a(this),{rowId:h,colModel:j[A]},A)}catch(z){v=j[A].edittype=="textarea"?a(this).text():a(this).html()}}if(p.p.autoencode){v=a.jgrid.htmlDecode(v)}if(rp_ge[p.p.id].checkOnSubmit===true||rp_ge[p.p.id].checkOnUpdate){rp_ge[p.p.id]._savedData[e]=v}e=a.jgrid.jqID(e);switch(j[A].edittype){case"password":case"text":case"button":case"image":case"textarea":if(v=="&nbsp;"||v=="&#160;"||(v.length==1&&v.charCodeAt(0)==160)){v=""}a("#"+n,"#"+d).val(v);break;case"select":var y=v.split(",");y=a.map(y,function(C){return a.trim(C)});a("#"+n+" option","#"+d).each(function(){if(!j[A].editoptions.multiple&&(a.trim(v)==a.trim(a(this).text())||y[0]==a.trim(a(this).text())||y[0]==a.trim(a(this).val()))){this.selected=true}else{if(j[A].editoptions.multiple){if(a.inArray(a.trim(a(this).text()),y)>-1||a.inArray(a.trim(a(this).val()),y)>-1){this.selected=true}else{this.selected=false}}else{this.selected=false}}});break;case"checkbox":v=String(v);if(j[A].editoptions&&j[A].editoptions.value){var x=j[A].editoptions.value.split(":");if(x[0]==v){a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("checked",true);a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("defaultChecked",true)}else{a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("checked",false);a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("defaultChecked",false)}}else{v=v.toLowerCase();if(v.search(/(false|0|no|off|undefined)/i)<0&&v!==""){a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("checked",true);a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("defaultChecked",true)}else{a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("checked",false);a("#"+n,"#"+d)[p.p.useProp?"prop":"attr"]("defaultChecked",false)}}break;case"custom":try{if(j[A].editoptions&&a.isFunction(j[A].editoptions.custom_value)){j[A].editoptions.custom_value.call(p,a("#"+n,"#"+d),"set",v)}else{throw"e1"}}catch(B){if(B=="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,B.message,a.jgrid.edit.bClose)}}break}o++}});if(o>0){a("#id_g",m).val(h)}},fillDataServerSide:function(f,c,d){var j=this,g=a(j),e=g.data("settings"),h=(c!==undefined?c:e.formEdit.$detailForm);var b=a.extend({success:function(m,k){var l;if(m.id&&m.id instanceof Object){if(m.id instanceof Object){m.JPA_ID=m.id;delete m.id}}l=a.rup_utils.jsontoarray(m);a.rup_utils.populateForm(l,h);rp_ge[j.p.id]._savedData=a.rup_utils.unnestjson(m);rp_ge[j.p.id]._savedData[e.id+"_id"]=f;a("#id_g",c).val(f);g.triggerHandler("rupTable_afterFormFillDataServerSide",[m,h,k])},error:function(m,k,l){e.$feedback.rup_feedback("option","delay",null);e.$feedback.rup_feedback("set",m.responseText,"error");e.$feedback.rup_feedback("option","delay",1000)}},e.formEdit.detailOptions.ajaxDetailOptions);b.url+="/"+g.rup_table("getPkUrl",f);a.when(a.rup_ajax(b)).then(function(m,k,l){g.triggerHandler("jqGridAddEditAfterFillData",[c,d])})},fillData:function(e,f,d,b){var h=this,g=a(h),c=g.data("settings");switch((e=="_empty"?"clientSide":c.formEdit.editOptions.fillDataMethod)){case"clientSide":a.proxy(a.jgrid.fillDataClientSide,h)(e,f,d,b);break;case"serverSide":default:a.proxy(a.jgrid.fillDataServerSide,h)(e,c.formEdit.$detailForm,b);break}},getFormData:function(c,g){var f=this,e=a(this),d=e.data("settings"),b;b=form2object(d.formEdit.$detailForm[0],null,false);jQuery.extend(true,c,b);return true},postIt:function(y,o,c){var t=this,p=t,u=jQuery(p),v=u.data("settings"),j=t.p.id,w=a.fn.jqGrid.rup.edit.detail.detailFormId+j,b=a.fn.jqGrid.rup.edit.detail.detailBodyId+j,r="#"+a.jgrid.jqID(b),d,z=[true,"",""],l={},k=t.p.prmNames,n,m,A,g,s;var q=a(t).triggerHandler("jqGridAddEditBeforeCheckValues",[a("#"+w),c]);if(q&&typeof q==="object"){y=q}if(a.isFunction(rp_ge[t.p.id].beforeCheckValues)){q=rp_ge[t.p.id].beforeCheckValues.call(t,y,a("#"+w),y[t.p.id+"_id"]=="_empty"?k.addoper:k.editoper);if(q&&typeof q==="object"){y=q}}for(A in y){if(y.hasOwnProperty(A)){z=a.jgrid.checkValues.call(t,y[A],A,t);if(z[0]===false){break}}}a.proxy(a.jgrid.setNulls,t)();if(z[0]){l=a(t).triggerHandler("jqGridAddEditClickSubmit",[rp_ge[t.p.id],y,c]);if(l===undefined&&a.isFunction(rp_ge[t.p.id].onclickSubmit)){l=rp_ge[t.p.id].onclickSubmit.call(t,rp_ge[t.p.id],y)||{}}z=a(t).triggerHandler("jqGridAddEditBeforeSubmit",[y,a("#"+w),c]);if(z===undefined){z=[true,"",""]}if(z[0]&&a.isFunction(rp_ge[t.p.id].beforeSubmit)){z=rp_ge[t.p.id].beforeSubmit.call(t,y,a("#"+w))}}if(z[0]){rp_ge[t.p.id].processing=true;a("#sData",r+"_2").addClass("ui-state-active");m=k.oper;n=k.id;y[m]=(a.trim(y[t.p.id+"_id"])=="_empty")?k.addoper:k.editoper;if(y[m]!=k.addoper){y[n]=y[t.p.id+"_id"]}else{if(y[n]===undefined){y[n]=y[t.p.id+"_id"]}}delete y[t.p.id+"_id"];y=a.extend(y,rp_ge[t.p.id].editData,l);if(t.p.treeGrid===true){if(y[m]==k.addoper){g=a(t).jqGrid("getGridParam","selrow");var f=t.p.treeGridModel=="adjacency"?t.p.treeReader.parent_id_field:"parent_id";y[f]=g}for(s in t.p.treeReader){if(t.p.treeReader.hasOwnProperty(s)){var e=t.p.treeReader[s];if(y.hasOwnProperty(e)){if(y[m]==k.addoper&&s==="parent_id_field"){continue}delete y[e]}}}}y[n]=a.jgrid.stripPref(t.p.idPrefix,y[n]);var x=a.extend({url:rp_ge[t.p.id].url||a(t).jqGrid("getGridParam","editurl"),type:rp_ge[t.p.id].mtype,data:a.isFunction(rp_ge[t.p.id].serializeEditData)?rp_ge[t.p.id].serializeEditData.call(t,y):y,complete:function(D,B){var C;y[n]=t.p.idPrefix+y[n];if(B!="success"){z[0]=false;z[1]=a(t).triggerHandler("jqGridAddEditErrorTextFormat",[D,c]);if(a.isFunction(rp_ge[t.p.id].errorTextFormat)){z[1]=rp_ge[t.p.id].errorTextFormat.call(t,D)}else{z[1]=B+" Status: '"+D.statusText+"'. Error code: "+D.status}}else{z=a(t).triggerHandler("jqGridAddEditAfterSubmit",[D,y,c]);if(z===undefined){z=[true,"",""]}if(z[0]&&a.isFunction(rp_ge[t.p.id].afterSubmit)){z=rp_ge[t.p.id].afterSubmit.call(t,D,y)}}if(z[0]===false){a("#"+v.formEdit.feedbackId+">td",r).html(z[1]);a("#"+v.formEdit.feedbackId,r).show()}else{a.each(t.p.colModel,function(){if(o[this.name]&&this.formatter&&this.formatter=="select"){try{delete o[this.name]}catch(F){}}if(this.formatter=="checkbox"&&y[this.name]==undefined){y[this.name]=null}if(this.formatter&&(this.formatter!=="checkbox"&&this.formatter!=="select")){if(y[this.name]===undefined){y[this.name]=this.formatter.call(a(t),undefined,y,y[m])}}if(this.formatterOnUpdate){y[this.name]=this.formatterOnUpdate.call(a(t),a("#"+w))}if(this.updateFromDetail){y[this.name]=this.updateFromDetail.call(a(t),a("#"+w))}});y=a.extend(y,o);if(t.p.autoencode){a.each(y,function(G,F){y[G]=a.jgrid.htmlDecode(F)})}if(y[m]==k.addoper){if(!z[2]){z[2]=a.jgrid.randId()}y[n]=z[2];if(rp_ge[t.p.id].closeAfterAdd){if(rp_ge[t.p.id].reloadAfterSubmit){a(t).trigger("reloadGrid")}else{if(t.p.treeGrid===true){a(t).jqGrid("addChildNode",z[2],g,y)}else{a(t).jqGrid("addRowData",z[2],y,rp_ge[t.p.id].addedrow);a(t).jqGrid("setSelection",z[2])}}a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(j),jqm:rp_ge[t.p.id].jqModal,onClose:rp_ge[t.p.id].onClose})}else{if(rp_ge[t.p.id].clearAfterAdd){if(rp_ge[t.p.id].reloadAfterSubmit){a(t).trigger("reloadGrid")}else{if(t.p.treeGrid===true){a(t).jqGrid("addChildNode",z[2],g,y)}else{a(t).jqGrid("addRowData",z[2],y,rp_ge[t.p.id].addedrow);a(t).jqGrid("setSelection",z[2])}}a.proxy(a.jgrid.fillData,t)("_empty",t,w)}else{if(rp_ge[t.p.id].reloadAfterSubmit){a(t).trigger("reloadGrid")}else{if(t.p.treeGrid===true){a(t).jqGrid("addChildNode",z[2],g,y)}else{a(t).jqGrid("addRowData",z[2],y,rp_ge[t.p.id].addedrow)}}}}}else{if(rp_ge[t.p.id].reloadAfterSubmit){a(t).trigger("reloadGrid");if(!rp_ge[t.p.id].closeAfterEdit){setTimeout(function(){a(t).jqGrid("setSelection",y[n])},1000)}}else{if(t.p.treeGrid===true){a(t).jqGrid("setTreeRow",y[n],y)}else{a(t).jqGrid("setRowData",y[n],y)}}if(rp_ge[t.p.id].closeAfterEdit){a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(j),jqm:rp_ge[t.p.id].jqModal,onClose:rp_ge[t.p.id].onClose})}}if(a.isFunction(rp_ge[t.p.id].afterComplete)){d=D;setTimeout(function(){a(t).triggerHandler("jqGridAddEditAfterComplete",[d,y,a("#"+w),c]);rp_ge[t.p.id].afterComplete.call(t,d,y,a("#"+w));d=null},500)}if(rp_ge[t.p.id].checkOnSubmit||rp_ge[t.p.id].checkOnUpdate){a("#"+w).data("disabled",false);if(rp_ge[t.p.id]._savedData[t.p.id+"_id"]!="_empty"){for(C in rp_ge[t.p.id]._savedData){if(rp_ge[t.p.id]._savedData.hasOwnProperty(C)&&y[C]){rp_ge[t.p.id]._savedData[C]=y[C]}}}}}rp_ge[t.p.id].processing=false;a("#sData",r+"_2").removeClass("ui-state-active");try{a(":input:visible","#"+w)[0].focus()}catch(E){}}},a.jgrid.ajaxOptions,rp_ge[t.p.id].ajaxEditOptions);if(!x.url&&!rp_ge[t.p.id].useDataProxy){if(a.isFunction(t.p.dataProxy)){rp_ge[t.p.id].useDataProxy=true}else{z[0]=false;z[1]+=" "+a.jgrid.errors.nourl}}if(z[0]){if(rp_ge[t.p.id].useDataProxy){var h=t.p.dataProxy.call(t,x,"set_"+t.p.id);if(h===undefined){h=[true,""]}if(h[0]===false){z[0]=false;z[1]=h[1]||"Error deleting the selected row!"}else{if(x.data.oper==k.addoper&&rp_ge[t.p.id].closeAfterAdd){a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(j),jqm:rp_ge[t.p.id].jqModal,onClose:rp_ge[t.p.id].onClose})}if(x.data.oper==k.editoper&&rp_ge[t.p.id].closeAfterEdit){a.jgrid.hideModal("#"+a.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+a.jgrid.jqID(j),jqm:rp_ge[t.p.id].jqModal,onClose:rp_ge[t.p.id].onClose})}}}else{a.ajax(x)}}}if(z[0]===false){a("#"+v.formEdit.feedbackId+">td",r).html(z[1]);a("#"+v.formEdit.feedbackId,r).show()}},setNulls:function(){var b=this;a.each(b.p.colModel,function(c,d){if(d.editoptions&&d.editoptions.NullIfEmpty===true){if(postdata.hasOwnProperty(d.name)&&postdata[d.name]===""){postdata[d.name]="null"}}})},compareData:function(f,b){var d=false,e,c=jQuery.rup_utils.unnestjson(f),g=jQuery.rup_utils.unnestjson(b);for(e in c){if(c.hasOwnProperty(e)&&String(c[e])!==String(g[e])){d=true;break}}return d},checkUpdates:function(g,k){var n=a(this),c=n.data("settings"),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,m=false;if(rp_ge[h.p.id].checkOnUpdate){postdata={};g={};a.proxy(a.jgrid.getFormData,h)(postdata,g);newData=a.extend({},postdata,g);if(c.formEdit.addEditOptions.defaultCompareData===true){m=a.proxy(a.jgrid.compareData,h)(newData,rp_ge[h.p.id]._savedData)}var l=jQuery.Event("rupTable_formEditCompareData");l.isDifferent=m;n.triggerHandler(l,[rp_ge[h.p.id]._savedData,newData]);if(l.isDifferent){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,n)()}}});f=false}}return f},restoreInline:function(c){var d=this,b;if(c!=="_empty"&&typeof(d.p.savedRow)!=="undefined"&&d.p.savedRow.length>0&&a.isFunction(a.fn.jqGrid.restoreRow)){for(b=0;b<d.p.savedRow.length;b++){if(d.p.savedRow[b].id==c){a(d).jqGrid("restoreRow",c);break}}}},getCurrPos:function(){var j=this,l=a(this),f=l.data("settings"),b=j.p.id,g=a.fn.jqGrid.rup.edit.detail.detailFormId+b,h=a.fn.jqGrid.rup.edit.detail.detailBodyId+b,k="#"+a.jgrid.jqID(h),c=a(j).jqGrid("getDataIDs"),d=a("#id_g",f.formEdit.$detailForm).val(),e=d!==undefined&&d!=="_empty"?d:l.jqGrid("getGridParam","selrow");pos=a.inArray(e,c);return[pos,c]},updateNav:function(c,b){var e=a(this),d;if(b!==undefined&&b[1]!==undefined){d=b[1].length-1;if(c===0){a("#pData",frmtb+"_2").addClass("ui-state-disabled")}else{if(b[1][c-1]!==undefined&&a("#"+a.jgrid.jqID(b[1][c-1])).hasClass("ui-state-disabled")){a("#pData",frmtb+"_2").addClass("ui-state-disabled")}else{a("#pData",frmtb+"_2").removeClass("ui-state-disabled")}}if(c==d){a("#nData",frmtb+"_2").addClass("ui-state-disabled")}else{if(b[1][c+1]!==undefined&&a("#"+a.jgrid.jqID(b[1][c+1])).hasClass("ui-state-disabled")){a("#nData",frmtb+"_2").addClass("ui-state-disabled")}else{a("#nData",frmtb+"_2").removeClass("ui-state-disabled")}}}e.rup_table("updateDetailPagination")}});a.jgrid.extend({editGridRow:function(b,c){c=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,c||{});rp_ge[a(this)[0].p.id]=c;return this.each(function(){var d=this,v=a(d),V=v.data("settings");if(!d.grid||!b){return}var B=d.p.id,y=a.fn.jqGrid.rup.edit.detail.detailFormId+B,S=a.fn.jqGrid.rup.edit.detail.detailBodyId+B,w="#"+a.jgrid.jqID(S),j={themodal:a.fn.jqGrid.rup.edit.detail.detailDivId+B,modalhead:"edithd"+B,modalcontent:"editcnt"+B,scrollelm:y},D=a.isFunction(rp_ge[d.p.id].beforeShowForm)?rp_ge[d.p.id].beforeShowForm:false,K=a.isFunction(rp_ge[d.p.id].afterShowForm)?rp_ge[d.p.id].afterShowForm:false,J=a.isFunction(rp_ge[d.p.id].beforeInitData)?rp_ge[d.p.id].beforeInitData:false,o=a.isFunction(rp_ge[d.p.id].onInitializeForm)?rp_ge[d.p.id].onInitializeForm:false,X=true,I=1,p=0,E,N,F,A,H;y=a.jgrid.jqID(y);if(b==="new"){b="_empty";H="add";c.caption=rp_ge[d.p.id].addCaption}else{c.caption=rp_ge[d.p.id].editCaption;H="edit"}V.opermode=H;if(c.recreateForm===true&&V.formEdit.detailFormCreated===true){V.formEdit.$detailFormDiv.remove()}var k=true;if(c.checkOnUpdate&&c.jqModal&&!c.modal){k=false}if(V.formEdit.detailFormCreated===true){j.themodal=V.formEdit.$detailFormDiv.attr("id");X=a(d).triggerHandler("jqGridAddEditBeforeInitData",[(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)),H]);if(X===undefined){X=true}if(X&&J){X=J.call(d,(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)))}if(X===false){return}a.proxy(a.jgrid.restoreInline,d)(b);a(".ui-jqdialog-title","#"+a.jgrid.jqID(j.modalhead)).html(c.caption);a("#"+V.formEdit.feedbackId,w).hide();if(rp_ge[d.p.id].topinfo){a(".topinfo",w).html(rp_ge[d.p.id].topinfo);a(".tinfo",w).show()}else{a(".tinfo",w).hide()}if(rp_ge[d.p.id].bottominfo){a(".bottominfo",w+"_2").html(rp_ge[d.p.id].bottominfo);a(".binfo",w+"_2").show()}else{a(".binfo",w+"_2").hide()}a.proxy(a.jgrid.fillData,d)(b,d,y,H);if(b=="_empty"||!rp_ge[d.p.id].viewPagerButtons){a("#pData, #nData",w+"_2").hide()}else{a("#pData, #nData",w+"_2").show()}if(rp_ge[d.p.id].processing===true){rp_ge[d.p.id].processing=false;a("#sData",w+"_2").removeClass("ui-state-active")}if((V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)).data("disabled")===true){a(".confirm","#"+a.jgrid.jqID(j.themodal)).hide();(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)).data("disabled",false)}a(d).triggerHandler("jqGridAddEditBeforeShowForm",[(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)),H]);if(D){D.call(d,(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)))}a("#"+a.jgrid.jqID(j.themodal)).data("onClose",rp_ge[d.p.id].onClose);a.jgrid.viewModal("#"+a.jgrid.jqID(j.themodal),{gbox:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,jqM:false,overlay:c.overlay,modal:c.modal});if(!k){a(".jqmOverlay").click(function(){if(!a.proxy(a.jgrid.checkUpdates,d)(N)){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,onClose:rp_ge[d.p.id].onClose});return false})}a(d).triggerHandler("jqGridAddEditAfterShowForm",[(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)),H]);if(K){K.call(d,(V.formEdit.$detailForm?V.formEdit.$detailForm:a("#"+y)))}}else{var q=isNaN(c.dataheight)?c.dataheight:c.dataheight+"px",g=isNaN(c.datawidth)?c.datawidth:c.datawidth+"px",Q=a(jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.detailForm.form",y,q)).data("disabled",false),z=a(jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.detailForm.body",S)),X=a(d).triggerHandler("jqGridAddEditBeforeInitData",[a("#"+y),H]);if(typeof(X)=="undefined"){X=true}if(X&&J){X=J.call(d,a("#"+y))}if(X===false){return}a.proxy(a.jgrid.restoreInline,d)(b);a(d.p.colModel).each(function(){var Z=this.formoptions;I=Math.max(I,Z?Z.colpos||0:0);p=Math.max(p,Z?Z.rowpos||0:0)});a(Q).append(z);flr=a(jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.detailForm.errorFeedback",V.formEdit.feedbackId));flr[0].rp=0;a(z).append(flr);flr=a("<div class='tinfo' style='display:none'><span class='topinfo'>"+rp_ge[d.p.id].topinfo+"</span></div>");flr[0].rp=0;a(z).append(flr);var e=d.p.direction=="rtl"?true:false,P=e?"nData":"pData",R=e?"pData":"nData";if(V.formEdit.$detailForm===undefined){V.formEdit.$detailForm=z.parent();a.proxy(a.jgrid.createData,d)(b,d,z,I)}else{V.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='"+d.p.id+"_id' value='"+b+"'/></span></div>"))}Q=V.formEdit.$detailForm[0];a.proxy(a.jgrid.fillData,d)(b,d);var l="<a href='javascript:void(0)' id='"+P+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",m="<a href='javascript:void(0)' id='"+R+"' 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='sData' class='fm-button ui-state-default ui-corner-all'>"+c.bSubmit+"</a>",t="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+c.bCancel+"</a>";var M="<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+S+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(e?m+l:l+m)+"</td><td class='EditButton'>"+h+t+"</td></tr>";M+="<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+rp_ge[d.p.id].bottominfo+"</td></tr>";M+="</tbody></table>";if(V.formEdit.ownFormEdit===false){if(p>0){for(var T=1;T<=I;T++){var W=z.find("#col_"+parseInt((parseInt(T,10)||1)*2,10));var x=[];a.each(W.find("div"),function(Z,aa){x[Z]=aa});x.sort(function(aa,Z){if(aa.rp>Z.rp){return 1}if(aa.rp<Z.rp){return -1}return 0});a.each(x,function(Z,aa){W.append(aa)})}}}c.gbox="#gbox_"+a.jgrid.jqID(B);var n=false;if(c.closeOnEscape===true){c.closeOnEscape=false;n=true}var f=v.rup_table("createDetailNavigation"),L;function u(){E={};N={};a("#"+V.formEdit.feedbackId,w).hide();a.proxy(a.jgrid.getFormData,d)(E);if(E[d.p.id+"_id"]=="_empty"){a.proxy(a.jgrid.postIt,d)(E,N,V.opermode)}else{if(c.checkOnSubmit===true){F=a.extend({},E,N);A=compareData(F,rp_ge[d.p.id]._savedData);if(A){a("#"+y).data("disabled",true);a(".confirm","#"+a.jgrid.jqID(j.themodal)).show()}else{a.proxy(a.jgrid.postIt,d)(E,N,V.opermode)}}else{a.proxy(a.jgrid.postIt,d)(E,N,V.opermode)}}return false}function U(){v.data("tmp.formEditSaveType","SAVE");if(!u()){return false}}function Y(){v.data("tmp.formEditSaveType","SAVE_REPEAT");if(!u()){return false}}function G(){if(!a.proxy(a.jgrid.checkUpdates,d)(N,function(){a.jgrid.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,onClose:rp_ge[d.p.id].onClose})})){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,onClose:rp_ge[d.p.id].onClose});return false}if(V.formEdit.ownFormEdit===true){if(!V.formEdit.$detailFormDiv.is(":visible")){V.formEdit.$detailFormDiv.show()}V.formEdit.$detailFormDiv.rup_dialog({type:a.rup.dialog.DIV,autoOpen:false,modal:true,resizable:c.resize,title:c.caption,width:c.width});V.formEdit.detailFormCreated=true;V.formEdit.$navigationBar.append(f);if(V.formEdit.$saveButton.length>0){V.formEdit.$saveButton.button().click(function(){jQuery.proxy(U,v)()})}if(V.formEdit.$saveRepeatButton.length>0){V.formEdit.$saveRepeatButton.button().click(function(){jQuery.proxy(Y,v)()})}if(V.formEdit.$cancelLink.length>0){V.formEdit.$cancelLink.on("click",function(){jQuery.proxy(G,v)()})}if(!jQuery.isFunction(c.onClose)){c.onClose=G}jQuery(".ui-dialog-titlebar-close, a:has(#closeText_"+V.formEdit.$detailFormDiv.first()[0].id+")",V.formEdit.$detailFormDiv.parent()).off("click").on("click",function(Z){c.onClose.call(Z)});j.themodal=V.formEdit.$detailFormDiv.attr("id")}else{var L=f.after(Q);var C={text:a.rup.i18nParse(a.rup.i18n.base,"rup_global.save"),click:U};var r={text:a.rup.i18nParse(a.rup.i18n.base,"rup_global.save_repeat"),click:Y};var s={text:a.rup.i18nParse(a.rup.i18n.base,"rup_global.cancel"),btnType:a.rup.dialog.LINK,click:G};c.buttons=[C,r,s];c.onClose=G;a.jgrid.createModal(j,L,c,"#gview_"+a.jgrid.jqID(d.p.id),a("#gbox_"+a.jgrid.jqID(d.p.id))[0]);V.formEdit.detailFormCreated=true}if(V.formEdit.$detailFormDiv===undefined){V.formEdit.$detailFormDiv=a("#"+a.jgrid.jqID(j.themodal))}if(e){a("#pData, #nData",w+"_2").css("float","right");a(".EditButton",w+"_2").css("text-align","left")}if(rp_ge[d.p.id].topinfo){a(".tinfo",w).show()}if(rp_ge[d.p.id].bottominfo){a(".binfo",w+"_2").show()}L=null;M=null;a("#"+a.jgrid.jqID(j.themodal)).keydown(function(Z){var aa=Z.target;if(a("#"+y).data("disabled")===true){return false}if(rp_ge[d.p.id].savekey[0]===true&&Z.which==rp_ge[d.p.id].savekey[1]){if(aa.tagName!="TEXTAREA"){a("#sData",w+"_2").trigger("click");return false}}if(Z.which===27){if(!a.proxy(a.jgrid.checkUpdates,d)(N)){return false}if(n){a.jgrid.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:c.gbox,jqm:c.jqModal,onClose:rp_ge[d.p.id].onClose})}return false}if(rp_ge[d.p.id].navkeys[0]===true){if(a("#id_g",w).val()=="_empty"){return true}if(Z.which==rp_ge[d.p.id].navkeys[1]){a("#pData",w+"_2").trigger("click");return false}if(Z.which==rp_ge[d.p.id].navkeys[2]){a("#nData",w+"_2").trigger("click");return false}}});if(c.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span","#"+a.jgrid.jqID(j.themodal)).removeClass("jqmClose");a("a.ui-jqdialog-titlebar-close","#"+a.jgrid.jqID(j.themodal)).unbind("click").click(function(){if(!a.proxy(a.jgrid.checkUpdates,d)(N)){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,onClose:rp_ge[d.p.id].onClose});return false})}c.saveicon=a.extend([true,"left","ui-icon-disk"],c.saveicon);c.closeicon=a.extend([true,"left","ui-icon-close"],c.closeicon);if(c.saveicon[0]===true){a("#sData",w+"_2").addClass(c.saveicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.saveicon[2]+"'></span>")}if(c.closeicon[0]===true){a("#cData",w+"_2").addClass(c.closeicon[1]=="right"?"fm-button-icon-right":"fm-button-icon-left").append("<span class='ui-icon "+c.closeicon[2]+"'></span>")}a(d).triggerHandler("jqGridAddEditInitializeForm",[V.formEdit.$detailForm,H]);if(o){o.call(d,V.formEdit.$detailForm)}if(b=="_empty"||!rp_ge[d.p.id].viewPagerButtons){a("#pData,#nData",w+"_2").hide()}else{a("#pData,#nData",w+"_2").show()}a(d).triggerHandler("jqGridAddEditBeforeShowForm",[V.formEdit.$detailForm,H]);if(D){D.call(d,V.formEdit.$detailForm)}a("#"+a.jgrid.jqID(j.themodal)).data("onClose",rp_ge[d.p.id].onClose);a.jgrid.viewModal("#"+a.jgrid.jqID(j.themodal),{gbox:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,overlay:c.overlay,modal:c.modal});if(!k){a(".jqmOverlay").click(function(){if(!a.proxy(a.jgrid.checkUpdates,d)(N)){return false}a.jgrid.hideModal("#"+a.jgrid.jqID(j.themodal),{gb:"#gbox_"+a.jgrid.jqID(B),jqm:c.jqModal,onClose:rp_ge[d.p.id].onClose});return false})}a(d).triggerHandler("jqGridAddEditAfterShowForm",[V.formEdit.$detailForm,H]);if(K){K.call(d,V.formEdit.$detailForm)}a(".fm-button","#"+a.jgrid.jqID(j.themodal)).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}var O=a.proxy(a.jgrid.getCurrPos,d)();v.rup_table("updateDetailPagination");a.proxy(a.jgrid.updateNav,d)(O[0],O[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:true,defaultCompareData:true,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:{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 c=this;c.rup_table("preConfigureInlineEdit",b)},postConfiguration:function(b){var c=this;c.rup_table("postConfigureInlineEdit",b)}});jQuery.fn.rup_table("extend",{preConfigureInlineEdit:function(c){var e=a(this),d;c.editable=true;if(c.inlineEdit.addEditOptions.url===undefined){c.inlineEdit.addEditOptions.url=c.baseUrl}c.inlineEdit.deleteOptions.ajaxDelOptions=a.extend(true,c.inlineEdit.deleteOptions.ajaxDelOptions,{success:function(g,f,h){e.triggerHandler("rupTableAfterDelete",[g,f,h]);e.rup_table("showFeedback",c.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.deletedOK"),"ok")}});d=c.inlineEdit.beforeSend;c.inlineEdit.addEditOptions.restoreAfterError=false;c.inlineEdit.addEditOptions.errorfunc=function(h,j,f,g,l){var m;if(j.status===406&&j.responseText!==""){try{m=jQuery.parseJSON(j.responseText);if(m.rupErrorFields){e.rup_table("showServerValidationFieldErrors",c.inlineEdit.$inlineForm,m)}}catch(k){e.rup_table("showFeedback",c.$feedback,j.responseText,"error")}}};c.inlineEdit.addEditOptions.ajaxRowOptions.beforeSend=function(g,f){jQuery.extend(true,f,{validate:c.validate,beforeSend:(jQuery.isFunction(d)?d:null),feedback:c.$feedback});c.inlineEdit.$inlineForm.on("rupValidate_formValidationError.inlineEditing",function(h,j){e.off("rupValidate_formValidationError.inlineEditing");a("#lui_"+a.jgrid.jqID(c.id)).hide()});c.inlineEdit.$inlineForm.rup_form("ajaxSubmit",f);return false};c.inlineEdit.addOptions=a.extend(true,{},c.inlineEdit.addEditOptions,c.inlineEdit.addOptions);c.inlineEdit.editOptions=a.extend(true,{},c.inlineEdit.addEditOptions,c.inlineEdit.editOptions);c.multiboxonly=true;c.getRowForEditing=function(){var g=this,f=g.jqGrid("getGridParam","selrow");return(f===null?false:f)};c.core.operations={add:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.new"),icon:"rup-icon rup-icon-new",enabled:function(){var f=this;return jQuery("tr[editable='1']",f).length===0},callback:function(g,f){var h=this;h.rup_table("addRow")}},edit:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.modify"),icon:"rup-icon rup-icon-edit",enabled:function(){var h=this,f=h.jqGrid("getGridParam","selrow"),g;f=(f===null?false:f);f=f&&(f.indexOf("jqg")===-1);g=jQuery("tr[editable='1'].jqgrid-new-row",h).length===0;return f&&g},callback:function(g,f){e.rup_table("editRow",jQuery.proxy(c.getRowForEditing,e)())}},save:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.save"),icon:"rup-icon rup-icon-save",enabled:function(){var f=this;return jQuery("tr[editable='1']",f).length>0},callback:function(g,f){e.rup_table("saveRow")}},clone:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.clone"),icon:"rup-icon rup-icon-clone",enabled:function(){var h=this,f=h.jqGrid("getGridParam","selrow"),g;f=(f===null?false:f);f=f&&(f.indexOf("jqg")===-1);g=jQuery("tr[editable='1'].jqgrid-new-row",h).length===0;return f&&g},callback:function(g,f){if(jQuery("tr[editable='1']",e).length>0){e.rup_table("restoreRow")}e.rup_table("cloneRow")}},cancel:{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.cancel"),icon:"rup-icon rup-icon-cancel",enabled:function(){var f=this;return jQuery("tr[editable='1']",f).length>0},callback:function(g,f){e.rup_table("restoreRow")}},"delete":{name:a.rup.i18nParse(a.rup.i18n.base,"rup_table.delete"),icon:"rup-icon rup-icon-delete",enabled:function(){var g=this,f=g.jqGrid("getGridParam","selrow");f=(f===null?false:f);return jQuery("tr[editable='1']",g).length>0||f},callback:function(g,f){e.rup_table("deleteRow")}}};e.on({"jqGridInlineErrorSaveRow.rupTable.inlineEditing":function(g,f,h){jQuery(e.getInd(f,true)).attr("id",c.inlineEditingRow);e.rup_table("setSelection",c.inlineEditingRow)},"jqGridInlineAfterSaveRow.rupTable.inlineEditing":function(k,j,h,g,f){jQuery("#"+jQuery.jgrid.jqID(j)+".jqgrid-new-row",e).removeClass("jqgrid-new-row");if(f.oper==="edit"){e.rup_table("showFeedback",c.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.modifyOK"),"ok")}else{e.rup_table("showFeedback",c.$feedback,a.rup.i18nParse(a.rup.i18n.base,"rup_table.insertOK"),"ok")}},"jqGridInlineEditRow.rupTable.inlineEditing":function b(f,j){var t=this,q=a(t),k=q.data("settings"),o=t.p.colModel,h=q.jqGrid("getInd",j,true),s,m,r,g;a("td[role='gridcell']",h).each(function(u){s=o[u];if(s.editable===true){m=s.name;g=a("[name='"+m+"']",h);g.attr({title:t.p.colNames[u],"class":"editable customelement"});if(s.rupType!==undefined){r=s.editoptions;switch(s.rupType){case"combo":r=a.extend({menuWidth:g.width()},r,{width:"100%"});break}g["rup_"+s.rupType](r);switch(s.rupType){case"date":g.css("width","88%");break}}}});k.inlineEditingRow=j;function n(v,u){q.on("jqGridInlineAfterSaveRow.inlineEditing.addNextRow",function(w){q.rup_table("addRow");jQuery(q.getInd(q[0].p.selrow,true)).find(":not([readonly]):focusable:first").focus();q.off("jqGridInlineAfterSaveRow.inlineEditing.addNextRow")});q.rup_table("saveRow",v);return true}function p(A,u){var v,B,x,z,y,w;v=q.getDataIDs();B=q.getInd(A)-1;x=parseInt(q.rup_table("getGridParam","rowNum"),10);if(B===x-1){z=parseInt(q.rup_table("getGridParam","page"),10);y=parseInt(Math.ceil(q.rup_table("getGridParam","records")/q.rup_table("getGridParam","rowNum")),10);if(z<y){q.trigger("reloadGrid",[{page:z+1}]);q.on("jqGridAfterLoadComplete.rupTable.inlineEdit",function(C,D){v=q.getDataIDs();q.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(E,F){if(u===undefined||u===-1){w=jQuery(q.jqGrid("getInd",F,true)).find("td :not([readonly]):focusable:first")}else{w=jQuery(q.jqGrid("getInd",F,true)).find("td:eq("+u+") :not([readonly]):focusable:first")}w.trigger("focus");q.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(q.getInd(v[0],true)).trigger("click");q.off("jqGridAfterLoadComplete.rupTable.inlineEdit")});return false}}else{q.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(C,D){if(u===undefined||u===-1){w=jQuery(q.jqGrid("getInd",D,true)).find("td :not([readonly]):focusable:first")}else{w=jQuery(q.jqGrid("getInd",D,true)).find("td:eq("+u+") :not([readonly]):focusable:first")}w.trigger("focus");q.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(q.getInd(v[B+1],true)).trigger("click");return false}return true}function l(y,u){var v,z,x,w;v=q.getDataIDs();z=q.getInd(y)-1;if(z===0){x=parseInt(q.rup_table("getGridParam","page"),10);if(x>1){q.trigger("reloadGrid",[{page:x-1}]);q.on("jqGridAfterLoadComplete.rupTable.inlineEdit",function(A,B){v=q.getDataIDs();q.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(C,D){if(u===undefined||u===-1){w=jQuery(q.jqGrid("getInd",D,true)).find("td :not([readonly]):focusable:last")}else{w=jQuery(q.jqGrid("getInd",D,true)).find("td:eq("+u+") :not([readonly]):focusable:last")}w.trigger("focus");q.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(q.getInd(v[v.length-1],true)).trigger("click");q.off("jqGridAfterLoadComplete.rupTable.inlineEdit")});return false}}else{q.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(A,B){if(u===undefined||u===-1){w=jQuery(q.jqGrid("getInd",B,true)).find("td :not([readonly]):focusable:last")}else{w=jQuery(q.jqGrid("getInd",B,true)).find("td:eq("+u+") :not([readonly]):focusable:last")}w.trigger("focus");q.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(q.getInd(v[z-1],true)).trigger("click");return false}}q.data("initialFormData",k.inlineEdit.$inlineForm.rup_form("formSerialize"));jQuery(h).on({keydown:function(v){if(v.keyCode===27){q.jqGrid("restoreRow",a(this).attr("id"),k.afterrestorefunc);return false}if(v.keyCode===13){var u=v.target;if(u.tagName=="TEXTAREA"){return true}q.rup_table("saveRow");return false}}});jQuery("td",jQuery(h)).on({keydown:function(w){var v,u;if(w.keyCode===38){u=a.map(q.rup_table("getColModel"),function(y,x){return y.name});v=jQuery.inArray(a(this).attr("aria-describedby").split(k.id+"_")[1],u);l(a(h).attr("id"),v);return false}if(w.keyCode===40){u=a.map(q.rup_table("getColModel"),function(y,x){return y.name});v=jQuery.inArray(a(this).attr("aria-describedby").split(k.id+"_")[1],u);p(a(h).attr("id"),v);return false}}});jQuery("input,select",jQuery(h)).on({focus:function(u){}});jQuery("input, textarea, select,a.rup_combo",jQuery(h)).filter(".editable:visible:last").on({keydown:function(u){if(u.keyCode==9&&!u.shiftKey){if(jQuery(h).attr("id").indexOf("jqg")!==-1){if(n(jQuery(h).attr("id"))===false){return false}}else{if(p(jQuery(h).attr("id"))===false){return false}}}}});jQuery("input, textarea, select,a.rup_combo",jQuery(h)).filter(".editable:visible:first").on({keydown:function(v){var u,x,w;if(v.keyCode==9){if(v.shiftKey){u=q.getDataIDs();x=q.getInd(j)-1;if(x===0){w=parseInt(q.rup_table("getGridParam","page"),10);if(w>1){q.trigger("reloadGrid",[{page:w-1}]);q.on("jqGridAfterLoadComplete.rupTable.inlineEdit",function(y,z){u=q.getDataIDs();q.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(A,B){jQuery(q.jqGrid("getInd",B,true)).find("td :focusable:last").trigger("focus");q.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(q.getInd(u[u.length-1],true)).trigger("click");q.off("jqGridAfterLoadComplete.rupTable.inlineEdit")});return false}}else{q.on("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected",function(y,z){jQuery(q.jqGrid("getInd",z,true)).find("td :focusable:last").trigger("focus");q.off("jqGridInlineEditRow.rupTable.inlineEditing.tabKeyNav.cellSelected")});jQuery(q.getInd(u[x-1],true)).trigger("click");return false}}}}})},"jqGridDblClickRow.rupTable.inlineEdit":function(g,j,f,h){if(!c.inlineEdit.autoEditRow){e.rup_table("editRow",j)}else{return false}},"jqGridBeforeSelectRow.rupTable.inlineEditing":function(k,j,l){var m=a(this),h=m.data("settings"),f=a("tr[editable=1]",m);if(f.length>0&&(h.inlineEditingRow!==undefined&&h.inlineEditingRow!==j)){if(m.data("initialFormData")!==h.inlineEdit.$inlineForm.rup_form("formSerialize")){m.on("jqGridInlineSuccessSaveRow.inlineEditing_beforeSelectRow",function(n){m.rup_table("setSelection",j);m.off("jqGridInlineSuccessSaveRow.inlineEditing_beforeSelectRow")});for(var g=0;g<f.length;g++){m.rup_table("saveRow",f[0].id)}return false}}return true},"jqGridSelectRow.rupTable.inlineEditing":function(j,h,f,k){var l=a(this),g;g=a("tr[editable=1]",l);if(g.length>0){jQuery.each(a("tr[editable=1]",l),function(m,n){if(a(n).attr("id")!==h){l.jqGrid("restoreRow",a(n).attr("id"))}})}if(c.inlineEdit.autoEditRow){l.rup_table("editRow",h)}},"rupTable_checkOutOfGrid.rupTable.inlineEditing":function(j,f){var k=a(this),h=k.data("settings"),g=h.core.operations.save;if(jQuery.proxy(g.enabled,k)()){jQuery.proxy(g.callback,k)(k,j)}}});if(c.inlineEdit.autoEditRow){e.on({"jqGridCellSelect.rupTable.inlineEditing":function(h,g,f,j,k){var l=a(this);if(f!==-1){l.on("jqGridInlineEditRow.rupTable.inlineEditing.cellSelected",function(m,n){jQuery(l.jqGrid("getInd",g,true)).find("td:eq("+f+") :focusable:first").trigger("focus");l.off("jqGridInlineEditRow.rupTable.inlineEditing.cellSelected")})}}})}},postConfigureInlineEdit:function(b){var e=this,d="inlineForm_"+b.id,c=a("<form>").attr({id:"inlineForm_"+b.id});e.wrap(c);b.inlineEdit.$inlineForm=a("#"+d);b.inlineEdit.$inlineForm.on("rupValidate_formValidationError.inlineEditing",function(g,h){var f=e.jqGrid("getGridParam","selrow");jQuery(e.getInd(f,true)).attr("id",b.inlineEditingRow);e.rup_table("setSelection",b.inlineEditingRow)});e.on({"jqGridLoadComplete.rupTable.formEditing":function(h){var j=a(this),f=j.data("settings"),g;if(f.inlineEdit.autoselectFirstRecord){g=jQuery.proxy(jQuery.jgrid.getCurrPos,j[0])();j.rup_table("highlightRowAsSelected",jQuery(j.jqGrid("getInd",g[1][0],true)))}}})}});jQuery.fn.rup_table("extend",{addRow:function(c){var f=this,e=f.data("settings"),b=f[0].p.colModel;var g={addRowParams:a.extend({},e.inlineEdit.addOptions,c)};for(var d=0;d<b.length;d++){if(b[d].editable===true&&b[d].editableOnAdd!==false){if(b[d].editable===true&&b[d].editableOnAdd===false){if(b[d].editoptions===undefined){b[d].editoptions={}}b[d].editoptions.readonly="readonly"}else{if(b[d].editoptions!==undefined&&b[d].editoptions.readonly!==undefined){delete b[d].editoptions.readonly}}}}if(f.triggerHandler("rupTable_beforeAddRow",[g])!==false){f.jqGrid("addRow",a.extend({},g))}return f},cloneRow:function(b,k){var h=this,d=h.data("settings"),f=(b===undefined?h.jqGrid("getGridParam","selrow"):b),g=h[0].p.colModel,j,c;if(h.triggerHandler("rupTable_beforeCloneRow",[d,b])!==false){j=h.jqGrid("getRowData",f);h.rup_table("addRow");c=jQuery("tbody:first tr[id*='jqg']",h).attr("id");h.jqGrid("setRowData",c,j);jQuery(h.jqGrid("getInd",c,true)).attr("editable","0");for(var e=0;e<g.length;e++){if(g[e].editable===true&&g[e].editableOnAdd!==false){if(g[e].editable===true&&g[e].editableOnAdd===false){if(g[e].editoptions===undefined){g[e].editoptions={}}g[e].editoptions.readonly="readonly"}else{if(g[e].editoptions!==undefined&&g[e].editoptions.readonly!==undefined){delete g[e].editoptions.readonly}}}}h.rup_table("editRow",c,{},true)}},editRow:function(h,c,f){var j=this,e=j.data("settings"),g=(h===undefined?j.jqGrid("getGridParam","selrow"):h),b=j[0].p.colModel;if(f!==true){for(var d=0;d<b.length;d++){if(b[d].editable===true&&b[d].editableOnEdit===false){if(b[d].editoptions===undefined){b[d].editoptions={}}b[d].editoptions.readonly="readonly"}else{if(b[d].editoptions!==undefined&&b[d].editoptions.readonly!==undefined){delete b[d].editoptions.readonly}}}}if(j.triggerHandler("rupTable_beforeEditRow",[e.inlineEdit.editOptions,g])!==false){j.jqGrid("editRow",g,a.extend({},e.inlineEdit.editOptions,c))}return j},deleteRow:function(f,b){var g=this,c=g.data("settings"),e=jQuery.extend(true,{},c.inlineEdit.deleteOptions,b),d=(f===undefined?g.rup_table("getSelectedRows"):f);if(d.length===1){if(e.mtype==="DELETE"){e.url=c.baseUrl+"/"+g.rup_table("getPkUrl",d)}}else{e.mtype="POST";e.ajaxDelOptions.contentType="application/json";e.ajaxDelOptions.type="POST";e.ajaxDelOptions.dataType="json";e.url=c.baseUrl+"/deleteAll";e.serializeDelData=function(j,h){return jQuery.toJSON({core:{pkToken:c.multiplePkToken,pkNames:c.primaryKey},multiselection:g.rup_table("getSelectedIds")})}}e.afterSubmit=function(){g.triggerHandler("rupTable_deleteAfterSubmit");return true};if(g.triggerHandler("rupTable_beforeDeleteRow",[e,d])!==false){g.jqGrid("delGridRow",d,e)}return g},saveRow:function(e,b){var f=this,c=f.data("settings"),d=(e===undefined?f.jqGrid("getGridParam","selrow"):e);if(d.indexOf("jqg")!==-1){f[0].p.ajaxRowOptions=c.inlineEdit.addOptions.ajaxRowOptions;f.jqGrid("saveRow",d,c.inlineEdit.addOptions)}else{f[0].p.ajaxRowOptions=c.inlineEdit.editOptions.ajaxRowOptions;f.jqGrid("saveRow",d,c.inlineEdit.editOptions)}return f},restoreRow:function(c){var d=this,b=(c===undefined?d.jqGrid("getGridParam","selrow"):c);d.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(c){var d=this;d.rup_table("preConfigureMultiselection",c)},postConfiguration:function(c){var d=this;if(c.multiselect===true){d.rup_table("postConfigureMultiselection",c)}}});jQuery.fn.rup_table("extend",{preConfigureMultiselection:function(c){var d=this;c.multiselect=true;c.multiselectWidth=40;c.core.operations.clone.enabled=function(){return c.multiselection.numSelected===1};c.getActiveLineId=function(){var f=this,e=f.data("settings"),g=jQuery.proxy(jQuery.jgrid.getCurrPos,f[0])();return jQuery.inArray(e.multiselection.rowForEditing,g[1])};c.getActiveRowId=function(){var f=this,e=f.data("settings");return e.multiselection.rowForEditing};c.getSelectedRows=function(){var f=this,e=f.data("settings");if(e.multiselection.selectedAll!==true){return e.multiselection.selectedIds}else{return e.multiselection.deselectedIds}};c.getSelectedLines=function(){var g=this,e=g.data("settings"),f=parseInt(g.rup_table("getGridParam","page"),10);if(e.multiselection.selectedAll!==true){return e.multiselection.selectedLinesPerPage[f]}else{return e.multiselection.deselectedLinesPerPage[f]}};d.on({"rupTable_serializeGridData.multiselection":function(h,e){var g={},f;function j(k){return k.rows+k.sidx+k.sord+k.filter!==undefined?jQuery.param(jQuery.extend({},k.filter,{rows:k.rows,sidx:k.sidx,sord:k.sord})):""}f=d.data("tmp.lastSearch");if(f!==undefined&&f!==j(e)){if(c&&c.multiselection&&c.multiselection.numSelected>0){g=d.rup_table("getSelectedIds");jQuery.extend(true,e,{multiselection:g})}}d.data("tmp.lastSearch",j(e))},"rupTable_setSelection.multiselection":function(g,k,e,h){var j=parseInt(d.rup_table("getGridParam","page"),10);if(jQuery.isArray(k)){for(var f=0;f<k.length;f++){d._processSelectedRow(c,k[f],e)}}else{d._processSelectedRow(c,k,e)}if(h===true){d.on("rupTable_serializeGridData.multiselection.reorderSelection",function(m,l){d.off("rupTable_serializeGridData.multiselection.reorderSelection");jQuery.extend(true,l,{multiselection:d.rup_table("getSelectedIds")})})}d.triggerHandler("rupTable_multiselectionUpdated");d.triggerHandler("jqGridSelectRow.rupTable.multiselection",[k,e]);return false}})},postConfigureMultiselection:function(c){var e=this;e._initializeMultiselectionProps(c);c.$selectAllCheck=jQuery("#cb_"+c.id);c.fncHasSelectedElements=function(){return c.multiselection.numSelected>0};c.getRowForEditing=function(){var l=this,g=l.data("settings"),k=parseInt(l.rup_table("getGridParam","page"),10),h=jQuery.proxy(jQuery.jgrid.getCurrPos,l[0])(),f,j;if(l._hasPageSelectedElements(k)){if(g.multiselection.rowForEditing!==undefined){return g.multiselection.rowForEditing}f=l._getSelectedLinesOfPage(k)[0];return h[1][f-1]}else{j=jQuery.proxy(g.fncGetNavigationParams,l)("first");execute=j[1];newPage=j[5];newPageIndex=j[6];if(execute){l.trigger("reloadGrid",[{page:newPage}]);l.on("jqGridAfterLoadComplete.multiselection.editRow",function(o,p){var n=jQuery.proxy(jQuery.jgrid.getCurrPos,l[0])(),m=l.getActiveRowId();l.jqGrid("editGridRow",m,g.editOptions);l.off("jqGridAfterLoadComplete.multiselection.editRow")})}return false}};c.getDetailTotalRowCount=function(){var g=this,f=g.data("settings");return f.multiselection.numSelected};c.getDetailCurrentRowCount=function(){var m=this,h=m.data("settings"),k=parseInt(m.rup_table("getGridParam","page"),10),n=jQuery.proxy(jQuery.jgrid.getCurrPos,m[0])(),g=parseInt(m.rup_table("getGridParam","rowNum"),10),l,f,o=0;if(!h.multiselection.selectedAll){l=jQuery.inArray(k,h.multiselection.selectedPages);f=h.multiselection.selectedPages[l];for(var j=1;j<f;j++){if(h.multiselection.selectedLinesPerPage[j]!==undefined){o+=h.multiselection.selectedLinesPerPage[j].length}}o+=jQuery.inArray(n[0]+1,h.multiselection.selectedLinesPerPage[f])+1}else{o=(k>1?((k-1)-h.multiselection.deselectedPages.length)*g:0);for(var j=0;j<h.multiselection.deselectedPages.length&&h.multiselection.deselectedPages[j]!==k;j++){o+=g-h.multiselection.deselectedLinesPerPage[h.multiselection.deselectedPages[j]].length}o+=jQuery.inArray(n[0]+1,m._getSelectedLinesOfPage(k))+1}return o};c.fncGetNavigationParams=function d(g){var s=this,l=s.data("settings"),r=false,t=false,o=0,k=0,f=jQuery.proxy(jQuery.jgrid.getCurrPos,s[0])(),p=parseInt(s.rup_table("getGridParam","page"),10),j=p,n=parseInt(Math.ceil(s.rup_table("getGridParam","records")/s.rup_table("getGridParam","rowNum")),10),h,q;f[0]=parseInt(f[0],10);b("#"+l.formEdit.feedbackId,l.formEdit.$detailForm).hide();switch(g){case"first":r=true;if(!l.multiselection.selectedAll){if(l.multiselection.selectedPages[0]!==p){t=true;j=l.multiselection.selectedPages[0]}}else{for(var m=1;m<=n;m++){if(s._hasPageSelectedElements(m)){if(m!==p){j=m;t=true}break}}}o=s._getFirstSelectedElementOfPage(j);k=o;break;case"prev":r=true;q=s._getSelectedLinesOfPage(p);h=jQuery.inArray(f[0]+1,q);if(h===0){t=true;for(var m=p-1;m>=0;m--){if(s._hasPageSelectedElements(m)){j=m;q=s._getSelectedLinesOfPage(m);o=q[q.length-1];break}}}else{o=q[h-1]}k=o;break;case"next":r=true;q=s._getSelectedLinesOfPage(p);h=jQuery.inArray(f[0]+1,q);if(h===q.length-1){t=true;for(var m=p+1;m<=n;m++){if(s._hasPageSelectedElements(m)){j=m;q=s._getSelectedLinesOfPage(m);o=q[0];break}}}else{o=q[h+1]}k=o;break;case"last":r=true;if(!l.multiselection.selectedAll){if(l.multiselection.selectedPages[l.multiselection.selectedPages.length-1]!==p){t=true;j=l.multiselection.selectedPages[l.multiselection.selectedPages.length-1]}}else{for(var m=n;m>0;m--){if(s._hasPageSelectedElements(m)){if(m!==p){j=m;t=true}break}}}q=s._getSelectedLinesOfPage(j);o=q[q.length-1];k=o}return[g,r,t,o-1,f,j,k-1]};c.doNavigation=function(r,o,q,m,g,k,j){var p=this,l=p.data("settings"),n=rp_ge[p.attr("id")],f,o,q,m,g,k,j,h;if(jQuery.isArray(r)){f=r[0];o=r[1];q=r[2];m=r[3];g=r[4];k=r[5];j=r[6];if(o){p.rup_table("hideFormErrors",l.formEdit.$detailForm);p.triggerHandler("jqGridAddEditClickPgButtons",[f,l.formEdit.$detailForm,g[1][g[m]]]);if(q){p.trigger("reloadGrid",[{page:k}]);p.on("jqGridAfterLoadComplete.pagination",function(u,v){var t=jQuery.proxy(jQuery.jgrid.getCurrPos,p[0])(),s=t[1][j];jQuery.proxy(jQuery.jgrid.fillData,p[0])(s,p[0],l.formEdit.$detailForm.attr("id"),l.opermode);jQuery.proxy(jQuery.jgrid.updateNav,p[0])();l.multiselection.rowForEditing=s;p.rup_table("clearHighlightedEditableRows");p.rup_table("highlightEditableRow",p.jqGrid("getInd",s,true));p.off("jqGridAfterLoadComplete.pagination")})}else{jQuery.proxy(jQuery.jgrid.fillData,p[0])(g[1][m],p[0],l.formEdit.$detailForm.attr("id"),l.opermode);jQuery.proxy(jQuery.jgrid.updateNav,p[0])();l.multiselection.rowForEditing=g[1][m];p.rup_table("clearHighlightedEditableRows");p.rup_table("highlightEditableRow",p.jqGrid("getInd",g[1][m],true))}p.triggerHandler("jqGridAddEditAfterClickPgButtons",[f,l.formEdit.$detailForm,g[1][g[m]]]);h=(n!==undefined?n.afterclickPgButtons:l.afterclickPgButtons);if(jQuery.isFunction(h)){n.fncAfterclickPgButtons.call(p,f,l.formEdit.$detailForm,g[1][g[m]])}}}};e.on({"jqGridSelectRow.rupTable.multiselection":function(g,h,o,q){var s,j,m,l,n,k,r,f;if(q!==false){if(q!==undefined&&jQuery(q.target).hasClass("treeclick")){return false}if(jQuery.rup.isCtrlPressed()===true||jQuery.rup.isShiftPressed()===true){window.getSelection().removeAllRanges()}if(!(jQuery.rup.isCtrlPressed()||jQuery.rup.isShiftPressed())&&(c.multiboxonly===true&&q!==undefined&&!(q.originalEvent!==undefined&&jQuery(q.originalEvent.target).is(":checkbox")&&jQuery(q.originalEvent.target).attr("id").indexOf("jqg_")!==-1))){e.rup_table("deselectRemainingRows")}if(jQuery.rup.isShiftPressed()===true){n=e.jqGrid("getInd",h,false);l=e.rup_table("getActiveLineId");if(l<n){k=n-1;r=l+1}else{k=l;r=n}f=e.jqGrid("getDataIDs");for(var p=r;p<k;p++){e._processSelectedRow(c,f[p],o);e.rup_table("highlightRowAsSelected",jQuery(e.jqGrid("getInd",f[p],true)))}}e._processSelectedRow(c,h,o);e.rup_table("updateSelectedRowNumber");c.$internalFeedback.rup_feedback("close");e.rup_table("clearHighlightedEditableRows");if(o){c.multiselection.rowForEditing=h;e.rup_table("highlightEditableRow",e.jqGrid("getInd",h,true))}else{s=parseInt(e.rup_table("getGridParam","page"),10);if(e._hasPageSelectedElements(s)){e.rup_table("highlightFirstEditableRow")}}}},"jqGridDblClickRow.rupTable.multiselection":function(h,g,k,f,j){e.rup_table("setSelection",g,true);e.rup_table("clearHighlightedEditableRows");e.rup_table("highlightEditableRow",e.jqGrid("getInd",g,true))},"jqGridGridComplete.rup_table.multiselection":function(g){var h=b(this),f=h.data("settings");if(h.rup_grid("getGridParam","records")===0){jQuery(jQuery("#cb_"+h.attr("id"),f.core.$tableDiv)[0]).attr("disabled","disabled")}else{jQuery(jQuery("#cb_"+h.attr("id"),f.core.$tableDiv)[0]).removeAttr("disabled")}},"jqGridLoadComplete.rupTable.multiselection":function(H,n){var r=e[0],h=r.p,k=e.rup_table("getGridParam","page"),D=e.rup_table("getGridParam","rowNum"),o,s=c.multiselection.selectedRowsPerPage[k],x=c.multiselection.deselectedRowsPerPage[k]||[],I,A,f,l,F,q,g,u,B,v,p,G,E;if(n.reorderedSelection!==undefined&&n.reorderedSelection!==null){e._initializeMultiselectionProps(c);c.multiselection.selectedAll=n.selectedAll;if(c.multiselection.selectedAll===true){F=c.multiselection.deselectedRowsPerPage;q=c.multiselection.deselectedLinesPerPage;g=c.multiselection.deselectedIds;u=c.multiselection.deselectedRows;B=c.multiselection.deselectedPages;c.multiselection.numSelected=n.records-n.reorderedSelection.length}else{F=c.multiselection.selectedRowsPerPage;q=c.multiselection.selectedLinesPerPage;g=c.multiselection.selectedIds;u=c.multiselection.selectedRows;B=c.multiselection.selectedPages;c.multiselection.numSelected=n.reorderedSelection.length}for(var z=0;z<n.reorderedSelection.length;z++){I=n.reorderedSelection[z];A=I.page;f=I.pageLine;var t="";for(var w=0;w<c.primaryKey.length;w++){t+=I.pk[c.primaryKey[w]]+c.multiplePkToken}l=t.substr(0,t.length-1);if(F[A]===undefined){F[A]=[];q[A]=[]}if(jQuery.inArray(l,g)===-1){g.push(l);u.push({id:l,page:A});F[A].push(l);q[A].push(f);if(F[A].length>0&&jQuery.inArray(A,B)===-1){jQuery.rup_utils.insertSorted(B,A)}}}}e.triggerHandler("rupTable_multiselectionUpdated");c.$internalFeedback.rup_feedback("close");if(e._hasPageSelectedElements(k)){if(c.multiselection.rowForEditing!==undefined&&jQuery.inArray(c.multiselection.rowForEditing,e.jqGrid("getDataIDs"))!==-1){e.rup_table("highlightEditableRow",jQuery(e.jqGrid("getInd",c.multiselection.rowForEditing,true)),true)}else{e.rup_table("highlightFirstEditableRow")}}var y=jQuery("[id='"+c.id+"_cb']");if(c.multiselection.headerContextMenu_enabled&&y.find("a").length===0){y.find("input").css("margin-right","1em");e._addArrow(y.find("input"))}e.find(".cbox").css("margin-right","1em");if(c.multiselection.rowContextMenu_enabled){var m=c.jerarquia!==undefined?true:false,C=jQuery.isEmptyObject(c.multiselection.rowContextMenu.items);b.each(e.find(".cbox"),function(j,J){e._addArrow(jQuery(J));if(m&&C&&b(J).parents("tr").find(".treeclick").hasClass("tree-leaf")){jQuery(this).next("a").addClass("ui-state-disabled").off("click")}})}},"jqGridSelectAll.rupTable.multiselection":function(f,h,j){var l=e.rup_table("getGridParam","page"),m,q,g,p,o,n,r;e.triggerHandler("rupTable_internalFeedbackClose");r=0;for(var k=0;k<h.length;k++){if(h[k].indexOf(c.id+"ghead_")===-1){e._processSelectedRow(c,h[k],j);r++}}m=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_grid.selectMsg","<b>"+r+"</b>","<b>"+l+"</b>");q=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_grid.deselectMsg","<b>"+r+"</b>","<b>"+l+"</b>");if(j){g=e._getRemainingRecordNum(c,h);if(g!==0){p=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.selectRestMsg",g);o=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.multiselection.selectRemainingRecords",e[0].id,p,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.selectAll"));e.rup_table("showFeedback",c.$internalFeedback,m+o,"alert")}else{e.rup_table("showFeedback",c.$internalFeedback,m,"alert")}b("#rup_grid_"+e[0].id+"_selectAll").on("click",function(s){e.rup_table("selectRemainingRows")});e.rup_table("highlightFirstEditableRow")}else{e.rup_table("clearHighlightedEditableRows");if(c.multiselection.numSelected>0){p=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.deselectRestMsg",c.multiselection.numSelected);n=jQuery.rup.i18nTemplate(jQuery.rup.i18n.base,"rup_table.templates.multiselection.deselectRemainingRecords",e[0].id,p,jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.deSelectAll"));e.rup_table("showFeedback",c.$internalFeedback,q+n,"alert")}else{e.rup_table("showFeedback",c.$internalFeedback,q,"alert")}b("#rup_grid_"+e[0].id+"_deselectAll").on("click",function(s){e.rup_table("deselectRemainingRows")})}e.rup_table("updateSelectedRowNumber")},"rupTableAfterSearchNav.rupTable.multiselection rupTableSearchSuccess.rupTable.multiselection rupTableAfterDelete.rupTable.multiselection":function(){var f=b(this);f.rup_table("resetSelecion")},"rupTable_multiselectionUpdated.multiselection":function(){var m=b(this),o=m[0],j=m.rup_table("getGridParam","page"),g=m.data("settings"),k=o.p,l=m.rup_table("getGridParam","rowNum"),p,f=g.multiselection.selectedRowsPerPage[j],n=g.multiselection.deselectedRowsPerPage[j]||[];m.triggerHandler("rupTable_internalFeedbackClose");if(g.multiselection.selectedAll){k.selarrrow=[];p=o.rows;for(var h=0;h<p.length;h++){if(jQuery.inArray(p[h].id,n)===-1){m.rup_table("highlightRowAsSelected",b(p[h]))}else{m.rup_table("clearHighlightedRowAsSelected",b(p[h]))}}if(n.length===0){g.$selectAllCheck[k.useProp?"prop":"attr"]("checked",true)}}else{if(f){p=o.rows;k.selarrrow=[];for(var h=0;h<p.length;h++){if(jQuery.inArray(p[h].id,f)!==-1){m.rup_table("highlightRowAsSelected",b(p[h]))}else{m.rup_table("clearHighlightedRowAsSelected",b(p[h]))}}if(f.length===l){g.$selectAllCheck[k.useProp?"prop":"attr"]("checked",true)}}}m.rup_table("updateSelectedRowNumber")},"rupTable_beforeAddRow.multiselection":function(f,g){e._checkSelectedElements(function(){e.jqGrid("editGridRow","new",g);e.rup_table("resetSelecion");e.rup_table("clearHighlightedEditableRows")});return false},"jqGridAddEditAfterSubmit.rupTable.formEditing":function(h,g,f,j){if(j!=="edit"){e.rup_table("resetSelecion");e.rup_table("clearHighlightedEditableRows")}}});if(c.multiboxonly===true){c.multiselection.multiboxonly=true}jQuery("body").on({"rup_ctrlKeyDown rup_shiftKeyDown":function(){if(c.multiselection.multiboxonly===true){e[0].p.multiboxonly=false}return false},"rup_ctrlKeyUp rup_shiftKeyUp":function(){if(c.multiselection.multiboxonly===true){e[0].p.multiboxonly=true}return false}});jQuery.contextMenu("destroy","[id='"+c.id+"_cb']");jQuery("[id='"+c.id+"_cb']").rup_contextMenu({trigger:"none",callback:c.multiselection.headerContextMenu.callback,items:e._headerContextMenuItems(c.multiselection.headerContextMenu,c),position:function(g,f,j){var h=this.offset();g.$menu.css({top:h.top+this.height(),left:h.left})}});if(c.multiselection.rowContextMenu_enabled){jQuery.contextMenu("destroy","td[aria-describedby='"+c.id+"_cb']");jQuery("td[aria-describedby='"+c.id+"_cb']").rup_contextMenu({trigger:"none",callback:c.multiselection.rowContextMenu.callback,items:e._rowContextMenuItems(c.multiselection.rowContextMenu,c),position:function(g,f,j){var h=this.offset();g.$menu.css({top:h.top+this.height(),left:h.left})}})}}});jQuery.fn.rup_table("extend",{getSelectedIds:function(){var e=this,d=e.data("settings"),c={};if(!d.multiselection.selectedAll){if(d.multiselection.selectedIds!=undefined){if(d.multiselection.selectedIds.length>0){jQuery.extend(true,c,{selectedIds:d.multiselection.selectedIds})}}jQuery.extend(true,c,{selectedAll:false})}else{if(d.multiselection.deselectedIds.length>0){jQuery.extend(true,c,{selectedIds:d.multiselection.deselectedIds})}jQuery.extend(true,c,{selectedAll:true})}return c},clearHighlightedEditableRows:function(){var d=this,c=d.data("settings");d.find("td[aria-describedby='"+c.id+"_rupInfoCol'] span.ui-icon.ui-icon-pencil").removeClass("ui-icon-pencil")},highlightFirstEditableRow:function(){var g=this,c=g.data("settings"),e=parseInt(g.rup_table("getGridParam","page"),10),d,f;g.rup_table("clearHighlightedEditableRows");if(g._hasPageSelectedElements(e)){d=g._getFirstSelectedElementOfPage(e);f=g.jqGrid("getDataIDs")[d-1];c.multiselection.rowForEditing=f;g.rup_table("highlightEditableRow",g.jqGrid("getInd",f,true))}},highlightEditableRow:function(c){var e=this,d=e.data("settings");c=jQuery(c);c.find("td[aria-describedby='"+d.id+"_rupInfoCol'] span").addClass("ui-icon ui-icon-rupInfoCol ui-icon-pencil")},refreshSelection:function(){var c=this;c.triggerHandler("rupTable_multiselectionUpdated")},resetSelection:function(){var d=this,c=d.data("settings");d.jqGrid("resetSelection");d._initializeMultiselectionProps(c);d.triggerHandler("rupTable_multiselectionUpdated")},selectAllRows:function(g){var h=this,f=h.data("settings"),d,c;h.rup_table("selectRemainingRows");jQuery("#cb_"+f.id).attr("checked","checked");d=h.jqGrid("getDataIDs");for(var e=0;e<d.length;e++){c=jQuery(h.jqGrid("getInd",d[e],true));h.rup_table("highlightRowAsSelected",c)}h.rup_table("highlightFirstEditableRow")},selectRemainingRows:function(d){var e=this,c=e.data("settings");e._initializeMultiselectionProps(c);c.multiselection.selectedAll=true;c.multiselection.numSelected=e.rup_table("getGridParam","records");e.rup_table("updateSelectedRowNumber");c.$internalFeedback.rup_feedback("close")},deselectAllRows:function(h){var j=this,g=j.data("settings"),d,c,f=j[0].p;j.rup_table("deselectRemainingRows");j.rup_table("clearHighlightedEditableRows");jQuery("#cb_"+g.id).removeAttr("checked");d=j.jqGrid("getDataIDs");f.selarrrow=[];for(var e=0;e<d.length;e++){c=jQuery(j.jqGrid("getInd",d[e],true));j.rup_table("clearHighlightedRowAsSelected",c)}},deselectRemainingRows:function(d){var e=this,c=e.data("settings");e._initializeMultiselectionProps(c);e.rup_table("updateSelectedRowNumber");c.$internalFeedback.rup_feedback("close")},updateSelectedRowNumber:function(){var d=b(this),c=d.data("settings");b("div .ui-paging-selected",c.$pager).html(c.multiselection.numSelected+" "+jQuery.rup.i18nParse(jQuery.rup.i18n.base,"rup_grid.pager.selected"));d.triggerHandler("rupTableSelectedRowNumberUpdated")}});jQuery.fn.rup_table("extend",{_addArrow:function(c){jQuery(c).after(jQuery("<a />").attr("href","javascript:void(0)").addClass("ui-icon rup-jerarquia_checkmenu_arrow").on("click",function(d){b(this).parents("th, td").contextMenu()}))},_checkSelectedElements:function(f){var g=b(this),c=g[0],e=g.rup_table("getGridParam","page"),d=g.data("settings");if(d.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(){f.call()}})}else{f.call()}},_headerContextMenuItems:function(d,e){var f=this,c={};if(d.selectAllPage){jQuery.extend(c,{selectAllPage:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.selectAllPage"),icon:"check",disabled:function(h,g){return f._getSelectedLinesOfPage(parseInt(f.rup_table("getGridParam","page"))).length===f.jqGrid("getGridParam","reccount")},callback:function(h,g){b("[id='cb_"+e.id+"']").attr("checked","checked").click().attr("checked","checked")}}})}if(d.deselectAllPage){jQuery.extend(c,{deselectAllPage:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.deselectAllPage"),icon:"uncheck",disabled:function(h,g){return f._getSelectedLinesOfPage(parseInt(f.rup_table("getGridParam","page"))).length===0},callback:function(h,g){b("[id='cb_"+e.id+"']").removeAttr("checked").click().removeAttr("checked")}}})}if(d.separator){jQuery.extend(c,{separator:""})}if(d.selectAll){jQuery.extend(c,{selectAll:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.selectAll"),icon:"check_all",disabled:function(h,g){return e.multiselection.numSelected===f.rup_table("getGridParam","records")},callback:function(h,g){f.rup_table("selectAllRows")}}})}if(d.deselectAll){jQuery.extend(c,{deselectAll:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.multiselection.deselectAll"),icon:"uncheck_all",disabled:function(h,g){return e.multiselection.numSelected===0},callback:function(h,g){f.rup_table("deselectAllRows")}}})}if(!jQuery.isEmptyObject(d.items)){jQuery.extend(c,d.items)}return c},_rowContextMenuItems:function(d,e){var f=this,c={};if(e.jerarquia!==undefined&&e.jerarquia.contextMenu){if(d.selectChild){jQuery.extend(c,{selectChild:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.selectChild"),icon:"child",callback:function(h,g){f._getJerarquiaChildren(this,h,g)}}})}if(d.selectDescendent){jQuery.extend(c,{selectDescendent:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.selectDescendent"),icon:"descendent",callback:function(h,g){f._getJerarquiaChildren(this,h,g)}}})}if(d.separator){jQuery.extend(c,{separator:""})}if(d.deselectChild){jQuery.extend(c,{deselectChild:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.deselectChild"),icon:"uncheck",callback:function(h,g){f._getJerarquiaChildren(this,h,g)}}})}if(d.deselectDescendent){jQuery.extend(c,{deselectDescendent:{name:b.rup.i18nParse(b.rup.i18n.base,"rup_table.plugins.jerarquia.deselectDescendent"),icon:"uncheck",callback:function(h,g){f._getJerarquiaChildren(this,h,g)}}})}}if(!jQuery.isEmptyObject(d.items)){jQuery.extend(c,d.items)}return c},_refreshSelectedElements:function(j,k,m,d){var e,l,c,n,h;if(j.multiselection.selectedAll!==true){e=j.multiselection.selectedRowsPerPage;l=j.multiselection.selectedLinesPerPage;c=j.multiselection.selectedIds;n=j.multiselection.selectedRows;h=j.multiselection.selectedPages}else{e=j.multiselection.deselectedRowsPerPage;l=j.multiselection.deselectedLinesPerPage;c=j.multiselection.deselectedIds;n=j.multiselection.deselectedRows;h=j.multiselection.deselectedPages;k=!k}if(k){if(jQuery.inArray(m,c)===-1){if(j.multiselection.selectedAll!==true){j.multiselection.numSelected++}else{j.multiselection.numSelected--}if(e[d.page]===undefined){e[d.page]=[];l[d.page]=[]}c.push(m);jQuery.rup_utils.insertSorted(l[d.page],d.pageLine);n.push({id:m,page:d.page});e[d.page].splice(d.pageLine,0,m);if(e[d.page].length>0&&jQuery.inArray(d.page,h)===-1){jQuery.rup_utils.insertSorted(h,d.page)}}}else{if(jQuery.inArray(m,c)!==-1){if(j.multiselection.selectedAll!==true){j.multiselection.numSelected--}else{j.multiselection.numSelected++}c.splice(jQuery.inArray(m,c),1);l[d.page].splice(jQuery.inArray(d.pageLine,l[d.page]),1);var g=JSON.stringify({id:m,page:d.page}),f=null;jQuery.grep(n,function(p,o){if(JSON.stringify(p)===g){f=o}});n.splice(f,1);e[d.page].splice(jQuery.inArray(m,e[d.page]),1);if(e[d.page].length==0&&jQuery.inArray(d.page,h)!==-1){h.splice(jQuery.inArray(d.page,h),1)}}}},_hasPageSelectedElements:function(c){var g=this,d=g.data("settings"),e,f=(typeof c==="string"?parseInt(c,10):c);if(!d.multiselection.selectedAll){return(jQuery.inArray(f,d.multiselection.selectedPages)!==-1)}else{e=parseInt(g.rup_table("getGridParam","rowNum"),10);if(jQuery.inArray(f,d.multiselection.deselectedPages)!==-1&&d.multiselection.deselectedLinesPerPage[f].length===e){return false}return true}},_initializeMultiselectionProps:function(c){if(c.multiselection===undefined){c.multiselection={}}c.multiselection.selectedAll=false;c.multiselection.numSelected=0;c.multiselection.selectedRowsPerPage=[];c.multiselection.selectedLinesPerPage=[];c.multiselection.selectedRows=[];c.multiselection.selectedIds=[];c.multiselection.selectedPages=[];c.multiselection.deselectedRowsPerPage=[];c.multiselection.deselectedLinesPerPage=[];c.multiselection.deselectedRows=[];c.multiselection.deselectedIds=[];c.multiselection.deselectedPages=[]},_getFirstSelectedElementOfPage:function(c){var h=this,e=h.data("settings"),f,g=(typeof c==="string"?parseInt(c,10):c);if(!e.multiselection.selectedAll){if(jQuery.inArray(g,e.multiselection.selectedPages)===-1){return false}return e.multiselection.selectedLinesPerPage[g][0]}else{if(jQuery.inArray(g,e.multiselection.deselectedPages)===-1){return 1}f=parseInt(h.rup_table("getGridParam","rowNum"),10);if(e.multiselection.deselectedLinesPerPage[g].length===f){return false}for(var d=1;d<=f;d++){if(jQuery.inArray(d,e.multiselection.deselectedLinesPerPage[g])===-1){return d}}}},_getRemainingRecordNum:function(f,j){var k=this,h=k.rup_table("getGridParam","records"),e=k.rup_table("getGridParam","reccount"),g=j.length,c=f.multiselection.numSelected,d=((h-e)!==0)?h-e-(c-g):0;return d},_getSelectedLinesOfPage:function(j){var k=this,f=k.data("settings"),g,d,h,c=[];if(!f.multiselection.selectedAll){if(jQuery.inArray(j,f.multiselection.selectedPages)===-1){return[]}return f.multiselection.selectedLinesPerPage[j]}else{g=parseInt(k.rup_table("getGridParam","rowNum"),10);d=k.rup_table("getGridParam","records");h=parseInt(Math.ceil(d/g,10));if(j===h){g=d-((h-1)*g)}for(var e=1;e<=g;e++){c[e-1]=e}if(jQuery.inArray(j,f.multiselection.deselectedPages)===-1){return c}if(f.multiselection.deselectedLinesPerPage[j].length===g){return[]}return jQuery.grep(c,function(l){return(jQuery.inArray(l,f.multiselection.deselectedLinesPerPage[j])===-1)})}},_processSelectedRow:function(e,d,f){var l=this,h=l.rup_table("getGridParam","page"),j=parseInt(h),m,c,k,g;if(f){if(e.multiselection.selectedAll){c=jQuery.inArray(d,e.multiselection.deselectedIds);if(c!=-1){e.multiselection.deselectedIds.splice(c,1);e.multiselection.deselectedRows.splice(c,1);k=jQuery.inArray(d,e.multiselection.deselectedRowsPerPage[h]);e.multiselection.deselectedRowsPerPage[h].splice(k,1);e.multiselection.deselectedLinesPerPage[h].splice(k,1);if(e.multiselection.deselectedRowsPerPage[h].length===0){g=jQuery.inArray(j,e.multiselection.deselectedPages);if(g!==-1){e.multiselection.deselectedPages.splice(g,1)}}e.multiselection.numSelected++}}else{if(e.multiselection.selectedRowsPerPage[h]===undefined){e.multiselection.selectedRowsPerPage[h]=[];e.multiselection.selectedLinesPerPage[h]=[]}if(jQuery.inArray(d,e.multiselection.selectedIds)===-1){e.multiselection.selectedIds.push(d);e.multiselection.selectedRows.push({id:d,page:h});m=jQuery.rup_utils.insertSorted(e.multiselection.selectedLinesPerPage[h],l._getLineIndex(d));e.multiselection.selectedRowsPerPage[h].splice(m,0,d);if(e.multiselection.selectedRowsPerPage[h].length>0&&jQuery.inArray(j,e.multiselection.selectedPages)===-1){jQuery.rup_utils.insertSorted(e.multiselection.selectedPages,j)}e.multiselection.numSelected++}}}else{if(e.multiselection.selectedAll){if(e.multiselection.deselectedRowsPerPage[h]===undefined){e.multiselection.deselectedRowsPerPage[h]=[];e.multiselection.deselectedLinesPerPage[h]=[]}if(jQuery.inArray(d,e.multiselection.deselectedIds)===-1){e.multiselection.deselectedIds.push(d);e.multiselection.deselectedRows.push({id:d,page:h});m=jQuery.rup_utils.insertSorted(e.multiselection.deselectedLinesPerPage[h],l._getLineIndex(d));e.multiselection.deselectedRowsPerPage[h].splice(m,0,d);if(e.multiselection.deselectedRowsPerPage[h].length>0&&jQuery.inArray(j,e.multiselection.deselectedPages)===-1){jQuery.rup_utils.insertSorted(e.multiselection.deselectedPages,j)}e.multiselection.numSelected--}}else{index=jQuery.inArray(d,e.multiselection.selectedIds);if(index!=-1){e.multiselection.selectedIds.splice(index,1);e.multiselection.selectedRows.splice(index,1);k=jQuery.inArray(d,e.multiselection.selectedRowsPerPage[h]);e.multiselection.selectedRowsPerPage[h].splice(k,1);e.multiselection.selectedLinesPerPage[h].splice(k,1);if(e.multiselection.selectedRowsPerPage[h].length===0){g=jQuery.inArray(j,e.multiselection.selectedPages);if(g!==-1){e.multiselection.selectedPages.splice(g,1)}}e.multiselection.numSelected--}}}l.rup_table("updateSelectedRowNumber")}});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(d,c){d.setRequestHeader("JQGridModel","true");d.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 c=this;return c.rup_table("preConfigurejerarquia",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigurejerarquia",b)}});a.fn.rup_table("extend",{preConfigurejerarquia:function(d){var e=this,b=d.jerarquia;e.jqGrid("setGridParam",{postData:{jerarquia:{}}});d.treeGrid=true;d.rowTotal=0;d.treeGridModel="adjacency";d.treeIcons=b.icons;var c=e.jqGrid.setTreeGrid;a.jgrid.extend({setTreeGrid:function(){c.call(e);e[0].p.altRows=true;e[0].p.pgbuttons=true;e[0].p.pginput=true;e[0].p.rowList=d.rowList;if(d.multiselect){e[0].p.multiselect=true}}});if(d.filter.childrenUrl===null){d.filter.childrenUrl=d.baseUrl+"Children"}d.ExpandColumn=b.column;if(d.multiselect){for(key in d.colModel){if(d.colModel[key].name===d.ExpandColumn){key=parseInt(key)+1;if(d.colModel[key]===undefined){d.colNames[key]="jerarquia_multiselect";d.colModel[key]={name:"jerarquia_multiselect",hidden:true}}d.ExpandColumn=d.colModel[key].name;break}}}d.colNames=a.merge(["level"],d.colNames);d.colModel=a.merge([{name:"level",hidden:true}],d.colModel);d.colNames=a.merge(["isLeaf"],d.colNames);d.colModel=a.merge([{name:"isLeaf",hidden:true}],d.colModel);d.colNames=a.merge(["parentNodes"],d.colNames);d.colModel=a.merge([{name:"parentNodes",hidden:true}],d.colModel);d.colNames=a.merge(["filter"],d.colNames);d.colModel=a.merge([{name:"filter",hidden:true}],d.colModel);a(e).data("tree",[]);e.on({"rupTable_serializeGridData.multiselection":function(g,f){a.extend(true,f,{jerarquia:{token:b.token}});if(a.isArray(f.jerarquia.tree)&&f.jerarquia.tree.length===0){f.jerarquia.tree=""}},"jqGridAddEditAfterComplete.rupTable.jerarquia":function(){e[0].p.treeGrid=false},"jqGridAddEditBeforeSubmit.rupTable.jerarquia jqGridBeforeRequest.rupTable.jerarquia":function(){e[0].p.treeGrid=true},"jqGridLoadComplete.rupTable.jerarquia":function(g,k){var n=a(e).data("tree"),o=n.length;for(var l=0;l<o;l++){a("[id='"+n[l]+"'] .tree-wrap > div").removeClass("tree-leaf "+d.treeIcons.leaf).addClass("tree-minus "+d.treeIcons.minus)}var p=e.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],e.rup_table("getGridParam","localReader").id),f=a("tr[id='"+h+"'] > td .tree-wrap");if(p[l].filter){f.prepend(m.clone())}if(b.parentNodesTooltip){f.parent().rup_tooltip({content:{text:e._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=e.rup_table("getGridParam","_index")[u.closest("tr.jqgrow")[0].id],r=e.rup_table("getGridParam","data")[s],t=a.jgrid.getAccessor(r,e.rup_table("getGridParam","localReader").id);if(u.hasClass(d.treeIcons.plus)){n.push(t)}else{n.splice(a.inArray(t,n),1)}a(e).data("tree",n);e.jqGrid("setGridParam",{postData:{jerarquia:{tree:n.toString()}}});e.trigger("reloadGrid")});e[0].p.treeGrid=false}});a.each(b.resetEvents,function(g,f){var k=a.isFunction(f[0])?f.shift():null,j="[id='"+f.join("'], [id='")+"']";a(j).on(g,function(l){if(k===null||k.call(e,l)===false){e.reset()}});for(var h=0;h<f.length;h++){a._data(a("#"+f[h])[0],"events")[g]=a._data(a("#"+f[h])[0],"events")[g].reverse()}});d.multiselection.rowContextMenu_enabled=d.jerarquia.contextMenu},postConfigurejerarquia:function(c){var d=this,b=c.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(c){var e=this.data("settings")["jerarquia"]["parentNodesTooltipFnc"],b=c.split(this.data("settings")["jerarquia"]["token"]).slice(1);if(e===null){var g="",f="&nbsp;&nbsp;";for(var d=0;d<b.length;d++){if(d!==(b.length-1)){g+=b[d]+"<br/>"+f+"└&nbsp;";f+="&nbsp;&nbsp;&nbsp;"}else{g+="<b>"+b[d]+"</b>"}}return g}else{return e.call(this,b)}},_getJerarquiaChildren:function(c,f,e){var j=this,g=j.data("settings"),h=j.rup_table("getRowData",c.parent().attr("id")),b={jerarquia:{parentId:a.jgrid.getAccessor(h,g.primaryKeyCol),child:f.toLowerCase().indexOf("child")!=-1},filter:j.rup_table("getFilterParams")};a.extend(true,b,j.rup_table("getGridParam","postData"));var d=a.isArray(g.primaryKey)?g.primaryKey[0]:g.primaryKey;a.rup_ajax({url:g.filter.childrenUrl,dataType:"json",data:a.toJSON(b),type:"POST",async:false,contentType:"application/json",beforeSend:function(k){k.setRequestHeader("JQGridModel",true);k.setRequestHeader("RUP",a.toJSON({primaryKey:d}))},success:function(q,m){var o=q.children,p=o.length,l=f.indexOf("deselect")!=-1?false:true;for(var n=0;n<p;n++){var k=o[n];rowPK=k.pk[d];j._refreshSelectedElements(g,l,rowPK,k)}j.triggerHandler("rupTable_multiselectionUpdated")},error:function(m,k,l){},complete:function(k,l){}})}});a.fn.rup_table.plugins.jerarquia={};a.fn.rup_table.plugins.jerarquia.defaults={treedatatype:"json",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 c=this;return c.rup_table("preConfigureMasterDetail",b)}});jQuery.fn.rup_table("extend",{preConfigureMasterDetail:function(b){var d=this,c;c=jQuery(b.masterDetail.master);b.masterDetail.$master=c;d.on({"rupTable_serializeGridData.rupTable.masterDetail":function(g,f){var e=d.rup_table("getMasterTablePkObject");if(e!==null){jsonParam={filter:e};jQuery.extend(true,f,jsonParam)}},"jqGridAddEditBeforeSubmit.rupTable.masterDetail":function(h,f,g){var e=d.rup_table("getMasterTablePkObject");if(e!==null){jQuery.extend(f,e)}},"rupTable_searchBeforeSubmit.rupTable.masterDetail":function(h,f,g){var e=d.rup_table("getMasterTablePkObject");if(e!==null){jsonParam={filter:e};jQuery.extend(true,g,jsonParam)}}});c.on({"jqGridSelectRow.rupTable.masterDetail":function(h,g,e){var f=d.data("tmp.masterDetail.lastRowid");if(f===undefined||f!==g){d.data("tmp.masterDetail.lastRowid",g);d.rup_table("showSearchCriteria");d.rup_table("filter")}},"jqGridAfterLoadComplete.multiselection.editRow":function(e,f){if(f.rows.length===0){d.removeData("tmp.masterDetail.lastRowid");d.jqGrid("clearGridData")}}})}});jQuery.fn.rup_table("extend",{getMasterTablePkObject:function(){var h=this,e=h.data("settings"),g=e.masterDetail.$master,j=g.rup_table("getSelectedRows"),k=e.masterDetail.masterPrimaryKey;function b(m,o){var n={};var l=m.split(".");if(l.length===1){n[m]=o;return n}else{n[l[0]]=b(m.substr(m.indexOf(".")+1),o);return n}}if(a.isArray(k)&&k.length>0&&(j.length===1)){var d=g.rup_table("getGridParam","multiplePkToken");var c=j[0].split(d);var f={};if(c.length===k.length){a.each(k,function(l,m){jQuery.extend(true,f,b(m,c[l]))})}return f}else{if(j.length===1){return b(k,j[0])}else{if(j.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(a){jQuery.rup_table.registerPlugin("report",{loadOrder:11,preConfiguration:function(b){var c=this;return c.rup_table("preConfigureReport",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureReport",b)}});jQuery.fn.rup_table("extend",{preConfigureReport:function(b){var c=this},postConfigureReport:function(e){var f=this,d=f.rup_table("getColModel"),b,c=e.report;b=f._getReportColumns(d,e);if(c.appendTo===undefined){c.appendTo=e.toolbar.id}jQuery.each(c.buttons[0].buttons,function(g,h){h.columns=a.extend(true,{},c.columns,h.columns);if(h.columns.grid===undefined){h.columns.grid=e.id}if(h.columns.customNames===undefined){h.columns.customNames=b}if(h.columns.click===undefined){h.columns.click=function(){}}});c.fncGetGridParam=function(){var k=this,g=k.data("settings"),h={},j={};jQuery.each(k.jqGrid("getGridParam","postData"),function(l,m){if(jQuery.inArray(l,g.report.sendPostDataParams)!==-1){h[l]=m}});if(g.filter!==undefined&&g.filter.$filterContainer!==undefined){j=k.rup_table("getFilterParams")}jQuery.extend(true,h,j);k.triggerHandler("rupTable_serializeReportData",[h]);return a.rup_utils.unnestjson(h)};jQuery.rup_report(c)}});jQuery.fn.rup_table("extend",{_getReportColumns:function(b,c){return jQuery.map(b,function(e,d){if(jQuery.inArray(e.name,c.report.excludeColumns)===-1){return e.name}else{return null}})}});jQuery.fn.rup_table.plugins.report={};jQuery.fn.rup_table.plugins.report.defaults={report:{columns:{},excludeColumns:["rupInfoCol","cb"],sendPostDataParams:["_search","core","nd","page","rows","sidx","sord"]}}})(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("multifilter",{loadOrder:15,preConfiguration:function(b){var c=this;return c.rup_table("preConfigureMultifilter",b)},postConfiguration:function(b){var c=this;return c.rup_table("postConfigureMultifilter",b)}});jQuery.fn.rup_table("extend",{preConfigureMultifilter:function(d){var g=this,f=d.id,h=d.multifilter,c,b,e;h.$dropdownDialog=a("#"+d.id+"_multifilter_dropdownDialog");h.dropdownDialogId=d.id+"_multifilter_dropdownDialog";e=g.rup_table("getMultifilterDialogTemplate",d);d.filter.$filterContainer.after(e);g.rup_table("configureMultifilter",d);d.multifilter.fncFilterName=function(j){if(h.$comboLabel==undefined){if(h.$filterDefaultName!==undefined){j=h.$filterDefaultName+"  {"+j+"}   "}}else{if(h.$comboLabel!=undefined&&d.$firstStartUp){if(h.$comboLabel.val()==""&&h.$filterDefaultName!=undefined){if(h.$filterDefaultName!==undefined){j=h.$filterDefaultName+"  {"+j+"}   "}}}else{if(h.$comboLabel.val()!=""&&h.$filterWithName){h.$filterWithName=false;j=h.$comboLabel.val()+"  {"+j+"}   "}}}return j}},postConfigureMultifilter:function(e){var l=this,d=e.multifilter,c,h,b,g,n,k,m,f;e.filter.$filterButton.rup_button({dropdown:{dropdownIcon:"ui-icon-gear",dropdownDialog:d.dropdownDialogId,dropdownDialogConfig:{title:"<span class='rup-icon rup-icon-filter'/>"+a.rup.i18n.base.rup_table.plugins.multifilter.tittle,width:"450px",buttons:[{id:e.id+"_multifilter_BtnSave",text:a.rup.i18n.base.rup_table.plugins.multifilter.save,click:function(){if(l._checkLabel(e)){var o=l._createFilterFromForm(e);l.rup_table("addFilter",o)}}},{id:e.id+"_multifilter_BtnApply",text:a.rup.i18n.base.rup_table.plugins.multifilter.apply,click:function(){if(e.$firstStartUp){e.$firstStartUp=false}if(l._checkLabel(e)){d.$filterWithName=true;var o=l._searchFilterInCombo(e);if(o!=undefined){l.rup_table("cleanFilterForm");l.triggerHandler("rupTable_multifilter_fillForm",o);l._fillForm(o);l.rup_table("filter");d.$closeDialog.click()}else{d.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.errorNoexiste,"error")}}}},{id:e.id+"_multifilter_BtnRemove",text:a.rup.i18n.base.rup_table.plugins.multifilter.remove,click:function(){if(l._checkLabel(e)){var o=l._createFilterFromForm(e);l.rup_table("deleteFilter",o)}}},{text:a.rup.i18n.base.rup_table.plugins.multifilter.cancel,click:function(){var o=l.data("filtroAnterior");if(o!=null){l.rup_table("cleanFilterForm");l.triggerHandler("rupTable_multifilter_fillForm",o);l._fillForm(o)}d.$comboLabel.val("");d.$closeDialog.click()},btnType:a.rup.dialog.LINK}]}}});l.on("rupTable_beforeFilter",function(o){});d.$dropdownButton=a("#"+e.id+"_filter_filterButton_dropdown");d.$combo=a("#"+e.id+"_multifilter_combo");d.$comboLabel=a("#"+e.id+"_multifilter_combo_label");d.$comboButton=a("#"+e.id+"_multifilter_dropdownDialog .rup-combobox-toggle");d.$defaultCheck=a("#"+e.id+"_multifilter_defaultFilter");d.$feedback=a("#"+e.id+"_multifilter_dropdownDialog_feedback");d.$closeDialog=a("#closeText_"+e.id+"_multifilter_dropdownDialog");a("#"+d.dropdownDialogId).rup_dialog("setOption","modal",true);a("#"+d.dropdownDialogId).rup_dialog("setOption","draggable",false);a("#"+d.dropdownDialogId).rup_dialog("setOption","resizable",false);a("#"+d.dropdownDialogId).parent().css("width","500px");d.$dropdownButton.on("click",function(){var o=form2object(e.filter.$filterContainer[0]);var p=a.rup_utils.jsontoarray(o);l.data("filtroAnterior",o);d.$comboLabel.focus()});l._configCombo(e);d.$feedback.rup_feedback({block:false});a(".rup-dropdown-dialog").on("dialogclose",function(){d.$comboLabel.autocomplete("widget").hide()});var j=form2object(e.filter.$filterContainer[0]);xhrArray=a.rup_utils.jsontoarray(j);l.data("filtroAnterior",j)}});jQuery.fn.rup_table("extend",{getMultifilterDialogTemplate:function(b){var d=this,e=b.multifilter;var c=jQuery('<div id="'+e.dropdownDialogId+'" style="display:none" class="rup_multifilter_dropdown"><div id="'+e.dropdownDialogId+'_feedback"></div><form><fieldset class="dropdownButton-inputs"><div id="'+e.dropdownDialogId+'_columna_cnt" class="formulario_columna_cnt"><div  id="'+e.dropdownDialogId+'_lineaCombo"  class="formulario_linea_izda_float"><label for="'+b.id+'_multifilter_combo">'+a.rup.i18n.base.rup_table.plugins.multifilter.filters+'</label><input id="'+b.id+'_multifilter_combo" class="rup_multifilter_selector" /></div><div  id="'+e.dropdownDialogId+'_lineaDefault" class="formulario_linea_izda_float"><input type="checkbox" id="'+b.id+'_multifilter_defaultFilter"/><label for="'+b.id+'_multifilter_defaultFilter">'+a.rup.i18n.base.rup_table.plugins.multifilter.defaultFilter+"</label></div></div></fieldset></form></div>");return c},configureMultifilter:function(d){var g=this,h=d.multifilter,f;g.data("settings",d);d.filter.$filterForm=a("#"+d.id+"_filter_form");var c={source:[{label:"Si",value:"0"},{label:"No",value:"1"}],width:120,blank:""};var b;if(h.idFilter!=null){b=h.idFilter}else{b=d.id}var e;if(h.userFilter!=null){e=h.userFilter}else{e=LOGGED_USER}jQuery("#"+d.id+"_multifilter_combo").rup_autocomplete({source:d.baseUrl+"/multiFilter/getAll?filterSelector="+b+"&user="+e,sourceParam:{label:"filterName",value:"filterDefault",data:"filterValue"},method:"GET",contains:false,combobox:true,menuAppendTo:a("#"+h.dropdownDialogId).parent(),select:function(){var j=g._searchFilterInCombo(d);g.rup_table("cleanFilterForm");g.triggerHandler("rupTable_multifilter_fillForm",j);g._fillForm(j)}});a(".jstree").on("rup_filter_treeLoaded",function(j,k){a(this).rup_tree("setRupValue",k)});d.filter.$cleanLink.on("click",function(){h.$combo.rup_autocomplete("set","","");d.filter.$filterSummary.html("<i></i>")})},addFilter:function(c){var d=this;var b=d.data("settings");var e=b.multifilter;if(e.idFilter!=null){c.filtro.filterSelector=e.idFilter}a.rup_ajax({url:b.baseUrl+"/multiFilter/add",type:"POST",data:a.toJSON(c),dataType:"json",showLoading:false,contentType:"application/json",async:false,beforeSend:function(g,f){return d.triggerHandler("rupTable_multifilter_beforeAdd",[g,f])},success:function(g,f,h){e.$savedFilterName=g.filterName;e.$savedFilterValue=g.filterValue;e.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.ok,"ok");e.$comboLabel.data("tmp.loadObjects.term",null);e.$comboLabel.data("loadObjects",{});e.$comboLabel.data("tmp.data",{});if(e.$comboLabel.autocomplete("widget").is(":visible")){e.$comboLabel.autocomplete("widget").hide()}},error:function(h,f,g){e.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.error,"error")}})},deleteFilter:function(c){var d=this;var b=d.data("settings");var e=b.multifilter;e.$savedFilterName=undefined;e.$savedFilterValue=undefined;if(e.idFilter!=null){c.filtro.filterSelector=e.idFilter}a.rup_ajax({url:b.baseUrl+"/multiFilter/delete",type:"POST",data:a.toJSON(c),dataType:"json",showLoading:false,contentType:"application/json",async:false,success:function(g,f,h){e.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.ok,"ok");e.$combo.rup_autocomplete("set","","");e.$comboLabel.data("tmp.loadObjects.term",null);e.$comboLabel.data("loadObjects",{});e.$comboLabel.data("tmp.data",{});if(e.$comboLabel.autocomplete("widget").is(":visible")){e.$comboLabel.autocomplete("widget").hide()}if(g.filterFeedback=="no_records"){e.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.noRecords,"error")}},error:function(h,f,g){e.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.error,"error")}})}});jQuery.fn.rup_table("extend",{_createFilterFromForm:function(e){var h=e.multifilter;var c=form2object(e.filter.$filterContainer[0]);var b;a.each(a("[ruptype='date']",e.filter.$filterContainer),function(j,k){b=a(k).datepicker("getDate");if(b!=null){c[k.name]=b.getTime().toString()}});var g=a.toJSON(c);var f;if(h.userFilter!=null){f=h.userFilter}else{f=LOGGED_USER}var d={filtro:{filterSelector:e.id,filterName:h.$comboLabel.val(),filterValue:g,filterDefault:h.$defaultCheck.is(":checked"),filterUser:f}};return d},_configCombo:function(b){var c=b.multifilter;c.$comboLabel.on("change",function(){b.filter.$filterSummary.html("<i></i>")});c.$comboLabel.data("autocomplete")._renderItem=function(d,e){if(e.value){return a("<li></li>").data("item.autocomplete",e).append("<a><b>"+e.label+"</b></a>").appendTo(d)}else{return a("<li></li>").data("item.autocomplete",e).append("<a>"+e.label+"</a>").appendTo(d)}};c.$comboLabel.off("blur click");c.$comboLabel.attr("placeholder",a.rup.i18n.base.rup_table.plugins.multifilter.input);c.$comboLabel.on("blur",function(f){var e=c.$combo.data("selected"),d=a(".ui-autocomplete:visible").length>0?true:false;c.$combo.data("selected",false);if(f.type==="keydown"&&f.keyCode!==13){return true}if(d===true&&f.type==="keydown"){c.$combo.focus();f.stopPropagation();return true}var g=a(f.currentTarget),h=c.$comboLabel.data("loadObjects");if(b.getText==true){if(h[g.val()]!==undefined){c.$combo.val(g.val());c.$combo.attr("rup_autocomplete_label",g.val())}else{c.$combo.val(g.val());c.$combo.attr("rup_autocomplete_label",g.val())}}else{if(h[g.val()]!==undefined){c.$combo.val(h[g.val()]);c.$combo.attr("rup_autocomplete_label",h[g.val()])}else{g.autocomplete("close")}}if(f.type==="keydown"&&f.keyCode===13&&(e||d)){return false}});c.$comboButton.off("click mousedown");c.$comboButton.on("blur",function(){if(c.$comboLabel.autocomplete("widget").is(":visible")){c.$comboLabel.autocomplete("widget").hide()}});c.$comboButton.on("click",function(){if(c.$comboLabel.autocomplete("widget").is(":visible")){c.$comboLabel.autocomplete("widget").hide()}else{c.$comboLabel.autocomplete("search","");c.$comboLabel.autocomplete("widget").show();c.$comboLabel.autocomplete("widget").trigger("focus")}})},_checkLabel:function(b){var c=b.multifilter;if(a.trim(c.$comboLabel.val())==""){c.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.emptyName,"error");return false}else{if(c.$comboLabel.val().length>b.multifilter.labelSize){c.$feedback.rup_feedback("set",a.rup.i18n.base.rup_table.plugins.multifilter.tooLong,"error");return false}}return true},_searchFilterInCombo:function(d){var h=d.multifilter;var c=a("#"+d.id+"_multifilter_combo_label").val();var b=a("#"+d.id+"_multifilter_combo_label").data("tmp.data");var g=a.grep(b,function(k,j){if(k.label==c){return k}});if(g.length!=0){h.$defaultCheck.attr("checked",g[0].value);var e=a.parseJSON(g[0].data);var f=[];f=a.rup_utils.jsontoarray(e)}if(e==undefined&&h.$savedFilterName!=undefined){if(h.$savedFilterName===c){var e=a.parseJSON(h.$savedFilterValue)}}return e},_fillForm:function(c){var e=this;var b=e.data("settings");a("[ruptype='date']",b.filter.$filterContainer).each(function(h,j){var n=jQuery(j);var l;var m=c[j.name];if(m!=undefined){if(m.search("/")==-1){var k=new Date(parseInt(m));var f=n.data("datepicker").settings.dateFormat;if(n.data("datepicker").settings.datetimepicker){var g={hour:k.getHours(),minute:k.getMinutes(),second:k.getSeconds()};l=a.datepicker.formatDate(f,k)+" "+a.timepicker._formatTime(g,"hh:mm:ss")}else{l=a.datepicker.formatDate(f,k)}c[j.name]=l}}});var d=a.rup_utils.jsontoarray(c);a.rup_utils.populateForm(d,a(this.selector+"_filter_form"))}});jQuery.fn.rup_table.plugins.multifilter={};jQuery.fn.rup_table.plugins.multifilter.defaults={multifilter:{}}})(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(c){if(typeof c.position==="number"){b("#"+c.idTab).tabs("disable",c.position)}else{if(typeof c.position==="object"){for(var d in c.position){b("#"+c.idTab).tabs("disable",c.position[d])}}else{if(typeof c.position==="undefined"){b("#"+c.idTab).tabs("disable")}}}},enableTabs:function(c){if(typeof c.position==="number"){b("#"+c.idTab).tabs("enable",c.position)}else{if(typeof c.position==="object"){for(var d in c.position){b("#"+c.idTab).tabs("enable",c.position[d])}}else{if(typeof c.position==="undefined"){b("#"+c.idTab).tabs("enable")}}}},loadTab:function(c){b("#"+c.idTab).tabs("load",c.position)},changeUrlTab:function(c){b("#"+c.idTab).tabs("url",c.position,b.rup_utils.setNoPortalParam(c.url))},changeLayerTab:function(c){this._includeLayer(b("#"+c.idTab+" ul:first-child"),c.layer,b(b("#"+c.idTab+" ul li a").get(c.position)))},selectTab:function(c){b("#"+c.idTab).tabs("select",c.position)},addTab:function(f){var h,e,g="rup-tabs-",d=0;if(f.maxNumberTabs!==undefined){var c=b("#"+f.idTab+" li").size();if(c+1>f.maxNumberTabs){b("#"+f.idTab).trigger("limitTabs");return false}}if(f.lengthLiteral!==undefined&&f.label.length>f.lengthLiteral){f.label=f.label.substr(0,f.lengthLiteral).concat("...")}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{if(f.layer!==undefined){f.layer=this._includeLayer(b("#"+f.idTab+" > ul:first-child"),f.layer,null);b("#"+f.idTab).tabs("add",f.layer,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]}})}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");if(undefined!==f.fixedHeight){b("#"+f.idTab+" div[id='rup-tabs-"+d+"']").css("height",f.fixedHeight)}}}if(f.tabsAtBottom){loadLi=b("#"+f.idTab+" ul li:last").not(".rup-tabs_loading");loadLi.removeClass("ui-corner-top").addClass("ui-corner-botttom")}loadSpan=b("#"+f.idTab+" ul li a span:last").not(".rup-tabs_loading");if(f.close===true){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")).append('<span class="ui-icon ui-icon-close" role="presentation">Remove Tab</span>');b("span.ui-icon-close").on("click",function(){var j=b(this).parent().attr("href");b(this).parent().parent().remove();b(j).remove();tabs.tabs("refresh")});b("span.ui-icon-close").addClass("rup-tabs-close");b("span.ui-icon-close").on({mouseenter:function(){b(this).addClass("rup-tabs-close-hover")},mouseleave:function(){b(this).removeClass("rup-tabs-close-hover")}})}else{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(c){b("#"+c.idTab).tabs("remove",c.position)}});b.fn.rup_tabs("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_tabs.defaults,e[0]),h;g.id=b(this).attr("id");g.iniLoad=false;if(undefined!==g.width){b("#"+g.id).css("width",g.width).addClass("rup-tabs_overflow")}if(undefined!==g.height){b("#"+g.id).css("height",g.height).addClass("rup-tabs_overflow")}var d=g.tabs,c=0;while(d!==undefined){c=c+1;d=d[0].tabs}g.profun=c;this._parseJSON(g.tabs,b.rup.i18n.app[g.id],b("#"+g.id),"",1,g);g.iniLoad=true;this._tabify(b("#"+g.id),g);if(undefined!==g.fixedHeight){b("#"+g.id+">.ui-tabs-panel").css("height",g.fixedHeight)}b("#"+g.id).on("limitTabs",function(){alert("limite de pestañas alcanzado")});if(g.disabled!==undefined){for(var f in g.disabled){b("#"+g.id).rup_tabs("disableTabs",{idTab:f,position:g.disabled[f]})}}}},_tabify:function(f,e){f.addClass("rup-tabs_container");f.data("settings",e);var c=function(g,h){if(b(h.panel).data("cargado")!==undefined&&b(h.panel).data("cargado")===false&&b(h.panel).length>0){b(h.panel).tabs("load",0);b(h.panel).data("cargado",true)}if(e.select!==undefined&&e.select!==null&&typeof e.select==="function"){e.select(g,h)}};var d=b.extend({},e.ajaxOptions);d.beforeSend=function(h,g){if(e.ajaxOptions.beforeSend!==undefined&&e.ajaxOptions.beforeSend!==null&&typeof e.ajaxOptions.beforeSend==="function"){e.ajaxOptions.beforeSend.call()}if(!e.iniLoad){f.data("cargado",false);return(false)}};d.complete=function(g,h){f.find("span.rup-tabs_loading_img").remove();if(e.ajaxOptions.complete!==undefined&&e.ajaxOptions.complete!==null&&typeof e.ajaxOptions.complete==="function"){e.ajaxOptions.complete(g,h)}};d.success=function(h,j,g){if(e.ajaxOptions.success!==undefined&&e.ajaxOptions.success!==null&&typeof e.ajaxOptions.success==="function"){e.ajaxOptions.success(h,j,g)}};d.error=function(k,j,h){var g;if(e.ajaxOptions.error!==undefined&&e.ajaxOptions.error!==null&&typeof e.ajaxOptions.error==="function"){g=function(){e.ajaxOptions.error(k,j,h)}}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> "+j+":  "+k.status+" - "+k.statusText+".</b></p>",width:"40%",beforeClose:g})};b(f).tabs({ajaxOptions:d,cache:e.cache,cookie:null,fx:e.fx,idPrefix:"rup-tabs-",panelTemplate:e.panelTemplate,selected:0,spinner:"<span class='rup-tabs_loading_img' />",create:e.create,select:c,load:e.load,show:e.show,add:e.add,remove:e.remove,enable:e.enable,disable:e.disable});if(e.scrollable===true){this._scrollable(e)}if(e.tabsAtBottom===true){b(f).addClass("tabs-bottom");b(f).find(".tabs-spacer").css("float","left").css("height","200px");b(".ui-tabs-nav, .ui-tabs-nav > *",b(f)).removeClass("ui-corner-all ui-corner-top").addClass("ui-corner-bottom");b(".ui-tabs-panel.ui-widget-content.ui-corner-bottom",b(f)).removeClass("ui-corner-bottom").addClass("ui-corner-top");b(".ui-tabs-nav",b(f)).appendTo(".tabs-bottom")}},_parseJSON:function(n,m,l,k,e,g){var j,f;if(g.lengthLiteral!==undefined){b.each(m,function(o,p){if(m[o].length>g.lengthLiteral){m[o]=m[o].substr(0,g.lengthLiteral).concat("...")}})}l.append(b("<ul>"));l=b(l).children("ul");for(var h=n.length;h--;){f=k+h;j=n[h];if(h===0&&e===g.profun){g.iniLoad=true}else{g.iniLoad=false}if(j.layer!==undefined){j.layer=this._includeLayer(l,j.layer,null);if(g.close===true){l.prepend(b("<li>").append(b("<a>").attr("href",j.layer).attr("rupLevel",f).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(m,j.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading")).append('<span class="ui-icon ui-icon-close" role="presentation">Remove Tab</span>')));b("span.ui-icon-close").on("click",function(){var o=b(this).parent().attr("href");b(this).parent().parent().remove();b(o).remove();l.tabs("refresh")});b("span.ui-icon-close").addClass("rup-tabs-close");b("span.ui-icon-close").on({mouseenter:function(){b(this).addClass("rup-tabs-close-hover")},mouseleave:function(){b(this).removeClass("rup-tabs-close-hover")}})}else{l.prepend(b("<li>").append(b("<a>").attr("href",j.layer).attr("rupLevel",f).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(m,j.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading"))))}}else{if(j.url!==undefined){l.prepend(b("<li>").append(b("<a>").attr("href",b.rup_utils.setNoPortalParam(j.url)).attr("rupLevel",f).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(m,j.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading"))))}else{if(j.tabs!==undefined){l.prepend(b("<li>").append(b("<a>").attr("id","#"+j.i18nCaption).attr("href","#"+j.i18nCaption).attr("rupLevel",f).css("padding-left","1.4em").css("padding-right","0.3em").append(b("<div>").addClass("rup-tabs_title").text(b.rup.i18nParse(m,j.i18nCaption))).append(b("<span>").addClass("rup-tabs_loading"))));l=b(l).parent();var d=b("<div>"),c=b.rup_utils.randomIdGenerator(d);l.append(d);l=b(l).children("#"+c);l.prepend(b("<div>").attr("id",j.i18nCaption).attr("actualTab",true));l=b(l).children("div:first-child");l.append(this._parseJSON(j.tabs,m,l,f,e+1,g));this._tabify(l,g);l=b(l).parents("div[actualTab=true]").find("ul").first();if(l.length===0){l=b("#"+g.id).find("ul").first()}}}}}b(l).parents("div[actualTab=true]").first().removeAttr("actualTab");delete l},_includeLayer:function(c,e,g){var d,f;if(b(e).length>0){if(b(e).length===1){f=b(e).css("display","")}else{f=b("<div>").append(b(e).css("display",""))}if(g===null){d=b("<div>").append(f);c.parent().append(d);e="#"+b.rup_utils.randomIdGenerator(d)}else{e=g.attr("href");d=b(g.attr("href"));d.children().remove();d.append(f)}}else{e="#load-tab-error";if(g===null){c.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{e=g.attr("href");d=b(g.attr("href"));d.children().remove();d.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 e},_scrollable:function(e){var c=b.extend({},e),h=b(this),k=h.find(".ui-tabs-nav"),j;h.css({padding:2,position:"relative"});h.wrap('<div id="stTabswrapper" class="stTabsMainWrapper" style="position:relative"/>').find(".ui-tabs-nav").css("overflow","hidden").wrapInner('<div class="stTabsInnerWrapper" style="width:30000px"><span class="stWidthChecker"/></div>');var f=h.find(".stWidthChecker"),l=h.find(".stTabsInnerWrapper"),m=h.parents("#stTabswrapper").width(h.outerWidth(true));if(b.browser.safari){m.width(h.width()+6)}if(c.resizable){if(!!b.fn.resizable){m.resizable({minWidth:m.width(),maxWidth:m.width()*2,minHeight:m.height(),maxHeight:m.height()*2,handles:c.resizeHandles,alsoResize:h,resize:function(){h.trigger("resized")}})}else{alert('Error:\nCannot be resizable because "jQuery.resizable" plugin is not available.')}}var d=(parseInt(parseInt(k.innerHeight()/2)-8)),g={cursor:"pointer","z-index":1000,position:"absolute",top:3,height:k.outerHeight()-(b.browser.safari?2:1)};m.prepend(j=b("<div/>").disableSelection().css({position:"relative","z-index":3000,display:"block"}).append(b("<span/>").disableSelection().attr("title","Previous tab").css(g).addClass("ui-state-active ui-corner-tl ui-corner-bl stPrev stNav").css("left",3).append(b("<span/>").disableSelection().addClass("ui-icon ui-icon-carat-1-w").html("Previous tab").css("margin-top",d)).click(function(){if(b(this).hasClass("ui-state-disabled")){return}prevIndex=k.find("li.ui-tabs-selected").prevAll().length-1;k.find("li").eq(prevIndex).find("a").trigger("click");return false}),b("<span/>").disableSelection().attr("title","Next tab").css(g).addClass("ui-state-active ui-corner-tr ui-corner-br stNext stNav").css({right:3}).append(b("<span/>").addClass("ui-icon ui-icon-carat-1-e").html("Next tab").css("margin-top",d)).click(function(){nextIndex=k.find("li.ui-tabs-selected").prevAll().length+1;k.find("li").eq(nextIndex).find("a").trigger("click");return false})));h.on("navEnabler",function(){setTimeout(function(){var q=k.find(".ui-tabs-selected").is(":last-child"),n=k.find(".ui-tabs-selected").is(":first-child"),p=m.find(".stNext"),o=m.find(".stPrev");if(q){o.removeClass("ui-state-disabled");p.addClass("ui-state-disabled")}else{if(n){p.removeClass("ui-state-disabled");o.addClass("ui-state-disabled")}else{p.removeClass("ui-state-disabled");o.removeClass("ui-state-disabled")}}},c.animationSpeed)}).on("navHandler",function(){if(b(".stWidthChecker").children().length>5){j.show();k.find("li:first").css("margin-left",j.find(".stPrev").outerWidth(true))}else{j.hide();k.find("li:first").css("margin-left",0)}}).on("scrollToTab",function(p,n,q,r){n=(typeof n!="undefined")?b(n):k.find("li.ui-tabs-selected");var o=j.is(":visible")?j.find(".stPrev").outerWidth(true):0;offsetLeft=-(h.width()-(n.outerWidth(true)+o+parseInt(k.find("li:last").css("margin-right"),10)));offsetLeft=(q=="tabClicked"&&r=="left")?-o:offsetLeft;offsetLeft=(q=="tabClicked"&&r=="right")?offsetLeft:offsetLeft;var s={axis:"x",margin:true,offset:{left:offsetLeft},easing:c.easing||""};k.scrollTo(n,c.animationSpeed,s)}).on("bindTabClick",function(){k.find("a").click(function(){var o=b(this).parents("li");var n=j.find(".stPrev").outerWidth(true);if((o.position().left-n)<0){h.trigger("scrollToTab",[o,"tabClicked","left"])}else{if((o.outerWidth()+o.position().left)>(h.width()-n)){h.trigger("scrollToTab",[o,"tabClicked","right"])}}h.trigger("navEnabler");return false})}).on("resized",function(){h.trigger("navHandler");h.trigger("scrollToTab",k.find("li.ui-tabs-selected"))}).trigger("navHandler").trigger("navEnabler").trigger("bindTabClick")}});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,tabsAtBottom:false}})(jQuery);(function(c){var a=c.scrollTo=function(d,f,g){c(window).scrollTo(d,f,g)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var d=this,f=!d.nodeName||c.inArray(d.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!f){return d}var g=(d.contentWindow||d).document||d.ownerDocument||d;return c.browser.safari||g.compatMode=="BackCompat"?g.body:g.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var o=this,m=c(o),n=f,k,l={},h=m.is("html,body");switch(typeof n){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(n)){n=b(n);break}n=c(n,this);case"object":if(n.is||n.style){k=(n=c(n)).offset()}}c.each(d.axis.split(""),function(q,r){var t=r=="x"?"Left":"Top",s=t.toLowerCase(),v="scroll"+t,p=o[v],g=a.max(o,r);if(k){l[v]=k[s]+(h?0:p-m.offset()[s]);if(d.margin){l[v]-=parseInt(n.css("margin"+t))||0;l[v]-=parseInt(n.css("border"+t+"Width"))||0}l[v]+=d.offset[s]||0;if(d.over[s]){l[v]+=n[r=="x"?"width":"height"]()*d.over[s]}}else{var u=n[s];l[v]=u.slice&&u.slice(-1)=="%"?parseFloat(u)/100*g:u}if(/^\d+$/.test(l[v])){l[v]=l[v]<=0?0:Math.min(l[v],g)}if(!q&&d.queue){if(p!=l[v]){j(d.onAfterFirst)}delete l[v]}});j(d.onAfter);function j(g){m.animate(l,e,d.easing,g&&function(){g.call(this,f,d)})}}).end()};a.max=function(g,j){var n=j=="x"?"Width":"Height",k="scroll"+n;if(!c(g).is("html,body")){return g[k]-c(g)[n.toLowerCase()]()}var o="client"+n,f=g.ownerDocument.documentElement,d=g.ownerDocument.body;return Math.max(f[k],d[k])-Math.min(f[o],d[o])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(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 c,d;c=a(this).data("datepicker").settings.timeFormat;d=a.datepicker.parseTime(c,a(this).rup_time("getTime"));return d?a.timepicker._formatTime(d,"hh:mm:ss"):""},setRupValue:function(f){var c,d,e;c=a(this).data("datepicker").settings.timeFormat;d=a.datepicker.parseTime("hh:mm:ss",f);e=d?a.timepicker._formatTime(d,c):"";a(this).val(e)},destroy:function(){var c=a(this).data("datepicker").settings.labelMaskId;if(c){a("#"+c).text("")}delete c;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(c){a(this).timepicker("refresh");a.datepicker._setTime(a.datepicker._getInst(a("#"+a(this).data("datepicker").settings.id)[0]),c)},refresh:function(){a(this).timepicker("refresh")},option:function(c,d){a(this).timepicker("option",c,d)}});a.fn.rup_time("extend",{_init:function(c){if(c.length>1){a.rup.errorGestor(a.rup.i18nParse(a.rup.i18n.base,"rup_global.initError")+a(this).attr("id"))}else{var e=a.extend({},a.fn.rup_time.defaults,c[0]);e.id=a(this).attr("id");(this).attr("ruptype","time");var f=a.rup.i18n.base.rup_time;for(var d in f){a.timepicker._defaults[d]=f[d]}if(e.labelMaskId){a("#"+e.labelMaskId).text(a.rup.i18nParse(a.rup.i18n.base,"rup_time.mask")+" ")}e.buttonImage=a.rup.STATICS+(e.buttonImage?e.buttonImage:"/rup/basic-theme/images/clock.png");a("#"+e.id).timepicker(e);if(!a("#"+e.id).is("div")){a("<img>").addClass("ui-timepicker-trigger").attr({src:e.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("#"+e.id).timepicker("show")}else{a("#"+e.id).timepicker("hide")}}).insertAfter(a("#"+e.id))}if(a.rup_utils.aplicatioInPortal()&&!a("#"+e.id).is("div")){a(".r01gContainer").append(a(".ui-datepicker:not(.r01gContainer .ui-datepicker)"))}if(e.disabled){a("#"+e.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(d){var c=a.datepicker._get(a.datepicker._getInst(d.target),"timepicker");switch(d.keyCode){case 37:if(d.ctrlKey&&!(d.altKey||d.shiftKey)){c.hour_slider.slider("option","value",c.hour_slider.slider("option","value")-c._defaults.stepHour)}else{if(d.ctrlKey&&d.shiftKey&&!d.altKey){c.minute_slider.slider("option","value",c.minute_slider.slider("option","value")-c._defaults.stepMinute)}else{if(d.ctrlKey&&d.shiftKey&&d.altKey){c.second_slider.slider("option","value",c.second_slider.slider("option","value")-c._defaults.stepSecond)}}}break;case 39:if(d.ctrlKey&&!(d.altKey||d.shiftKey)){c.hour_slider.slider("option","value",c.hour_slider.slider("option","value")+c._defaults.stepHour)}else{if(d.ctrlKey&&d.shiftKey&&!d.altKey){c.minute_slider.slider("option","value",c.minute_slider.slider("option","value")+c._defaults.stepMinute)}else{if(d.ctrlKey&&d.shiftKey&&d.altKey){c.second_slider.slider("option","value",c.second_slider.slider("option","value")+c._defaults.stepSecond)}}}break}if(c){c._onTimeChange()}return a.datepicker._timepicker_doKeyPress(d)}})(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(g,e){var d,c;if(g.id){d=g.id}else{d=g.i18nCaption}if(d.indexOf(a(this).attr("id"))!==0){d=a(this).attr("id")+"##"+d}var b=a("<button type='button'/>").text(a.rup.i18nParse(e,g.i18nCaption)).addClass("rup-toolbar_button").attr({id:d});b.button().button("option","icons",{primary:g.css,secondary:null});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)}b.bind("focusout",function(){a(this).removeClass("ui-state-focus")});return b},addMButton:function(f,d){var b="",c;if(f.id===undefined){alert("El atributo ID es obligatorio en los MButtons.");b=null}else{c=f.id;if(c.indexOf(a(this).attr("id"))!==0){c=a(this).attr("id")+"##"+f.id}b=a("<a/>").attr("id",c).text(a.rup.i18nParse(d,f.i18nCaption)).addClass("rup-toolbar_menuButton");if(f.css===undefined){f.css="rup-toolbar_menuButtonIcon"}b.button().button("option","icons",{primary:null,secondary:f.css})}if(f.right!==undefined&&f.right===true){var e=this.children("div");if(e.length===0){e=a("<div />").attr("id",this.attr("id")+"-rightButtons").css("float","right");this.append(e)}b.prependTo(e)}else{a(this).append(b)}this._setKeyDown(b);if(f.click){b.click({i18nCaption:f.i18nCaption},f.click)}return b},addButtonsToMButton:function(h,j,k){var b,g,c=h.length,d,f;if(a("[id='mbutton_"+j.attr("id")+"']").length===0){b=a("<div>").addClass("ui-widget ui-widget-content rup-toolbar_menuButtonContainer").attr("id","mbutton_"+j[0].id).css("display","none");g=a("<ul>").attr("role","menu").attr("aria-activedescendant","active-menuitem").attr("aria-labelledby","active-menuitem")}else{b=a("[id='mbutton_"+j.attr("id")+"']");g=b.children("ul")}j.attr("href","#");for(var e=c;e--;){d=h[e];if(d.id){f=j.attr("id")+"##"+d.id}else{f=j.attr("id")+"##"+d.i18nCaption}h[e].id=f;g.prepend(a("<li>").css("display","block").append(this.addButton(h[e],k).addClass("rup-toolbar_menuButtonElement")))}if(!a.rup_utils.aplicatioInPortal()){b.appendTo("body");b.append(g)}else{b.append(g);a(".r01gContainer").append(b)}delete g;delete b},showMButton:function(){var c=a(this),d=c.offset().top+c.getTotalHeight(),b=a.rup_toolbar.showingMB,e=this.id;if(b===e){a("[id='mbutton_"+e+"']").slideUp("fast");c.removeClass("rup-toolbar_menuButtonSlided");b=null}else{a("[id='mbutton_"+b+"']").slideUp("fast");a("[id='mbutton_"+e+"']").css("position","absolute").css("top",d).css("left",c.offset().left).slideDown("fast");a("[id='"+b+"']").removeClass("rup-toolbar_menuButtonSlided");c.addClass("rup-toolbar_menuButtonSlided");b=e}a.rup_toolbar.showingMB=b;delete e;delete b;delete d;delete c;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(c,b){if(c.indexOf(this.attr("id"))===-1){c=this.attr("id")+"##"+c}a("[id='"+c+"']").addClass(b)},unpressButton:function(c,b){if(c.indexOf(this.attr("id"))===-1){c=this.attr("id")+"##"+c}a("[id='"+c+"']").removeClass(b)},tooglePressButton:function(c,b){if(c.indexOf(this.attr("id"))===-1){c=this.attr("id")+"##"+c}a("[id='"+c+"']").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(e){var c=a(e.currentTarget),d=c.parent(),f;switch(e.keyCode){case a.ui.keyCode.TAB:if(!e.shiftKey){if(c.next().attr("id")!==d.attr("id")+"-rightButtons"){f=c.next(":focusable")}else{f=c.next().children(":focusable:first")}if(f.size()===1){f.focus();a.rup_toolbar.focusedExternally[d.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 g=a.extend({},a.fn.rup_toolbar.defaults,b),f=a(this),h,c=[];if(a.rup_toolbar.focusedExternally===undefined){a.rup_toolbar.focusedExternally={}}a.rup_toolbar.focusedExternally[this.id]=false;g.id=this.id;h=a.rup.i18n.app[g.id];f.addClass("rup-toolbar ui-widget-header ui-widget ui-widget-content");if(g.width!=null){f.width(g.width)}a(document).click(a.rup_toolbar.hideMButtons);for(var e=0;e<g.buttons.length;e+=1){var j=g.buttons[e];if(!(j.right!==undefined&&j.right===true)){if(j.buttons){mbutton=f.addMButton({id:j.id,i18nCaption:j.i18nCaption,css:j.css,click:f.showMButton},h);if(mbutton!==null){f.addButtonsToMButton(j.buttons,mbutton,h)}}else{f.addButton(j,h)}}else{c.push(j)}}for(var e=0;e<c.length;e+=1){var d=c[e];if(d.buttons){mbutton=f.addMButton({id:d.id,i18nCaption:d.i18nCaption,css:d.css,click:f.showMButton,right:d.right},h);if(mbutton!==null){f.addButtonsToMButton(d.buttons,mbutton,h)}}else{f.addButton(d,h)}}})};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(c,d){return b(this).qtip("option",c,d)}});b.fn.rup_tooltip("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{if(b(this).size()>0){var g=b.extend({},b.fn.rup_tooltip.defaults,e[0]),f=this[0].className.indexOf("rup-grid")!==-1,d;if(g.id===undefined){g.id=b(this).attr("id")}if(f){var c=b(this).each(function(j,k){b.attr(this,"rup_tooltip",b.attr(this,"title"));if(k.localName==="img"){b(k).parents("td").attr("rup_tooltip",b(k).attr("rup_tooltip"))}}).removeAttr("title");g={content:" ",position:{target:"event",effect:false},show:{delay:g.show.delay},hide:{delay:0},events:{show:function(k,j){var l=b(k.originalEvent.target);if(l.length){while(l.attr("rup_tooltip")===undefined&&l[0].nodeName!=="TD"){l=b(l).parent()}j.set("content.text",(l.attr("rup_tooltip")==="")?" ":l.attr("rup_tooltip"));if(l.attr("rup_tooltip")===""||l.attr("rup_tooltip")===" "){l.qtip("destroy")}if(l[0].nodeName!=="TD"){l=b(l).parents("td")}if(l.nextAll("td:visible").length==0){j.set("position.my.x","right")}else{j.set("position.my.x","left")}j.set("position.target",l)}},render:function(k,j){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(g)}else{var h;if((b.rup_utils.aplicatioInPortal())&&(!g.applyToPortal)){h=b("div.r01gContainer "+b(this).selector)}else{h=this}if(g.open!==undefined){g.events.show=g.open}if(g.close!==undefined){g.events.hide=g.close}g.events.render=function(k,j){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(h).qtip(g);if(g.disabled){b(h).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(c){c.widget("blueimpUIX.fileupload",c.blueimpUI.fileupload,{options:{errorMessages:{maxFileSize:c.rup.i18nParse(c.rup.i18n.base,"rup_upload.maxFileSizeError"),minFileSize:c.rup.i18nParse(c.rup.i18n.base,"rup_upload.minFileSizeError"),acceptFileTypes:c.rup.i18nParse(c.rup.i18n.base,"rup_upload.acceptFileTypesError"),maxNumberOfFiles:c.rup.i18nParse(c.rup.i18n.base,"rup_upload.maxNumberOfFilesError")}},_renderUpload:function(j){var h=this,f=this.options,e=this._renderUploadTemplate(j),d=this._validate(j);if(!(e instanceof c)){return c()}var g=c.data(this.element[0],"settings");e.css("display","none");e.find(".progress div").slice(d?1:0).remove().end().first().progressbar();e.find(".start button").slice(this.options.autoUpload||!d?0:1).remove().end().first().button({text:true,icons:{primary:"ui-icon-circle-arrow-e"}});var k=e.find(".cancel button").slice(1).remove().end().first().button({text:true,icons:{primary:"ui-icon-cancel"}});if(g.submitInForm){k.bind("click",function(m){var l;m.preventDefault();h.options.fileInput.attr("value","");l=h.options.fileInput.clone(true).attr("value","").insertAfter(h.options.fileInput);h.options.fileInput.remove();h.options.fileInput=l})}e.find(".preview").each(function(l,m){h._loadImage(j[l],function(n){c(n).hide().appendTo(m).fadeIn()},{maxWidth:f.previewMaxWidth,maxHeight:f.previewMaxHeight,fileTypes:f.previewFileTypes,canvas:f.previewAsCanvas})});return e},_renderDownload:function(e){var d=this._renderDownloadTemplate(e);if(!(d instanceof c)){return c()}d.css("display","none");d.find(".delete button").button({text:true,icons:{primary:"ui-icon-trash"}});d.find("a").each(this._enableDragToDesktop);return d},_renderUploadTemplate:function(f){var e=this,g=c();var d=c.data(this.element[0],"settings");c.each(f,function(h,j){j=e._uploadTemplateHelper(j);var k=c('<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>'+(d.submitInForm?'<div class="izq_float cancel" style><button>'+c.rup.i18nParse(c.rup.i18n.base,"rup_upload.cancelUpload")+"</button></div>":"")+"</div>"+(!d.submitInForm?'<div class="formulario_columna_cnt">'+(j.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>'+c.rup.i18nParse(c.rup.i18n.base,"rup_upload.startUpload")+"</button></div>")+'<div class="izq_float cancel"><button>'+c.rup.i18nParse(c.rup.i18n.base,"rup_upload.cancelUpload")+"</button></div></div>":'<div class="izq_float start fileupload-buttonbar ui-button" style="display:none"><button>'+c.rup.i18nParse(c.rup.i18n.base,"rup_upload.startUpload")+"</button></div>")+"</td></tr>");k.find(".name b").text(j.name);k.find(".size").text(j.sizef);k.find(".type").text(j.type);if(j.error){k.addClass("ui-state-error");k.find(".error").text(e.options.errorMessages[j.error]||j.error)}g=g.add(k)});return g},_renderDownloadTemplate:function(e){var d=this,f=c();c.each(e,function(g,h){h=d._downloadTemplateHelper(h);var j=c('<tr class="template-download"><td>'+(h.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">'+c.rup.i18nParse(c.rup.i18n.base,"rup_upload.openUploaded")+'</span></div></div></a><div class="izq_float delete"><button>'+c.rup.i18nParse(c.rup.i18n.base,"rup_upload.deleteUploaded")+"</button></div></div>")+"</td></tr>");j.find(".size").text(h.sizef);j.find(".type").text(h.type);if(h.error){j.find(".name").text(h.name);j.addClass("ui-state-error");j.find(".error").text(d.options.errorMessages[h.error]||h.error)}else{j.find(".name a").text(h.name);if(h.thumbnail_url){j.find(".preview").append("<a><img></a>").find("img").prop("src",h.thumbnail_url);j.find("a").prop("target","_blank")}j.find("a").prop("href",c.rup_utils.setNoPortalParam(h.url));j.find(".delete button").attr("data-type",h.delete_type).attr("data-url",c.rup_utils.setNoPortalParam(h.delete_url))}f=f.add(j)});return f},_initFileUploadButtonBar:function(){var e=this.element.find(".fileupload-buttonbar"),f=this.element.find(".files"),d=this.options.namespace;e.find(".start").button({icons:{primary:"ui-icon-circle-arrow-e"}}).bind("click."+d,function(g){g.preventDefault();f.find(".start button").click()});e.find(".cancel").button({icons:{primary:"ui-icon-cancel"}}).bind("click."+d,function(g){g.preventDefault();f.find(".cancel button").click()});e.find(".delete").button({icons:{primary:"ui-icon-trash"}}).bind("click."+d,function(g){g.preventDefault();f.find(".delete button").click()});e.find(".toggle").bind("change."+d,function(g){f.find(".delete input").prop("checked",c(this).is(":checked"))})},_getAJAXSettings:function(e){var d=c.extend({},this.options,e);this._initFormSettings(d);this._initDataSettings(d);return d}});var a={};c.extend(c.rup.iniRup,c.rup.rupSelectorObjectConstructor("rup_upload",a));c.fn.rup_upload("extend",{option:function(d){c(this).fileupload("option",d)},destroy:function(){c(this).fileupload("destroy")},enable:function(){c(this).fileupload("enable")},disable:function(){c(this).fileupload("disable")},add:function(d){c(this).fileupload("add",d)},send:function(d){c(this).fileupload("send",d)}});function b(){var j=c(this),f=c("#fileupload-progressbar").fadeIn(),d=500,n=0,g=0,m=0,k,o=function(t,s){g=s.loaded;n=s.total},r=function(){j.unbind("fileuploadprogressall",o).unbind("fileuploadstop",r);window.clearInterval(k);f.fadeOut(function(){f.html("")})},q=function(t){var s=new Date(t*1000);return("0"+s.getUTCHours()).slice(-2)+":"+("0"+s.getUTCMinutes()).slice(-2)+":"+("0"+s.getUTCSeconds()).slice(-2)},l=function(s){if(s>=1000000000){return(s/1000000000).toFixed(2)+" GB"}if(s>=1000000){return(s/1000000).toFixed(2)+" MB"}if(s>=1000){return(s/1000).toFixed(2)+" KB"}return s+" B"},h=function(s){return(s*100).toFixed(2)+" %"},p=function(t,u,s){f.html(l(s)+"ps | "+q((u-t)/s)+" | "+h(t/u)+" | "+l(t)+" / "+l(u))},e=function(){var s=g-m;if(!s){return}m=g;p(g,n,s*(1000/d))};j.bind("fileuploadprogressall",o).bind("fileuploadstop",r);k=window.setInterval(e,d)}c.fn.rup_upload("extend",{_init:function(f){var g=c.extend({},c.fn.rup_upload.defaults,f[0]),e=this;if(g.pif!==null){var d="",h=jQuery.extend(true,c.fn.rup_upload.pif.defaults,g.pif);if(h.userFolder!==true&&h.folderPath===undefined){alert("RUP_UPLOAD - No se ha especificado el valor del parámetro folderPath para el uso del PIF.");return -1}jQuery.extend(true,g,{formData:{base_url:g.url,hadoop_folder_path:h.folderPath,hadoop_preserve_name:h.preserveName,y31_ttl:h.fileTtl,securityToken:h.securityToken}})}c.data(this[0],"settings",g);c(this).fileupload(g);if(g.submitInForm){c(this).rup_upload("option",{singleFileUploads:false,maxNumberOfFiles:1,replaceFileInput:false})}c(this).bind("fileuploadadd",function(k,j){if(g.submitInForm){c(this).find(".template-upload").hide();c(this).find(".template-upload .cancel button").unbind("click");c(this).find(".template-upload .cancel button").click()}});c(this).bind("fileuploadsend",function(k,j){j.url=c.rup_utils.setNoPortalParam(j.url);if(!c.rup.browser.xhrFileUploadSupport||g.forceIframeTransport===true){j.url=j.url+(j.url.match("\\?")===null?"?":"&")+"_emulate_iframe_http_status=true"}})},_private:function(d){}});c.fn.rup_upload.defaults={label:null,fileInput:null,submitInForm:false,submitFormButton:undefined,pif:null};c.fn.rup_upload.pif={};c.fn.rup_upload.pif.defaults={fileTtl:129600,preserveName:false,_JANO_PUT_SERVLET:"/y31ApiJSWAR/Y31JanoServicePutServlet",securityToken:"app"}})(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(f){var c={};f.rup_validate={};f.extend(f.rup.iniRup,f.rup.rupSelectorObjectConstructor("rup_validate",c));var e={};var a=new RegExp("\\{\\d\\}");f.each(f.rup.i18n.base.rup_validate.messages,function(j,k){if(k.match(a)!==null){e[j]=jQuery.validator.format(k)}else{e[j]=k}});var d=new RegExp(f.rup.i18n.base.rup_validate.regexp.decimal);f.extend(f.validator.messages,e);jQuery.validator.addMethod("dni",function(k,j){return this.optional(j)||euroNif(k)});function g(k){if(k.length===9){var l=k.substr(0,8);var m=typeof l;var n=typeof k.substr(k.length-1,k.length);l=l%23;var j="TRWAGMYFPDXBNJZSQVHLCKET";j=j.substring(l,l+1);if(j!=(k.substr(k.length-1,k.length)).toUpperCase()){return false}else{return true}}else{return false}}function h(j){return j.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,"")}jQuery.validator.addMethod("dni",function(k,j){return this.optional(j)||g(k)});jQuery.validator.addMethod("maxWords",function(k,j,l){return this.optional(j)||h(k).match(/\b\w+\b/g).length<l});jQuery.validator.addMethod("minWords",function(k,j,l){return this.optional(j)||h(k).match(/\b\w+\b/g).length>=l});jQuery.validator.addMethod("rangeWords",function(k,j,l){return this.optional(j)||h(k).match(/\b\w+\b/g).length>=l[0]&&k.match(/bw+b/g).length<l[1]});jQuery.validator.addMethod("letterswithbasicpunc",function(k,j){return this.optional(j)||/^[a-z-.,()'\"\s]+$/i.test(k)});jQuery.validator.addMethod("alphanumeric",function(k,j){return this.optional(j)||/^\w+$/i.test(k)});jQuery.validator.addMethod("lettersonly",function(k,j){return this.optional(j)||/^[a-z]+$/i.test(k)});jQuery.validator.addMethod("nowhitespace",function(k,j){return this.optional(j)||/^\S+$/i.test(k)});jQuery.validator.addMethod("integer",function(k,j){return this.optional(j)||/^-?\d+$/.test(k)});jQuery.validator.addMethod("pattern",function(k,j,l){return this.optional(j)||l.test(k)});jQuery.validator.addMethod("number",function(k,j){var l=new RegExp(f.rup.i18n.base.rup_validate.regexp.decimal);return this.optional(j)||l.test(k)});jQuery.validator.addMethod("date",function(k,j,m){var l;if(typeof m==="boolean"){if(m===true){l=f.rup.i18n.base.rup_validate.format.date}else{return true}}else{l=m}return this.optional(j)||f.rup_validate.checkDate(l,k)});f.extend(f.rup_validate,{checkDate:function(v,m){var t=function(j){return(((j%4===0)&&(j%100!==0||(j%400===0)))?29:28)},s=function(y){for(var j=1;j<=y;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 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}});f.fn.rup_validate("extend",{destroy:function(){var j=this;j.rup_validate("resetForm");f.removeData(j[0]);j.unbind()},resetForm:function(){var j=this,k=j.data("settings");if(k!=null&&k.feedback!==undefined&&k.showErrorsInFeedback){k.feedback.rup_feedback("hide")}j.validate().resetForm()}});f.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(f.isEmptyObject(v)){delete w.invalid[w.currentElements.attr("name")]}}l=w.settings.feedback;if(w.settings.showErrorsInFeedback&&l!==undefined&&l!==null){p=f("<ul>").addClass("rup-maint_feedbackUL").prepend(w.settings.feedbackErrorConfig.errorMsg);if(jQuery.isEmptyObject(w.invalid)){l.rup_feedback("close")}else{if(w.settings.showFieldErrorsInFeedback){f.each((!jQuery.isEmptyObject(w.submitted)?w.submitted:w.invalid),function(j,y){if(w.invalid[j]!==undefined){u=w.settings.feedbackErrorConfig.getField(w,w.currentForm,j);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,y);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(f.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}}f("."+w.settings.errorClass+":not(.rup-maint_validateIcon)",w.currentForm).removeClass(w.settings.errorClass);w.defaultShowErrors()},showErrorsInFeedback:function(j){},errorPlacement:function(k,l){if(l.attr("ruptype")==="combo"){var j=f("#"+l.attr("id")+"-button");if(j){k.insertAfter(j)}}else{k.insertAfter(l)}}},showFieldErrorAsDefault:{errorElement:"img",errorPlacement:function(k,l){var m=k.attr("src",this.errorImage).addClass("rup-maint_validateIcon").html("").rup_tooltip({applyToPortal:true});if(l.attr("ruptype")==="combo"){var j=f("#"+l.attr("id")+"-button");if(j){m.insertAfter(j)}}else{m.insertAfter(l)}}}};f.fn.rup_validate("extend",{_init:function(k){var j=this,l=f.extend(true,{},f.fn.rup_validate.defaults,b.defaultPresetSettings,k[0]);j.addClass("rup_validate");j.attr("ruptype","validate");if(l.showFieldErrorAsDefault){l=f.extend(true,l,b.showFieldErrorAsDefault)}l=f.extend(true,{},l,k[0]);j.validate(l);if(l.showFieldErrorAsDefault){j.validate().showLabel=function(n,o){var m=this.errorsFor(n);if(m.length){m.removeClass(this.settings.validClass).addClass(this.settings.errorClass);m.attr("generated")&&m.html(o)}else{if(l.showFieldErrorAsDefault){m=f("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(n),generated:true}).addClass(this.settings.errorClass).attr("title",o||"")}else{m=f("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(n),generated:true}).addClass(this.settings.errorClass).html(o||"")}if(this.settings.wrapper){m=m.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(m).length){this.settings.errorPlacement?this.settings.errorPlacement(m,f(n)):m.insertAfter(n)}}if(!o&&this.settings.success){m.text("");typeof this.settings.success=="string"?m.addClass(this.settings.success):this.settings.success(m)}this.toShow=this.toShow.add(m)}}if(!l.liveCheckingErrors){j.unbind("click").unbind("focusin").unbind("focusout").unbind("keyup")}j.on("invalid-form.rupValidate_formValidationError",function(m){j.off("invalid-form.rupValidate_formValidationError");j.triggerHandler("rupValidate_formValidationError",[this])});j.data("settings",l)}});f.fn.rup_validate.defaults={ignore:":hidden[ruptype!='autocomplete'][ruptype!='combo']",feedbackOptions:{gotoTop:false,fadeSpeed:null,delay:null},feedbackErrorConfig:{errorMsg:f.rup.i18nParse(f.rup.i18n.base,"rup_maint.validateError"),getField:function(j,k,l){return f("[name='"+l+"']",k)},getFieldName:function(j,n,o){var m=o.attr("ruptype"),l,k;if(m!==undefined&&m==="combo"){l=o.attr("id")+"-button"}else{l=o.attr("id")}k=o.parent().find("label[for='"+l+"']:not(."+j.settings.errorClass+")");if(k.length>0){return k.text()}return o.attr("title")},getFieldErrorLabel:function(j,k,m,l){return f("<li>").append("<b>"+l+":</b>")},getFieldErrorMsg:function(j,m,o,l){if(f.isArray(l)){var n=f("<ul>");for(var k=0;k<l.length;k++){n.append(f("<li>").append(l[k]))}return n}else{return f("<ul>").append(f("<li>").append(l))}}},liveCheckingErrors:false,showErrorsInFeedback:true,showFieldErrorAsDefault:true,showFieldErrorsInFeedback:true,errorImage:f.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(d){if(b("#stepDesc"+d).hasClass("disabled")){return false}var c=b("#steps li.current").attr("id");b("#steps li").removeClass("current");b("#stepDesc"+d).addClass("current");b("#steps li").removeClass("visited");if(d!=0){b("#stepDesc"+(d-1)).addClass("visited")}b("#step"+c.substring(8)).hide();b("#step"+d).show();if(!this.rup_wizard("isCurrentStepLast")){b(".rup-wizard_submitButton").hide()}else{b(".rup-wizard_submitButton").show();if(!this.rup_wizard("isCurrentStepSummary")){b("#step"+d).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(c){return(this.rup_wizard("getCurrentStep")===c)},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(c){b("#stepDesc"+c).removeClass("disabled")},disableStep:function(c){b("#stepDesc"+c).addClass("disabled")},isStepDisabled:function(c){return b("#stepDesc"+c).hasClass("disabled")}});b.fn.rup_wizard("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_wizard.defaults,e[0]),d=this;this._formToWizard(g);b("#steps").addClass("rup-wizard_stepsDescContainer");b("#steps").children().each(function(j,k){b(k).addClass("rup-wizard_stepDesc").click(function(n){var m=b(this).attr("id").substring(8);if(!d.isStepDisabled(m)){if(g.stepFnc[m]!==undefined){if(g.stepFnc[m].call()===false){n.stopImmediatePropagation();return false}}b(this).rup_wizard("step",m)}});var l=b(k).children();b(l).text((j+1)+". "+b(l).text());b(k).text("").append(l)});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(j){d._gotoPrevStep(d,g,j)});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(j){d._gotoNextStep(d,g,j)});b("#"+g.submitButton).addClass("rup-wizard_submitButton");if(g.submitFnc){b("#"+g.submitButton).click(g.submitFnc)}b("#steps li:first").addClass("rup-wizard_firstStepDesc");b("#steps li:last").addClass("rup-wizard_lastStepDesc");if(g.summary){b("#steps li:last").removeClass("rup-wizard_lastStepDesc");var c=b("#steps").children().size(),f=b("<li>").attr("id","stepDesc"+c).addClass("rup-wizard_stepDesc rup-wizard_summary rup-wizard_lastStepDesc").append("<a href='#'>"+(c+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));d._generateSummary(c,d,g)});b("#steps").append(f);b("div[id='step"+(c-1)+"']").after("<div id='step"+c+"' style='display: none;'/>");var h=b("<a>").attr("id","step"+(c-1)+"Next").html(b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.next")).addClass("rup-wizard_next").unbind("click").click(function(j){d._gotoNextStep(d,g,j);d._generateSummary(c,d,g)});b("#step"+(c-1)+"commands").append(h)}if(g.disabled!==undefined){b.each(g.disabled,function(k,m){if(typeof m==="number"){b(this).rup_wizard("disableStep",m)}else{if(typeof m==="string"){var n=parseInt(m.substring(0,m.indexOf("-"))),j=parseInt(m.substring(m.indexOf("-")+1,m.length));for(var l=n;l<=j;l++){b(this).rup_wizard("disableStep",l)}}}})}}this.rup_wizard("step",0)},_gotoNextStep:function(d,e,f){var c=parseInt(b("#steps li.current").attr("id").substring(8))+1;if(d.isStepDisabled(c)){c=b("#stepDesc"+(c-1)).nextAll("li:not(.disabled)").first().attr("id");if(c!==undefined){c=parseInt(c.substring(8))}else{return false}if(jQuery("#steps").children().size()-1===c){d._generateSummary(c,d,e)}}if(e.stepFnc[c]!==undefined){if(b("#stepDesc"+c).not(".rup-wizard_summary").length>0){if(e.stepFnc[c].call()===false){f.stopImmediatePropagation();return false}}}b("#stepDesc"+c).rup_wizard("step",c)},_gotoPrevStep:function(d,e,f){var c=parseInt(b("#steps li.current").attr("id").substring(8))-1;if(d.isStepDisabled(c)){c=b("#stepDesc"+(c+1)).prevAll("li:not(.disabled)").first().attr("id");if(c!==undefined){c=parseInt(c.substring(8))}else{return false}}if(e.stepFnc[c]!==undefined){if(e.stepFnc[c].call()===false){f.stopImmediatePropagation();return false}}b("#stepDesc"+c).rup_wizard("step",c)},_generateSummary:function(d,e,h){if(b("#stepDesc"+d).hasClass("disabled")){return false}b("#step"+d).parent().append(b(".rup-wizard_submitButton"));if(h.summaryFnc_PRE&&h.summaryFnc_PRE.call()===false){return false}b("#step"+d).remove();b("div[id='step"+(d-1)+"']").after("<div id='step"+d+"' style='display: none;'/>");for(var g=0;g<d;g++){if(!e.isStepDisabled(g)){b("#step"+d).append(b("#step"+g).children().clone())}}b("#step"+d+" p[id$='commands']").remove();b("div[id='step"+(d)+"'] fieldset:last").append("<p id='step"+d+"commands'></p>");var f=b("<a>").attr("id","step"+d+"Prev").html(b.rup.i18nParse(b.rup.i18n.base,"rup_wizard.prev")).addClass("rup-wizard_prev").unbind("click").click(function(j){e._gotoPrevStep(e,h,j)});b("#step"+d+"commands").append(f);if(h.summaryFnc_INTER&&h.summaryFnc_INTER.call()===false){return false}b("#step"+d+" .ui-multiselect").each(function(){var m=b("#"+b(this).prev().attr("id"));if(m.data("settings")!==undefined){var l=m.rup_combo("label");if(l.length>0){if(m.data("settings")["summaryInline"]==undefined){var k=b("<div />").addClass("rup-wizard_summaryMultivalue").insertAfter(this);for(var j=0;j<l.length;j++){b(h.labelElement,{text:"- "+l[j],"class":"rup-wizard_summaryValue"}).appendTo(k);b("<br/>").appendTo(k)}}else{b(h.labelElement,{text:l.toString().replace(/,/g,", "),"class":"rup-wizard_summaryValue"}).insertAfter(this)}}else{b(h.labelElement,{html:"&nbsp;","class":"rup-wizard_summaryValue"}).insertAfter(this)}b(this).prev().remove();b(this).remove()}});b("#step"+d+" input").each(function(){if(this.type==="text"){b(h.labelElement,{text:this.value,"class":"rup-wizard_summaryValue"}).insertAfter(this)}else{if(this.type==="password"){b(h.labelElement,{text:e._hidePassword(this.value),"class":"rup-wizard_summaryValue"}).insertAfter(this)}else{if(this.type==="radio"){if(this.checked){b(h.labelElement,{text:b("#step"+d+" label[for='"+this.id+"']").text(),"class":"rup-wizard_summaryValue"}).insertAfter(this);b("#"+this.id).attr("checked","checked")}b("#step"+d+" label[for='"+this.id+"']").remove()}else{if(this.type==="checkbox"){if(this.checked){b(h.labelElement,{text:"[X] "+b("#step"+d+" label[for='"+this.id+"']").text(),"class":"rup-wizard_summaryValue"}).insertAfter(this)}else{b(h.labelElement,{text:"[ ] "+b("#step"+d+" label[for='"+this.id+"']").text(),"class":"rup-wizard_summaryValue"}).insertAfter(this)}b("#step"+d+" label[for='"+this.id+"']").remove()}}}}b(this).remove()});b("#step"+d+" textarea").each(function(){b(h.textareaElement,{text:b("#"+b(this).attr("id")).val(),"class":"rup-wizard_summaryParagraph"}).insertAfter(this);b(this).remove()});b("#step"+d+" select:not('.ui-pg-selbox')").each(function(){b(h.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"+d+" label").each(function(){b(h.labelSeparatorElement,{html:h.labelSeparatorText,"class":"rup-wizard_separator"}).insertAfter(this);b(h.labelElement,{text:this.innerHTML,"class":"rup-wizard_summaryLabel"}).insertAfter(this);b(this).remove()});b("#step"+d+" .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(h.rupAccordion)){b(this).rup_accordion(h.accordion)}else{b(this).rup_accordion(h.rupAccordion)}});b("#step"+d+" .rup_combo").each(function(){b(this).remove()});b("#step"+d+" img.ui-datepicker-trigger").each(function(){b(this).remove()});b("#step"+d+" img.ui-timepicker-trigger").each(function(){b(this).remove()});var c=0;if(h.summaryTabs2Accordion){h.rupTabsElement="<a />"}b("#step"+d+" > fieldset").children(".rup-tabs_container").each(function(){var k=new Array(),l=new Array(),j=b(this).parent().attr("accordionable",true),o=new Array();e._getRupTabs(e,b(this),k,l);var n=null,p=b(j);for(var m=0;m<k.length;m++){n=b(h.rupTabsElement).text(k[m]);if(l[m].indexOf("rupRandomLayerId")!==-1){n=b(n).wrap("<div class='IE8_fix'>");n=b(n).parent().append(b(this).find(l[m]).html());b(n).children("div").addClass("rup-wizard_tabLevel-"+o.length);n=b(n).children().unwrap()}else{n=b(n).attr("tabContainer",true);n=b(n).wrap("<div class='IE8_fix'>");n=b(n).parent().append(b("<div>").attr("id","subtab_"+k[m]).attr("accordionable",true).addClass("rup-wizard_tabContainerLevel-"+o.length));n=b(n).children().unwrap();o.push(k[m]);c++;b(p).append(n);p=b("#subtab_"+k[m]);continue}if(b("#"+o[o.length-1]).find(l[m]).length===0){p=b(j);do{o.pop();if(b("#"+o[o.length-1]).find(l[m]).length>0){p=b("#subtab_"+o[o.length-1]);break}else{b(b(n).get(1)).removeAttr("class").addClass("rup-wizard_tabLevel-"+o.length)}}while(o.length>0)}b(p).append(n)}b("#step"+d+" .rup-table-container").each(function(){var q=b(this);q.fluidWidth({fluidBaseLayer:"#"+q.parent().attr("id")})});if(h.summaryTabs2Accordion){b(j).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(h.summaryWithAccordion){b("#step"+d).find("legend").each(function(j,k){b("<a />").text(k.innerHTML).insertBefore(b(k).parent()).wrap("<h1 />");b(k).parent().replaceWith(b("<div />").attr("accordionable",b(k).parent().attr("accordionable")===undefined?false:true).append(b(k).parent().children()));b(k).remove()});if(b.isEmptyObject(h.summaryAccordion)){b("#step"+d).rup_accordion(h.accordion)}else{b("#step"+d).rup_accordion(h.summaryAccordion)}b("<fieldset />").attr("id","commands_fieldset").append(b("#step"+d).find("p[id='step"+(d)+"commands']")).appendTo(b("#step"+d));if(h.summaryWithAccordionSpaceBefore){b("#step"+d).prepend("</br>")}if(h.summaryWithAccordionSpaceAfter){b("#commands_fieldset").prepend("</br>")}}if(h.summaryTabs2Accordion){for(var g=0;g<=c;g++){b(".rup-wizard_tabLevel-"+g).removeClass("rup-wizard_tabLevel-"+g);b(".rup-wizard_tabContainerLevel-"+g).removeClass("rup-wizard_tabContainerLevel-"+g)}b("[accordionable=true]").each(function(k,l){if(l.nodeName==="FIELDSET"){var m=b(l).find("legend")[0],n=b(l).find("p[id='step"+(d)+"commands']"),j=b("<div />").attr("accordionable",b(l).attr("accordionable")===undefined?false:true).append(b(l).children());b(l).replaceWith(j);b(m).remove();b(n).remove();if(b.isEmptyObject(h.tabAccordion)){b(j).rup_accordion(h.accordion)}else{b(j).rup_accordion(h.tabAccordion)}b(j).prepend(m);b(j).append(b("<fieldset />").append(n))}else{if(b.isEmptyObject(h.tabAccordion)){b(l).rup_accordion(h.accordion)}else{b(l).rup_accordion(h.tabAccordion)}}})}b("[accordionable]").removeAttr("accordionable");b("#step"+d).find("p[id$='commands']").append(b(".rup-wizard_submitButton"));b("#step"+d).show();if(h.summaryFnc_POST){h.summaryFnc_POST.call()}},_getRupTabs:function(d,f,c,e){b(f).find(".rup-tabs_title").each(function(g,h){if(b.inArray(h.innerHTML,c)!==-1){return}e.push(b(h).parent().attr("href"));c.push(h.innerHTML);if(e[e.length-1].substring(1)===c[c.length-1]){d._getRupTabs(d,b("#"+c[c.length-1]),c,e)}})},_hidePassword:function(c){var e="";for(var d=0;d<c.length;d++){e+="*"}return e},_formToWizard:function(f){f=b.extend({submitButton:""},f);var h=this;var d=b(h).find("fieldset");var j=d.size();var c="#"+f.submitButton;b(c).hide();b(h).before("<ul id='steps'></ul>");d.each(function(m){b(this).wrap("<div id='step"+m+"'></div>");b(this).append("<p id='step"+m+"commands'></p>");var l=b(this).find("legend").html();b("#steps").append("<li id='stepDesc"+m+"'>Step "+(m+1)+"<a href='#'>"+l+"</a></li>");if(m==0){k(m);e(m)}else{if(m==j-1){b("#step"+m).hide();g(m)}else{b("#step"+m).hide();g(m);k(m)}}});function g(l){var m="step"+l;b("#"+m+"commands").append("<a href='#' id='"+m+"Prev' class='prev'>< Back</a>");b("#"+m+"Prev").bind("click",function(n){b("#"+m).hide();b("#step"+(l-1)).show();b(c).hide();e(l-1)})}function k(l){var m="step"+l;b("#"+m+"commands").append("<a href='#' id='"+m+"Next' class='next'>Next ></a>");b("#"+m+"Next").bind("click",function(n){b("#"+m).hide();b("#step"+(l+1)).show();if(l+2==j){b(c).show()}e(l+1)})}function e(l){b("#steps li").removeClass("current");b("#stepDesc"+l).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",{getRupValue:function(){var g=this,e=g.data("settings"),j,h,d=g.attr("name"),c;if(b.inArray("checkbox",e.plugins)!==-1){j=g.rup_tree("get_checked",null,true)}else{j=g.rup_tree("get_selected")}var f=b.map(j,function(m,l){var k=b(m);if(b.isFunction(e.core.getValue)){return b.proxy(e.core.getValue,g)(k,k.data())}h=k.attr("id");return h?h:k.text()});if(e.core.submitAsJSON){return b.rup_utils.getRupValueAsJson(d,f)}else{if(e.core.submitAsString){return b.rup_utils.getRupValueWrapped(d,f.toString())}else{return b.rup_utils.getRupValueWrapped(d,f)}}},setRupValue:function(e){var h=this,f=h.data("settings"),k,d,g,j,c;h.rup_tree("uncheck_all");k=h.get_container_ul().find("li");c=f.core.readAsString===true?e.split(","):e;b.each(k,function(l,m){d=b(m);if(b.isFunction(f.core.getValue)){g=b.proxy(f.core.getValue,h)(d,d.data())}else{j=d.attr("id");g=j?j:d.text()}if(b.inArray(g,c)!==-1){h.rup_tree("check_node",m)}})},rollback:function(c){b.jstree.rollback(c)},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(c){$(this).jstree("refresh",c)},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(c,d){return($(this).jstree("get_path",c,d))},open_node:function(d,e,c){$(this).jstree("open_node",d,e,c)},close_node:function(d,c){$(this).jstree("close_node",d,c)},toggle_node:function(c){return($(this).jstree("toggle_node",c))},open_all:function(c,d){$(this).jstree("open_all",c,d)},close_all:function(c,d){$(this).jstree("close_all",c,d)},is_open:function(c){return($(this).jstree("is_open",c))},is_closed:function(c){return($(this).jstree("is_closed",c))},is_leaf:function(c){return($(this).jstree("is_leaf",c))},get_rollback:function(){return($(this).jstree("get_rollback"))},create_node:function(d,c,e,f){return($(this).jstree("create_node",d,c,e,f))},get_text:function(c){return($(this).jstree("get_text",c))},rename_node:function(c,d){$(this).jstree("rename_node",c,d)},delete_node:function(c){$(this).jstree("delete_node",c)},check_move:function(){return($(this).jstree("check_move"))},move_node:function(h,f,c,e,d,g){return($(this).jstree("move_node",h,f,c,e,d,g))},get_theme:function(){var c=$(this).jstree("get_theme");if(typeof c!=="string"){return"rup-default"}else{return c}},set_theme:function(d,c){if(d!=="rup-default"){if($(this).rup_tree("get_theme")==="rup-default"){$(this).removeClass("jstree-rup-default")}var e=this.data("settings");e.actualThemeUrl=c;this.data("settings",e);$(this).jstree("set_theme",d,c)}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(c){return($(this).jstree("refresh",c))},hover_node:function(c){$(this).jstree("hover_node",c)},dehover_node:function(){$(this).jstree("dehover_node")},select_node:function(e,c,d){$(this).jstree("select_node",e,c,d)},deselect_node:function(c){$(this).jstree("deselect_node",c)},toggle_select:function(c){$(this).jstree("toggle_select",c)},deselect_all:function(c){$(this).jstree("deselect_all",c)},get_selected:function(c){return($(this).jstree("get_selected",c))},is_selected:function(c){return($(this).jstree("is_selected",c))},enable_hotkeys:function(){$(this).jstree("enable_hotkeys")},disable_hotkeys:function(){$(this).jstree("disable_hotkeys")},change_state:function(d,c){$(this).jstree("change_state",d,c)},check_node:function(c){$(this).jstree("check_node",c)},uncheck_node:function(c){$(this).jstree("uncheck_node",c)},check_all:function(){$(this).jstree("check_all")},uncheck_all:function(){$(this).jstree("uncheck_all")},is_checked:function(c){return($(this).jstree("is_checked",c))},get_checked:function(d,c){return($(this).jstree("get_checked",d,c))},get_unchecked:function(d,c){return($(this).jstree("is_checked",d,c))},show_checkboxes:function(){$(this).jstree("show_checkboxes")},hide_checkboxes:function(){$(this).jstree("hide_checkboxes")},rename:function(c){$(this).jstree("rename",c)},create:function(e,d,f,g,c){return($(this).jstree("create",e,d,f,g,c))},remove:function(c){$(this).jstree("remove",c)},cut:function(c){$(this).jstree("cut",c)},copy:function(c){$(this).jstree("copy",c)},paste:function(c){$(this).jstree("paste",c)},show_contextmenu:function(d,c,e){$(this).jstree("show_contextmenu",d,c,e)},set_type:function(c,d){$(this).jstree("set_type",c,d)}});b.fn.rup_tree("extend",{_init:function(f){if(f.length>1){b.rup.errorGestor(b.rup.i18n.base.rup_global.initError+b(this).attr("id"))}else{if(f.length>0){if(f[0].select){f[0].ui=f[0].select;delete f[0].select}if(f[0].jQueryUIStyles){f[0].themeroller=f[0].jQueryUIStyles;delete f[0].jQueryUIStyles}}var h=b.extend(true,{},b.fn.rup_tree.defaults,f[0]),e=this[0],c=this;h.$self=$(this);h.$self.attr("ruptype","tree");if(h.ui===undefined||h.ui.enable!==false){h.plugins[h.plugins.length]="ui"}if(h.crrm===undefined||h.crrm.enable!==false){h.plugins[h.plugins.length]="crrm";c.bind("cut.jstree",$.proxy(function(l,k){$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled");k.args[0].children("a").addClass("rup_tree_cutNode ui-state-disabled")},this));c.bind("copy.jstree",$.proxy(function(l,k){$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled")},this));c.bind("paste.jstree",$.proxy(function(l,k){$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled")},this))}if(h.hotkeys===undefined||h.hotkeys.enable!==false){h.plugins[h.plugins.length]="hotkeys";if(h.crrm===undefined||h.crrm.enable!==false){b.jstree.defaults.hotkeys.esc=$.proxy(function(k){if(k.target.tagName==="BODY"){$(this).jstree("cleanCut");$(this).find(".rup_tree_cutNode.ui-state-disabled").removeClass("rup_tree_cutNode ui-state-disabled")}},this)}}c._eventRecollector(h,c);c.addClass("rup_tree");if(h.xml_data!==undefined){h.plugins[h.plugins.length]="xml_data"}else{if(h.json_data!==undefined){h.plugins[h.plugins.length]="json_data"}else{h.plugins[h.plugins.length]="html_data"}}if(h.contextmenu!==undefined&&h.contextmenu.enable===true){h.plugins[h.plugins.length]="contextmenu"}else{delete h.contextmenu}if(h.sort!==undefined){if(h.sort.enable===true){h.plugins[h.plugins.length]="sort";if(h.sort.sortFunction!==undefined){h.sort=h.sort.sortFunction}else{delete h.sort}}else{delete h.sort}}if(h.checkbox!==undefined&&h.checkbox.enable===true){h.plugins[h.plugins.length]="checkbox";delete h.checkbox.enable}else{delete h.checkbox}if(h.wholerow!==undefined&&h.wholerow===true){h.plugins[h.plugins.length]="wholerow"}if(h.unique!==undefined&&h.unique.enable===true){h.plugins[h.plugins.length]="unique";delete h.unique.enable}else{delete h.unique}if(h.types!==undefined){h.plugins[h.plugins.length]="types";if($.rup_utils.aplicatioInPortal()){this.get_container().bind("loaded.jstree",$.proxy(function(){$(this).jstree("types_portal_css")},this))}}if(h.dnd!==undefined&&h.dnd.enable===true){h.plugins[h.plugins.length]="dnd";delete h.dnd.enable}else{delete h.dnd}if(h.themeroller!==undefined){if(h.themeroller.enable===true){h.plugins[h.plugins.length]="themeroller";delete h.themeroller.enable}else{h.plugins[h.plugins.length]="themes";delete h.themeroller}}else{h.plugins[h.plugins.length]="themes"}c.data("settings",h);c.jstree(h);c.bind("loaded.jstree",$.proxy(function(){this.removeClass("rup_tree")},this));if(h.themeroller===undefined&&!h.themes.theme){c.addClass("jstree-rup-default");$(this).jstree("set_theme_data","rup-default")}if(h.contextmenu!==undefined&&h.contextmenu.enable===true){delete h.contextmenu.enable;if(h.contextmenu.defaultOptions!==undefined){var j=this.jstree("get_settings").contextmenu.items;var d=h.contextmenu.defaultOptions;for(option in d){if(d[option]===false){j[option]=null}else{if(option==="ccp"){var g=d.ccp;for(ccpOption in g){if(g[ccpOption]===false){j.ccp.submenu[ccpOption]=null}}}}}$(this).jstree("set_contextmenu_items",j);delete h.contextmenu.defaultOptions}}else{delete h.contextmenu}}},_eventRecollector:function(f,d){var c;for(var e in f){c=e.split("_event");if(c.length>1){this.bind(c[0]+".jstree",f[e])}}}});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")},getValue:undefined,submitAsJSON:false,submitAsString:false,readAsString:false},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(be,M){var aw=be.document,bv=be.navigator,bn=be.location;var b=(function(){var bG=function(b1,b2){return new bG.fn.init(b1,b2,bE)},bV=be.jQuery,bI=be.$,bE,bZ=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bN=/\S/,bJ=/^\s+/,bF=/\s+$/,bB=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bO=/^[\],:{}\s]*$/,bX=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bQ=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bK=/(?:^|:|,)(?:\s*\[)+/g,bz=/(webkit)[ \/]([\w.]+)/,bS=/(opera)(?:.*version)?[ \/]([\w.]+)/,bR=/(msie) ([\w.]+)/,bT=/(mozilla)(?:.*? rv:([\w.]+))?/,bC=/-([a-z]|[0-9])/ig,b0=/^-ms-/,bU=function(b1,b2){return(b2+"").toUpperCase()},bY=bv.userAgent,bW,bD,e,bM=Object.prototype.toString,bH=Object.prototype.hasOwnProperty,bA=Array.prototype.push,bL=Array.prototype.slice,bP=String.prototype.trim,bw=Array.prototype.indexOf,by={};bG.fn=bG.prototype={constructor:bG,init:function(b1,b5,b4){var b3,b6,b2,b7;if(!b1){return this}if(b1.nodeType){this.context=this[0]=b1;this.length=1;return this}if(b1==="body"&&!b5&&aw.body){this.context=aw;this[0]=aw.body;this.selector=b1;this.length=1;return this}if(typeof b1==="string"){if(b1.charAt(0)==="<"&&b1.charAt(b1.length-1)===">"&&b1.length>=3){b3=[null,b1,null]}else{b3=bZ.exec(b1)}if(b3&&(b3[1]||!b5)){if(b3[1]){b5=b5 instanceof bG?b5[0]:b5;b7=(b5?b5.ownerDocument||b5:aw);b2=bB.exec(b1);if(b2){if(bG.isPlainObject(b5)){b1=[aw.createElement(b2[1])];bG.fn.attr.call(b1,b5,true)}else{b1=[b7.createElement(b2[1])]}}else{b2=bG.buildFragment([b3[1]],[b7]);b1=(b2.cacheable?bG.clone(b2.fragment):b2.fragment).childNodes}return bG.merge(this,b1)}else{b6=aw.getElementById(b3[2]);if(b6&&b6.parentNode){if(b6.id!==b3[2]){return b4.find(b1)}this.length=1;this[0]=b6}this.context=aw;this.selector=b1;return this}}else{if(!b5||b5.jquery){return(b5||b4).find(b1)}else{return this.constructor(b5).find(b1)}}}else{if(bG.isFunction(b1)){return b4.ready(b1)}}if(b1.selector!==M){this.selector=b1.selector;this.context=b1.context}return bG.makeArray(b1,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return bL.call(this,0)},get:function(b1){return b1==null?this.toArray():(b1<0?this[this.length+b1]:this[b1])},pushStack:function(b2,b4,b1){var b3=this.constructor();if(bG.isArray(b2)){bA.apply(b3,b2)}else{bG.merge(b3,b2)}b3.prevObject=this;b3.context=this.context;if(b4==="find"){b3.selector=this.selector+(this.selector?" ":"")+b1}else{if(b4){b3.selector=this.selector+"."+b4+"("+b1+")"}}return b3},each:function(b2,b1){return bG.each(this,b2,b1)},ready:function(b1){bG.bindReady();bD.add(b1);return this},eq:function(b1){b1=+b1;return b1===-1?this.slice(b1):this.slice(b1,b1+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bL.apply(this,arguments),"slice",bL.call(arguments).join(","))},map:function(b1){return this.pushStack(bG.map(this,function(b3,b2){return b1.call(b3,b2,b3)}))},end:function(){return this.prevObject||this.constructor(null)},push:bA,sort:[].sort,splice:[].splice};bG.fn.init.prototype=bG.fn;bG.extend=bG.fn.extend=function(){var ca,b3,b1,b2,b7,b8,b6=arguments[0]||{},b5=1,b4=arguments.length,b9=false;if(typeof b6==="boolean"){b9=b6;b6=arguments[1]||{};b5=2}if(typeof b6!=="object"&&!bG.isFunction(b6)){b6={}}if(b4===b5){b6=this;--b5}for(;b5<b4;b5++){if((ca=arguments[b5])!=null){for(b3 in ca){b1=b6[b3];b2=ca[b3];if(b6===b2){continue}if(b9&&b2&&(bG.isPlainObject(b2)||(b7=bG.isArray(b2)))){if(b7){b7=false;b8=b1&&bG.isArray(b1)?b1:[]}else{b8=b1&&bG.isPlainObject(b1)?b1:{}}b6[b3]=bG.extend(b9,b8,b2)}else{if(b2!==M){b6[b3]=b2}}}}}return b6};bG.extend({noConflict:function(b1){if(be.$===bG){be.$=bI}if(b1&&be.jQuery===bG){be.jQuery=bV}return bG},isReady:false,readyWait:1,holdReady:function(b1){if(b1){bG.readyWait++}else{bG.ready(true)}},ready:function(b1){if((b1===true&&!--bG.readyWait)||(b1!==true&&!bG.isReady)){if(!aw.body){return setTimeout(bG.ready,1)}bG.isReady=true;if(b1!==true&&--bG.readyWait>0){return}bD.fireWith(aw,[bG]);if(bG.fn.trigger){bG(aw).trigger("ready").off("ready")}}},bindReady:function(){if(bD){return}bD=bG.Callbacks("once memory");if(aw.readyState==="complete"){return setTimeout(bG.ready,1)}if(aw.addEventListener){aw.addEventListener("DOMContentLoaded",e,false);be.addEventListener("load",bG.ready,false)}else{if(aw.attachEvent){aw.attachEvent("onreadystatechange",e);be.attachEvent("onload",bG.ready);var b1=false;try{b1=be.frameElement==null}catch(b2){}if(aw.documentElement.doScroll&&b1){bx()}}}},isFunction:function(b1){return bG.type(b1)==="function"},isArray:Array.isArray||function(b1){return bG.type(b1)==="array"},isWindow:function(b1){return b1!=null&&b1==b1.window},isNumeric:function(b1){return !isNaN(parseFloat(b1))&&isFinite(b1)},type:function(b1){return b1==null?String(b1):by[bM.call(b1)]||"object"},isPlainObject:function(b3){if(!b3||bG.type(b3)!=="object"||b3.nodeType||bG.isWindow(b3)){return false}try{if(b3.constructor&&!bH.call(b3,"constructor")&&!bH.call(b3.constructor.prototype,"isPrototypeOf")){return false}}catch(b2){return false}var b1;for(b1 in b3){}return b1===M||bH.call(b3,b1)},isEmptyObject:function(b2){for(var b1 in b2){return false}return true},error:function(b1){throw new Error(b1)},parseJSON:function(b1){if(typeof b1!=="string"||!b1){return null}b1=bG.trim(b1);if(be.JSON&&be.JSON.parse){return be.JSON.parse(b1)}if(bO.test(b1.replace(bX,"@").replace(bQ,"]").replace(bK,""))){return(new Function("return "+b1))()}bG.error("Invalid JSON: "+b1)},parseXML:function(b3){if(typeof b3!=="string"||!b3){return null}var b1,b2;try{if(be.DOMParser){b2=new DOMParser();b1=b2.parseFromString(b3,"text/xml")}else{b1=new ActiveXObject("Microsoft.XMLDOM");b1.async="false";b1.loadXML(b3)}}catch(b4){b1=M}if(!b1||!b1.documentElement||b1.getElementsByTagName("parsererror").length){bG.error("Invalid XML: "+b3)}return b1},noop:function(){},globalEval:function(b1){if(b1&&bN.test(b1)){(be.execScript||function(b2){be["eval"].call(be,b2)})(b1)}},camelCase:function(b1){return b1.replace(b0,"ms-").replace(bC,bU)},nodeName:function(b2,b1){return b2.nodeName&&b2.nodeName.toUpperCase()===b1.toUpperCase()},each:function(b4,b7,b3){var b2,b5=0,b6=b4.length,b1=b6===M||bG.isFunction(b4);if(b3){if(b1){for(b2 in b4){if(b7.apply(b4[b2],b3)===false){break}}}else{for(;b5<b6;){if(b7.apply(b4[b5++],b3)===false){break}}}}else{if(b1){for(b2 in b4){if(b7.call(b4[b2],b2,b4[b2])===false){break}}}else{for(;b5<b6;){if(b7.call(b4[b5],b5,b4[b5++])===false){break}}}}return b4},trim:bP?function(b1){return b1==null?"":bP.call(b1)}:function(b1){return b1==null?"":b1.toString().replace(bJ,"").replace(bF,"")},makeArray:function(b4,b2){var b1=b2||[];if(b4!=null){var b3=bG.type(b4);if(b4.length==null||b3==="string"||b3==="function"||b3==="regexp"||bG.isWindow(b4)){bA.call(b1,b4)}else{bG.merge(b1,b4)}}return b1},inArray:function(b3,b4,b2){var b1;if(b4){if(bw){return bw.call(b4,b3,b2)}b1=b4.length;b2=b2?b2<0?Math.max(0,b1+b2):b2:0;for(;b2<b1;b2++){if(b2 in b4&&b4[b2]===b3){return b2}}}return -1},merge:function(b5,b3){var b4=b5.length,b2=0;if(typeof b3.length==="number"){for(var b1=b3.length;b2<b1;b2++){b5[b4++]=b3[b2]}}else{while(b3[b2]!==M){b5[b4++]=b3[b2++]}}b5.length=b4;return b5},grep:function(b2,b7,b1){var b3=[],b6;b1=!!b1;for(var b4=0,b5=b2.length;b4<b5;b4++){b6=!!b7(b2[b4],b4);if(b1!==b6){b3.push(b2[b4])}}return b3},map:function(b1,b8,b9){var b6,b7,b5=[],b3=0,b2=b1.length,b4=b1 instanceof bG||b2!==M&&typeof b2==="number"&&((b2>0&&b1[0]&&b1[b2-1])||b2===0||bG.isArray(b1));if(b4){for(;b3<b2;b3++){b6=b8(b1[b3],b3,b9);if(b6!=null){b5[b5.length]=b6}}}else{for(b7 in b1){b6=b8(b1[b7],b7,b9);if(b6!=null){b5[b5.length]=b6}}}return b5.concat.apply([],b5)},guid:1,proxy:function(b5,b4){if(typeof b4==="string"){var b3=b5[b4];b4=b5;b5=b3}if(!bG.isFunction(b5)){return M}var b1=bL.call(arguments,2),b2=function(){return b5.apply(b4,b1.concat(bL.call(arguments)))};b2.guid=b5.guid=b5.guid||b2.guid||bG.guid++;return b2},access:function(b1,b7,ca,b8,b5,cb,b9){var b3,b6=ca==null,b4=0,b2=b1.length;if(ca&&typeof ca==="object"){for(b4 in ca){bG.access(b1,b7,b4,ca[b4],1,cb,b8)}b5=1}else{if(b8!==M){b3=b9===M&&bG.isFunction(b8);if(b6){if(b3){b3=b7;b7=function(cd,cc,ce){return b3.call(bG(cd),ce)}}else{b7.call(b1,b8);b7=null}}if(b7){for(;b4<b2;b4++){b7(b1[b4],ca,b3?b8.call(b1[b4],b4,b7(b1[b4],ca)):b8,b9)}}b5=1}}return b5?b1:b6?b7.call(b1):b2?b7(b1[0],ca):cb},now:function(){return(new Date()).getTime()},uaMatch:function(b2){b2=b2.toLowerCase();var b1=bz.exec(b2)||bS.exec(b2)||bR.exec(b2)||b2.indexOf("compatible")<0&&bT.exec(b2)||[];return{browser:b1[1]||"",version:b1[2]||"0"}},sub:function(){function b1(b4,b5){return new b1.fn.init(b4,b5)}bG.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 bG&&!(b5 instanceof b1)){b5=b1(b5)}return bG.fn.init.call(this,b4,b5,b2)};b1.fn.init.prototype=b1.fn;var b2=b1(aw);return b1},browser:{}});bG.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(b2,b1){by["[object "+b1+"]"]=b1.toLowerCase()});bW=bG.uaMatch(bY);if(bW.browser){bG.browser[bW.browser]=true;bG.browser.version=bW.version}if(bG.browser.webkit){bG.browser.safari=true}if(bN.test("\xA0")){bJ=/^[\s\xA0]+/;bF=/[\s\xA0]+$/}bE=bG(aw);if(aw.addEventListener){e=function(){aw.removeEventListener("DOMContentLoaded",e,false);bG.ready()}}else{if(aw.attachEvent){e=function(){if(aw.readyState==="complete"){aw.detachEvent("onreadystatechange",e);bG.ready()}}}}function bx(){if(bG.isReady){return}try{aw.documentElement.doScroll("left")}catch(b1){setTimeout(bx,1);return}bG.ready()}return bG})();var a4={};function Y(e){var bw=a4[e]={},bx,by;e=e.split(/\s+/);for(bx=0,by=e.length;bx<by;bx++){bw[e[bx]]=true}return bw}b.Callbacks=function(by){by=by?(a4[by]||Y(by)):{};var bD=[],bE=[],bz,e,bA,bx,bB,bC,bG=function(bH){var bI,bL,bK,bJ,bM;for(bI=0,bL=bH.length;bI<bL;bI++){bK=bH[bI];bJ=b.type(bK);if(bJ==="array"){bG(bK)}else{if(bJ==="function"){if(!by.unique||!bF.has(bK)){bD.push(bK)}}}}},bw=function(bI,bH){bH=bH||[];bz=!by.memory||[bI,bH];e=true;bA=true;bC=bx||0;bx=0;bB=bD.length;for(;bD&&bC<bB;bC++){if(bD[bC].apply(bI,bH)===false&&by.stopOnFalse){bz=true;break}}bA=false;if(bD){if(!by.once){if(bE&&bE.length){bz=bE.shift();bF.fireWith(bz[0],bz[1])}}else{if(bz===true){bF.disable()}else{bD=[]}}}},bF={add:function(){if(bD){var bH=bD.length;bG(arguments);if(bA){bB=bD.length}else{if(bz&&bz!==true){bx=bH;bw(bz[0],bz[1])}}}return this},remove:function(){if(bD){var bH=arguments,bJ=0,bK=bH.length;for(;bJ<bK;bJ++){for(var bI=0;bI<bD.length;bI++){if(bH[bJ]===bD[bI]){if(bA){if(bI<=bB){bB--;if(bI<=bC){bC--}}}bD.splice(bI--,1);if(by.unique){break}}}}}return this},has:function(bI){if(bD){var bH=0,bJ=bD.length;for(;bH<bJ;bH++){if(bI===bD[bH]){return true}}}return false},empty:function(){bD=[];return this},disable:function(){bD=bE=bz=M;return this},disabled:function(){return !bD},lock:function(){bE=M;if(!bz||bz===true){bF.disable()}return this},locked:function(){return !bE},fireWith:function(bI,bH){if(bE){if(bA){if(!by.once){bE.push([bI,bH])}}else{if(!(by.once&&bz)){bw(bI,bH)}}}return this},fire:function(){bF.fireWith(this,arguments);return this},fired:function(){return !!e}};return bF};var aL=[].slice;b.extend({Deferred:function(bz){var by=b.Callbacks("once memory"),bx=b.Callbacks("once memory"),bw=b.Callbacks("memory"),e="pending",bB={resolve:by,reject:bx,notify:bw},bD={done:by.add,fail:bx.add,progress:bw.add,state:function(){return e},isResolved:by.fired,isRejected:bx.fired,then:function(bF,bE,bG){bC.done(bF).fail(bE).progress(bG);return this},always:function(){bC.done.apply(bC,arguments).fail.apply(bC,arguments);return this},pipe:function(bG,bF,bE){return b.Deferred(function(bH){b.each({done:[bG,"resolve"],fail:[bF,"reject"],progress:[bE,"notify"]},function(bJ,bM){var bI=bM[0],bL=bM[1],bK;if(b.isFunction(bI)){bC[bJ](function(){bK=bI.apply(this,arguments);if(bK&&b.isFunction(bK.promise)){bK.promise().then(bH.resolve,bH.reject,bH.notify)}else{bH[bL+"With"](this===bC?bH:this,[bK])}})}else{bC[bJ](bH[bL])}})}).promise()},promise:function(bF){if(bF==null){bF=bD}else{for(var bE in bD){bF[bE]=bD[bE]}}return bF}},bC=bD.promise({}),bA;for(bA in bB){bC[bA]=bB[bA].fire;bC[bA+"With"]=bB[bA].fireWith}bC.done(function(){e="resolved"},bx.disable,bw.lock).fail(function(){e="rejected"},by.disable,bw.lock);if(bz){bz.call(bC,bC)}return bC},when:function(bB){var by=aL.call(arguments,0),bw=0,e=by.length,bC=new Array(e),bx=e,bz=e,bD=e<=1&&bB&&b.isFunction(bB.promise)?bB:b.Deferred(),bF=bD.promise();function bE(bG){return function(bH){by[bG]=arguments.length>1?aL.call(arguments,0):bH;if(!(--bx)){bD.resolveWith(bD,by)}}}function bA(bG){return function(bH){bC[bG]=arguments.length>1?aL.call(arguments,0):bH;bD.notifyWith(bF,bC)}}if(e>1){for(;bw<e;bw++){if(by[bw]&&by[bw].promise&&b.isFunction(by[bw].promise)){by[bw].promise().then(bE(bw),bD.reject,bA(bw))}else{--bx}}if(!bx){bD.resolveWith(bD,by)}}else{if(bD!==bB){bD.resolveWith(bD,e?[bB]:[])}}return bF}});b.support=(function(){var bJ,bI,bF,bG,by,bE,bD,bA,bK,bB,bz,bx,bw=aw.createElement("div"),bH=aw.documentElement;bw.setAttribute("className","t");bw.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";bI=bw.getElementsByTagName("*");bF=bw.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=aw.createElement("select");by=bG.appendChild(aw.createElement("option"));bE=bw.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bw.firstChild.nodeType===3),tbody:!bw.getElementsByTagName("tbody").length,htmlSerialize:!!bw.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:by.selected,getSetAttribute:bw.className!=="t",enctype:!!aw.createElement("form").enctype,html5Clone:aw.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=bJ.boxModel=(aw.compatMode==="CSS1Compat");bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!by.disabled;try{delete bw.test}catch(bC){bJ.deleteExpando=false}if(!bw.addEventListener&&bw.attachEvent&&bw.fireEvent){bw.attachEvent("onclick",function(){bJ.noCloneEvent=false});bw.cloneNode(true).fireEvent("onclick")}bE=aw.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bE.setAttribute("name","t");bw.appendChild(bE);bD=aw.createDocumentFragment();bD.appendChild(bw.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bw);if(bw.attachEvent){for(bz in {submit:1,change:1,focusin:1}){bB="on"+bz;bx=(bB in bw);if(!bx){bw.setAttribute(bB,"return;");bx=(typeof bw[bB]==="function")}bJ[bz+"Bubbles"]=bx}}bD.removeChild(bw);bD=bG=by=bw=bE=null;b(function(){var bN,bW,bX,bV,bP,bQ,bS,bM,bL,bR,bO,e,bU,bT=aw.getElementsByTagName("body")[0];if(!bT){return}bM=1;bU="padding:0;margin:0;border:";bO="position:absolute;top:0;left:0;width:1px;height:1px;";e=bU+"0;visibility:hidden;";bL="style='"+bO+bU+"5px solid #000;";bR="<div "+bL+"display:block;'><div style='"+bU+"0;display:block;overflow:hidden;'></div></div><table "+bL+"' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";bN=aw.createElement("div");bN.style.cssText=e+"width:0;height:0;position:static;top:0;margin-top:"+bM+"px";bT.insertBefore(bN,bT.firstChild);bw=aw.createElement("div");bN.appendChild(bw);bw.innerHTML="<table><tr><td style='"+bU+"0;display:none'></td><td>t</td></tr></table>";bA=bw.getElementsByTagName("td");bx=(bA[0].offsetHeight===0);bA[0].style.display="";bA[1].style.display="none";bJ.reliableHiddenOffsets=bx&&(bA[0].offsetHeight===0);if(be.getComputedStyle){bw.innerHTML="";bS=aw.createElement("div");bS.style.width="0";bS.style.marginRight="0";bw.style.width="2px";bw.appendChild(bS);bJ.reliableMarginRight=(parseInt((be.getComputedStyle(bS,null)||{marginRight:0}).marginRight,10)||0)===0}if(typeof bw.style.zoom!=="undefined"){bw.innerHTML="";bw.style.width=bw.style.padding="1px";bw.style.border=0;bw.style.overflow="hidden";bw.style.display="inline";bw.style.zoom=1;bJ.inlineBlockNeedsLayout=(bw.offsetWidth===3);bw.style.display="block";bw.style.overflow="visible";bw.innerHTML="<div style='width:5px;'></div>";bJ.shrinkWrapBlocks=(bw.offsetWidth!==3)}bw.style.cssText=bO+e;bw.innerHTML=bR;bW=bw.firstChild;bX=bW.firstChild;bP=bW.nextSibling.firstChild.firstChild;bQ={doesNotAddBorder:(bX.offsetTop!==5),doesAddBorderForTableAndCells:(bP.offsetTop===5)};bX.style.position="fixed";bX.style.top="20px";bQ.fixedPosition=(bX.offsetTop===20||bX.offsetTop===15);bX.style.position=bX.style.top="";bW.style.overflow="hidden";bW.style.position="relative";bQ.subtractsBorderForOverflowNotVisible=(bX.offsetTop===-5);bQ.doesNotIncludeMarginInBodyOffset=(bT.offsetTop!==bM);if(be.getComputedStyle){bw.style.marginTop="1%";bJ.pixelMargin=(be.getComputedStyle(bw,null)||{marginTop:0}).marginTop!=="1%"}if(typeof bN.style.zoom!=="undefined"){bN.style.zoom=1}bT.removeChild(bN);bS=bw=bN=null;b.extend(bJ,bQ)});return bJ})();var aU=/^(?:\{.*\}|\[.*\])$/,aB=/([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&&!T(e)},data:function(by,bw,bA,bz){if(!b.acceptData(by)){return}var bH,bB,bE,bF=b.expando,bD=typeof bw==="string",bG=by.nodeType,e=bG?b.cache:by,bx=bG?by[bF]:by[bF]&&bF,bC=bw==="events";if((!bx||!e[bx]||(!bC&&!bz&&!e[bx].data))&&bD&&bA===M){return}if(!bx){if(bG){by[bF]=bx=++b.uuid}else{bx=bF}}if(!e[bx]){e[bx]={};if(!bG){e[bx].toJSON=b.noop}}if(typeof bw==="object"||typeof bw==="function"){if(bz){e[bx]=b.extend(e[bx],bw)}else{e[bx].data=b.extend(e[bx].data,bw)}}bH=bB=e[bx];if(!bz){if(!bB.data){bB.data={}}bB=bB.data}if(bA!==M){bB[b.camelCase(bw)]=bA}if(bC&&!bB[bw]){return bH.events}if(bD){bE=bB[bw];if(bE==null){bE=bB[b.camelCase(bw)]}}else{bE=bB}return bE},removeData:function(by,bw,bz){if(!b.acceptData(by)){return}var bC,bB,bA,bD=b.expando,bE=by.nodeType,e=bE?b.cache:by,bx=bE?by[bD]:bD;if(!e[bx]){return}if(bw){bC=bz?e[bx]:e[bx].data;if(bC){if(!b.isArray(bw)){if(bw in bC){bw=[bw]}else{bw=b.camelCase(bw);if(bw in bC){bw=[bw]}else{bw=bw.split(" ")}}}for(bB=0,bA=bw.length;bB<bA;bB++){delete bC[bw[bB]]}if(!(bz?T:b.isEmptyObject)(bC)){return}}}if(!bz){delete e[bx].data;if(!T(e[bx])){return}}if(b.support.deleteExpando||!e.setInterval){delete e[bx]}else{e[bx]=null}if(bE){if(b.support.deleteExpando){delete by[bD]}else{if(by.removeAttribute){by.removeAttribute(bD)}else{by[bD]=null}}}},_data:function(bw,e,bx){return b.data(bw,e,bx,true)},acceptData:function(bw){if(bw.nodeName){var e=b.noData[bw.nodeName.toLowerCase()];if(e){return !(e===true||bw.getAttribute("classid")!==e)}}return true}});b.fn.extend({data:function(bE,bD){var bz,bw,bC,e,by,bx=this[0],bB=0,bA=null;if(bE===M){if(this.length){bA=b.data(bx);if(bx.nodeType===1&&!b._data(bx,"parsedAttrs")){bC=bx.attributes;for(by=bC.length;bB<by;bB++){e=bC[bB].name;if(e.indexOf("data-")===0){e=b.camelCase(e.substring(5));a7(bx,e,bA[e])}}b._data(bx,"parsedAttrs",true)}}return bA}if(typeof bE==="object"){return this.each(function(){b.data(this,bE)})}bz=bE.split(".",2);bz[1]=bz[1]?"."+bz[1]:"";bw=bz[1]+"!";return b.access(this,function(bF){if(bF===M){bA=this.triggerHandler("getData"+bw,[bz[0]]);if(bA===M&&bx){bA=b.data(bx,bE);bA=a7(bx,bE,bA)}return bA===M&&bz[1]?this.data(bz[0]):bA}bz[1]=bF;this.each(function(){var bG=b(this);bG.triggerHandler("setData"+bw,bz);b.data(this,bE,bF);bG.triggerHandler("changeData"+bw,bz)})},null,bD,arguments.length>1,null,false)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function a7(by,bx,bz){if(bz===M&&by.nodeType===1){var bw="data-"+bx.replace(aB,"-$1").toLowerCase();bz=by.getAttribute(bw);if(typeof bz==="string"){try{bz=bz==="true"?true:bz==="false"?false:bz==="null"?null:b.isNumeric(bz)?+bz:aU.test(bz)?b.parseJSON(bz):bz}catch(bA){}b.data(by,bx,bz)}else{bz=M}}return bz}function T(bw){for(var e in bw){if(e==="data"&&b.isEmptyObject(bw[e])){continue}if(e!=="toJSON"){return false}}return true}function bk(bz,by,bB){var bx=by+"defer",bw=by+"queue",e=by+"mark",bA=b._data(bz,bx);if(bA&&(bB==="queue"||!b._data(bz,bw))&&(bB==="mark"||!b._data(bz,e))){setTimeout(function(){if(!b._data(bz,bw)&&!b._data(bz,e)){b.removeData(bz,bx,true);bA.fire()}},0)}}b.extend({_mark:function(bw,e){if(bw){e=(e||"fx")+"mark";b._data(bw,e,(b._data(bw,e)||0)+1)}},_unmark:function(bz,by,bw){if(bz!==true){bw=by;by=bz;bz=false}if(by){bw=bw||"fx";var e=bw+"mark",bx=bz?0:((b._data(by,e)||1)-1);if(bx){b._data(by,e,bx)}else{b.removeData(by,e,true);bk(by,bw,"mark")}}},queue:function(bw,e,by){var bx;if(bw){e=(e||"fx")+"queue";bx=b._data(bw,e);if(by){if(!bx||b.isArray(by)){bx=b._data(bw,e,b.makeArray(by))}else{bx.push(by)}}return bx||[]}},dequeue:function(bz,by){by=by||"fx";var bw=b.queue(bz,by),bx=bw.shift(),e={};if(bx==="inprogress"){bx=bw.shift()}if(bx){if(by==="fx"){bw.unshift("inprogress")}b._data(bz,by+".run",e);bx.call(bz,function(){b.dequeue(bz,by)},e)}if(!bw.length){b.removeData(bz,by+"queue "+by+".run",true);bk(bz,by,"queue")}}});b.fn.extend({queue:function(e,bw){var bx=2;if(typeof e!=="string"){bw=e;e="fx";bx--}if(arguments.length<bx){return b.queue(this[0],e)}return bw===M?this:this.each(function(){var by=b.queue(this,e,bw);if(e==="fx"&&by[0]!=="inprogress"){b.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(bw,e){bw=b.fx?b.fx.speeds[bw]||bw:bw;e=e||"fx";return this.queue(e,function(by,bx){var bz=setTimeout(by,bw);bx.stop=function(){clearTimeout(bz)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(bE,bx){if(typeof bE!=="string"){bx=bE;bE=M}bE=bE||"fx";var e=b.Deferred(),bw=this,bz=bw.length,bC=1,bA=bE+"defer",bB=bE+"queue",bD=bE+"mark",by;function bF(){if(!(--bC)){e.resolveWith(bw,[bw])}}while(bz--){if((by=b.data(bw[bz],bA,M,true)||(b.data(bw[bz],bB,M,true)||b.data(bw[bz],bD,M,true))&&b.data(bw[bz],bA,b.Callbacks("once memory"),true))){bC++;by.add(bF)}}bF();return e.promise(bx)}});var aR=/[\n\t\r]/g,ah=/\s+/,aW=/\r/g,g=/^(?:button|input)$/i,D=/^(?:button|input|object|select|textarea)$/i,m=/^a(?:rea)?$/i,ap=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,F=b.support.getSetAttribute,bg,a0,aH;b.fn.extend({attr:function(e,bw){return b.access(this,b.attr,e,bw,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,bw){return b.access(this,b.prop,e,bw,arguments.length>1)},removeProp:function(e){e=b.propFix[e]||e;return this.each(function(){try{this[e]=M;delete this[e]}catch(bw){}})},addClass:function(bz){var bB,bx,bw,by,bA,bC,e;if(b.isFunction(bz)){return this.each(function(bD){b(this).addClass(bz.call(this,bD,this.className))})}if(bz&&typeof bz==="string"){bB=bz.split(ah);for(bx=0,bw=this.length;bx<bw;bx++){by=this[bx];if(by.nodeType===1){if(!by.className&&bB.length===1){by.className=bz}else{bA=" "+by.className+" ";for(bC=0,e=bB.length;bC<e;bC++){if(!~bA.indexOf(" "+bB[bC]+" ")){bA+=bB[bC]+" "}}by.className=b.trim(bA)}}}}return this},removeClass:function(bA){var bB,bx,bw,bz,by,bC,e;if(b.isFunction(bA)){return this.each(function(bD){b(this).removeClass(bA.call(this,bD,this.className))})}if((bA&&typeof bA==="string")||bA===M){bB=(bA||"").split(ah);for(bx=0,bw=this.length;bx<bw;bx++){bz=this[bx];if(bz.nodeType===1&&bz.className){if(bA){by=(" "+bz.className+" ").replace(aR," ");for(bC=0,e=bB.length;bC<e;bC++){by=by.replace(" "+bB[bC]+" "," ")}bz.className=b.trim(by)}else{bz.className=""}}}}return this},toggleClass:function(by,bw){var bx=typeof by,e=typeof bw==="boolean";if(b.isFunction(by)){return this.each(function(bz){b(this).toggleClass(by.call(this,bz,this.className,bw),bw)})}return this.each(function(){if(bx==="string"){var bB,bA=0,bz=b(this),bC=bw,bD=by.split(ah);while((bB=bD[bA++])){bC=e?bC:!bz.hasClass(bB);bz[bC?"addClass":"removeClass"](bB)}}else{if(bx==="undefined"||bx==="boolean"){if(this.className){b._data(this,"__className__",this.className)}this.className=this.className||by===false?"":b._data(this,"__className__")||""}}})},hasClass:function(e){var by=" "+e+" ",bx=0,bw=this.length;for(;bx<bw;bx++){if(this[bx].nodeType===1&&(" "+this[bx].className+" ").replace(aR," ").indexOf(by)>-1){return true}}return false},val:function(by){var e,bw,bz,bx=this[0];if(!arguments.length){if(bx){e=b.valHooks[bx.type]||b.valHooks[bx.nodeName.toLowerCase()];if(e&&"get" in e&&(bw=e.get(bx,"value"))!==M){return bw}bw=bx.value;return typeof bw==="string"?bw.replace(aW,""):bw==null?"":bw}return}bz=b.isFunction(by);return this.each(function(bB){var bA=b(this),bC;if(this.nodeType!==1){return}if(bz){bC=by.call(this,bB,bA.val())}else{bC=by}if(bC==null){bC=""}else{if(typeof bC==="number"){bC+=""}else{if(b.isArray(bC)){bC=b.map(bC,function(bD){return bD==null?"":bD+""})}}}e=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()];if(!e||!("set" in e)||e.set(this,bC,"value")===M){this.value=bC}})}});b.extend({valHooks:{option:{get:function(e){var bw=e.attributes.value;return !bw||bw.specified?e.value:e.text}},select:{get:function(e){var bB,bw,bA,by,bz=e.selectedIndex,bC=[],bD=e.options,bx=e.type==="select-one";if(bz<0){return null}bw=bx?bz:0;bA=bx?bz+1:bD.length;for(;bw<bA;bw++){by=bD[bw];if(by.selected&&(b.support.optDisabled?!by.disabled:by.getAttribute("disabled")===null)&&(!by.parentNode.disabled||!b.nodeName(by.parentNode,"optgroup"))){bB=b(by).val();if(bx){return bB}bC.push(bB)}}if(bx&&!bC.length&&bD.length){return b(bD[bz]).val()}return bC},set:function(bw,bx){var e=b.makeArray(bx);b(bw).find("option").each(function(){this.selected=b.inArray(b(this).val(),e)>=0});if(!e.length){bw.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bB,by,bC,bA){var bx,e,bz,bw=bB.nodeType;if(!bB||bw===3||bw===8||bw===2){return}if(bA&&by in b.attrFn){return b(bB)[by](bC)}if(typeof bB.getAttribute==="undefined"){return b.prop(bB,by,bC)}bz=bw!==1||!b.isXMLDoc(bB);if(bz){by=by.toLowerCase();e=b.attrHooks[by]||(ap.test(by)?a0:bg)}if(bC!==M){if(bC===null){b.removeAttr(bB,by);return}else{if(e&&"set" in e&&bz&&(bx=e.set(bB,bC,by))!==M){return bx}else{bB.setAttribute(by,""+bC);return bC}}}else{if(e&&"get" in e&&bz&&(bx=e.get(bB,by))!==null){return bx}else{bx=bB.getAttribute(by);return bx===null?M:bx}}},removeAttr:function(bz,bB){var bA,bC,bx,e,bw,by=0;if(bB&&bz.nodeType===1){bC=bB.toLowerCase().split(ah);e=bC.length;for(;by<e;by++){bx=bC[by];if(bx){bA=b.propFix[bx]||bx;bw=ap.test(bx);if(!bw){b.attr(bz,bx,"")}bz.removeAttribute(F?bx:bA);if(bw&&bA in bz){bz[bA]=false}}}}},attrHooks:{type:{set:function(e,bw){if(g.test(e.nodeName)&&e.parentNode){b.error("type property can't be changed")}else{if(!b.support.radioValue&&bw==="radio"&&b.nodeName(e,"input")){var bx=e.value;e.setAttribute("type",bw);if(bx){e.value=bx}return bw}}}},value:{get:function(bw,e){if(bg&&b.nodeName(bw,"button")){return bg.get(bw,e)}return e in bw?bw.value:null},set:function(bw,bx,e){if(bg&&b.nodeName(bw,"button")){return bg.set(bw,bx,e)}bw.value=bx}}},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(bA,by,bB){var bx,e,bz,bw=bA.nodeType;if(!bA||bw===3||bw===8||bw===2){return}bz=bw!==1||!b.isXMLDoc(bA);if(bz){by=b.propFix[by]||by;e=b.propHooks[by]}if(bB!==M){if(e&&"set" in e&&(bx=e.set(bA,bB,by))!==M){return bx}else{return(bA[by]=bB)}}else{if(e&&"get" in e&&(bx=e.get(bA,by))!==null){return bx}else{return bA[by]}}},propHooks:{tabIndex:{get:function(bw){var e=bw.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):D.test(bw.nodeName)||m.test(bw.nodeName)&&bw.href?0:M}}}});b.attrHooks.tabindex=b.propHooks.tabIndex;a0={get:function(bw,e){var by,bx=b.prop(bw,e);return bx===true||typeof bx!=="boolean"&&(by=bw.getAttributeNode(e))&&by.nodeValue!==false?e.toLowerCase():M},set:function(bw,by,e){var bx;if(by===false){b.removeAttr(bw,e)}else{bx=b.propFix[e]||e;if(bx in bw){bw[bx]=true}bw.setAttribute(e,e.toLowerCase())}return e}};if(!F){aH={name:true,id:true,coords:true};bg=b.valHooks.button={get:function(bx,bw){var e;e=bx.getAttributeNode(bw);return e&&(aH[bw]?e.nodeValue!=="":e.specified)?e.nodeValue:M},set:function(bx,by,bw){var e=bx.getAttributeNode(bw);if(!e){e=aw.createAttribute(bw);bx.setAttributeNode(e)}return(e.nodeValue=by+"")}};b.attrHooks.tabindex.set=bg.set;b.each(["width","height"],function(bw,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{set:function(bx,by){if(by===""){bx.setAttribute(e,"auto");return by}}})});b.attrHooks.contenteditable={get:bg.get,set:function(bw,bx,e){if(bx===""){bx="false"}bg.set(bw,bx,e)}}}if(!b.support.hrefNormalized){b.each(["href","src","width","height"],function(bw,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{get:function(by){var bx=by.getAttribute(e,2);return bx===null?M:bx}})})}if(!b.support.style){b.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||M},set:function(e,bw){return(e.style.cssText=""+bw)}}}if(!b.support.optSelected){b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(bw){var e=bw.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,bw){if(b.isArray(bw)){return(e.checked=b.inArray(b(e).val(),bw)>=0)}}})});var bf=/^(?:textarea|input|select)$/i,o=/^([^\.]*)?(?:\.(.+))?$/,K=/(?:^|\s)hover(\.\S+)?\b/,aQ=/^key/,bh=/^(?:mouse|contextmenu)|click/,U=/^(?:focusinfocus|focusoutblur)$/,V=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Z=function(e){var bw=V.exec(e);if(bw){bw[1]=(bw[1]||"").toLowerCase();bw[3]=bw[3]&&new RegExp("(?:^|\\s)"+bw[3]+"(?:\\s|$)")}return bw},k=function(bx,e){var bw=bx.attributes||{};return((!e[1]||bx.nodeName.toLowerCase()===e[1])&&(!e[2]||(bw.id||{}).value===e[2])&&(!e[3]||e[3].test((bw["class"]||{}).value)))},bu=function(e){return b.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};b.event={add:function(by,bD,bK,bB,bz){var bE,bC,bL,bJ,bI,bG,e,bH,bw,bA,bx,bF;if(by.nodeType===3||by.nodeType===8||!bD||!bK||!(bE=b._data(by))){return}if(bK.handler){bw=bK;bK=bw.handler;bz=bw.selector}if(!bK.guid){bK.guid=b.guid++}bL=bE.events;if(!bL){bE.events=bL={}}bC=bE.handle;if(!bC){bE.handle=bC=function(bM){return typeof b!=="undefined"&&(!bM||b.event.triggered!==bM.type)?b.event.dispatch.apply(bC.elem,arguments):M};bC.elem=by}bD=b.trim(bu(bD)).split(" ");for(bJ=0;bJ<bD.length;bJ++){bI=o.exec(bD[bJ])||[];bG=bI[1];e=(bI[2]||"").split(".").sort();bF=b.event.special[bG]||{};bG=(bz?bF.delegateType:bF.bindType)||bG;bF=b.event.special[bG]||{};bH=b.extend({type:bG,origType:bI[1],data:bB,handler:bK,guid:bK.guid,selector:bz,quick:bz&&Z(bz),namespace:e.join(".")},bw);bx=bL[bG];if(!bx){bx=bL[bG]=[];bx.delegateCount=0;if(!bF.setup||bF.setup.call(by,bB,e,bC)===false){if(by.addEventListener){by.addEventListener(bG,bC,false)}else{if(by.attachEvent){by.attachEvent("on"+bG,bC)}}}}if(bF.add){bF.add.call(by,bH);if(!bH.handler.guid){bH.handler.guid=bK.guid}}if(bz){bx.splice(bx.delegateCount++,0,bH)}else{bx.push(bH)}b.event.global[bG]=true}by=null},global:{},remove:function(bK,bF,bw,bI,bC){var bJ=b.hasData(bK)&&b._data(bK),bG,by,bA,bM,bD,bB,bH,bx,bz,bL,bE,e;if(!bJ||!(bx=bJ.events)){return}bF=b.trim(bu(bF||"")).split(" ");for(bG=0;bG<bF.length;bG++){by=o.exec(bF[bG])||[];bA=bM=by[1];bD=by[2];if(!bA){for(bA in bx){b.event.remove(bK,bA+bF[bG],bw,bI,true)}continue}bz=b.event.special[bA]||{};bA=(bI?bz.delegateType:bz.bindType)||bA;bE=bx[bA]||[];bB=bE.length;bD=bD?new RegExp("(^|\\.)"+bD.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(bH=0;bH<bE.length;bH++){e=bE[bH];if((bC||bM===e.origType)&&(!bw||bw.guid===e.guid)&&(!bD||bD.test(e.namespace))&&(!bI||bI===e.selector||bI==="**"&&e.selector)){bE.splice(bH--,1);if(e.selector){bE.delegateCount--}if(bz.remove){bz.remove.call(bK,e)}}}if(bE.length===0&&bB!==bE.length){if(!bz.teardown||bz.teardown.call(bK,bD)===false){b.removeEvent(bK,bA,bJ.handle)}delete bx[bA]}}if(b.isEmptyObject(bx)){bL=bJ.handle;if(bL){bL.elem=null}b.removeData(bK,["events","handle"],true)}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(bw,bE,bB,bK){if(bB&&(bB.nodeType===3||bB.nodeType===8)){return}var bH=bw.type||bw,by=[],e,bx,bD,bI,bA,bz,bG,bF,bC,bJ;if(U.test(bH+b.event.triggered)){return}if(bH.indexOf("!")>=0){bH=bH.slice(0,-1);bx=true}if(bH.indexOf(".")>=0){by=bH.split(".");bH=by.shift();by.sort()}if((!bB||b.event.customEvent[bH])&&!b.event.global[bH]){return}bw=typeof bw==="object"?bw[b.expando]?bw:new b.Event(bH,bw):new b.Event(bH);bw.type=bH;bw.isTrigger=true;bw.exclusive=bx;bw.namespace=by.join(".");bw.namespace_re=bw.namespace?new RegExp("(^|\\.)"+by.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;bz=bH.indexOf(":")<0?"on"+bH:"";if(!bB){e=b.cache;for(bD in e){if(e[bD].events&&e[bD].events[bH]){b.event.trigger(bw,bE,e[bD].handle.elem,true)}}return}bw.result=M;if(!bw.target){bw.target=bB}bE=bE!=null?b.makeArray(bE):[];bE.unshift(bw);bG=b.event.special[bH]||{};if(bG.trigger&&bG.trigger.apply(bB,bE)===false){return}bC=[[bB,bG.bindType||bH]];if(!bK&&!bG.noBubble&&!b.isWindow(bB)){bJ=bG.delegateType||bH;bI=U.test(bJ+bH)?bB:bB.parentNode;bA=null;for(;bI;bI=bI.parentNode){bC.push([bI,bJ]);bA=bI}if(bA&&bA===bB.ownerDocument){bC.push([bA.defaultView||bA.parentWindow||be,bJ])}}for(bD=0;bD<bC.length&&!bw.isPropagationStopped();bD++){bI=bC[bD][0];bw.type=bC[bD][1];bF=(b._data(bI,"events")||{})[bw.type]&&b._data(bI,"handle");if(bF){bF.apply(bI,bE)}bF=bz&&bI[bz];if(bF&&b.acceptData(bI)&&bF.apply(bI,bE)===false){bw.preventDefault()}}bw.type=bH;if(!bK&&!bw.isDefaultPrevented()){if((!bG._default||bG._default.apply(bB.ownerDocument,bE)===false)&&!(bH==="click"&&b.nodeName(bB,"a"))&&b.acceptData(bB)){if(bz&&bB[bH]&&((bH!=="focus"&&bH!=="blur")||bw.target.offsetWidth!==0)&&!b.isWindow(bB)){bA=bB[bz];if(bA){bB[bz]=null}b.event.triggered=bH;bB[bH]();b.event.triggered=M;if(bA){bB[bz]=bA}}}}return bw.result},dispatch:function(bI){bI=b.event.fix(bI||be.event);var bE=((b._data(this,"events")||{})[bI.type]||[]),bD=bE.delegateCount,by=[].slice.call(arguments,0),bF=!bI.exclusive&&!bI.namespace,bA=b.event.special[bI.type]||{},bw=[],bK,bH,bz,bB,bL,bJ,bC,bx,e,bG,bM;by[0]=bI;bI.delegateTarget=this;if(bA.preDispatch&&bA.preDispatch.call(this,bI)===false){return}if(bD&&!(bI.button&&bI.type==="click")){bB=b(this);bB.context=this.ownerDocument||this;for(bz=bI.target;bz!=this;bz=bz.parentNode||this){if(bz.disabled!==true){bJ={};bx=[];bB[0]=bz;for(bK=0;bK<bD;bK++){e=bE[bK];bG=e.selector;if(bJ[bG]===M){bJ[bG]=(e.quick?k(bz,e.quick):bB.is(bG))}if(bJ[bG]){bx.push(e)}}if(bx.length){bw.push({elem:bz,matches:bx})}}}}if(bE.length>bD){bw.push({elem:this,matches:bE.slice(bD)})}for(bK=0;bK<bw.length&&!bI.isPropagationStopped();bK++){bC=bw[bK];bI.currentTarget=bC.elem;for(bH=0;bH<bC.matches.length&&!bI.isImmediatePropagationStopped();bH++){e=bC.matches[bH];if(bF||(!bI.namespace&&!e.namespace)||bI.namespace_re&&bI.namespace_re.test(e.namespace)){bI.data=e.data;bI.handleObj=e;bL=((b.event.special[e.origType]||{}).handle||e.handler).apply(bC.elem,by);if(bL!==M){bI.result=bL;if(bL===false){bI.preventDefault();bI.stopPropagation()}}}}}if(bA.postDispatch){bA.postDispatch.call(this,bI)}return bI.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(bw,e){if(bw.which==null){bw.which=e.charCode!=null?e.charCode:e.keyCode}return bw}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(by,bx){var bz,bA,e,bw=bx.button,bB=bx.fromElement;if(by.pageX==null&&bx.clientX!=null){bz=by.target.ownerDocument||aw;bA=bz.documentElement;e=bz.body;by.pageX=bx.clientX+(bA&&bA.scrollLeft||e&&e.scrollLeft||0)-(bA&&bA.clientLeft||e&&e.clientLeft||0);by.pageY=bx.clientY+(bA&&bA.scrollTop||e&&e.scrollTop||0)-(bA&&bA.clientTop||e&&e.clientTop||0)}if(!by.relatedTarget&&bB){by.relatedTarget=bB===by.target?bx.toElement:bB}if(!by.which&&bw!==M){by.which=(bw&1?1:(bw&2?3:(bw&4?2:0)))}return by}},fix:function(bx){if(bx[b.expando]){return bx}var bw,bA,e=bx,by=b.event.fixHooks[bx.type]||{},bz=by.props?this.props.concat(by.props):this.props;bx=b.Event(e);for(bw=bz.length;bw;){bA=bz[--bw];bx[bA]=e[bA]}if(!bx.target){bx.target=e.srcElement||aw}if(bx.target.nodeType===3){bx.target=bx.target.parentNode}if(bx.metaKey===M){bx.metaKey=bx.ctrlKey}return by.filter?by.filter(bx,e):bx},special:{ready:{setup:b.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(bx,bw,e){if(b.isWindow(this)){this.onbeforeunload=e}},teardown:function(bw,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}},simulate:function(bx,bz,by,bw){var bA=b.extend(new b.Event(),by,{type:bx,isSimulated:true,originalEvent:{}});if(bw){b.event.trigger(bA,null,bz)}else{b.event.dispatch.call(bz,bA)}if(bA.isDefaultPrevented()){by.preventDefault()}}};b.event.handle=b.event.dispatch;b.removeEvent=aw.removeEventListener?function(bw,e,bx){if(bw.removeEventListener){bw.removeEventListener(e,bx,false)}}:function(bw,e,bx){if(bw.detachEvent){bw.detachEvent("on"+e,bx)}};b.Event=function(bw,e){if(!(this instanceof b.Event)){return new b.Event(bw,e)}if(bw&&bw.type){this.originalEvent=bw;this.type=bw.type;this.isDefaultPrevented=(bw.defaultPrevented||bw.returnValue===false||bw.getPreventDefault&&bw.getPreventDefault())?j:bm}else{this.type=bw}if(e){b.extend(this,e)}this.timeStamp=bw&&bw.timeStamp||b.now();this[b.expando]=true};function bm(){return false}function j(){return true}b.Event.prototype={preventDefault:function(){this.isDefaultPrevented=j;var bw=this.originalEvent;if(!bw){return}if(bw.preventDefault){bw.preventDefault()}else{bw.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=j;var bw=this.originalEvent;if(!bw){return}if(bw.stopPropagation){bw.stopPropagation()}bw.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=j;this.stopPropagation()},isDefaultPrevented:bm,isPropagationStopped:bm,isImmediatePropagationStopped:bm};b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bw,e){b.event.special[bw]={delegateType:e,bindType:e,handle:function(bA){var bC=this,bB=bA.relatedTarget,bz=bA.handleObj,bx=bz.selector,by;if(!bB||(bB!==bC&&!b.contains(bC,bB))){bA.type=bz.origType;by=bz.handler.apply(this,arguments);bA.type=e}return by}}});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(by){var bx=by.target,bw=b.nodeName(bx,"input")||b.nodeName(bx,"button")?bx.form:M;if(bw&&!bw._submit_attached){b.event.add(bw,"submit._submit",function(e){e._submit_bubble=true});bw._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(bf.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(bx){var bw=bx.target;if(bf.test(bw.nodeName)&&!bw._change_attached){b.event.add(bw,"change._change",function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){b.event.simulate("change",this.parentNode,e,true)}});bw._change_attached=true}})},handle:function(bw){var e=bw.target;if(this!==e||bw.isSimulated||bw.isTrigger||(e.type!=="radio"&&e.type!=="checkbox")){return bw.handleObj.handler.apply(this,arguments)}},teardown:function(){b.event.remove(this,"._change");return bf.test(this.nodeName)}}}if(!b.support.focusinBubbles){b.each({focus:"focusin",blur:"focusout"},function(by,e){var bw=0,bx=function(bz){b.event.simulate(e,bz.target,b.event.fix(bz),true)};b.event.special[e]={setup:function(){if(bw++===0){aw.addEventListener(by,bx,true)}},teardown:function(){if(--bw===0){aw.removeEventListener(by,bx,true)}}}})}b.fn.extend({on:function(bx,e,bA,bz,bw){var bB,by;if(typeof bx==="object"){if(typeof e!=="string"){bA=bA||e;e=M}for(by in bx){this.on(by,e,bA,bx[by],bw)}return this}if(bA==null&&bz==null){bz=e;bA=e=M}else{if(bz==null){if(typeof e==="string"){bz=bA;bA=M}else{bz=bA;bA=e;e=M}}}if(bz===false){bz=bm}else{if(!bz){return this}}if(bw===1){bB=bz;bz=function(bC){b().off(bC);return bB.apply(this,arguments)};bz.guid=bB.guid||(bB.guid=b.guid++)}return this.each(function(){b.event.add(this,bx,bz,bA,e)})},one:function(bw,e,by,bx){return this.on(bw,e,by,bx,1)},off:function(bx,e,bz){if(bx&&bx.preventDefault&&bx.handleObj){var bw=bx.handleObj;b(bx.delegateTarget).off(bw.namespace?bw.origType+"."+bw.namespace:bw.origType,bw.selector,bw.handler);return this}if(typeof bx==="object"){for(var by in bx){this.off(by,e,bx[by])}return this}if(e===false||typeof e==="function"){bz=e;e=M}if(bz===false){bz=bm}return this.each(function(){b.event.remove(this,bx,bz,e)})},bind:function(e,bx,bw){return this.on(e,null,bx,bw)},unbind:function(e,bw){return this.off(e,null,bw)},live:function(e,bx,bw){b(this.context).on(e,this.selector,bx,bw);return this},die:function(e,bw){b(this.context).off(e,this.selector||"**",bw);return this},delegate:function(e,bw,by,bx){return this.on(bw,e,by,bx)},undelegate:function(e,bw,bx){return arguments.length==1?this.off(e,"**"):this.off(bw,e,bx)},trigger:function(e,bw){return this.each(function(){b.event.trigger(e,bw,this)})},triggerHandler:function(e,bw){if(this[0]){return b.event.trigger(e,bw,this[0],true)}},toggle:function(by){var bw=arguments,e=by.guid||b.guid++,bx=0,bz=function(bA){var bB=(b._data(this,"lastToggle"+by.guid)||0)%bx;b._data(this,"lastToggle"+by.guid,bB+1);bA.preventDefault();return bw[bB].apply(this,arguments)||false};bz.guid=e;while(bx<bw.length){bw[bx++].guid=e}return this.click(bz)},hover:function(e,bw){return this.mouseenter(e).mouseleave(bw||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(bw,e){b.fn[e]=function(by,bx){if(bx==null){bx=by;by=null}return arguments.length>0?this.on(e,null,by,bx):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aQ.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bh.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 bI=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bD="sizcache"+(Math.random()+"").replace(".",""),bJ=0,bM=Object.prototype.toString,bC=false,bB=true,bL=/\\/g,bP=/\r\n/g,bR=/\W/;[0,0].sort(function(){bB=false;return 0});var bz=function(bW,e,bZ,b0){bZ=bZ||[];e=e||aw;var b2=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bW||typeof bW!=="string"){return bZ}var bT,b4,b7,bS,b3,b6,b5,bY,bV=true,bU=bz.isXML(e),bX=[],b1=bW;do{bI.exec("");bT=bI.exec(b1);if(bT){b1=bT[3];bX.push(bT[1]);if(bT[2]){bS=bT[3];break}}}while(bT);if(bX.length>1&&bE.exec(bW)){if(bX.length===2&&bF.relative[bX[0]]){b4=bN(bX[0]+bX[1],e,b0)}else{b4=bF.relative[bX[0]]?[e]:bz(bX.shift(),e);while(bX.length){bW=bX.shift();if(bF.relative[bW]){bW+=bX.shift()}b4=bN(bW,b4,b0)}}}else{if(!b0&&bX.length>1&&e.nodeType===9&&!bU&&bF.match.ID.test(bX[0])&&!bF.match.ID.test(bX[bX.length-1])){b3=bz.find(bX.shift(),e,bU);e=b3.expr?bz.filter(b3.expr,b3.set)[0]:b3.set[0]}if(e){b3=b0?{expr:bX.pop(),set:bG(b0)}:bz.find(bX.pop(),bX.length===1&&(bX[0]==="~"||bX[0]==="+")&&e.parentNode?e.parentNode:e,bU);b4=b3.expr?bz.filter(b3.expr,b3.set):b3.set;if(bX.length>0){b7=bG(b4)}else{bV=false}while(bX.length){b6=bX.pop();b5=b6;if(!bF.relative[b6]){b6=""}else{b5=bX.pop()}if(b5==null){b5=e}bF.relative[b6](b7,b5,bU)}}else{b7=bX=[]}}if(!b7){b7=b4}if(!b7){bz.error(b6||bW)}if(bM.call(b7)==="[object Array]"){if(!bV){bZ.push.apply(bZ,b7)}else{if(e&&e.nodeType===1){for(bY=0;b7[bY]!=null;bY++){if(b7[bY]&&(b7[bY]===true||b7[bY].nodeType===1&&bz.contains(e,b7[bY]))){bZ.push(b4[bY])}}}else{for(bY=0;b7[bY]!=null;bY++){if(b7[bY]&&b7[bY].nodeType===1){bZ.push(b4[bY])}}}}}else{bG(b7,bZ)}if(bS){bz(bS,b2,bZ,b0);bz.uniqueSort(bZ)}return bZ};bz.uniqueSort=function(bS){if(bK){bC=bB;bS.sort(bK);if(bC){for(var e=1;e<bS.length;e++){if(bS[e]===bS[e-1]){bS.splice(e--,1)}}}}return bS};bz.matches=function(e,bS){return bz(e,null,null,bS)};bz.matchesSelector=function(e,bS){return bz(bS,null,null,[e]).length>0};bz.find=function(bY,e,bZ){var bX,bT,bV,bU,bW,bS;if(!bY){return[]}for(bT=0,bV=bF.order.length;bT<bV;bT++){bW=bF.order[bT];if((bU=bF.leftMatch[bW].exec(bY))){bS=bU[1];bU.splice(1,1);if(bS.substr(bS.length-1)!=="\\"){bU[1]=(bU[1]||"").replace(bL,"");bX=bF.find[bW](bU,e,bZ);if(bX!=null){bY=bY.replace(bF.match[bW],"");break}}}}if(!bX){bX=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:bX,expr:bY}};bz.filter=function(b2,b1,b5,bV){var bX,e,b0,b7,b4,bS,bU,bW,b3,bT=b2,b6=[],bZ=b1,bY=b1&&b1[0]&&bz.isXML(b1[0]);while(b2&&b1.length){for(b0 in bF.filter){if((bX=bF.leftMatch[b0].exec(b2))!=null&&bX[2]){bS=bF.filter[b0];bU=bX[1];e=false;bX.splice(1,1);if(bU.substr(bU.length-1)==="\\"){continue}if(bZ===b6){b6=[]}if(bF.preFilter[b0]){bX=bF.preFilter[b0](bX,bZ,b5,b6,bV,bY);if(!bX){e=b7=true}else{if(bX===true){continue}}}if(bX){for(bW=0;(b4=bZ[bW])!=null;bW++){if(b4){b7=bS(b4,bX,bW,bZ);b3=bV^b7;if(b5&&b7!=null){if(b3){e=true}else{bZ[bW]=false}}else{if(b3){b6.push(b4);e=true}}}}}if(b7!==M){if(!b5){bZ=b6}b2=b2.replace(bF.match[b0],"");if(!e){return[]}break}}}if(b2===bT){if(e==null){bz.error(b2)}else{break}}bT=b2}return bZ};bz.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var bx=bz.getText=function(bV){var bT,bU,e=bV.nodeType,bS="";if(e){if(e===1||e===9||e===11){if(typeof bV.textContent==="string"){return bV.textContent}else{if(typeof bV.innerText==="string"){return bV.innerText.replace(bP,"")}else{for(bV=bV.firstChild;bV;bV=bV.nextSibling){bS+=bx(bV)}}}}else{if(e===3||e===4){return bV.nodeValue}}}else{for(bT=0;(bU=bV[bT]);bT++){if(bU.nodeType!==8){bS+=bx(bU)}}}return bS};var bF=bz.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(bX,bS){var bU=typeof bS==="string",bW=bU&&!bR.test(bS),bY=bU&&!bW;if(bW){bS=bS.toLowerCase()}for(var bT=0,e=bX.length,bV;bT<e;bT++){if((bV=bX[bT])){while((bV=bV.previousSibling)&&bV.nodeType!==1){}bX[bT]=bY||bV&&bV.nodeName.toLowerCase()===bS?bV||false:bV===bS}}if(bY){bz.filter(bS,bX,true)}},">":function(bX,bS){var bW,bV=typeof bS==="string",bT=0,e=bX.length;if(bV&&!bR.test(bS)){bS=bS.toLowerCase();for(;bT<e;bT++){bW=bX[bT];if(bW){var bU=bW.parentNode;bX[bT]=bU.nodeName.toLowerCase()===bS?bU:false}}}else{for(;bT<e;bT++){bW=bX[bT];if(bW){bX[bT]=bV?bW.parentNode:bW.parentNode===bS}}if(bV){bz.filter(bS,bX,true)}}},"":function(bU,bS,bW){var bV,bT=bJ++,e=bO;if(typeof bS==="string"&&!bR.test(bS)){bS=bS.toLowerCase();bV=bS;e=bw}e("parentNode",bS,bT,bU,bV,bW)},"~":function(bU,bS,bW){var bV,bT=bJ++,e=bO;if(typeof bS==="string"&&!bR.test(bS)){bS=bS.toLowerCase();bV=bS;e=bw}e("previousSibling",bS,bT,bU,bV,bW)}},find:{ID:function(bS,bT,bU){if(typeof bT.getElementById!=="undefined"&&!bU){var e=bT.getElementById(bS[1]);return e&&e.parentNode?[e]:[]}},NAME:function(bT,bW){if(typeof bW.getElementsByName!=="undefined"){var bS=[],bV=bW.getElementsByName(bT[1]);for(var bU=0,e=bV.length;bU<e;bU++){if(bV[bU].getAttribute("name")===bT[1]){bS.push(bV[bU])}}return bS.length===0?null:bS}},TAG:function(e,bS){if(typeof bS.getElementsByTagName!=="undefined"){return bS.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(bU,bS,bT,e,bX,bY){bU=" "+bU[1].replace(bL,"")+" ";if(bY){return bU}for(var bV=0,bW;(bW=bS[bV])!=null;bV++){if(bW){if(bX^(bW.className&&(" "+bW.className+" ").replace(/[\t\n\r]/g," ").indexOf(bU)>=0)){if(!bT){e.push(bW)}}else{if(bT){bS[bV]=false}}}}return false},ID:function(e){return e[1].replace(bL,"")},TAG:function(bS,e){return bS[1].replace(bL,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){bz.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bS=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bS[1]+(bS[2]||1))-0;e[3]=bS[3]-0}else{if(e[2]){bz.error(e[0])}}e[0]=bJ++;return e},ATTR:function(bV,bS,bT,e,bW,bX){var bU=bV[1]=bV[1].replace(bL,"");if(!bX&&bF.attrMap[bU]){bV[1]=bF.attrMap[bU]}bV[4]=(bV[4]||bV[5]||"").replace(bL,"");if(bV[2]==="~="){bV[4]=" "+bV[4]+" "}return bV},PSEUDO:function(bV,bS,bT,e,bW){if(bV[1]==="not"){if((bI.exec(bV[3])||"").length>1||/^\w/.test(bV[3])){bV[3]=bz(bV[3],null,null,bS)}else{var bU=bz.filter(bV[3],bS,bT,true^bW);if(!bT){e.push.apply(e,bU)}return false}}else{if(bF.match.POS.test(bV[0])||bF.match.CHILD.test(bV[0])){return true}}return bV},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(bT,bS,e){return !!bz(e[3],bT).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bT){var e=bT.getAttribute("type"),bS=bT.type;return bT.nodeName.toLowerCase()==="input"&&"text"===bS&&(e===bS||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(bS){var e=bS.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bS.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bS){var e=bS.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bS.type},button:function(bS){var e=bS.nodeName.toLowerCase();return e==="input"&&"button"===bS.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(bS,e){return e===0},last:function(bT,bS,e,bU){return bS===bU.length-1},even:function(bS,e){return e%2===0},odd:function(bS,e){return e%2===1},lt:function(bT,bS,e){return bS<e[3]-0},gt:function(bT,bS,e){return bS>e[3]-0},nth:function(bT,bS,e){return e[3]-0===bS},eq:function(bT,bS,e){return e[3]-0===bS}},filter:{PSEUDO:function(bT,bY,bX,bZ){var e=bY[1],bS=bF.filters[e];if(bS){return bS(bT,bX,bY,bZ)}else{if(e==="contains"){return(bT.textContent||bT.innerText||bx([bT])||"").indexOf(bY[3])>=0}else{if(e==="not"){var bU=bY[3];for(var bW=0,bV=bU.length;bW<bV;bW++){if(bU[bW]===bT){return false}}return true}else{bz.error(e)}}}},CHILD:function(bT,bV){var bU,b1,bX,b0,e,bW,bZ,bY=bV[1],bS=bT;switch(bY){case"only":case"first":while((bS=bS.previousSibling)){if(bS.nodeType===1){return false}}if(bY==="first"){return true}bS=bT;case"last":while((bS=bS.nextSibling)){if(bS.nodeType===1){return false}}return true;case"nth":bU=bV[2];b1=bV[3];if(bU===1&&b1===0){return true}bX=bV[0];b0=bT.parentNode;if(b0&&(b0[bD]!==bX||!bT.nodeIndex)){bW=0;for(bS=b0.firstChild;bS;bS=bS.nextSibling){if(bS.nodeType===1){bS.nodeIndex=++bW}}b0[bD]=bX}bZ=bT.nodeIndex-b1;if(bU===0){return bZ===0}else{return(bZ%bU===0&&bZ/bU>=0)}}},ID:function(bS,e){return bS.nodeType===1&&bS.getAttribute("id")===e},TAG:function(bS,e){return(e==="*"&&bS.nodeType===1)||!!bS.nodeName&&bS.nodeName.toLowerCase()===e},CLASS:function(bS,e){return(" "+(bS.className||bS.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bW,bU){var bT=bU[1],e=bz.attr?bz.attr(bW,bT):bF.attrHandle[bT]?bF.attrHandle[bT](bW):bW[bT]!=null?bW[bT]:bW.getAttribute(bT),bX=e+"",bV=bU[2],bS=bU[4];return e==null?bV==="!=":!bV&&bz.attr?e!=null:bV==="="?bX===bS:bV==="*="?bX.indexOf(bS)>=0:bV==="~="?(" "+bX+" ").indexOf(bS)>=0:!bS?bX&&e!==false:bV==="!="?bX!==bS:bV==="^="?bX.indexOf(bS)===0:bV==="$="?bX.substr(bX.length-bS.length)===bS:bV==="|="?bX===bS||bX.substr(0,bS.length+1)===bS+"-":false},POS:function(bV,bS,bT,bW){var e=bS[2],bU=bF.setFilters[e];if(bU){return bU(bV,bT,bS,bW)}}}};var bE=bF.match.POS,by=function(bS,e){return"\\"+(e-0+1)};for(var bA in bF.match){bF.match[bA]=new RegExp(bF.match[bA].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bF.leftMatch[bA]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bF.match[bA].source.replace(/\\(\d+)/g,by))}bF.match.globalPOS=bE;var bG=function(bS,e){bS=Array.prototype.slice.call(bS,0);if(e){e.push.apply(e,bS);return e}return bS};try{Array.prototype.slice.call(aw.documentElement.childNodes,0)[0].nodeType}catch(bQ){bG=function(bV,bU){var bT=0,bS=bU||[];if(bM.call(bV)==="[object Array]"){Array.prototype.push.apply(bS,bV)}else{if(typeof bV.length==="number"){for(var e=bV.length;bT<e;bT++){bS.push(bV[bT])}}else{for(;bV[bT];bT++){bS.push(bV[bT])}}}return bS}}var bK,bH;if(aw.documentElement.compareDocumentPosition){bK=function(bS,e){if(bS===e){bC=true;return 0}if(!bS.compareDocumentPosition||!e.compareDocumentPosition){return bS.compareDocumentPosition?-1:1}return bS.compareDocumentPosition(e)&4?-1:1}}else{bK=function(bZ,bY){if(bZ===bY){bC=true;return 0}else{if(bZ.sourceIndex&&bY.sourceIndex){return bZ.sourceIndex-bY.sourceIndex}}var bW,bS,bT=[],e=[],bV=bZ.parentNode,bX=bY.parentNode,b0=bV;if(bV===bX){return bH(bZ,bY)}else{if(!bV){return -1}else{if(!bX){return 1}}}while(b0){bT.unshift(b0);b0=b0.parentNode}b0=bX;while(b0){e.unshift(b0);b0=b0.parentNode}bW=bT.length;bS=e.length;for(var bU=0;bU<bW&&bU<bS;bU++){if(bT[bU]!==e[bU]){return bH(bT[bU],e[bU])}}return bU===bW?bH(bZ,e[bU],-1):bH(bT[bU],bY,1)};bH=function(bS,e,bT){if(bS===e){return bT}var bU=bS.nextSibling;while(bU){if(bU===e){return -1}bU=bU.nextSibling}return 1}}(function(){var bS=aw.createElement("div"),bT="script"+(new Date()).getTime(),e=aw.documentElement;bS.innerHTML="<a name='"+bT+"'/>";e.insertBefore(bS,e.firstChild);if(aw.getElementById(bT)){bF.find.ID=function(bV,bW,bX){if(typeof bW.getElementById!=="undefined"&&!bX){var bU=bW.getElementById(bV[1]);return bU?bU.id===bV[1]||typeof bU.getAttributeNode!=="undefined"&&bU.getAttributeNode("id").nodeValue===bV[1]?[bU]:M:[]}};bF.filter.ID=function(bW,bU){var bV=typeof bW.getAttributeNode!=="undefined"&&bW.getAttributeNode("id");return bW.nodeType===1&&bV&&bV.nodeValue===bU}}e.removeChild(bS);e=bS=null})();(function(){var e=aw.createElement("div");e.appendChild(aw.createComment(""));if(e.getElementsByTagName("*").length>0){bF.find.TAG=function(bS,bW){var bV=bW.getElementsByTagName(bS[1]);if(bS[1]==="*"){var bU=[];for(var bT=0;bV[bT];bT++){if(bV[bT].nodeType===1){bU.push(bV[bT])}}bV=bU}return bV}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bF.attrHandle.href=function(bS){return bS.getAttribute("href",2)}}e=null})();if(aw.querySelectorAll){(function(){var e=bz,bU=aw.createElement("div"),bT="__sizzle__";bU.innerHTML="<p class='TEST'></p>";if(bU.querySelectorAll&&bU.querySelectorAll(".TEST").length===0){return}bz=function(b5,bW,b0,b4){bW=bW||aw;if(!b4&&!bz.isXML(bW)){var b3=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b5);if(b3&&(bW.nodeType===1||bW.nodeType===9)){if(b3[1]){return bG(bW.getElementsByTagName(b5),b0)}else{if(b3[2]&&bF.find.CLASS&&bW.getElementsByClassName){return bG(bW.getElementsByClassName(b3[2]),b0)}}}if(bW.nodeType===9){if(b5==="body"&&bW.body){return bG([bW.body],b0)}else{if(b3&&b3[3]){var bZ=bW.getElementById(b3[3]);if(bZ&&bZ.parentNode){if(bZ.id===b3[3]){return bG([bZ],b0)}}else{return bG([],b0)}}}try{return bG(bW.querySelectorAll(b5),b0)}catch(b1){}}else{if(bW.nodeType===1&&bW.nodeName.toLowerCase()!=="object"){var bX=bW,bY=bW.getAttribute("id"),bV=bY||bT,b7=bW.parentNode,b6=/^\s*[+~]/.test(b5);if(!bY){bW.setAttribute("id",bV)}else{bV=bV.replace(/'/g,"\\$&")}if(b6&&b7){bW=bW.parentNode}try{if(!b6||b7){return bG(bW.querySelectorAll("[id='"+bV+"'] "+b5),b0)}}catch(b2){}finally{if(!bY){bX.removeAttribute("id")}}}}}return e(b5,bW,b0,b4)};for(var bS in e){bz[bS]=e[bS]}bU=null})()}(function(){var e=aw.documentElement,bT=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bT){var bV=!bT.call(aw.createElement("div"),"div"),bS=false;try{bT.call(aw.documentElement,"[test!='']:sizzle")}catch(bU){bS=true}bz.matchesSelector=function(bX,bZ){bZ=bZ.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!bz.isXML(bX)){try{if(bS||!bF.match.PSEUDO.test(bZ)&&!/!=/.test(bZ)){var bW=bT.call(bX,bZ);if(bW||!bV||bX.document&&bX.document.nodeType!==11){return bW}}}catch(bY){}}return bz(bZ,null,null,[bX]).length>0}}})();(function(){var e=aw.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}bF.order.splice(1,0,"CLASS");bF.find.CLASS=function(bS,bT,bU){if(typeof bT.getElementsByClassName!=="undefined"&&!bU){return bT.getElementsByClassName(bS[1])}};e=null})();function bw(bS,bX,bW,b0,bY,bZ){for(var bU=0,bT=b0.length;bU<bT;bU++){var e=b0[bU];if(e){var bV=false;e=e[bS];while(e){if(e[bD]===bW){bV=b0[e.sizset];break}if(e.nodeType===1&&!bZ){e[bD]=bW;e.sizset=bU}if(e.nodeName.toLowerCase()===bX){bV=e;break}e=e[bS]}b0[bU]=bV}}}function bO(bS,bX,bW,b0,bY,bZ){for(var bU=0,bT=b0.length;bU<bT;bU++){var e=b0[bU];if(e){var bV=false;e=e[bS];while(e){if(e[bD]===bW){bV=b0[e.sizset];break}if(e.nodeType===1){if(!bZ){e[bD]=bW;e.sizset=bU}if(typeof bX!=="string"){if(e===bX){bV=true;break}}else{if(bz.filter(bX,[e]).length>0){bV=e;break}}}e=e[bS]}b0[bU]=bV}}}if(aw.documentElement.contains){bz.contains=function(bS,e){return bS!==e&&(bS.contains?bS.contains(e):true)}}else{if(aw.documentElement.compareDocumentPosition){bz.contains=function(bS,e){return !!(bS.compareDocumentPosition(e)&16)}}else{bz.contains=function(){return false}}}bz.isXML=function(e){var bS=(e?e.ownerDocument||e:0).documentElement;return bS?bS.nodeName!=="HTML":false};var bN=function(bT,e,bX){var bW,bY=[],bV="",bZ=e.nodeType?[e]:e;while((bW=bF.match.PSEUDO.exec(bT))){bV+=bW[0];bT=bT.replace(bF.match.PSEUDO,"")}bT=bF.relative[bT]?bT+"*":bT;for(var bU=0,bS=bZ.length;bU<bS;bU++){bz(bT,bZ[bU],bY,bX)}return bz.filter(bV,bY)};bz.attr=b.attr;bz.selectors.attrMap={};b.find=bz;b.expr=bz.selectors;b.expr[":"]=b.expr.filters;b.unique=bz.uniqueSort;b.text=bz.getText;b.isXMLDoc=bz.isXML;b.contains=bz.contains})();var ac=/Until$/,ar=/^(?:parents|prevUntil|prevAll)/,bc=/,/,bq=/^.[^:#\[\.,]*$/,Q=Array.prototype.slice,I=b.expr.match.globalPOS,az={children:true,contents:true,next:true,prev:true};b.fn.extend({find:function(e){var bx=this,bz,bw;if(typeof e!=="string"){return b(e).filter(function(){for(bz=0,bw=bx.length;bz<bw;bz++){if(b.contains(bx[bz],this)){return true}}})}var by=this.pushStack("","find",e),bB,bC,bA;for(bz=0,bw=this.length;bz<bw;bz++){bB=by.length;b.find(e,this[bz],by);if(bz>0){for(bC=bB;bC<by.length;bC++){for(bA=0;bA<bB;bA++){if(by[bA]===by[bC]){by.splice(bC--,1);break}}}}}return by},has:function(bw){var e=b(bw);return this.filter(function(){for(var by=0,bx=e.length;by<bx;by++){if(b.contains(this,e[by])){return true}}})},not:function(e){return this.pushStack(aI(this,e,false),"not",e)},filter:function(e){return this.pushStack(aI(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?I.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(bz,by){var bw=[],bx,e,bA=this[0];if(b.isArray(bz)){var bC=1;while(bA&&bA.ownerDocument&&bA!==by){for(bx=0;bx<bz.length;bx++){if(b(bA).is(bz[bx])){bw.push({selector:bz[bx],elem:bA,level:bC})}}bA=bA.parentNode;bC++}return bw}var bB=I.test(bz)||typeof bz!=="string"?b(bz,by||this.context):0;for(bx=0,e=this.length;bx<e;bx++){bA=this[bx];while(bA){if(bB?bB.index(bA)>-1:b.find.matchesSelector(bA,bz)){bw.push(bA);break}else{bA=bA.parentNode;if(!bA||!bA.ownerDocument||bA===by||bA.nodeType===11){break}}}}bw=bw.length>1?b.unique(bw):bw;return this.pushStack(bw,"closest",bz)},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,bw){var by=typeof e==="string"?b(e,bw):b.makeArray(e&&e.nodeType?[e]:e),bx=b.merge(this.get(),by);return this.pushStack(C(by[0])||C(bx[0])?bx:b.unique(bx))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bw){var e=bw.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bw,e,bx){return b.dir(bw,"parentNode",bx)},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(bw,e,bx){return b.dir(bw,"nextSibling",bx)},prevUntil:function(bw,e,bx){return b.dir(bw,"previousSibling",bx)},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,bw){b.fn[e]=function(bz,bx){var by=b.map(this,bw,bz);if(!ac.test(e)){bx=bz}if(bx&&typeof bx==="string"){by=b.filter(bx,by)}by=this.length>1&&!az[e]?b.unique(by):by;if((this.length>1||bc.test(bx))&&ar.test(e)){by=by.reverse()}return this.pushStack(by,e,Q.call(arguments).join(","))}});b.extend({filter:function(bx,e,bw){if(bw){bx=":not("+bx+")"}return e.length===1?b.find.matchesSelector(e[0],bx)?[e[0]]:[]:b.find.matches(bx,e)},dir:function(bx,bw,bz){var e=[],by=bx[bw];while(by&&by.nodeType!==9&&(bz===M||by.nodeType!==1||!b(by).is(bz))){if(by.nodeType===1){e.push(by)}by=by[bw]}return e},nth:function(bz,e,bx,by){e=e||1;var bw=0;for(;bz;bz=bz[bx]){if(bz.nodeType===1&&++bw===e){break}}return bz},sibling:function(bx,bw){var e=[];for(;bx;bx=bx.nextSibling){if(bx.nodeType===1&&bx!==bw){e.push(bx)}}return e}});function aI(by,bx,e){bx=bx||0;if(b.isFunction(bx)){return b.grep(by,function(bA,bz){var bB=!!bx.call(bA,bz,bA);return bB===e})}else{if(bx.nodeType){return b.grep(by,function(bA,bz){return(bA===bx)===e})}else{if(typeof bx==="string"){var bw=b.grep(by,function(bz){return bz.nodeType===1});if(bq.test(bx)){return b.filter(bx,bw,!e)}else{bx=b.filter(bx,bw)}}}}return b.grep(by,function(bA,bz){return(b.inArray(bA,bx)>=0)===e})}function a(e){var bx=aT.split("|"),bw=e.createDocumentFragment();if(bw.createElement){while(bx.length){bw.createElement(bx.pop())}}return bw}var aT="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ai=/ jQuery\d+="(?:\d+|null)"/g,at=/^\s+/,S=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/<tbody/i,X=/<|&#?\w+;/,af=/<(?:script|style)/i,P=/<(?:script|object|embed|option|style)/i,aj=new RegExp("<(?:"+aT+")[\\s/>]","i"),p=/checked\s*(?:[^=]|=\s*.checked.)/i,bo=/\/(java|ecma)script/i,aP=/^\s*<!(?:\[CDATA\[|\-\-)/,ay={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,"",""]},ad=a(aw);ay.optgroup=ay.option;ay.tbody=ay.tfoot=ay.colgroup=ay.caption=ay.thead;ay.th=ay.td;if(!b.support.htmlSerialize){ay._default=[1,"div<div>","</div>"]}b.fn.extend({text:function(e){return b.access(this,function(bw){return bw===M?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||aw).createTextNode(bw))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bx){b(this).wrapAll(e.call(this,bx))})}if(this[0]){var bw=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bw.insertBefore(this[0])}bw.map(function(){var bx=this;while(bx.firstChild&&bx.firstChild.nodeType===1){bx=bx.firstChild}return bx}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapInner(e.call(this,bw))})}return this.each(function(){var bw=b(this),bx=bw.contents();if(bx.length){bx.wrapAll(e)}else{bw.append(e)}})},wrap:function(e){var bw=b.isFunction(e);return this.each(function(bx){b(this).wrapAll(bw?e.call(this,bx):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(bw){this.parentNode.insertBefore(bw,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(bw){this.parentNode.insertBefore(bw,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,by){for(var bw=0,bx;(bx=this[bw])!=null;bw++){if(!e||b.filter(e,[bx]).length){if(!by&&bx.nodeType===1){b.cleanData(bx.getElementsByTagName("*"));b.cleanData([bx])}if(bx.parentNode){bx.parentNode.removeChild(bx)}}}return this},empty:function(){for(var e=0,bw;(bw=this[e])!=null;e++){if(bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"))}while(bw.firstChild){bw.removeChild(bw.firstChild)}}return this},clone:function(bw,e){bw=bw==null?false:bw;e=e==null?bw:e;return this.map(function(){return b.clone(this,bw,e)})},html:function(e){return b.access(this,function(bz){var by=this[0]||{},bx=0,bw=this.length;if(bz===M){return by.nodeType===1?by.innerHTML.replace(ai,""):null}if(typeof bz==="string"&&!af.test(bz)&&(b.support.leadingWhitespace||!at.test(bz))&&!ay[(d.exec(bz)||["",""])[1].toLowerCase()]){bz=bz.replace(S,"<$1></$2>");try{for(;bx<bw;bx++){by=this[bx]||{};if(by.nodeType===1){b.cleanData(by.getElementsByTagName("*"));by.innerHTML=bz}}by=0}catch(bA){}}if(by){this.empty().append(bz)}},null,e,arguments.length)},replaceWith:function(e){if(this[0]&&this[0].parentNode){if(b.isFunction(e)){return this.each(function(by){var bx=b(this),bw=bx.html();bx.replaceWith(e.call(this,by,bw))})}if(typeof e!=="string"){e=b(e).detach()}return this.each(function(){var bx=this.nextSibling,bw=this.parentNode;b(this).remove();if(bx){b(bx).before(e)}else{b(bw).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(bC,bG,bF){var by,bz,bB,bE,bD=bC[0],bw=[];if(!b.support.checkClone&&arguments.length===3&&typeof bD==="string"&&p.test(bD)){return this.each(function(){b(this).domManip(bC,bG,bF,true)})}if(b.isFunction(bD)){return this.each(function(bI){var bH=b(this);bC[0]=bD.call(this,bI,bG?bH.html():M);bH.domManip(bC,bG,bF)})}if(this[0]){bE=bD&&bD.parentNode;if(b.support.parentNode&&bE&&bE.nodeType===11&&bE.childNodes.length===this.length){by={fragment:bE}}else{by=b.buildFragment(bC,this,bw)}bB=by.fragment;if(bB.childNodes.length===1){bz=bB=bB.firstChild}else{bz=bB.firstChild}if(bz){bG=bG&&b.nodeName(bz,"tr");for(var bx=0,e=this.length,bA=e-1;bx<e;bx++){bF.call(bG?bd(this[bx],bz):this[bx],by.cacheable||(e>1&&bx<bA)?b.clone(bB,true,true):bB)}}if(bw.length){b.each(bw,function(bH,bI){if(bI.src){b.ajax({type:"GET",global:false,url:bI.src,async:false,dataType:"script"})}else{b.globalEval((bI.text||bI.textContent||bI.innerHTML||"").replace(aP,"/*$0*/"))}if(bI.parentNode){bI.parentNode.removeChild(bI)}})}}return this}});function bd(e,bw){return b.nodeName(e,"table")?(e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody"))):e}function t(bC,bw){if(bw.nodeType!==1||!b.hasData(bC)){return}var bz,by,e,bB=b._data(bC),bA=b._data(bw,bB),bx=bB.events;if(bx){delete bA.handle;bA.events={};for(bz in bx){for(by=0,e=bx[bz].length;by<e;by++){b.event.add(bw,bz,bx[bz][by])}}}if(bA.data){bA.data=b.extend({},bA.data)}}function ak(bw,e){var bx;if(e.nodeType!==1){return}if(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(bw)}bx=e.nodeName.toLowerCase();if(bx==="object"){e.outerHTML=bw.outerHTML}else{if(bx==="input"&&(bw.type==="checkbox"||bw.type==="radio")){if(bw.checked){e.defaultChecked=e.checked=bw.checked}if(e.value!==bw.value){e.value=bw.value}}else{if(bx==="option"){e.selected=bw.defaultSelected}else{if(bx==="input"||bx==="textarea"){e.defaultValue=bw.defaultValue}else{if(bx==="script"&&e.text!==bw.text){e.text=bw.text}}}}}e.removeAttribute(b.expando);e.removeAttribute("_submit_attached");e.removeAttribute("_change_attached")}b.buildFragment=function(bA,by,bw){var bz,e,bx,bB,bC=bA[0];if(by&&by[0]){bB=by[0].ownerDocument||by[0]}if(!bB.createDocumentFragment){bB=aw}if(bA.length===1&&typeof bC==="string"&&bC.length<512&&bB===aw&&bC.charAt(0)==="<"&&!P.test(bC)&&(b.support.checkClone||!p.test(bC))&&(b.support.html5Clone||!aj.test(bC))){e=true;bx=b.fragments[bC];if(bx&&bx!==1){bz=bx}}if(!bz){bz=bB.createDocumentFragment();b.clean(bA,bB,bz,bw)}if(e){b.fragments[bC]=bx?bz:1}return{fragment:bz,cacheable:e}};b.fragments={};b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bw){b.fn[e]=function(bx){var bA=[],bD=b(bx),bC=this.length===1&&this[0].parentNode;if(bC&&bC.nodeType===11&&bC.childNodes.length===1&&bD.length===1){bD[bw](this[0]);return this}else{for(var bB=0,by=bD.length;bB<by;bB++){var bz=(bB>0?this.clone(true):this).get();b(bD[bB])[bw](bz);bA=bA.concat(bz)}return this.pushStack(bA,e,bD.selector)}}});function bi(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function aA(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bw=(e.nodeName||"").toLowerCase();if(bw==="input"){aA(e)}else{if(bw!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),aA)}}}function an(e){var bw=aw.createElement("div");ad.appendChild(bw);bw.innerHTML=e.outerHTML;return bw.firstChild}b.extend({clone:function(bz,bB,bx){var e,bw,by,bA=b.support.html5Clone||b.isXMLDoc(bz)||!aj.test("<"+bz.nodeName+">")?bz.cloneNode(true):an(bz);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(bz.nodeType===1||bz.nodeType===11)&&!b.isXMLDoc(bz)){ak(bz,bA);e=bi(bz);bw=bi(bA);for(by=0;e[by];++by){if(bw[by]){ak(e[by],bw[by])}}}if(bB){t(bz,bA);if(bx){e=bi(bz);bw=bi(bA);for(by=0;e[by];++by){t(e[by],bw[by])}}}e=bw=null;return bA},clean:function(bJ,bx,bw,by){var bB,bI,bE,bK=[];bx=bx||aw;if(typeof bx.createElement==="undefined"){bx=bx.ownerDocument||bx[0]&&bx[0].ownerDocument||aw}for(var bF=0,bH;(bH=bJ[bF])!=null;bF++){if(typeof bH==="number"){bH+=""}if(!bH){continue}if(typeof bH==="string"){if(!X.test(bH)){bH=bx.createTextNode(bH)}else{bH=bH.replace(S,"<$1></$2>");var bO=(d.exec(bH)||["",""])[1].toLowerCase(),bA=ay[bO]||ay._default,bL=bA[0],bC=bx.createElement("div"),bM=ad.childNodes,bN;if(bx===aw){ad.appendChild(bC)}else{a(bx).appendChild(bC)}bC.innerHTML=bA[1]+bH+bA[2];while(bL--){bC=bC.lastChild}if(!b.support.tbody){var bz=w.test(bH),e=bO==="table"&&!bz?bC.firstChild&&bC.firstChild.childNodes:bA[1]==="<table>"&&!bz?bC.childNodes:[];for(bE=e.length-1;bE>=0;--bE){if(b.nodeName(e[bE],"tbody")&&!e[bE].childNodes.length){e[bE].parentNode.removeChild(e[bE])}}}if(!b.support.leadingWhitespace&&at.test(bH)){bC.insertBefore(bx.createTextNode(at.exec(bH)[0]),bC.firstChild)}bH=bC.childNodes;if(bC){bC.parentNode.removeChild(bC);if(bM.length>0){bN=bM[bM.length-1];if(bN&&bN.parentNode){bN.parentNode.removeChild(bN)}}}}}var bG;if(!b.support.appendChecked){if(bH[0]&&typeof(bG=bH.length)==="number"){for(bE=0;bE<bG;bE++){E(bH[bE])}}else{E(bH)}}if(bH.nodeType){bK.push(bH)}else{bK=b.merge(bK,bH)}}if(bw){bB=function(bP){return !bP.type||bo.test(bP.type)};for(bF=0;bK[bF];bF++){bI=bK[bF];if(by&&b.nodeName(bI,"script")&&(!bI.type||bo.test(bI.type))){by.push(bI.parentNode?bI.parentNode.removeChild(bI):bI)}else{if(bI.nodeType===1){var bD=b.grep(bI.getElementsByTagName("script"),bB);bK.splice.apply(bK,[bF+1,0].concat(bD))}bw.appendChild(bI)}}}return bK},cleanData:function(bw){var bz,bx,e=b.cache,bC=b.event.special,bB=b.support.deleteExpando;for(var bA=0,by;(by=bw[bA])!=null;bA++){if(by.nodeName&&b.noData[by.nodeName.toLowerCase()]){continue}bx=by[b.expando];if(bx){bz=e[bx];if(bz&&bz.events){for(var bD in bz.events){if(bC[bD]){b.event.remove(by,bD)}else{b.removeEvent(by,bD,bz.handle)}}if(bz.handle){bz.handle.elem=null}}if(bB){delete by[b.expando]}else{if(by.removeAttribute){by.removeAttribute(b.expando)}}delete e[bx]}}}});var am=/alpha\([^)]*\)/i,av=/opacity=([^)]*)/,z=/([A-Z]|^ms)/g,bp=/^[\-+]?(?:\d*\.)?\d+$/i,a2=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,J=/^([\-+])=([\-+.\de]+)/,aF=/^margin/,ba={position:"absolute",visibility:"hidden",display:"block"},H=["Top","Right","Bottom","Left"],aa,aK,aZ;b.fn.css=function(e,bw){return b.access(this,function(by,bx,bz){return bz!==M?b.style(by,bx,bz):b.css(by,bx)},e,bw,arguments.length>1)};b.extend({cssHooks:{opacity:{get:function(bx,bw){if(bw){var e=aa(bx,"opacity");return e===""?"1":e}else{return bx.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(by,bx,bE,bz){if(!by||by.nodeType===3||by.nodeType===8||!by.style){return}var bC,bD,bA=b.camelCase(bx),bw=by.style,bF=b.cssHooks[bA];bx=b.cssProps[bA]||bA;if(bE!==M){bD=typeof bE;if(bD==="string"&&(bC=J.exec(bE))){bE=(+(bC[1]+1)*+bC[2])+parseFloat(b.css(by,bx));bD="number"}if(bE==null||bD==="number"&&isNaN(bE)){return}if(bD==="number"&&!b.cssNumber[bA]){bE+="px"}if(!bF||!("set" in bF)||(bE=bF.set(by,bE))!==M){try{bw[bx]=bE}catch(bB){}}}else{if(bF&&"get" in bF&&(bC=bF.get(by,false,bz))!==M){return bC}return bw[bx]}},css:function(bz,by,bw){var bx,e;by=b.camelCase(by);e=b.cssHooks[by];by=b.cssProps[by]||by;if(by==="cssFloat"){by="float"}if(e&&"get" in e&&(bx=e.get(bz,true,bw))!==M){return bx}else{if(aa){return aa(bz,by)}}},swap:function(bz,by,bA){var e={},bx,bw;for(bw in by){e[bw]=bz.style[bw];bz.style[bw]=by[bw]}bx=bA.call(bz);for(bw in by){bz.style[bw]=e[bw]}return bx}});b.curCSS=b.css;if(aw.defaultView&&aw.defaultView.getComputedStyle){aK=function(bB,bx){var bw,bA,e,bz,by=bB.style;bx=bx.replace(z,"-$1").toLowerCase();if((bA=bB.ownerDocument.defaultView)&&(e=bA.getComputedStyle(bB,null))){bw=e.getPropertyValue(bx);if(bw===""&&!b.contains(bB.ownerDocument.documentElement,bB)){bw=b.style(bB,bx)}}if(!b.support.pixelMargin&&e&&aF.test(bx)&&a2.test(bw)){bz=by.width;by.width=bw;bw=e.width;by.width=bz}return bw}}if(aw.documentElement.currentStyle){aZ=function(bA,bx){var bB,e,bz,bw=bA.currentStyle&&bA.currentStyle[bx],by=bA.style;if(bw==null&&by&&(bz=by[bx])){bw=bz}if(a2.test(bw)){bB=by.left;e=bA.runtimeStyle&&bA.runtimeStyle.left;if(e){bA.runtimeStyle.left=bA.currentStyle.left}by.left=bx==="fontSize"?"1em":bw;bw=by.pixelLeft+"px";by.left=bB;if(e){bA.runtimeStyle.left=e}}return bw===""?"auto":bw}}aa=aK||aZ;function ag(bz,bx,bw){var bA=bx==="width"?bz.offsetWidth:bz.offsetHeight,by=bx==="width"?1:0,e=4;if(bA>0){if(bw!=="border"){for(;by<e;by+=2){if(!bw){bA-=parseFloat(b.css(bz,"padding"+H[by]))||0}if(bw==="margin"){bA+=parseFloat(b.css(bz,bw+H[by]))||0}else{bA-=parseFloat(b.css(bz,"border"+H[by]+"Width"))||0}}}return bA+"px"}bA=aa(bz,bx);if(bA<0||bA==null){bA=bz.style[bx]}if(a2.test(bA)){return bA}bA=parseFloat(bA)||0;if(bw){for(;by<e;by+=2){bA+=parseFloat(b.css(bz,"padding"+H[by]))||0;if(bw!=="padding"){bA+=parseFloat(b.css(bz,"border"+H[by]+"Width"))||0}if(bw==="margin"){bA+=parseFloat(b.css(bz,bw+H[by]))||0}}}return bA+"px"}b.each(["height","width"],function(bw,e){b.cssHooks[e]={get:function(bz,by,bx){if(by){if(bz.offsetWidth!==0){return ag(bz,e,bx)}else{return b.swap(bz,ba,function(){return ag(bz,e,bx)})}}},set:function(bx,by){return bp.test(by)?by+"px":by}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bw,e){return av.test((e&&bw.currentStyle?bw.currentStyle.filter:bw.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(bz,bA){var by=bz.style,bw=bz.currentStyle,e=b.isNumeric(bA)?"alpha(opacity="+bA*100+")":"",bx=bw&&bw.filter||by.filter||"";by.zoom=1;if(bA>=1&&b.trim(bx.replace(am,""))===""){by.removeAttribute("filter");if(bw&&!bw.filter){return}}by.filter=am.test(bx)?bx.replace(am,e):bx+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,e){return b.swap(bw,{display:"inline-block"},function(){if(e){return aa(bw,"margin-right")}else{return bw.style.marginRight}})}}}});if(b.expr&&b.expr.filters){b.expr.filters.hidden=function(bx){var bw=bx.offsetWidth,e=bx.offsetHeight;return(bw===0&&e===0)||(!b.support.reliableHiddenOffsets&&((bx.style&&bx.style.display)||b.css(bx,"display"))==="none")};b.expr.filters.visible=function(e){return !b.expr.filters.hidden(e)}}b.each({margin:"",padding:"",border:"Width"},function(e,bw){b.cssHooks[e+bw]={expand:function(bz){var by,bA=typeof bz==="string"?bz.split(" "):[bz],bx={};for(by=0;by<4;by++){bx[e+H[by]+bw]=bA[by]||bA[by-2]||bA[0]}return bx}}});var l=/%20/g,aq=/\[\]$/,bt=/\r?\n/g,br=/#.*$/,aE=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,a1=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aO=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,aS=/^(?:GET|HEAD)$/,c=/^\/\//,N=/\?/,a8=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,bs=/([?&])_=[^&]*/,L=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,ab={},r={},aG,s,aX=["*/"]+["*"];try{aG=bn.href}catch(ax){aG=aw.createElement("a");aG.href="";aG=aG.href}s=L.exec(aG.toLowerCase())||[];function f(e){return function(bz,bB){if(typeof bz!=="string"){bB=bz;bz="*"}if(b.isFunction(bB)){var by=bz.toLowerCase().split(h),bx=0,bA=by.length,bw,bC,bD;for(;bx<bA;bx++){bw=by[bx];bD=/^\+/.test(bw);if(bD){bw=bw.substr(1)||"*"}bC=e[bw]=e[bw]||[];bC[bD?"unshift":"push"](bB)}}}}function aY(bw,bF,bA,bE,bC,by){bC=bC||bF.dataTypes[0];by=by||{};by[bC]=true;var bB=bw[bC],bx=0,e=bB?bB.length:0,bz=(bw===ab),bD;for(;bx<e&&(bz||!bD);bx++){bD=bB[bx](bF,bA,bE);if(typeof bD==="string"){if(!bz||by[bD]){bD=M}else{bF.dataTypes.unshift(bD);bD=aY(bw,bF,bA,bE,bD,by)}}}if((bz||!bD)&&!by["*"]){bD=aY(bw,bF,bA,bE,"*",by)}return bD}function ao(bx,by){var bw,e,bz=b.ajaxSettings.flatOptions||{};for(bw in by){if(by[bw]!==M){(bz[bw]?bx:(e||(e={})))[bw]=by[bw]}}if(e){b.extend(true,bx,e)}}b.fn.extend({load:function(bx,bA,bB){if(typeof bx!=="string"&&A){return A.apply(this,arguments)}else{if(!this.length){return this}}var bz=bx.indexOf(" ");if(bz>=0){var e=bx.slice(bz,bx.length);bx=bx.slice(0,bz)}var by="GET";if(bA){if(b.isFunction(bA)){bB=bA;bA=M}else{if(typeof bA==="object"){bA=b.param(bA,b.ajaxSettings.traditional);by="POST"}}}var bw=this;b.ajax({url:bx,type:by,dataType:"html",data:bA,complete:function(bD,bC,bE){bE=bD.responseText;if(bD.isResolved()){bD.done(function(bF){bE=bF});bw.html(e?b("<div>").append(bE.replace(a8,"")).find(e):bE)}if(bB){bw.each(bB,[bE,bC,bD])}}});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||q.test(this.nodeName)||a1.test(this.type))}).map(function(e,bw){var bx=b(this).val();return bx==null?null:b.isArray(bx)?b.map(bx,function(bz,by){return{name:bw.name,value:bz.replace(bt,"\r\n")}}):{name:bw.name,value:bx.replace(bt,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bw){b.fn[bw]=function(bx){return this.on(bw,bx)}});b.each(["get","post"],function(e,bw){b[bw]=function(bx,bz,bA,by){if(b.isFunction(bz)){by=by||bA;bA=bz;bz=M}return b.ajax({type:bw,url:bx,data:bz,success:bA,dataType:by})}});b.extend({getScript:function(e,bw){return b.get(e,M,bw,"script")},getJSON:function(e,bw,bx){return b.get(e,bw,bx,"json")},ajaxSetup:function(bw,e){if(e){ao(bw,b.ajaxSettings)}else{e=bw;bw=b.ajaxSettings}ao(bw,e);return bw},ajaxSettings:{url:aG,isLocal:aO.test(s[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","*":aX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":be.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(ab),ajaxTransport:f(r),ajax:function(bA,by){if(typeof bA==="object"){by=bA;bA=M}by=by||{};var bE=b.ajaxSetup({},by),bT=bE.context||bE,bH=bT!==bE&&(bT.nodeType||bT instanceof b)?b(bT):b.event,bS=b.Deferred(),bO=b.Callbacks("once memory"),bC=bE.statusCode||{},bD,bI={},bP={},bR,bz,bM,bF,bJ,bB=0,bx,bL,bK={readyState:0,setRequestHeader:function(bU,bV){if(!bB){var e=bU.toLowerCase();bU=bP[e]=bP[e]||bU;bI[bU]=bV}return this},getAllResponseHeaders:function(){return bB===2?bR:null},getResponseHeader:function(bU){var e;if(bB===2){if(!bz){bz={};while((e=aE.exec(bR))){bz[e[1].toLowerCase()]=e[2]}}e=bz[bU.toLowerCase()]}return e===M?null:e},overrideMimeType:function(e){if(!bB){bE.mimeType=e}return this},abort:function(e){e=e||"abort";if(bM){bM.abort(e)}bG(0,e);return this}};function bG(b0,bV,b1,bX){if(bB===2){return}bB=2;if(bF){clearTimeout(bF)}bM=M;bR=bX||"";bK.readyState=b0>0?4:0;var bU,b5,b4,bY=bV,bZ=b1?bl(bE,bK,b1):M,bW,b3;if(b0>=200&&b0<300||b0===304){if(bE.ifModified){if((bW=bK.getResponseHeader("Last-Modified"))){b.lastModified[bD]=bW}if((b3=bK.getResponseHeader("Etag"))){b.etag[bD]=b3}}if(b0===304){bY="notmodified";bU=true}else{try{b5=G(bE,bZ);bY="success";bU=true}catch(b2){bY="parsererror";b4=b2}}}else{b4=bY;if(!bY||b0){bY="error";if(b0<0){b0=0}}}bK.status=b0;bK.statusText=""+(bV||bY);if(bU){bS.resolveWith(bT,[b5,bY,bK])}else{bS.rejectWith(bT,[bK,bY,b4])}bK.statusCode(bC);bC=M;if(bx){bH.trigger("ajax"+(bU?"Success":"Error"),[bK,bE,bU?b5:b4])}bO.fireWith(bT,[bK,bY]);if(bx){bH.trigger("ajaxComplete",[bK,bE]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bS.promise(bK);bK.success=bK.done;bK.error=bK.fail;bK.complete=bO.add;bK.statusCode=function(bU){if(bU){var e;if(bB<2){for(e in bU){bC[e]=[bC[e],bU[e]]}}else{e=bU[bK.status];bK.then(e,e)}}return this};bE.url=((bA||bE.url)+"").replace(br,"").replace(c,s[1]+"//");bE.dataTypes=b.trim(bE.dataType||"*").toLowerCase().split(h);if(bE.crossDomain==null){bJ=L.exec(bE.url.toLowerCase());bE.crossDomain=!!(bJ&&(bJ[1]!=s[1]||bJ[2]!=s[2]||(bJ[3]||(bJ[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bE.data&&bE.processData&&typeof bE.data!=="string"){bE.data=b.param(bE.data,bE.traditional)}aY(ab,bE,by,bK);if(bB===2){return false}bx=bE.global;bE.type=bE.type.toUpperCase();bE.hasContent=!aS.test(bE.type);if(bx&&b.active++===0){b.event.trigger("ajaxStart")}if(!bE.hasContent){if(bE.data){bE.url+=(N.test(bE.url)?"&":"?")+bE.data;delete bE.data}bD=bE.url;if(bE.cache===false){var bw=b.now(),bQ=bE.url.replace(bs,"$1_="+bw);bE.url=bQ+((bQ===bE.url)?(N.test(bE.url)?"&":"?")+"_="+bw:"")}}if(bE.data&&bE.hasContent&&bE.contentType!==false||by.contentType){bK.setRequestHeader("Content-Type",bE.contentType)}if(bE.ifModified){bD=bD||bE.url;if(b.lastModified[bD]){bK.setRequestHeader("If-Modified-Since",b.lastModified[bD])}if(b.etag[bD]){bK.setRequestHeader("If-None-Match",b.etag[bD])}}bK.setRequestHeader("Accept",bE.dataTypes[0]&&bE.accepts[bE.dataTypes[0]]?bE.accepts[bE.dataTypes[0]]+(bE.dataTypes[0]!=="*"?", "+aX+"; q=0.01":""):bE.accepts["*"]);for(bL in bE.headers){bK.setRequestHeader(bL,bE.headers[bL])}if(bE.beforeSend&&(bE.beforeSend.call(bT,bK,bE)===false||bB===2)){bK.abort();return false}for(bL in {success:1,error:1,complete:1}){bK[bL](bE[bL])}bM=aY(r,bE,by,bK);if(!bM){bG(-1,"No Transport")}else{bK.readyState=1;if(bx){bH.trigger("ajaxSend",[bK,bE])}if(bE.async&&bE.timeout>0){bF=setTimeout(function(){bK.abort("timeout")},bE.timeout)}try{bB=1;bM.send(bI,bG)}catch(bN){if(bB<2){bG(-1,bN)}else{throw bN}}}return bK},param:function(e,bx){var bw=[],bz=function(bA,bB){bB=b.isFunction(bB)?bB():bB;bw[bw.length]=encodeURIComponent(bA)+"="+encodeURIComponent(bB)};if(bx===M){bx=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){bz(this.name,this.value)})}else{for(var by in e){v(by,e[by],bx,bz)}}return bw.join("&").replace(l,"+")}});function v(bx,bz,bw,by){if(b.isArray(bz)){b.each(bz,function(bB,bA){if(bw||aq.test(bx)){by(bx,bA)}else{v(bx+"["+(typeof bA==="object"?bB:"")+"]",bA,bw,by)}})}else{if(!bw&&b.type(bz)==="object"){for(var e in bz){v(bx+"["+e+"]",bz[e],bw,by)}}else{by(bx,bz)}}}b.extend({active:0,lastModified:{},etag:{}});function bl(bE,bD,bA){var bw=bE.contents,bC=bE.dataTypes,bx=bE.responseFields,bz,bB,by,e;for(bB in bx){if(bB in bA){bD[bx[bB]]=bA[bB]}}while(bC[0]==="*"){bC.shift();if(bz===M){bz=bE.mimeType||bD.getResponseHeader("content-type")}}if(bz){for(bB in bw){if(bw[bB]&&bw[bB].test(bz)){bC.unshift(bB);break}}}if(bC[0] in bA){by=bC[0]}else{for(bB in bA){if(!bC[0]||bE.converters[bB+" "+bC[0]]){by=bB;break}if(!e){e=bB}}by=by||e}if(by){if(by!==bC[0]){bC.unshift(by)}return bA[by]}}function G(bI,bA){if(bI.dataFilter){bA=bI.dataFilter(bA,bI.dataType)}var bE=bI.dataTypes,bH={},bB,bF,bx=bE.length,bC,bD=bE[0],by,bz,bG,bw,e;for(bB=1;bB<bx;bB++){if(bB===1){for(bF in bI.converters){if(typeof bF==="string"){bH[bF.toLowerCase()]=bI.converters[bF]}}}by=bD;bD=bE[bB];if(bD==="*"){bD=by}else{if(by!=="*"&&by!==bD){bz=by+" "+bD;bG=bH[bz]||bH["* "+bD];if(!bG){e=M;for(bw in bH){bC=bw.split(" ");if(bC[0]===by||bC[0]==="*"){e=bH[bC[1]+" "+bD];if(e){bw=bH[bw];if(bw===true){bG=e}else{if(e===true){bG=bw}}break}}}}if(!(bG||e)){b.error("No conversion from "+bz.replace(" "," to "))}if(bG!==true){bA=bG?bG(bA):e(bw(bA))}}}}return bA}var aD=b.now(),u=/(\=)\?(&|$)|\?\?/i;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return b.expando+"_"+(aD++)}});b.ajaxPrefilter("json jsonp",function(bE,bB,bD){var by=(typeof bE.data==="string")&&/^application\/x\-www\-form\-urlencoded/.test(bE.contentType);if(bE.dataTypes[0]==="jsonp"||bE.jsonp!==false&&(u.test(bE.url)||by&&u.test(bE.data))){var bC,bx=bE.jsonpCallback=b.isFunction(bE.jsonpCallback)?bE.jsonpCallback():bE.jsonpCallback,bA=be[bx],e=bE.url,bz=bE.data,bw="$1"+bx+"$2";if(bE.jsonp!==false){e=e.replace(u,bw);if(bE.url===e){if(by){bz=bz.replace(u,bw)}if(bE.data===bz){e+=(/\?/.test(e)?"&":"?")+bE.jsonp+"="+bx}}}bE.url=e;bE.data=bz;be[bx]=function(bF){bC=[bF]};bD.always(function(){be[bx]=bA;if(bC&&b.isFunction(bA)){be[bx](bC[0])}});bE.converters["script json"]=function(){if(!bC){b.error(bx+" was not called")}return bC[0]};bE.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===M){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});b.ajaxTransport("script",function(bx){if(bx.crossDomain){var e,bw=aw.head||aw.getElementsByTagName("head")[0]||aw.documentElement;return{send:function(by,bz){e=aw.createElement("script");e.async="async";if(bx.scriptCharset){e.charset=bx.scriptCharset}e.src=bx.url;e.onload=e.onreadystatechange=function(bB,bA){if(bA||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(bw&&e.parentNode){bw.removeChild(e)}e=M;if(!bA){bz(200,"success")}}};bw.insertBefore(e,bw.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var B=be.ActiveXObject?function(){for(var e in O){O[e](0,1)}}:false,y=0,O;function aN(){try{return new be.XMLHttpRequest()}catch(bw){}}function al(){try{return new be.ActiveXObject("Microsoft.XMLHTTP")}catch(bw){}}b.ajaxSettings.xhr=be.ActiveXObject?function(){return !this.isLocal&&aN()||al()}:aN;(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 bw;return{send:function(bC,bx){var bB=e.xhr(),bA,bz;if(e.username){bB.open(e.type,e.url,e.async,e.username,e.password)}else{bB.open(e.type,e.url,e.async)}if(e.xhrFields){for(bz in e.xhrFields){bB[bz]=e.xhrFields[bz]}}if(e.mimeType&&bB.overrideMimeType){bB.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!bC["X-Requested-With"]){bC["X-Requested-With"]="XMLHttpRequest"}try{for(bz in bC){bB.setRequestHeader(bz,bC[bz])}}catch(by){}bB.send((e.hasContent&&e.data)||null);bw=function(bL,bF){var bG,bE,bD,bJ,bI;try{if(bw&&(bF||bB.readyState===4)){bw=M;if(bA){bB.onreadystatechange=b.noop;if(B){delete O[bA]}}if(bF){if(bB.readyState!==4){bB.abort()}}else{bG=bB.status;bD=bB.getAllResponseHeaders();bJ={};bI=bB.responseXML;if(bI&&bI.documentElement){bJ.xml=bI}try{bJ.text=bB.responseText}catch(bL){}try{bE=bB.statusText}catch(bK){bE=""}if(!bG&&e.isLocal&&!e.crossDomain){bG=bJ.text?200:404}else{if(bG===1223){bG=204}}}}}catch(bH){if(!bF){bx(-1,bH)}}if(bJ){bx(bG,bE,bJ,bD)}};if(!e.async||bB.readyState===4){bw()}else{bA=++y;if(B){if(!O){O={};b(be).unload(B)}O[bA]=bw}bB.onreadystatechange=bw}},abort:function(){if(bw){bw(0,1)}}}}})}var R={},bb,n,aC=/^(?:toggle|show|hide)$/,aV=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,a5,aJ=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],a6;b.fn.extend({show:function(by,bB,bA){var bx,bz;if(by||by===0){return this.animate(a3("show",3),by,bB,bA)}else{for(var bw=0,e=this.length;bw<e;bw++){bx=this[bw];if(bx.style){bz=bx.style.display;if(!b._data(bx,"olddisplay")&&bz==="none"){bz=bx.style.display=""}if((bz===""&&b.css(bx,"display")==="none")||!b.contains(bx.ownerDocument.documentElement,bx)){b._data(bx,"olddisplay",x(bx.nodeName))}}}for(bw=0;bw<e;bw++){bx=this[bw];if(bx.style){bz=bx.style.display;if(bz===""||bz==="none"){bx.style.display=b._data(bx,"olddisplay")||""}}}return this}},hide:function(by,bB,bA){if(by||by===0){return this.animate(a3("hide",3),by,bB,bA)}else{var bx,bz,bw=0,e=this.length;for(;bw<e;bw++){bx=this[bw];if(bx.style){bz=b.css(bx,"display");if(bz!=="none"&&!b._data(bx,"olddisplay")){b._data(bx,"olddisplay",bz)}}}for(bw=0;bw<e;bw++){if(this[bw].style){this[bw].style.display="none"}}return this}},_toggle:b.fn.toggle,toggle:function(bx,bw,by){var e=typeof bx==="boolean";if(b.isFunction(bx)&&b.isFunction(bw)){this._toggle.apply(this,arguments)}else{if(bx==null||e){this.each(function(){var bz=e?bx:b(this).is(":hidden");b(this)[bz?"show":"hide"]()})}else{this.animate(a3("toggle",3),bx,bw,by)}}return this},fadeTo:function(e,by,bx,bw){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:by},e,bx,bw)},animate:function(bA,bx,bz,by){var e=b.speed(bx,bz,by);if(b.isEmptyObject(bA)){return this.each(e.complete,[false])}bA=b.extend({},bA);function bw(){if(e.queue===false){b._mark(this)}var bF=b.extend({},e),bM=this.nodeType===1,bK=bM&&b(this).is(":hidden"),bC,bH,bE,bL,bO,bG,bJ,bD,bI,bN,bB;bF.animatedProperties={};for(bE in bA){bC=b.camelCase(bE);if(bE!==bC){bA[bC]=bA[bE];delete bA[bE]}if((bO=b.cssHooks[bC])&&"expand" in bO){bG=bO.expand(bA[bC]);delete bA[bC];for(bE in bG){if(!(bE in bA)){bA[bE]=bG[bE]}}}}for(bC in bA){bH=bA[bC];if(b.isArray(bH)){bF.animatedProperties[bC]=bH[1];bH=bA[bC]=bH[0]}else{bF.animatedProperties[bC]=bF.specialEasing&&bF.specialEasing[bC]||bF.easing||"swing"}if(bH==="hide"&&bK||bH==="show"&&!bK){return bF.complete.call(this)}if(bM&&(bC==="height"||bC==="width")){bF.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||x(this.nodeName)==="inline"){this.style.display="inline-block"}else{this.style.zoom=1}}}}if(bF.overflow!=null){this.style.overflow="hidden"}for(bE in bA){bL=new b.fx(this,bF,bE);bH=bA[bE];if(aC.test(bH)){bB=b._data(this,"toggle"+bE)||(bH==="toggle"?bK?"show":"hide":0);if(bB){b._data(this,"toggle"+bE,bB==="show"?"hide":"show");bL[bB]()}else{bL[bH]()}}else{bJ=aV.exec(bH);bD=bL.cur();if(bJ){bI=parseFloat(bJ[2]);bN=bJ[3]||(b.cssNumber[bE]?"":"px");if(bN!=="px"){b.style(this,bE,(bI||1)+bN);bD=((bI||1)/bL.cur())*bD;b.style(this,bE,bD+bN)}if(bJ[1]){bI=((bJ[1]==="-="?-1:1)*bI)+bD}bL.custom(bD,bI,bN)}else{bL.custom(bD,bH,"")}}}return true}return e.queue===false?this.each(bw):this.queue(e.queue,bw)},stop:function(bx,bw,e){if(typeof bx!=="string"){e=bw;bw=bx;bx=M}if(bw&&bx!==false){this.queue(bx||"fx",[])}return this.each(function(){var by,bz=false,bB=b.timers,bA=b._data(this);if(!e){b._unmark(true,this)}function bC(bF,bG,bE){var bD=bG[bE];b.removeData(bF,bE,true);bD.stop(e)}if(bx==null){for(by in bA){if(bA[by]&&bA[by].stop&&by.indexOf(".run")===by.length-4){bC(this,bA,by)}}}else{if(bA[by=bx+".run"]&&bA[by].stop){bC(this,bA,by)}}for(by=bB.length;by--;){if(bB[by].elem===this&&(bx==null||bB[by].queue===bx)){if(e){bB[by](true)}else{bB[by].saveState()}bz=true;bB.splice(by,1)}}if(!(e&&bz)){b.dequeue(this,bx)}})}});function bj(){setTimeout(au,0);return(a6=b.now())}function au(){a6=M}function a3(bw,e){var bx={};b.each(aJ.concat.apply([],aJ.slice(0,e)),function(){bx[this]=bw});return bx}b.each({slideDown:a3("show",1),slideUp:a3("hide",1),slideToggle:a3("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bw){b.fn[e]=function(bx,bz,by){return this.animate(bw,bx,bz,by)}});b.extend({speed:function(bx,by,bw){var e=bx&&typeof bx==="object"?b.extend({},bx):{complete:bw||!bw&&by||b.isFunction(bx)&&bx,duration:bx,easing:bw&&by||by&&!b.isFunction(by)&&by};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(bz){if(b.isFunction(e.old)){e.old.call(this)}if(e.queue){b.dequeue(this,e.queue)}else{if(bz!==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(bw,e,bx){this.options=e;this.elem=bw;this.prop=bx;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,bw=b.css(this.elem,this.prop);return isNaN(e=parseFloat(bw))?!bw||bw==="auto"?0:bw:e},custom:function(bA,bz,by){var e=this,bx=b.fx;this.startTime=a6||bj();this.end=bz;this.now=this.start=bA;this.pos=this.state=0;this.unit=by||this.unit||(b.cssNumber[this.prop]?"":"px");function bw(bB){return e.step(bB)}bw.queue=this.options.queue;bw.elem=this.elem;bw.saveState=function(){if(b._data(e.elem,"fxshow"+e.prop)===M){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(bw()&&b.timers.push(bw)&&!a5){a5=setInterval(bx.tick,bx.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!==M){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(bz){var bB,bC,bw,by=a6||bj(),e=true,bA=this.elem,bx=this.options;if(bz||by>=bx.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bx.animatedProperties[this.prop]=true;for(bB in bx.animatedProperties){if(bx.animatedProperties[bB]!==true){e=false}}if(e){if(bx.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bD,bE){bA.style["overflow"+bE]=bx.overflow[bD]})}if(bx.hide){b(bA).hide()}if(bx.hide||bx.show){for(bB in bx.animatedProperties){b.style(bA,bB,bx.orig[bB]);b.removeData(bA,"fxshow"+bB,true);b.removeData(bA,"toggle"+bB,true)}}bw=bx.complete;if(bw){bx.complete=false;bw.call(bA)}}return false}else{if(bx.duration==Infinity){this.now=by}else{bC=by-this.startTime;this.state=bC/bx.duration;this.pos=b.easing[bx.animatedProperties[this.prop]](this.state,bC,0,1,bx.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bx,bw=b.timers,e=0;for(;e<bw.length;e++){bx=bw[e];if(!bx()&&bw[e]===bx){bw.splice(e--,1)}}if(!bw.length){b.fx.stop()}},interval:13,stop:function(){clearInterval(a5);a5=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(aJ.concat.apply([],aJ),function(e,bw){if(bw.indexOf("margin")){b.fx.step[bw]=function(bx){b.style(bx.elem,bw,Math.max(0,bx.now)+bx.unit)}}});if(b.expr&&b.expr.filters){b.expr.filters.animated=function(e){return b.grep(b.timers,function(bw){return e===bw.elem}).length}}function x(by){if(!R[by]){var e=aw.body,bw=b("<"+by+">").appendTo(e),bx=bw.css("display");bw.remove();if(bx==="none"||bx===""){if(!bb){bb=aw.createElement("iframe");bb.frameBorder=bb.width=bb.height=0}e.appendChild(bb);if(!n||!bb.createElement){n=(bb.contentWindow||bb.contentDocument).document;n.write((b.support.boxModel?"<!doctype html>":"")+"<html><body>");n.close()}bw=n.createElement(by);n.body.appendChild(bw);bx=b.css(bw,"display");e.removeChild(bb)}R[by]=bx}return R[by]}var a9,W=/^t(?:able|d|h)$/i,ae=/^(?:body|html)$/i;if("getBoundingClientRect" in aw.documentElement){a9=function(bz,bI,bx,bC){try{bC=bz.getBoundingClientRect()}catch(bG){}if(!bC||!b.contains(bx,bz)){return bC?{top:bC.top,left:bC.left}:{top:0,left:0}}var bD=bI.body,bE=aM(bI),bB=bx.clientTop||bD.clientTop||0,bF=bx.clientLeft||bD.clientLeft||0,bw=bE.pageYOffset||b.support.boxModel&&bx.scrollTop||bD.scrollTop,bA=bE.pageXOffset||b.support.boxModel&&bx.scrollLeft||bD.scrollLeft,bH=bC.top+bw-bB,by=bC.left+bA-bF;return{top:bH,left:by}}}else{a9=function(bA,bF,by){var bD,bx=bA.offsetParent,bw=bA,bB=bF.body,bC=bF.defaultView,e=bC?bC.getComputedStyle(bA,null):bA.currentStyle,bE=bA.offsetTop,bz=bA.offsetLeft;while((bA=bA.parentNode)&&bA!==bB&&bA!==by){if(b.support.fixedPosition&&e.position==="fixed"){break}bD=bC?bC.getComputedStyle(bA,null):bA.currentStyle;bE-=bA.scrollTop;bz-=bA.scrollLeft;if(bA===bx){bE+=bA.offsetTop;bz+=bA.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&W.test(bA.nodeName))){bE+=parseFloat(bD.borderTopWidth)||0;bz+=parseFloat(bD.borderLeftWidth)||0}bw=bx;bx=bA.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bD.overflow!=="visible"){bE+=parseFloat(bD.borderTopWidth)||0;bz+=parseFloat(bD.borderLeftWidth)||0}e=bD}if(e.position==="relative"||e.position==="static"){bE+=bB.offsetTop;bz+=bB.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bE+=Math.max(by.scrollTop,bB.scrollTop);bz+=Math.max(by.scrollLeft,bB.scrollLeft)}return{top:bE,left:bz}}}b.fn.offset=function(e){if(arguments.length){return e===M?this:this.each(function(by){b.offset.setOffset(this,e,by)})}var bw=this[0],bx=bw&&bw.ownerDocument;if(!bx){return null}if(bw===bx.body){return b.offset.bodyOffset(bw)}return a9(bw,bx,bx.documentElement)};b.offset={bodyOffset:function(e){var bx=e.offsetTop,bw=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bx+=parseFloat(b.css(e,"marginTop"))||0;bw+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bx,left:bw}},setOffset:function(by,bH,bB){var bC=b.css(by,"position");if(bC==="static"){by.style.position="relative"}var bA=b(by),bw=bA.offset(),e=b.css(by,"top"),bF=b.css(by,"left"),bG=(bC==="absolute"||bC==="fixed")&&b.inArray("auto",[e,bF])>-1,bE={},bD={},bx,bz;if(bG){bD=bA.position();bx=bD.top;bz=bD.left}else{bx=parseFloat(e)||0;bz=parseFloat(bF)||0}if(b.isFunction(bH)){bH=bH.call(by,bB,bw)}if(bH.top!=null){bE.top=(bH.top-bw.top)+bx}if(bH.left!=null){bE.left=(bH.left-bw.left)+bz}if("using" in bH){bH.using.call(by,bE)}else{bA.css(bE)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bx=this[0],bw=this.offsetParent(),by=this.offset(),e=ae.test(bw[0].nodeName)?{top:0,left:0}:bw.offset();by.top-=parseFloat(b.css(bx,"marginTop"))||0;by.left-=parseFloat(b.css(bx,"marginLeft"))||0;e.top+=parseFloat(b.css(bw[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bw[0],"borderLeftWidth"))||0;return{top:by.top-e.top,left:by.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||aw.body;while(e&&(!ae.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(bx,bw){var e=/Y/.test(bw);b.fn[bx]=function(by){return b.access(this,function(bz,bC,bB){var bA=aM(bz);if(bB===M){return bA?(bw in bA)?bA[bw]:b.support.boxModel&&bA.document.documentElement[bC]||bA.document.body[bC]:bz[bC]}if(bA){bA.scrollTo(!e?bB:b(bA).scrollLeft(),e?bB:b(bA).scrollTop())}else{bz[bC]=bB}},bx,by,arguments.length,null)}});function aM(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each({Height:"height",Width:"width"},function(bx,by){var bw="client"+bx,e="scroll"+bx,bz="offset"+bx;b.fn["inner"+bx]=function(){var bA=this[0];return bA?bA.style?parseFloat(b.css(bA,by,"padding")):this[by]():null};b.fn["outer"+bx]=function(bB){var bA=this[0];return bA?bA.style?parseFloat(b.css(bA,by,bB?"margin":"border")):this[by]():null};b.fn[by]=function(bA){return b.access(this,function(bD,bC,bE){var bG,bF,bH,bB;if(b.isWindow(bD)){bG=bD.document;bF=bG.documentElement[bw];return b.support.boxModel&&bF||bG.body&&bG.body[bw]||bF}if(bD.nodeType===9){bG=bD.documentElement;if(bG[bw]>=bG[e]){return bG[bw]}return Math.max(bD.body[e],bG[e],bD.body[bz],bG[bz])}if(bE===M){bH=b.css(bD,bC);bB=parseFloat(bH);return b.isNumeric(bB)?bB:bH}b(bD).css(bC,bE)},by,bA,arguments.length,null)}});be.jQuery=be.$=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,d){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(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=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{e=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"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(n,m,l,o){a.each(f,function(){m-=parseFloat(a.css(n,"padding"+this))||0;if(l){m-=parseFloat(a.css(n,"border"+this+"Width"))||0}if(o){m-=parseFloat(a.css(n,"margin"+this))||0}});return m}a.fn["inner"+e]=function(l){if(l===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,l)+"px")})};a.fn["outer"+e]=function(l,m){if(typeof l!=="number"){return k["outer"+e].call(this,l)}return this.each(function(){a(this).css(h,j(this,l,true,m)+"px")})}});function c(g,e){var j,h,f,k=g.nodeName.toLowerCase();if("area"===k){j=g.parentNode;h=j.name;if(!g.href||!h||j.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(k)?!g.disabled:"a"===k?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.css(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var e,h=a.ui[f].prototype;for(e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var h,j=e.plugins[g];if(!j||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11){return}for(h=0;h<j.length;h++){if(e.options[j[h][0]]){j[h][1].apply(e.element,f)}}}},contains:a.contains,hasScroll:function(h,f){if(a(h).css("overflow")==="hidden"){return false}var e=(f&&f==="left")?"scrollLeft":"scrollTop",g=false;if(h[e]>0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(k,f,j,h,e,g){return a.ui.isOverAxis(k,j,e)&&a.ui.isOverAxis(f,h,g)}})})(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,d){var c=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(f,j,e){var m,l,h,k,g=f.split(".")[0];f=f.split(".")[1];m=g+"-"+f;if(!e){e=j;j=a.Widget}a.expr[":"][m]=function(n){return !!a.data(n,m)};a[g]=a[g]||{};l=a[g][f];h=a[g][f]=function(n,o){if(!this._createWidget){return new h(n,o)}if(arguments.length){this._createWidget(n,o)}};a.extend(h,l,{version:e.version,_proto:a.extend({},e),_childConstructors:[]});k=new j();k.options=a.widget.extend({},k.options);a.each(e,function(o,n){if(a.isFunction(n)){e[o]=(function(){var p=function(){return j.prototype[o].apply(this,arguments)},q=function(r){return j.prototype[o].apply(this,r)};return function(){var t=this._super,r=this._superApply,s;this._super=p;this._superApply=q;s=n.apply(this,arguments);this._super=t;this._superApply=r;return s}})()}});h.prototype=a.widget.extend(k,{widgetEventPrefix:f},e,{constructor:h,namespace:g,widgetName:f,widgetBaseClass:m,widgetFullName:m});if(l){a.each(l._childConstructors,function(o,p){var n=p.prototype;a.widget(n.namespace+"."+n.widgetName,h,p._proto)});delete l._childConstructors}else{j._childConstructors.push(h)}a.widget.bridge(f,h)};a.widget.extend=function(k){var f=c.call(arguments,1),j=0,e=f.length,g,h;for(;j<e;j++){for(g in f[j]){h=f[j][g];if(f[j].hasOwnProperty(g)&&h!==d){k[g]=a.isPlainObject(h)?a.widget.extend({},k[g],h):h}}}return k};a.widget.bridge=function(f,e){var g=e.prototype.widgetFullName;a.fn[f]=function(k){var h=typeof k==="string",j=c.call(arguments,1),l=this;k=!h&&j.length?a.widget.extend.apply(null,[k].concat(j)):k;if(h){this.each(function(){var n,m=a.data(this,g);if(!m){return a.error("cannot call methods on "+f+" prior to initialization; attempted to call method '"+k+"'")}if(!a.isFunction(m[k])||k.charAt(0)==="_"){return a.error("no such method '"+k+"' for "+f+" widget instance")}n=m[k].apply(m,j);if(n!==m&&n!==d){l=n&&n.jquery?l.pushStack(n.get()):n;return false}})}else{this.each(function(){var m=a.data(this,g);if(m){m.option(k||{})._init()}else{new e(k,this)}})}return l}};a.Widget=function(e,f){};a.Widget._childConstructors=[];a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(e,f){f=a(f||this.defaultElement||this)[0];this.element=a(f);this.options=a.widget.extend({},this.options,this._getCreateOptions(),e);this.bindings=a();this.hoverable=a();this.focusable=a();if(f!==this){a.data(f,this.widgetName,this);a.data(f,this.widgetFullName,this);this._bind({remove:"destroy"});this.document=a(f.style?f.ownerDocument:f.document||f);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(h,j){var e=h,k,g,f;if(arguments.length===0){return a.widget.extend({},this.options)}if(typeof h==="string"){e={};k=h.split(".");h=k.shift();if(k.length){g=e[h]=a.widget.extend({},this.options[h]);for(f=0;f<k.length-1;f++){g[k[f]]=g[k[f]]||{};g=g[k[f]]}h=k.pop();if(j===d){return g[h]===d?null:g[h]}g[h]=j}else{if(j===d){return this.options[h]===d?null:this.options[h]}e[h]=j}}this._setOptions(e);return this},_setOptions:function(e){var f;for(f in e){this._setOption(f,e[f])}return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!f).attr("aria-disabled",f);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(g,f){if(!f){f=g;g=this.element}else{g=a(g);this.bindings=this.bindings.add(g)}var e=this;a.each(f,function(n,m){function k(){if(e.options.disabled===true||a(this).hasClass("ui-state-disabled")){return}return(typeof m==="string"?e[m]:m).apply(e,arguments)}if(typeof m!=="string"){k.guid=m.guid=m.guid||k.guid||jQuery.guid++}var l=n.match(/^(\w+)\s*(.*)$/),j=l[1]+"."+e.widgetName,h=l[2];if(h){e.widget().delegate(h,j,k)}else{g.bind(j,k)}})},_delay:function(h,g){function f(){return(typeof h==="string"?e[h]:h).apply(e,arguments)}var e=this;return setTimeout(f,g||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._bind(e,{mouseenter:function(f){a(f.currentTarget).addClass("ui-state-hover")},mouseleave:function(f){a(f.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._bind(e,{focusin:function(f){a(f.currentTarget).addClass("ui-state-focus")},focusout:function(f){a(f.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,f,g){var k,j,h=this.options[e];g=g||{};f=a.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];j=f.originalEvent;if(j){for(k in j){if(!(k in f)){f[k]=j[k]}}}this.element.trigger(f,g);return !(a.isFunction(h)&&h.apply(this.element[0],[f].concat(g))===false||f.isDefaultPrevented())}};a.each({show:"fadeIn",hide:"fadeOut"},function(f,e){a.Widget.prototype["_"+f]=function(j,h,l){if(typeof h==="string"){h={effect:h}}var k,g=!h?f:h===true||typeof h==="number"?e:h.effect||e;h=h||{};if(typeof h==="number"){h={duration:h}}k=!a.isEmptyObject(h);h.complete=l;if(h.delay){j.delay(h.delay)}if(k&&a.effects&&(a.effects.effect[g]||a.uiBackCompat!==false&&a.effects[g])){j[f](h)}else{if(g!==f&&j[g]){j[g](h.duration,h.easing,l)}else{j.queue(function(m){a(this)[f]();if(l){l.call(j[0])}m()})}}}});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(f,c){f.ui=f.ui||{};var e=/left|center|right/,h=/top|center|bottom/,b=/[\+\-]\d+%?/,j=/^\w+/,d=/%$/,a="center",g=f.fn.position;f.position={scrollbarWidth:function(){var l,k,n=f("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),m=n.children()[0];f("body").append(n);l=m.offsetWidth;n.css("overflow","scroll");k=m.offsetWidth;if(l===k){k=n[0].clientWidth}n.remove();return l-k},getScrollInfo:function(m){var o=m[0]!==window,l=o?m.css("overflow-x"):"",k=o?m.css("overflow-y"):"",n=l==="auto"||l==="scroll"?f.position.scrollbarWidth():0,p=k==="auto"||k==="scroll"?f.position.scrollbarWidth():0;return{height:m.height()<m[0].scrollHeight?p:0,width:m.width()<m[0].scrollWidth?n:0}}};f.fn.position=function(s){if(!s||!s.of){return g.apply(this,arguments)}s=f.extend({},s);var o=f(s.of),l=f(s.within||window),p=o[0],r=(s.collision||"flip").split(" "),k={},t,q,n,m;if(p.nodeType===9){q=o.width();n=o.height();m={top:0,left:0}}else{if(f.isWindow(p)){q=o.width();n=o.height();m={top:o.scrollTop(),left:o.scrollLeft()}}else{if(p.preventDefault){s.at="left top";q=n=0;m={top:s.of.pageY,left:s.of.pageX}}else{q=o.outerWidth();n=o.outerHeight();m=o.offset()}}}f.each(["my","at"],function(){var w=(s[this]||"").split(" "),v,u;if(w.length===1){w=e.test(w[0])?w.concat([a]):h.test(w[0])?[a].concat(w):[a,a]}w[0]=e.test(w[0])?w[0]:a;w[1]=h.test(w[1])?w[1]:a;v=b.exec(w[0]);u=b.exec(w[1]);k[this]=[v?v[0]:0,u?u[0]:0];s[this]=[j.exec(w[0])[0],j.exec(w[1])[0]]});if(r.length===1){r[1]=r[0]}if(s.at[0]==="right"){m.left+=q}else{if(s.at[0]===a){m.left+=q/2}}if(s.at[1]==="bottom"){m.top+=n}else{if(s.at[1]===a){m.top+=n/2}}t=[parseInt(k.at[0],10)*(d.test(k.at[0])?q/100:1),parseInt(k.at[1],10)*(d.test(k.at[1])?n/100:1)];m.left+=t[0];m.top+=t[1];return this.each(function(){var y=f(this),A=y.outerWidth(),w=y.outerHeight(),z=parseInt(f.css(this,"marginLeft"),10)||0,v=parseInt(f.css(this,"marginTop"),10)||0,x=f.position.getScrollInfo(l),D=A+z+(parseInt(f.css(this,"marginRight"),10)||0)+x.width,E=w+v+(parseInt(f.css(this,"marginBottom"),10)||0)+x.height,B=f.extend({},m),C=[parseInt(k.my[0],10)*(d.test(k.my[0])?y.outerWidth()/100:1),parseInt(k.my[1],10)*(d.test(k.my[1])?y.outerHeight()/100:1)],u;if(s.my[0]==="right"){B.left-=A}else{if(s.my[0]===a){B.left-=A/2}}if(s.my[1]==="bottom"){B.top-=w}else{if(s.my[1]===a){B.top-=w/2}}B.left+=C[0];B.top+=C[1];if(!f.support.offsetFractions){B.left=Math.round(B.left);B.top=Math.round(B.top)}u={marginLeft:z,marginTop:v};f.each(["left","top"],function(G,F){if(f.ui.position[r[G]]){f.ui.position[r[G]][F](B,{targetWidth:q,targetHeight:n,elemWidth:A,elemHeight:w,collisionPosition:u,collisionWidth:D,collisionHeight:E,offset:[t[0]+C[0],t[1]+C[1]],my:s.my,at:s.at,within:l,elem:y})}});if(f.fn.bgiframe){y.bgiframe()}y.offset(f.extend(B,{using:s.using}))})};f.ui.position={fit:{left:function(p,o){var n=o.within,r=f(window),m=f.isWindow(o.within[0]),t=m?r.scrollLeft():n.offset().left,v=m?r.width():n.outerWidth(),q=p.left-o.collisionPosition.marginLeft,u=t-q,l=q+o.collisionWidth-v-t,k,s;if(o.collisionWidth>v){if(u>0&&l<=0){k=p.left+u+o.collisionWidth-v-t;p.left+=u-k}else{if(l>0&&u<=0){p.left=t}else{if(u>l){p.left=t+v-o.collisionWidth}else{p.left=t}}}}else{if(u>0){p.left+=u}else{if(l>0){p.left-=l}else{p.left=Math.max(p.left-q,p.left)}}}},top:function(o,n){var m=n.within,r=f(window),l=f.isWindow(n.within[0]),u=l?r.scrollTop():m.offset().top,v=l?r.height():m.outerHeight(),q=o.top-n.collisionPosition.marginTop,s=u-q,p=q+n.collisionHeight-v-u,t,k;if(n.collisionHeight>v){if(s>0&&p<=0){k=o.top+s+n.collisionHeight-v-u;o.top+=s-k}else{if(p>0&&s<=0){o.top=u}else{if(s>p){o.top=u+v-n.collisionHeight}else{o.top=u}}}}else{if(s>0){o.top+=s}else{if(p>0){o.top-=p}else{o.top=Math.max(o.top-q,o.top)}}}}},flip:{left:function(s,r){if(r.at[0]===a){return}r.elem.removeClass("ui-flipped-left ui-flipped-right");var q=r.within,u=f(window),m=f.isWindow(r.within[0]),x=(m?0:q.offset().left)+q.scrollLeft(),A=m?q.width():q.outerWidth(),o=m?0:q.offset().left,t=s.left-r.collisionPosition.marginLeft,y=t-o,l=t+r.collisionWidth-A-o,n=r.my[0]==="left",w=r.my[0]==="left"?-r.elemWidth:r.my[0]==="right"?r.elemWidth:0,z=r.at[0]==="left"?r.targetWidth:-r.targetWidth,p=-2*r.offset[0],k,v;if(y<0){k=s.left+w+z+p+r.collisionWidth-A-x;if(k<0||k<Math.abs(y)){r.elem.addClass("ui-flipped-right");s.left+=w+z+p}}else{if(l>0){v=s.left-r.collisionPosition.marginLeft+w+z+p-o;if(v>0||Math.abs(v)<l){r.elem.addClass("ui-flipped-left");s.left+=w+z+p}}}},top:function(q,p){if(p.at[1]===a){return}p.elem.removeClass("ui-flipped-top ui-flipped-bottom");var o=p.within,t=f(window),m=f.isWindow(p.within[0]),y=(m?0:o.offset().top)+o.scrollTop(),z=m?o.height():o.outerHeight(),k=m?0:o.offset().top,s=q.top-p.collisionPosition.marginTop,v=s-k,r=s+p.collisionHeight-z-k,w=p.my[1]==="top",u=w?-p.elemHeight:p.my[1]==="bottom"?p.elemHeight:0,A=p.at[1]==="top"?p.targetHeight:-p.targetHeight,n=-2*p.offset[1],x,l;if(v<0){l=q.top+u+A+n+p.collisionHeight-z-y;if((q.top+u+A+n)>v&&(l<0||l<Math.abs(v))){p.elem.addClass("ui-flipped-bottom");q.top+=u+A+n}}else{if(r>0){x=q.top-p.collisionPosition.marginTop+u+A+n-k;if((q.top+u+A+n)>r&&(x>0||Math.abs(x)<r)){p.elem.addClass("ui-flipped-top");q.top+=u+A+n}}}}},flipfit:{left:function(){f.ui.position.flip.left.apply(this,arguments);f.ui.position.fit.left.apply(this,arguments)},top:function(){f.ui.position.flip.top.apply(this,arguments);f.ui.position.fit.top.apply(this,arguments)}}};(function(){var o,q,l,n,m,k=document.getElementsByTagName("body")[0],p=document.createElement("div");o=document.createElement(k?"div":"body");l={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(k){f.extend(l,{position:"absolute",left:"-1000px",top:"-1000px"})}for(m in l){o.style[m]=l[m]}o.appendChild(p);q=k||document.documentElement;q.insertBefore(o,q.firstChild);p.style.cssText="position: absolute; left: 10.7432222px;";n=f(p).offset().left;f.support.offsetFractions=n>10&&n<11;o.innerHTML="";q.removeChild(o)})();if(f.uiBackCompat!==false){(function(l){var k=l.fn.position;l.fn.position=function(n){if(!n||!n.offset){return k.call(this,n)}var o=n.offset.split(" "),m=n.at.split(" ");if(o.length===1){o[1]=o[0]}if(/^\d/.test(o[0])){o[0]="+"+o[0]}if(/^\d/.test(o[1])){o[1]="+"+o[1]}if(m.length===1){if(/left|center|right/.test(m[0])){m[1]="center"}else{m[1]=m[0];m[0]="center"}}return k.call(this,l.extend(n,{at:m[0]+o[0]+" "+m[1]+o[1],offset:c}))}}(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(c){if(this.options.disabled){c.preventDefault()}},this));if(this.options.disabled){this.element.addClass("ui-state-disabled")}this._bind({"mousedown .ui-menu-item > a":function(c){c.preventDefault()},"click .ui-state-disabled > a":function(c){c.preventDefault()},"click .ui-menu-item:has(a)":function(c){c.stopImmediatePropagation();if(!b(c.target).closest(".ui-menu-item").is(".ui-state-disabled")){this.select(c);this._delay(function(){if(!this.element.is(":focus")){this.element.focus()}},20)}},"mouseover .ui-menu-item":function(c){c.stopImmediatePropagation();var d=b(c.currentTarget);d.siblings().children(".ui-state-active").removeClass("ui-state-active");this.focus(c,d)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(c){var e=this.element,d=e.children(".ui-menu-item").not(".ui-state-disabled").eq(0);if(this._hasScroll()&&!this.active){e.children().each(function(){var f=b(this);if(f.offset().top-e.offset().top>=0){d=f;return false}})}else{if(this.active){d=this.active}}this.focus(c,d)},blur:function(c){this._delay(function(){if(!b.contains(this.element[0],this.document[0].activeElement)){this.collapseAll(c)}})},keydown:"_keydown"});this.refresh();this._bind(this.document,{click:function(c){if(!b(c.target).closest(".ui-menu").length){this.collapseAll(c)}}})},_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(g){switch(g.keyCode){case b.ui.keyCode.PAGE_UP:this.previousPage(g);g.preventDefault();g.stopImmediatePropagation();break;case b.ui.keyCode.PAGE_DOWN:this.nextPage(g);g.preventDefault();g.stopImmediatePropagation();break;case b.ui.keyCode.HOME:this._move("first","first",g);g.preventDefault();g.stopImmediatePropagation();break;case b.ui.keyCode.END:this._move("last","last",g);g.preventDefault();g.stopImmediatePropagation();break;case b.ui.keyCode.UP:this.previous(g);g.preventDefault();g.stopImmediatePropagation();break;case b.ui.keyCode.DOWN:this.next(g);g.preventDefault();g.stopImmediatePropagation();break;case b.ui.keyCode.LEFT:if(this.collapse(g)){g.stopImmediatePropagation()}g.preventDefault();break;case b.ui.keyCode.RIGHT:if(this.expand(g)){g.stopImmediatePropagation()}g.preventDefault();break;case b.ui.keyCode.ENTER:if(this.active.children("a[aria-haspopup='true']").length){if(this.expand(g)){g.stopImmediatePropagation()}}else{this.select(g);g.stopImmediatePropagation()}g.preventDefault();break;case b.ui.keyCode.ESCAPE:if(this.collapse(g)){g.stopImmediatePropagation()}g.preventDefault();break;default:g.stopPropagation();clearTimeout(this.filterTimer);var c,f=this.previousFilter||"",h=String.fromCharCode(g.keyCode),e=false;if(h===f){e=true}else{h=f+h}function d(j){return j.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}c=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+d(h),"i").test(b(this).children("a").text())});c=e&&c.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):c;if(!c.length){h=String.fromCharCode(g.keyCode);c=this.activeMenu.children(".ui-menu-item").filter(function(){return new RegExp("^"+d(h),"i").test(b(this).children("a").text())})}if(c.length){this.focus(g,c);if(c.length>1){this.previousFilter=h;this.filterTimer=this._delay(function(){delete this.previousFilter},1000)}else{delete this.previousFilter}}else{delete this.previousFilter}}},refresh:function(){var d,e=this.menuId,c=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"});d=c.add(this.element);d.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(f){return e+"-"+f});d.children(":not(.ui-menu-item)").each(function(){var f=b(this);if(!/[^\-—–\s]/.test(f.text())){f.addClass("ui-widget-content ui-menu-divider")}});c.each(function(){var g=b(this),f=g.prev("a");f.attr("aria-haspopup","true").prepend('<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>');g.attr("aria-labelledby",f.attr("id"))})},focus:function(c,k){var h,e,l,f,j,g,d;this.blur(c);if(this._hasScroll()){e=parseFloat(b.css(this.activeMenu[0],"borderTopWidth"))||0;l=parseFloat(b.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)}}}this.active=k.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);h=b("> .ui-menu",k);if(h.length&&(/^mouse/.test(c.type))){this._startOpening(h)}this.activeMenu=k.parent();this._trigger("focus",c,{item:k})},blur:function(c){clearTimeout(this.timer);if(!this.active){return}this.active.children("a").removeClass("ui-state-focus");this.active=null;this._trigger("blur",c,{item:this.active})},_startOpening:function(c){clearTimeout(this.timer);if(c.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();this._open(c)},this.delay)},_open:function(d){clearTimeout(this.timer);this.element.find(".ui-menu").not(d.parents()).hide().attr("aria-hidden","true");var c=b.extend({},{of:this.active},b.type(this.options.position)==="function"?this.options.position(this.active):this.options.position);d.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(c)},collapseAll:function(d,c){clearTimeout(this.timer);this.timer=this._delay(function(){var e=c?this.element:b(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.delay)},_close:function(c){if(!c){c=this.active?this.active.parent():this.element}c.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(d){var c=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(c&&c.length){this._close();this.focus(d,c);return true}},expand:function(d){var c=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").not(".ui-state-disabled").first();if(c&&c.length){this._open(c.parent());this._delay(function(){this.focus(d,c)},20);return true}},next:function(c){this._move("next","first",c)},previous:function(c){this._move("prev","last",c)},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(f,d,e){var c;if(this.active){if(f==="first"||f==="last"){c=this.active[f==="first"?"prevAll":"nextAll"](".ui-menu-item").not(".ui-state-disabled").eq(-1)}else{c=this.active[f+"All"](".ui-menu-item").not(".ui-state-disabled").eq(0)}}if(!c||!c.length||!this.active){c=this.activeMenu.children(".ui-menu-item")[d]()}this.focus(e,c);if(c.is(".ui-state-disabled")){this._move(f,d,e)}},nextPage:function(e){if(!this.active){this._move("next","first",e);return}if(this.isLastItem()){return}if(this._hasScroll()){var f=this.active.offset().top,d=this.element.height(),c;this.active.nextAll(".ui-menu-item").not(".ui-state-disabled").each(function(){c=b(this);return b(this).offset().top-f-d<0});this.focus(e,c)}else{this.focus(e,this.activeMenu.children(".ui-menu-item").not(".ui-state-disabled")[!this.active?"first":"last"]())}},previousPage:function(e){if(!this.active){this._move("next","first",e);return}if(this.isFirstItem()){return}if(this._hasScroll()){var f=this.active.offset().top,d=this.element.height(),c;this.active.prevAll(".ui-menu-item").not(".ui-state-disabled").each(function(){c=b(this);return b(this).offset().top-f+d>0});this.focus(e,c)}else{this.focus(e,this.activeMenu.children(".ui-menu-item").not(".ui-state-disabled").first())}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(c){var d={item:this.active};this.collapseAll(c,true);this._trigger("select",c,d)}})}(jQuery));