Ext.namespace("Ext.ux");Ext.ux.Image=Ext.extend(Ext.BoxComponent,{src:Ext.BLANK_IMAGE_URL,autoEl:{tag:"img",cls:"tng-managed-image",src:Ext.BLANK_IMAGE_URL},initComponent:function(){Ext.ux.Image.superclass.initComponent.apply(this,arguments)},onRender:function(){Ext.ux.Image.superclass.onRender.apply(this,arguments);if(!Ext.isEmpty(this.src)&&(this.src!==Ext.BLANK_IMAGE_URL)){this.setSrc(this.src)}this.relayEvents(this.el,["click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","keypress","keydown","keyup"])},setSrc:function(a){this.el.dom.src=a}});Ext.reg("image",Ext.ux.Image);(function(){var X=this,ac,F=X.jQuery,S=X.$,U=X.jQuery=X.$=function(b,a){return new U.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ad=/^.[^:#\[\.,]*$/;U.fn=U.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=U.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return U().find(e)}var d=U(a||[]);d.context=document;d.selector=e;return d}}else{return U(b).find(e)}}else{if(U.isFunction(e)){return U(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(U.isArray(e)?e:U.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ac?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=U(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return U.each(this,a,b)},index:function(a){return U.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ac){return this[0]&&U[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){U.attr(b?this.style:this,c,U.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ac}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";U.each(a||this,function(){U.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:U.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=U(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){U(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){U(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||U([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;U.find(b,this[0],a);return a}else{return this.pushStack(U.unique(U.map(this,function(c){return U.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!U.support.noCloneEvent&&!U.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return U.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=U.data(a[c],"events");for(var e in g){for(var f in g[e]){U.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(U.isFunction(a)&&U.grep(this,function(b,c){return a.call(b,c)})||U.multiFilter(a,U.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=U.expr.match.POS.test(c)?U(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:U(d).is(c)){U.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ad.test(b)){return this.pushStack(U.multiFilter(b,this,true),"not",b)}else{b=U.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ac&&!b.nodeType;return this.filter(function(){return a?U.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(U.unique(U.merge(this.get(),typeof a==="string"?U(a):U.makeArray(a))))},is:function(a){return !!a&&U.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ac){var j=this[0];if(j){if(U.nodeName(j,"option")){return(j.attributes.value||{}).specified?j.value:j.text}if(U.nodeName(j,"select")){var e=j.selectedIndex,b=[],a=j.options,f=j.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=U(g).val();if(f){return c}b.push(c)}}return b}return(j.value||"").replace(/\r/g,"")}return ac}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(U.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(U.inArray(this.value,c)>=0||U.inArray(this.name,c)>=0)}else{if(U.nodeName(this,"select")){var k=U.makeArray(c);U("option",this).each(function(){this.selected=(U.inArray(this.value,k)>=0||U.inArray(this.text,k)>=0)});if(!k.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ac?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(U.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=U.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,j=this.length;g<j;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){U.each(h,E)}}return this;function c(l,k){return a&&U.nodeName(l,"table")&&U.nodeName(k,"tr")?(l.getElementsByTagName("tbody")[0]||l.appendChild(l.ownerDocument.createElement("tbody"))):l}}};U.fn.init.prototype=U.fn;function E(b,a){if(a.src){U.ajax({url:a.src,async:false,dataType:"script"})}else{U.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ae(){return +new Date}U.extend=U.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!U.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=U.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ac){c[g]=a}}}}}return c};var ah=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;U.extend({noConflict:function(a){X.$=S;if(a){X.jQuery=F}return U},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&U.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(U.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ac){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ac){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(U.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ah.test(e)?a+"px":a},className:{add:function(b,a){U.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!U.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ac?U.grep(b.className.split(/\s+/),function(c){return !U.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&U.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}U.each(b,function(){if(!h){a-=parseFloat(U.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(U.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(U.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{U.swap(e,f,d)}return Math.max(0,Math.round(a))}return U.curCSS(e,g,c)},curCSS:function(e,h,g){var b,j=e.style;if(h=="opacity"&&!U.support.opacity){b=U.attr(j,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&j&&j[h]){b=j[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(l,k){return k.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=j.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;j.left=b||0;b=j.pixelLeft+"px";j.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");U.each(g,function(m,j){if(typeof j==="number"){j+=""}if(!j){return}if(typeof j==="string"){j=j.replace(/(<(\w+)[^>]*?)\/>/g,function(u,r,v){return v.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?u:r+"></"+v+">"});var n=j.replace(/^\s+/,"").substring(0,10).toLowerCase();var l=!n.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!n.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||n.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!n.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!n.indexOf("<td")||!n.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!n.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!U.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=l[1]+j+l[2];while(l[0]--){a=a.lastChild}if(!U.support.tbody){var k=/<tbody/i.test(j),o=!n.indexOf("<table")&&!k?a.firstChild&&a.firstChild.childNodes:l[1]=="<table>"&&!k?a.childNodes:[];for(var q=o.length-1;q>=0;--q){if(U.nodeName(o[q],"tbody")&&!o[q].childNodes.length){o[q].parentNode.removeChild(o[q])}}}if(!U.support.leadingWhitespace&&/^\s/.test(j)){a.insertBefore(b.createTextNode(j.match(/^\s*/)[0]),a.firstChild)}j=U.makeArray(a.childNodes)}if(j.nodeType){f.push(j)}else{f=U.merge(f,j)}});if(d){for(var c=0;f[c];c++){if(U.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(U.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ac}var e=!U.isXMLDoc(c),a=b!==ac;f=e&&U.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&U.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(U.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ac}return c[f]}if(!U.support.style&&e&&f=="style"){return U.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!U.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ac:h}if(!U.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(k,j){return j.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||U.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!U.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=U.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();U.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};U.each({parent:function(a){return a.parentNode},parents:function(a){return U.dir(a,"parentNode")},next:function(a){return U.nth(a,2,"nextSibling")},prev:function(a){return U.nth(a,2,"previousSibling")},nextAll:function(a){return U.dir(a,"nextSibling")},prevAll:function(a){return U.dir(a,"previousSibling")},siblings:function(a){return U.sibling(a.parentNode.firstChild,a)},children:function(a){return U.sibling(a.firstChild)},contents:function(a){return U.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:U.makeArray(a.childNodes)}},function(b,a){U.fn[b]=function(d){var c=U.map(this,a);if(d&&typeof d=="string"){c=U.multiFilter(d,c)}return this.pushStack(U.unique(c),b,d)}});U.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){U.fn[b]=function(h){var e=[],c=U(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();U.fn[a].apply(U(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});U.each({removeAttr:function(a){U.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){U.className.add(this,a)},removeClass:function(a){U.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!U.className.has(this,a)}U.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||U.filter(a,[this]).length){U("*",this).add([this]).each(function(){U.event.remove(this);U.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){U(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){U.fn[b]=function(){return this.each(a,arguments)}});function Z(b,a){return b[0]&&parseInt(U.curCSS(b[0],a,true),10)||0}var ab="jQuery"+ae(),I=0,R={};U.extend({cache:{},data:function(c,d,b){c=c==X?R:c;var a=c[ab];if(!a){a=c[ab]=++I}if(d&&!U.cache[a]){U.cache[a]={}}if(b!==ac){U.cache[a][d]=b}return d?U.cache[a][d]:a},removeData:function(c,d){c=c==X?R:c;var a=c[ab];if(d){if(U.cache[a]){delete U.cache[a][d];d="";for(d in U.cache[a]){break}if(!d){U.removeData(c)}}}else{try{delete c[ab]}catch(b){if(c.removeAttribute){c.removeAttribute(ab)}}delete U.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=U.data(c,d);if(!b||U.isArray(a)){b=U.data(c,d,U.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=U.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ac){c.call(a)}}});U.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ac){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ac&&this.length){c=U.data(this[0],d)}return c===ac&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){U.data(this,d,b)})}},removeData:function(a){return this.each(function(){U.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ac){return U.queue(this[0],b)}return this.each(function(){var c=U.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){U.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,m=Object.prototype.toString;var o=function(v,z,an,am){an=an||[];z=z||document;if(z.nodeType!==1&&z.nodeType!==9){return[]}if(!v||typeof v!=="string"){return an}var u=[],x,aj,B,A,al,y,w=true;b.lastIndex=0;while((x=b.exec(v))!==null){u.push(x[1]);if(x[2]){y=RegExp.rightContext;break}}if(u.length>1&&g.exec(v)){if(u.length===2&&l.relative[u[0]]){aj=k(u[0]+u[1],z)}else{aj=l.relative[u[0]]?[z]:o(u.shift(),z);while(u.length){v=u.shift();if(l.relative[v]){v+=u.shift()}aj=k(v,aj)}}}else{var ak=am?{expr:u.pop(),set:q(am)}:o.find(u.pop(),u.length===1&&z.parentNode?z.parentNode:z,c(z));aj=o.filter(ak.expr,ak.set);if(u.length>0){B=q(aj)}else{w=false}while(u.length){var C=u.pop(),D=C;if(!l.relative[C]){C=""}else{D=u.pop()}if(D==null){D=z}l.relative[C](B,D,c(z))}}if(!B){B=aj}if(!B){throw"Syntax error, unrecognized expression: "+(C||v)}if(m.call(B)==="[object Array]"){if(!w){an.push.apply(an,B)}else{if(z.nodeType===1){for(var r=0;B[r]!=null;r++){if(B[r]&&(B[r]===true||B[r].nodeType===1&&j(z,B[r]))){an.push(aj[r])}}}else{for(var r=0;B[r]!=null;r++){if(B[r]&&B[r].nodeType===1){an.push(aj[r])}}}}}else{q(B,an)}if(y){o(y,z,an,am);if(n){hasDuplicate=false;an.sort(n);if(hasDuplicate){for(var r=1;r<an.length;r++){if(an[r]===an[r-1]){an.splice(r--,1)}}}}}return an};o.matches=function(u,r){return o(u,null,null,r)};o.find=function(r,A,B){var u,w;if(!r){return[]}for(var x=0,y=l.order.length;x<y;x++){var v=l.order[x],w;if((w=l.match[v].exec(r))){var z=RegExp.leftContext;if(z.substr(z.length-1)!=="\\"){w[1]=(w[1]||"").replace(/\\/g,"");u=l.find[v](w,A,B);if(u!=null){r=r.replace(l.match[v],"");break}}}}if(!u){u=A.getElementsByTagName("*")}return{set:u,expr:r}};o.filter=function(al,am,D,x){var y=al,B=[],r=am,v,A,u=am&&am[0]&&c(am[0]);while(al&&am.length){for(var an in l.filter){if((v=l.match[an].exec(al))!=null){var z=l.filter[an],C,aj;A=false;if(r==B){B=[]}if(l.preFilter[an]){v=l.preFilter[an](v,r,D,B,x,u);if(!v){A=C=true}else{if(v===true){continue}}}if(v){for(var w=0;(aj=r[w])!=null;w++){if(aj){C=z(aj,v,w,r);var ak=x^!!C;if(D&&C!=null){if(ak){A=true}else{r[w]=false}}else{if(ak){B.push(aj);A=true}}}}}if(C!==ac){if(!D){r=B}al=al.replace(l.match[an],"");if(!A){return[]}break}}}if(al==y){if(A==null){throw"Syntax error, unrecognized expression: "+al}else{break}}y=al}return r};var l=o.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(r){return r.getAttribute("href")}},relative:{"+":function(r,A,u){var w=typeof A==="string",B=w&&!/\W/.test(A),v=w&&!B;if(B&&!u){A=A.toUpperCase()}for(var x=0,y=r.length,z;x<y;x++){if((z=r[x])){while((z=z.previousSibling)&&z.nodeType!==1){}r[x]=v||z&&z.nodeName===A?z||false:z===A}}if(v){o.filter(A,r,true)}},">":function(y,v,x){var A=typeof v==="string";if(A&&!/\W/.test(v)){v=x?v:v.toUpperCase();for(var u=0,w=y.length;u<w;u++){var z=y[u];if(z){var r=z.parentNode;y[u]=r.nodeName===v?r:false}}}else{for(var u=0,w=y.length;u<w;u++){var z=y[u];if(z){y[u]=A?z.parentNode:z.parentNode===v}}if(A){o.filter(v,y,true)}}},"":function(r,v,x){var u=h++,w=a;if(!v.match(/\W/)){var y=v=x?v:v.toUpperCase();w=d}w("parentNode",v,u,r,y,x)},"~":function(r,v,x){var u=h++,w=a;if(typeof v==="string"&&!v.match(/\W/)){var y=v=x?v:v.toUpperCase();w=d}w("previousSibling",v,u,r,y,x)}},find:{ID:function(v,u,r){if(typeof u.getElementById!=="undefined"&&!r){var w=u.getElementById(v[1]);return w?[w]:[]}},NAME:function(u,y,x){if(typeof y.getElementsByName!=="undefined"){var v=[],z=y.getElementsByName(u[1]);for(var r=0,w=z.length;r<w;r++){if(z[r].getAttribute("name")===u[1]){v.push(z[r])}}return v.length===0?null:v}},TAG:function(u,r){return r.getElementsByTagName(u[1])}},preFilter:{CLASS:function(r,v,u,w,y,x){r=" "+r[1].replace(/\\/g,"")+" ";if(x){return r}for(var A=0,z;(z=v[A])!=null;A++){if(z){if(y^(z.className&&(" "+z.className+" ").indexOf(r)>=0)){if(!u){w.push(z)}}else{if(u){v[A]=false}}}}return false},ID:function(r){return r[1].replace(/\\/g,"")},TAG:function(u,v){for(var r=0;v[r]===false;r++){}return v[r]&&c(v[r])?u[1]:u[1].toUpperCase()},CHILD:function(u){if(u[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(u[2]=="even"&&"2n"||u[2]=="odd"&&"2n+1"||!/\D/.test(u[2])&&"0n+"+u[2]||u[2]);u[2]=(r[1]+(r[2]||1))-0;u[3]=r[3]-0}u[0]=h++;return u},ATTR:function(z,v,u,w,y,x){var r=z[1].replace(/\\/g,"");if(!x&&l.attrMap[r]){z[1]=l.attrMap[r]}if(z[2]==="~="){z[4]=" "+z[4]+" "}return z},PSEUDO:function(y,v,u,w,x){if(y[1]==="not"){if(y[3].match(b).length>1||/^\w/.test(y[3])){y[3]=o(y[3],null,null,v)}else{var r=o.filter(y[3],v,u,true^x);if(!u){w.push.apply(w,r)}return false}}else{if(l.match.POS.test(y[0])||l.match.CHILD.test(y[0])){return true}}return y},POS:function(r){r.unshift(true);return r}},filters:{enabled:function(r){return r.disabled===false&&r.type!=="hidden"},disabled:function(r){return r.disabled===true},checked:function(r){return r.checked===true},selected:function(r){r.parentNode.selectedIndex;return r.selected===true},parent:function(r){return !!r.firstChild},empty:function(r){return !r.firstChild},has:function(r,u,v){return !!o(v[3],r).length},header:function(r){return/h\d/i.test(r.nodeName)},text:function(r){return"text"===r.type},radio:function(r){return"radio"===r.type},checkbox:function(r){return"checkbox"===r.type},file:function(r){return"file"===r.type},password:function(r){return"password"===r.type},submit:function(r){return"submit"===r.type},image:function(r){return"image"===r.type},reset:function(r){return"reset"===r.type},button:function(r){return"button"===r.type||r.nodeName.toUpperCase()==="BUTTON"},input:function(r){return/input|select|textarea|button/i.test(r.nodeName)}},setFilters:{first:function(r,u){return u===0},last:function(u,v,w,r){return v===r.length-1},even:function(r,u){return u%2===0},odd:function(r,u){return u%2===1},lt:function(r,u,v){return u<v[3]-0},gt:function(r,u,v){return u>v[3]-0},nth:function(r,u,v){return v[3]-0==u},eq:function(r,u,v){return v[3]-0==u}},filter:{PSEUDO:function(y,u,r,x){var v=u[1],A=l.filters[v];if(A){return A(y,r,u,x)}else{if(v==="contains"){return(y.textContent||y.innerText||"").indexOf(u[3])>=0}else{if(v==="not"){var z=u[3];for(var r=0,w=z.length;r<w;r++){if(z[r]===y){return false}}return true}}}},CHILD:function(A,x){var u=x[1],z=A;switch(u){case"only":case"first":while(z=z.previousSibling){if(z.nodeType===1){return false}}if(u=="first"){return true}z=A;case"last":while(z=z.nextSibling){if(z.nodeType===1){return false}}return true;case"nth":var y=x[2],B=x[3];if(y==1&&B==0){return true}var v=x[0],C=A.parentNode;if(C&&(C.sizcache!==v||!A.nodeIndex)){var w=0;for(z=C.firstChild;z;z=z.nextSibling){if(z.nodeType===1){z.nodeIndex=++w}}C.sizcache=v}var r=A.nodeIndex-B;if(y==0){return r==0}else{return(r%y==0&&r/y>=0)}}},ID:function(r,u){return r.nodeType===1&&r.getAttribute("id")===u},TAG:function(r,u){return(u==="*"&&r.nodeType===1)||r.nodeName===u},CLASS:function(r,u){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(u)>-1},ATTR:function(y,r){var u=r[1],w=l.attrHandle[u]?l.attrHandle[u](y):y[u]!=null?y[u]:y.getAttribute(u),x=w+"",z=r[2],v=r[4];return w==null?z==="!=":z==="="?x===v:z==="*="?x.indexOf(v)>=0:z==="~="?(" "+x+" ").indexOf(v)>=0:!v?x&&w!==false:z==="!="?x!=v:z==="^="?x.indexOf(v)===0:z==="$="?x.substr(x.length-v.length)===v:z==="|="?x===v||x.substr(0,v.length+1)===v+"-":false},POS:function(y,v,u,x){var w=v[2],r=l.setFilters[w];if(r){return r(y,u,v,x)}}}};var g=l.match.POS;for(var e in l.match){l.match[e]=RegExp(l.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var q=function(r,u){r=Array.prototype.slice.call(r);if(u){u.push.apply(u,r);return u}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){q=function(x,r){var v=r||[];if(m.call(x)==="[object Array]"){Array.prototype.push.apply(v,x)}else{if(typeof x.length==="number"){for(var u=0,w=x.length;u<w;u++){v.push(x[u])}}else{for(var u=0;x[u];u++){v.push(x[u])}}}return v}}var n;if(document.documentElement.compareDocumentPosition){n=function(u,v){var r=u.compareDocumentPosition(v)&4?-1:u===v?0:1;if(r===0){hasDuplicate=true}return r}}else{if("sourceIndex" in document.documentElement){n=function(u,v){var r=u.sourceIndex-v.sourceIndex;if(r===0){hasDuplicate=true}return r}}else{if(document.createRange){n=function(r,v){var u=r.ownerDocument.createRange(),w=v.ownerDocument.createRange();u.selectNode(r);u.collapse(true);w.selectNode(v);w.collapse(true);var x=u.compareBoundaryPoints(Range.START_TO_END,w);if(x===0){hasDuplicate=true}return x}}}}(function(){var u=document.createElement("form"),r="script"+(new Date).getTime();u.innerHTML="<input name='"+r+"'/>";var v=document.documentElement;v.insertBefore(u,v.firstChild);if(!!document.getElementById(r)){l.find.ID=function(z,y,x){if(typeof y.getElementById!=="undefined"&&!x){var w=y.getElementById(z[1]);return w?w.id===z[1]||typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id").nodeValue===z[1]?[w]:ac:[]}};l.filter.ID=function(x,w){var y=typeof x.getAttributeNode!=="undefined"&&x.getAttributeNode("id");return x.nodeType===1&&y&&y.nodeValue===w}}v.removeChild(u)})();(function(){var r=document.createElement("div");r.appendChild(document.createComment(""));if(r.getElementsByTagName("*").length>0){l.find.TAG=function(w,x){var y=x.getElementsByTagName(w[1]);if(w[1]==="*"){var u=[];for(var v=0;y[v];v++){if(y[v].nodeType===1){u.push(y[v])}}y=u}return y}}r.innerHTML="<a href='#'></a>";if(r.firstChild&&typeof r.firstChild.getAttribute!=="undefined"&&r.firstChild.getAttribute("href")!=="#"){l.attrHandle.href=function(u){return u.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var u=o,r=document.createElement("div");r.innerHTML="<p class='TEST'></p>";if(r.querySelectorAll&&r.querySelectorAll(".TEST").length===0){return}o=function(y,z,w,v){z=z||document;if(!v&&z.nodeType===9&&!c(z)){try{return q(z.querySelectorAll(y),w)}catch(x){}}return u(y,z,w,v)};o.find=u.find;o.filter=u.filter;o.selectors=u.selectors;o.matches=u.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var r=document.createElement("div");r.innerHTML="<div class='test e'></div><div class='test'></div>";if(r.getElementsByClassName("e").length===0){return}r.lastChild.className="e";if(r.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS");l.find.CLASS=function(w,v,u){if(typeof v.getElementsByClassName!=="undefined"&&!u){return v.getElementsByClassName(w[1])}}})()}function d(z,u,v,B,r,C){var D=z=="previousSibling"&&!C;for(var x=0,y=B.length;x<y;x++){var A=B[x];if(A){if(D&&A.nodeType===1){A.sizcache=v;A.sizset=x}A=A[z];var w=false;while(A){if(A.sizcache===v){w=B[A.sizset];break}if(A.nodeType===1&&!C){A.sizcache=v;A.sizset=x}if(A.nodeName===u){w=A;break}A=A[z]}B[x]=w}}}function a(z,u,v,B,r,C){var D=z=="previousSibling"&&!C;for(var x=0,y=B.length;x<y;x++){var A=B[x];if(A){if(D&&A.nodeType===1){A.sizcache=v;A.sizset=x}A=A[z];var w=false;while(A){if(A.sizcache===v){w=B[A.sizset];break}if(A.nodeType===1){if(!C){A.sizcache=v;A.sizset=x}if(typeof u!=="string"){if(A===u){w=true;break}}else{if(o.filter(u,[A]).length>0){w=A;break}}}A=A[z]}B[x]=w}}}var j=document.compareDocumentPosition?function(r,u){return r.compareDocumentPosition(u)&16}:function(r,u){return r!==u&&(r.contains?r.contains(u):true)};var c=function(r){return r.nodeType===9&&r.documentElement.nodeName!=="HTML"||!!r.ownerDocument&&c(r.ownerDocument)};var k=function(w,y){var r=[],A="",z,u=y.nodeType?[y]:y;while((z=l.match.PSEUDO.exec(w))){A+=z[0];w=w.replace(l.match.PSEUDO,"")}w=l.relative[w]?w+"*":w;for(var x=0,v=u.length;x<v;x++){o(w,u[x],r)}return o.filter(A,r)};U.find=o;U.filter=o.filter;U.expr=o.selectors;U.expr[":"]=U.expr.filters;o.selectors.filters.hidden=function(r){return r.offsetWidth===0||r.offsetHeight===0};o.selectors.filters.visible=function(r){return r.offsetWidth>0||r.offsetHeight>0};o.selectors.filters.animated=function(r){return U.grep(U.timers,function(u){return r===u.elem}).length};U.multiFilter=function(r,v,u){if(u){r=":not("+r+")"}return o.matches(r,v)};U.dir=function(u,v){var w=[],r=u[v];while(r&&r!=document){if(r.nodeType==1){w.push(r)}r=r[v]}return w};U.nth=function(x,w,u,r){w=w||1;var v=0;for(;x;x=x[u]){if(x.nodeType==1&&++v==w){break}}return x};U.sibling=function(r,u){var v=[];for(;r;r=r.nextSibling){if(r.nodeType==1&&r!=u){v.push(r)}}return v};return;X.Sizzle=o})();U.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=X){c=X}if(!d.guid){d.guid=this.guid++}if(a!==ac){var e=d;d=this.proxy(e);d.data=a}var g=U.data(c,"events")||U.data(c,"events",{}),b=U.data(c,"handle")||U.data(c,"handle",function(){return typeof U!=="undefined"&&!U.event.triggered?U.event.handle.apply(arguments.callee.elem,arguments):ac});b.elem=c;U.each(f.split(/\s+/),function(l,k){var j=k.split(".");k=j.shift();d.type=j.slice().sort().join(".");var h=g[k];if(U.event.specialAll[k]){U.event.specialAll[k].setup.call(c,a,j)}if(!h){h=g[k]={};if(!U.event.special[k]||U.event.special[k].setup.call(c,a,j)===false){if(c.addEventListener){c.addEventListener(k,b,false)}else{if(c.attachEvent){c.attachEvent("on"+k,b)}}}}h[d.guid]=d;U.event.global[k]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=U.data(b,"events"),g,h;if(f){if(e===ac||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))}}else{if(e.type){c=e.handler;e=e.type}U.each(e.split(/\s+/),function(n,l){var j=l.split(".");l=j.shift();var m=RegExp("(^|\\.)"+j.slice().sort().join(".*\\.")+"(\\.|$)");if(f[l]){if(c){delete f[l][c.guid]}else{for(var k in f[l]){if(m.test(f[l][k].type)){delete f[l][k]}}}if(U.event.specialAll[l]){U.event.specialAll[l].teardown.call(b,j)}for(g in f[l]){break}if(!g){if(!U.event.special[l]||U.event.special[l].teardown.call(b,j)===false){if(b.removeEventListener){b.removeEventListener(l,U.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+l,U.data(b,"handle"))}}}g=null;delete f[l]}}})}for(g in f){break}if(!g){var a=U.data(b,"handle");if(a){a.elem=null}U.removeData(b,"events");U.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[ab]?d:U.extend(U.Event(f),d):U.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){U.each(U.cache,function(){if(this.events&&this.events[f]){U.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ac}d.result=ac;d.target=e;b=U.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=U.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(U.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(U.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){U.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=U.event.fix(b||X.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(U.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ac){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(c){if(c[ab]){return c}var e=c;c=U.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){U.event.add(this,a[0],ag)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");U.each((U.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){U.event.remove(this,a[0],ag)}}}}}};U.Event=function(a){if(!this.preventDefault){return new U.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ae();this[ab]=true};function Y(){return false}function J(){return true}U.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var ai=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;U.event.handle.apply(this,arguments)}};U.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){U.event.special[b]={setup:function(){U.event.add(this,a,ai,b)},teardown:function(){U.event.remove(this,a,ai)}}});U.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){U.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=U.event.proxy(c||a,function(e){U(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){U.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){U.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){U.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=U.Event(c);b.preventDefault();b.stopPropagation();U.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){U.event.proxy(a,c[b++])}return this.click(U.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(U.isReady){a.call(document,U)}else{U.readyList.push(a)}return this},live:function(a,b){var c=U.event.proxy(b);c.guid+=this.selector+a;U(document).bind(aa(a,this.selector),this.selector,c);return this},die:function(a,b){U(document).unbind(aa(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function ag(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];U.each(U.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=U(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return U.data(e.elem,"closest")-U.data(f.elem,"closest")});U.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function aa(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}U.extend({isReady:false,readyList:[],ready:function(){if(!U.isReady){U.isReady=true;if(U.readyList){U.each(U.readyList,function(){this.call(document,U)});U.readyList=null}U(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);U.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);U.ready()}});if(document.documentElement.doScroll&&X==X.top){(function(){if(U.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}U.ready()})()}}}U.event.add(X,"load",U.ready)}U.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){U.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});U(X).bind("unload",function(){for(var a in U.cache){if(a!=1&&U.cache[a].handle){U.event.remove(U.cache[a].handle.elem)}}});(function(){U.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return}U.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(X[b]){U.support.scriptEval=true;delete X[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){U.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}U(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);U.boxModel=U.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=U.support.cssFloat?"cssFloat":"styleFloat";U.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};U.fn.extend({_load:U.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(U.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=U.param(b);d="POST"}}}var f=this;U.ajax({url:e,type:d,dataType:"html",data:b,complete:function(j,h){if(h=="success"||h=="notmodified"){f.html(g?U("<div/>").append(j.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):j.responseText)}if(a){f.each(a,[j.responseText,h,j])}}});return this},serialize:function(){return U.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?U.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(c,b){var a=U(this).val();return a==null?null:U.isArray(a)?U.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});U.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){U.fn[a]=function(c){return this.bind(a,c)}});var N=ae();U.extend({get:function(d,b,a,c){if(U.isFunction(b)){a=b;b=null}return U.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return U.get(b,null,a,"script")},getJSON:function(c,b,a){return U.get(c,b,a,"json")},post:function(d,b,a,c){if(U.isFunction(b)){a=b;b={}}return U.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){U.extend(U.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return X.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(l){l=U.extend(true,l,U.extend(true,{},U.ajaxSettings,l));var a,v=/=\?(&|$)/g,f,b,u=l.type.toUpperCase();if(l.data&&l.processData&&typeof l.data!=="string"){l.data=U.param(l.data)}if(l.dataType=="jsonp"){if(u=="GET"){if(!l.url.match(v)){l.url+=(l.url.match(/\?/)?"&":"?")+(l.jsonp||"callback")+"=?"}}else{if(!l.data||!l.data.match(v)){l.data=(l.data?l.data+"&":"")+(l.jsonp||"callback")+"=?"}}l.dataType="json"}if(l.dataType=="json"&&(l.data&&l.data.match(v)||l.url.match(v))){a="jsonp"+N++;if(l.data){l.data=(l.data+"").replace(v,"="+a+"$1")}l.url=l.url.replace(v,"="+a+"$1");l.dataType="script";X[a]=function(y){b=y;q();m();X[a]=ac;try{delete X[a]}catch(x){}if(r){r.removeChild(d)}}}if(l.dataType=="script"&&l.cache==null){l.cache=false}if(l.cache===false&&u=="GET"){var w=ae();var c=l.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+w+"$2");l.url=c+((c==l.url)?(l.url.match(/\?/)?"&":"?")+"_="+w:"")}if(l.data&&u=="GET"){l.url+=(l.url.match(/\?/)?"&":"?")+l.data;l.data=null}if(l.global&&!U.active++){U.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(l.url);if(l.dataType=="script"&&u=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var r=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=l.url;if(l.scriptCharset){d.charset=l.scriptCharset}if(!a){var j=false;d.onload=d.onreadystatechange=function(){if(!j&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){j=true;q();m();d.onload=d.onreadystatechange=null;r.removeChild(d)}}}r.appendChild(d);return ac}var n=false;var o=l.xhr();if(l.username){o.open(u,l.url,l.async,l.username,l.password)}else{o.open(u,l.url,l.async)}try{if(l.data){o.setRequestHeader("Content-Type",l.contentType)}if(l.ifModified){o.setRequestHeader("If-Modified-Since",U.lastModified[l.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.setRequestHeader("Accept",l.dataType&&l.accepts[l.dataType]?l.accepts[l.dataType]+", */*":l.accepts._default)}catch(e){}if(l.beforeSend&&l.beforeSend(o,l)===false){if(l.global&&!--U.active){U.event.trigger("ajaxStop")}o.abort();return false}if(l.global){U.event.trigger("ajaxSend",[o,l])}var k=function(z){if(o.readyState==0){if(h){clearInterval(h);h=null;if(l.global&&!--U.active){U.event.trigger("ajaxStop")}}}else{if(!n&&o&&(o.readyState==4||z=="timeout")){n=true;if(h){clearInterval(h);h=null}f=z=="timeout"?"timeout":!U.httpSuccess(o)?"error":l.ifModified&&U.httpNotModified(o,l.url)?"notmodified":"success";if(f=="success"){try{b=U.httpData(o,l.dataType,l)}catch(x){f="parsererror"}}if(f=="success"){var y;try{y=o.getResponseHeader("Last-Modified")}catch(x){}if(l.ifModified&&y){U.lastModified[l.url]=y}if(!a){q()}}else{U.handleError(l,o,f)}m();if(z){o.abort()}if(l.async){o=null}}}};if(l.async){var h=setInterval(k,13);if(l.timeout>0){setTimeout(function(){if(o&&!n){k("timeout")}},l.timeout)}}try{o.send(l.data)}catch(e){U.handleError(l,o,null,e)}if(!l.async){k()}function q(){if(l.success){l.success(b,f)}if(l.global){U.event.trigger("ajaxSuccess",[o,l])}}function m(){if(l.complete){l.complete(o,f)}if(l.global){U.event.trigger("ajaxComplete",[o,l])}if(l.global&&!--U.active){U.event.trigger("ajaxStop")}}return o},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){U.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==U.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){U.globalEval(b)}if(c=="json"){b=X["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(U.isArray(d)||d.jquery){U.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(U.isArray(d[c])){U.each(d[c],function(){a(c,this)})}else{a(c,U.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var W={},V,af=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};U.each(af.concat.apply([],af.slice(0,c)),function(){a[this]=b});return a}U.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=U.data(this[e],"olddisplay");this[e].style.display=h||"";if(U.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(W[f]){b=W[f]}else{var d=U("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();W[f]=b}U.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=U.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=U.data(this[c],"olddisplay");if(!e&&e!=="none"){U.data(this[c],"olddisplay",U.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:U.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return U.isFunction(a)&&U.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:U(this).is(":hidden");U(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=U.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=U.extend({},e),j,f=this.nodeType==1&&U(this).is(":hidden"),h=this;for(j in a){if(a[j]=="hide"&&f||a[j]=="show"&&!f){return g.complete.call(this)}if((j=="height"||j=="width")&&this.style){g.display=U.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=U.extend({},a);U.each(a,function(q,l){var m=new U.fx(h,g,q);if(/toggle|show|hide/.test(l)){m[l=="toggle"?f?"show":"hide":l](a)}else{var n=l.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),k=m.cur(true)||0;if(n){var r=parseFloat(n[2]),o=n[3]||"px";if(o!="px"){h.style[q]=(r||1)+o;k=((r||1)/m.cur(true))*k;h.style[q]=k+o}if(n[1]){r=((n[1]=="-="?-1:1)*r)+k}m.custom(k,r,o)}else{m.custom(k,l,"")}}});return true})},stop:function(b,c){var a=U.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});U.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){U.fn[b]=function(d,c){return this.animate(a,d,c)}});U.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||U.isFunction(b)&&b,duration:b,easing:c&&a||a&&!U.isFunction(a)&&a};d.duration=U.fx.off?0:typeof d.duration==="number"?d.duration:U.fx.speeds[d.duration]||U.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){U(this).dequeue()}if(U.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});U.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(U.fx.step[this.prop]||U.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(U.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(U.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ae();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&U.timers.push(d)&&!V){V=setInterval(function(){var f=U.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(V);V=ac}},13)}},show:function(){this.options.orig[this.prop]=U.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());U(this.elem).show()},hide:function(){this.options.orig[this.prop]=U.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ae();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(U.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){U(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){U.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=U.easing[this.options.easing||(U.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};U.extend(U.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){U.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){U.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return U.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||U.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||U.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{U.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return U.offset.bodyOffset(this[0])}U.offset.initialized||U.offset.initialize();var f=this[0],j=f.offsetParent,k=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,l=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===j){b+=f.offsetTop,g+=f.offsetLeft;if(U.offset.doesNotAddBorder&&!(U.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=j,j=f.offsetParent}if(U.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}l=c}if(l.position==="relative"||l.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(l.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}U.offset={initialize:function(){if(this.initialized){return}var c=document.body,j=document.createElement("div"),g,h,a,f,b,k,e=c.style.marginTop,d='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(k in b){j.style[k]=b[k]}j.innerHTML=d;c.insertBefore(j,c.firstChild);g=j.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(j);this.initialized=true},bodyOffset:function(c){U.offset.initialized||U.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(U.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(U.curCSS(c,"marginTop",true),10)||0,b+=parseInt(U.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};U.fn.extend({position:function(){var b=0,c=0,e;if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Z(this,"marginTop");a.left-=Z(this,"marginLeft");f.top+=Z(d,"borderTopWidth");f.left+=Z(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&U.css(a,"position")=="static")){a=a.offsetParent}return U(a)}});U.each(["Left","Top"],function(b,c){var a="scroll"+c;U.fn[a]=function(d){if(!this[0]){return null}return d!==ac?this.each(function(){this==X||this==document?X.scrollTo(!b?d:U(X).scrollLeft(),b?d:U(X).scrollTop()):this[a]=d}):this[0]==X||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||U.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});U.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();U.fn["inner"+d]=function(){return this[0]?U.css(this[0],e,false,"padding"):null};U.fn["outer"+d]=function(g){return this[0]?U.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();U.fn[a]=function(g){return this[0]==X?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ac?(this.length?U.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();$(document).ajaxComplete(function(c,a,b){var d=$.httpData(a,b.dataType);if(d.error){alert(T(d.error));return false}});$(document).ready(function(){$(window).bind("resize",function(){if(v_grid=$(".ui-jqgrid-btable:visible")){v_grid.each(function(a){var b=$(this).attr("id");var c=$("#gbox_"+b).parent().width();$("#"+b).setGridWidth(c)})}if(v_dialog=$(".ui-dialog-content:visible")){v_dialog.each(function(b){var a=$(this).attr("id");$("#"+a).dialog("option","position","center")})}})});var SERVER="";if(typeof(Ext)!="undefined"){Ext.BLANK_IMAGE_URL=SERVER+"/images/default/s.gif";Ext.DatePicker.prototype.startDay=1}function htmlSpecialCharsRenderer(b){if(b){try{return b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#039;")}catch(a){return""}}else{return""}}function getDaysDiff(e,d){var f=1000*60*60*24;var c=e.getTime();var b=d.getTime();var a=Math.abs(c-b);return Math.round(a/f)}Ext.ns("TourSearch.Data");TourSearch.Data.DepartureStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"town_from"},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:true});TourSearch.Data.ArrivalStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"town_to"},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:true});TourSearch.Data.TourStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"packet",townfrom:null,townto:null},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t","n"]),autoLoad:false,onDepartureChanged:function(){var a=TourSearch.Data.TourStore;a.baseParams.townfrom=this.getValue().toString();a.updateData()},onArrivalChanged:function(){var a=TourSearch.Data.TourStore;a.baseParams.townto=this.getValue().toString();a.updateData()},updateData:function(){var a=TourSearch.Data.TourStore;if(a.baseParams.townfrom!=null&&a.baseParams.townto!=null){a.reload()}else{a.removeAll()}}});TourSearch.Data.FlightDaysStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/flight_days"}),baseParams:{packet:0,townfrom:0,townto:0},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"i"},["i","v"]),autoLoad:false,onTourChanged:function(){var a=TourSearch.Data.FlightDaysStore;a.baseParams.packet=this.getValue().toString();a.updateData()},onDepartureChanged:function(){var a=TourSearch.Data.FlightDaysStore;a.baseParams.townfrom=this.getValue().toString();a.baseParams.packet=0;a.updateData()},onArrivalChanged:function(){var a=TourSearch.Data.FlightDaysStore;a.baseParams.townto=this.getValue().toString();a.baseParams.packet=0;a.updateData()},updateData:function(){var b=TourSearch.Data.FlightDaysStore;var a=TourSearch.Data.TourStore.baseParams.townfrom;if(b.baseParams.packet<=0&&!a){b.baseParams.packet=1}if(b.baseParams.packet&&b.baseParams.townfrom!=null){b.reload()}else{b.removeAll()}}});TourSearch.Data.NightsStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"nights",packet:0,townto:0},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:false,onTourChanged:function(){var a=TourSearch.Data.NightsStore;a.baseParams.packet=this.getValue().toString();a.updateData()},onArrivalChanged:function(){var a=TourSearch.Data.NightsStore;a.baseParams.townto=this.getValue().toString();a.baseParams.packet=0;a.updateData()},updateData:function(){var b=TourSearch.Data.NightsStore;var a=TourSearch.Data.TourStore.baseParams.townfrom;if(b.baseParams.packet<=0&&!a){b.baseParams.packet=1}if(b.baseParams.packet){b.reload()}else{b.removeAll()}}});TourSearch.Data.StarsStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"stars",packet:0,townto:0,datebeg:"",dateend:""},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:false,onTourChanged:function(){var a=TourSearch.Data.StarsStore;a.baseParams.packet=this.getValue().toString();a.updateData()},onArrivalChanged:function(){var a=TourSearch.Data.StarsStore;a.baseParams.townto=this.getValue().toString();a.baseParams.packet=0;a.updateData()},updateData:function(){var b=TourSearch.Data.StarsStore;var a=TourSearch.Data.TourStore.baseParams.townfrom;if(b.baseParams.packet<=0&&!a){b.baseParams.packet=1}if(b.baseParams.packet){b.baseParams.datebeg=Ext.get("dateFromDateField").getValue().toString();b.baseParams.dateend=Ext.get("dateToDateField").getValue().toString();b.reload()}else{b.removeAll()}}});TourSearch.Data.MealsStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"meals",packet:0,hotel:-1,townto:0,pcount:0,stars:0,datebeg:"",dateend:""},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:false,onHotelChanged:function(){var a=TourSearch.Data.MealsStore;a.baseParams.hotel=this.getValue().toString();a.baseParams.pcount=people_counter().toString();a.updateData()},onTourChanged:function(){var a=TourSearch.Data.MealsStore;a.baseParams.packet=this.getValue().toString();a.baseParams.pcount=people_counter().toString();a.baseParams.hotel=-1;a.updateData()},onArrivalChanged:function(){var a=TourSearch.Data.MealsStore;a.baseParams.townto=this.getValue().toString();a.baseParams.pcount=people_counter().toString();a.baseParams.packet=0;a.updateData()},onStarsChanged:function(){var a=TourSearch.Data.MealsStore;a.baseParams.stars=this.getValue().toString();a.baseParams.pcount=people_counter().toString();a.updateData()},onPCChanged:function(){var a=TourSearch.Data.MealsStore;a.baseParams.pcount=people_counter().toString();if(a.baseParams.hotel>=0){a.updateData()}},updateData:function(){var b=TourSearch.Data.MealsStore;var a=TourSearch.Data.TourStore.baseParams.townfrom;if(b.baseParams.packet<=0&&!a){b.baseParams.packet=1}if(b.baseParams.packet){b.baseParams.datebeg=Ext.get("dateFromDateField").getValue().toString();b.baseParams.dateend=Ext.get("dateToDateField").getValue().toString();b.reload()}else{b.removeAll()}}});TourSearch.Data.HotelsStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/selectors"}),baseParams:{name:"hotels",packet:0,townto:0,stars:0,datebeg:"",dateend:""},reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:false,onTourChanged:function(){var a=TourSearch.Data.HotelsStore;a.baseParams.packet=this.getValue().toString();a.updateData()},onArrivalChanged:function(){var a=TourSearch.Data.HotelsStore;a.baseParams.townto=this.getValue().toString();a.baseParams.packet=0;a.updateData()},onStarsChanged:function(){var a=TourSearch.Data.HotelsStore;a.baseParams.stars=this.getValue().toString();a.updateData()},updateData:function(){var b=TourSearch.Data.HotelsStore;var a=TourSearch.Data.TourStore.baseParams.townfrom;if(b.baseParams.packet<=0&&!a){b.baseParams.packet=1}if(b.baseParams.packet&&b.baseParams.townto!=null&&b.baseParams.stars){b.baseParams.datebeg=Ext.get("dateFromDateField").getValue().toString();b.baseParams.dateend=Ext.get("dateToDateField").getValue().toString();b.reload()}else{b.removeAll()}}});TourSearch.Data.PriceStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:SERVER+"/tour_search/price_list"}),reader:new Ext.data.JsonReader({root:"data",totalProperty:"total",id:"v"},["v","t"]),autoLoad:true});function people_counter(){var b=parseInt(kidsComboBox.getValue());var a=parseInt(adultsComboBox.getValue());if(!b){b=0}if(!a){a=0}return b+a}Ext.ns("TourSearch");TourSearch.AdvancedSliderTip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,38],style:"z-index: 1000;",init:function(a){if(a.vertical){this.offsets=[22,17]}a.on("enable",this.onSliderShow,this);a.on("change",this.onSliderShow,this);a.on("show",this.onSliderShow,this);a.on("hide",this.onSliderHide,this);a.on("disable",this.onSliderHide,this);a.on("destroy",this.destroy,this)},onSliderShow:function(a){this.show();this.body.update(this.getText(a));this.doAutoWidth();this.el.alignTo(a.thumb,"b-t?",this.offsets)},onSliderHide:function(a){this.hide()},getText:function(a){return a.getValue()}});Ext.ns("TourSearch");var languages=new Array();languages.en={"from data":"From...","to date":"To...","from place":"From...","to place":"To..."};languages.ru={Ok:"Ok",Cancel:"Отмена",Search:"Поиск","To Excel":"В Excel",From:"Откуда",To:"Куда",Tour:"Тур",Period:"Период",Category:"Категория",Hotel:"Отель",Meals:"Питание",Adults:"Взрослых",Children:"Детей",Age:"Возраст",Price:"Цена","Places for flights":"Места на рейсы","Places in the hotel":"Места в гостинице","Age of child:":"Возраст ребенка:","Select departure city":"Выберите город отправления","Select arrival city":"Выберите город пребывания","Select tour":"Выберите тур","Choose category":"Выберите категорию","Choose hotel":"Выберите отель","Choose the type of meals":"Выберите тип питания","Select number of adults":"Выберите кол-во взрослых","Select number of children":"Выберите кол-во детей","First child":"Первый ребенок","Second child":"Второй ребенок","Third child":"Третий ребенок","From...":["С...","От..."],"To...":["По...","До..."],"one adult":"1 взрослый","two adults":"2 взрослых","three adults":"3 взрослых","four adults":"4 взрослых","no children":"нет детей","one child":"1 ребенок","two children":"2 ребенка","three children":"3 ребенка","Can not find the day of departure for the selected tour":"Невозможно найти дни вылета для выбранного тура","No results found as per your request. Enter new parameters!":"По вашему запросу ничего не найдено. Введите новые параметры поиска!",Any:"Любая","Places in the hotel on all days":"Места в гостинице на все дни"};languages.de={Ok:"OK",Cancel:"Abbrechen",Search:"Suche","To Excel":"In Excel",From:"Aus",To:"Zu",Tour:"Tour",Period:"Datum",Category:"Kategorie",Hotel:"Hotel",Meals:"Verpflegung",Adults:"Erwachsene",Children:"Kinder",Age:"Alter",Price:"Preis","Places for flights":"Verfügbare Busplaetze","Places in the hotel":"Verfügbare Hotelplaetze ","Age of child:":"Alter des Kindes","Select departure city":"Wählen Sie einen Abfahrtsort ","Select arrival city":"Wählen Sie einen Ankunftsort","Select tour":"Wählen Sie Tour","Choose category":"Wählen Sie eine Kategorie","Choose hotel":"Wählen Sie Hotel","Choose the type of meals":"Wählen Sie eine Art der Verpflegung","Select number of adults":"Wählen Sie die Anzahl der Erwachsenen","Select number of children":"Wählen Sie die Anzahl der Kinder","First child":"Wählen Sie Alter beim ersten","Second child":"Wählen Sie das Alter der zweiten","Third child":"Wählen Sie dritte Zeitalter","From...":["S...","Von..."],"To...":["Wie...","Um..."],"one adult":"Einen Erwachsenen","two adults":"Zwei Erwachsene","three adults":"Drei Erwachsene","four adults":"Vier Erwachsene","no children":"Kein Kind","one child":"Ein Kind","two children":"Zwei Kinder","three children":"Drei Säuglinge","Can not find the day of departure for the selected tour":"Nicht finden können, der Tag der Abreise für die ausgewählte Tour","No results found as per your request. Enter new parameters!":"Nichts gefunden. Bitte andere Parameter anwahlen!",Any:"Beliebig","Places in the hotel on all days":"Places in the hotel on all days"};languages.uk=languages.ru;var currentLanguage=(navigator.language||navigator.systemLanguage||navigator.userLanguage).substr(0,2).toLowerCase();var currentDictionary=languages[currentLanguage];var t=function(b,a){var c=(currentDictionary&&currentDictionary[b])||b;return typeof(c)=="string"?c:c[a||0]};Ext.ns("TourSearch");var kidsAgesLabel;TourSearch.Data.AdultsCountStore=new Ext.data.SimpleStore({fields:["v","t"],data:[["1",t("one adult")],["2",t("two adults")],["3",t("three adults")],["4",t("four adults")]]});var adultsComboBox=new Ext.form.ComboBox({id:"adultsComboBox",name:"adults",fieldLabel:t("Adults"),store:TourSearch.Data.AdultsCountStore,value:"1",valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",readOnly:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("Select number of adults"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});adultsComboBox.addListener("focus",adultsComboBox.onTriggerClick);adultsComboBox.addListener("select",function(){mealComboBox.clearValue()});adultsComboBox.addListener("select",TourSearch.Data.MealsStore.onPCChanged);if(TourSearch.Data.ResultsStore){adultsComboBox.addListener("select",TourSearch.Data.ResultsStore.onAdultsCountChanged)}TourSearch.Data.KidsCountStore=new Ext.data.SimpleStore({fields:["v","t"],data:[["0",t("no children")],["1",t("one child")],["2",t("two children")],["3",t("three children")]]});var kidsComboBox=new Ext.form.ComboBox({id:"kidsComboBox",name:"kids",fieldLabel:t("Children"),store:TourSearch.Data.KidsCountStore,value:"0",valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",readOnly:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("Select number of children"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});kidsComboBox.addListener("focus",kidsComboBox.onTriggerClick);kidsComboBox.addListener("select",function(){mealComboBox.clearValue()});kidsComboBox.addListener("select",TourSearch.Data.MealsStore.onPCChanged);if(TourSearch.Data.ResultsStore){kidsComboBox.addListener("select",TourSearch.Data.ResultsStore.onKidsCountChanged)}kidsComboBox.addListener("select",function(){var b=[firstKidAgeComboBox,secondKidAgeComboBox,thirdKidAgeComboBox];for(i=0;i<b.length;i++){var a=(i<kidsComboBox.getValue());b[i].setDisabled(!a)}});var ages=new Array();for(i=0;i<18;i++){ages[i]=[new String(i),new String(i)]}TourSearch.Data.KidsAgesStore=new Ext.data.SimpleStore({fields:["v","t"],data:ages});var firstKidAgeComboBox=new Ext.form.ComboBox({id:"firstKidAgeComboBox",name:"firstKidAge",store:TourSearch.Data.KidsAgesStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",readOnly:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("First child"),selectOnFocus:true,lazyInit:false,fieldLabel:t("Age"),disabled:true,width:100});firstKidAgeComboBox.addListener("focus",firstKidAgeComboBox.onTriggerClick);if(TourSearch.Data.ResultsStore){firstKidAgeComboBox.addListener("select",TourSearch.Data.ResultsStore.onFirstKidAgeChanged)}var secondKidAgeComboBox=new Ext.form.ComboBox({id:"secondKidAgeComboBox",name:"secondKidAge",store:TourSearch.Data.KidsAgesStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,readOnly:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("Second child"),selectOnFocus:true,lazyInit:false,disabled:true,style:"margin-left: 3px;",width:100});secondKidAgeComboBox.addListener("focus",secondKidAgeComboBox.onTriggerClick);if(TourSearch.Data.ResultsStore){secondKidAgeComboBox.addListener("select",TourSearch.Data.ResultsStore.onSecondKidAgeChanged)}var thirdKidAgeComboBox=new Ext.form.ComboBox({id:"thirdKidAgeComboBox",name:"thirdKidAge",store:TourSearch.Data.KidsAgesStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,readOnly:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("Third child"),selectOnFocus:true,lazyInit:false,disabled:true,style:"margin-left: 6px;",width:100});thirdKidAgeComboBox.addListener("focus",thirdKidAgeComboBox.onTriggerClick);if(TourSearch.Data.ResultsStore){thirdKidAgeComboBox.addListener("select",TourSearch.Data.ResultsStore.onThirdKidAgeChanged)}adultsSlider=null;kidsSlider=null;firstKidAgeSlider=null;secondKidAgeSlider=null;thirdKidAgeSlider=null;Ext.ns("TourSearch");var results_page="results.html";var rw,get_params=function(){return{fromtown:departureComboBox.getValue().toString(),totown:arrivalComboBox.getValue().toString(),tour:tourComboBox.getValue().toString(),startDate:dateFromDateField.getValue().format("m/d/Y"),nights:nightsComboBox.getValue().toString(),stars:starsComboBox.getValue().toString(),hotels:hotelComboBox.getValue().toString(),meal:mealComboBox.getValue().toString(),adults_count:adultsComboBox.getValue().toString(),kids_count:kidsComboBox.getValue().toString(),kidsAge1:firstKidAgeComboBox.getValue().toString(),kidsAge2:secondKidAgeComboBox.getValue().toString(),kidsAge3:thirdKidAgeComboBox.getValue().toString(),freight_block:flightAllotmentCheckbox.getValue().toString(),hotel_block:hotelAllotmentCheckbox.getValue().toString(),hotel_block_all:hotelAllAllotmentCheckbox.getValue().toString(),priceFrom:priceFromNumberField.getValue().toString(),priceTo:priceToNumberField.getValue().toString()}};function ts_prepare_layout(){searchButton.handler=function(){if(!searchFormPanel.getForm().isValid()){return false}var a=880,b=600;rw=window.open(results_page,"_blank","location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,directories=0,width="+a+",height="+b);if(!rw.opener){rw.opener=window}};searchFormPanel=new Ext.form.FormPanel({frame:true,region:"center",labelAlign:"right",labelWidth:85,items:[{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[departureComboBox,arrivalComboBox,tourComboBox,durationPanel,starsComboBox,hotelComboBox,pricePanel]},{columnWidth:0.5,layout:"form",items:[adultsComboBox,kidsComboBox,{xtype:"panel",fieldLabel:t("Age"),anchor:"90%",layout:"table",layoutConfig:{columns:3,rows:1},items:[firstKidAgeComboBox,secondKidAgeComboBox,thirdKidAgeComboBox]},mealComboBox,{xtype:"panel",cls:"x-form-item",style:"margin-left: 85px;",items:[flightAllotmentCheckbox,hotelAllotmentCheckbox,hotelAllAllotmentCheckbox]}]}]},{xtype:"panel",buttonAlign:"center",buttons:[searchButton,toXLSButton]},tourNoticeIcon]});viewport=new Ext.Viewport({layout:"border",items:[searchFormPanel]})}Ext.ns("TourSearch");var departureComboBox,arrivalComboBox,tourComboBox,tourNoticeIcon,dateFromDateField,dateToDateField,nightsComboBox,durationPanel,starsComboBox,hotelComboBox,mealComboBox,kidsAgesPanel,flightAllotmentCheckbox,hotelAllotmentCheckbox,hotelAllAllotmentCheckbox,priceFromNumberField,priceToNumberField,pricePanel,searchFormPanel,viewport,toXLSButton,ots2=0,searchButton;Ext.onReady(function(){Ext.QuickTips.init();TourSearch.Data.DepartureStore.on("load",function(f,e,g){var h=TourSearch.Data.DepartureStore;if(h.data.length>0){var d=h.getAt(0);if(d&&d.data.v>0){departureComboBox.enable();tourComboBox.enable();toXLSButton.enable()}else{flightAllotmentCheckbox.disable();hotelAllotmentCheckbox.disable();hotelAllAllotmentCheckbox.setValue("on");hotelAllAllotmentCheckbox.disable();ots2=1}}});departureComboBox=new Ext.form.ComboBox({disabled:true,id:"departureComboBox",name:"departure",fieldLabel:t("From"),store:TourSearch.Data.DepartureStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,minChars:3,mode:"local",forceSelection:true,emptyText:t("Select departure city"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});departureComboBox.addListener("focus",departureComboBox.onTriggerClick);departureComboBox.addListener("select",TourSearch.Data.TourStore.onDepartureChanged);departureComboBox.addListener("select",TourSearch.Data.FlightDaysStore.onDepartureChanged);if(TourSearch.Data.ResultsStore){departureComboBox.addListener("select",TourSearch.Data.ResultsStore.onDepartureChanged)}TourSearch.Data.ArrivalStore.on("load",function(f,e,g){var h=TourSearch.Data.ArrivalStore;var d=h.getAt(0);if(d&&d.data.v>0){arrivalComboBox.enable()}if(departureComboBox.disabled&&arrivalComboBox.disabled){TourSearch.Data.FlightDaysStore.baseParams.townfrom=0;TourSearch.Data.HotelsStore.baseParams.townto=0;TourSearch.Data.TourStore.load()}});arrivalComboBox=new Ext.form.ComboBox({id:"arrivalComboBox",name:"arrival",fieldLabel:t("To"),store:TourSearch.Data.ArrivalStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,minChars:3,mode:"local",forceSelection:true,emptyText:t("Select arrival city"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});arrivalComboBox.addListener("focus",arrivalComboBox.onTriggerClick);arrivalComboBox.addListener("select",TourSearch.Data.TourStore.onArrivalChanged);arrivalComboBox.addListener("select",TourSearch.Data.HotelsStore.onArrivalChanged);arrivalComboBox.addListener("select",TourSearch.Data.FlightDaysStore.onArrivalChanged);arrivalComboBox.addListener("select",TourSearch.Data.NightsStore.onArrivalChanged);arrivalComboBox.addListener("select",TourSearch.Data.StarsStore.onArrivalChanged);arrivalComboBox.addListener("select",TourSearch.Data.MealsStore.onArrivalChanged);if(TourSearch.Data.ResultsStore){arrivalComboBox.addListener("select",TourSearch.Data.ResultsStore.onArrivalChanged)}tourComboBox=new Ext.form.ComboBox({disabled:true,id:"tourComboBox",name:"tour",fieldLabel:t("Tour"),store:TourSearch.Data.TourStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,minChars:3,mode:"local",forceSelection:true,emptyText:t("Select tour"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});tourComboBox.addListener("focus",tourComboBox.onTriggerClick);tourComboBox.addListener("select",TourSearch.Data.HotelsStore.onTourChanged);tourComboBox.addListener("select",TourSearch.Data.FlightDaysStore.onTourChanged);tourComboBox.addListener("select",TourSearch.Data.NightsStore.onTourChanged);tourComboBox.addListener("select",TourSearch.Data.StarsStore.onTourChanged);tourComboBox.addListener("select",TourSearch.Data.MealsStore.onTourChanged);if(TourSearch.Data.ResultsStore){tourComboBox.addListener("select",TourSearch.Data.ResultsStore.onTourChanged)}tourNoticeIcon=new Ext.ux.Image({id:"tourNoticeIcon",src:"/images/info.png",style:"position: absolute;",hidden:true,hideNotice:function(){tourNoticeIcon.hide();Ext.QuickTips.unregister(tourNoticeIcon)},onTourChanged:function(){var f=tourComboBox.getValue();if(f<=0){return}var e=tourComboBox.getStore().getById(f);if(!Ext.isDefined(e)){return}var d=e.data.n;if(!Ext.isDefined(d)||d.length==0){return}Ext.QuickTips.register({target:tourNoticeIcon,text:d,width:300,dismissDelay:20000});p=tourComboBox.getPosition(false);s=tourComboBox.getSize();tourNoticeIcon.setPosition(p[0]+s.width-48,p[1]-5);tourNoticeIcon.show()}});departureComboBox.addListener("select",tourNoticeIcon.hideNotice);arrivalComboBox.addListener("select",tourNoticeIcon.hideNotice);tourComboBox.addListener("select",tourNoticeIcon.hideNotice);tourComboBox.addListener("select",tourNoticeIcon.onTourChanged);dateFromDateField=new Ext.form.DateField({id:"dateFromDateField",name:"dateFrom",format:"d.m.Y",emptyText:t("From..."),allowBlank:false,triggerAction:"all",forceSelection:true,width:92});dateFromDateField.disabledDatesRE=new RegExp(".*");dateFromDateField.setDisabledDates(null);TourSearch.Data.FlightDaysStore.addListener("load",function(e,f){dateFromDateField.disabledDatesRE=new RegExp(".*");dateFromDateField.setDisabledDates(null);dateToDateField.disabledDatesRE=new RegExp(".*");dateToDateField.setDisabledDates(null);var d=f[0];if(d.data.v.length<=0){Ext.MessageBox.show({msg:t("Can not find the day of departure for the selected tour"),buttons:Ext.MessageBox.OK});return}dateFromDateField.disabledDatesRE=new RegExp("^(?!"+f[0].data.v.replace(/\./g,"\\.")+")");dateFromDateField.setDisabledDates(null)});if(TourSearch.Data.ResultsStore){dateFromDateField.addListener("changed",TourSearch.Data.ResultsStore.onDateFromChanged);dateFromDateField.addListener("select",TourSearch.Data.ResultsStore.onDateFromChanged)}dateToDateField=new Ext.form.DateField({id:"dateToDateField",name:"dateTo",format:"d.m.Y",emptyText:t("To..."),allowBlank:false,triggerAction:"all",forceSelection:true,onDateFromChanged:function(){var g=dateFromDateField.getValue();if(Ext.isEmpty(g)){dateToDateField.clearValue();dateToDateField.disabledDatesRE=new RegExp(".*");dateToDateField.setDisabledDates(null);return}var f=TourSearch.Data.NightsStore.reader.jsonData.data;var e=new Array();for(i=0;i<f.length;i++){e[i]=g.add(Date.DAY,f[i].v).format("d.m.Y")}dateToDateField.disabledDatesRE=new RegExp("^(?!"+e.join("|").replace(/\./g,"\\.")+")");dateToDateField.setDisabledDates(null);var d=nightsComboBox.getValue();if(!Ext.isEmpty(d)){dateToDateField.setValue(g.add(Date.DAY,d))}},onNightsChanged:function(){var d=nightsComboBox.getValue();if(Ext.isEmpty(d)){dateToDateField.clearValue();return}if(!Ext.isEmpty(dateFromDateField.getValue())){dateToDateField.setValue(dateFromDateField.getValue().add(Date.DAY,d))}},width:92,style:"margin-left: 6px"});dateToDateField.disabledDatesRE=new RegExp(".*");dateToDateField.setDisabledDates(null);dateFromDateField.addListener("changed",dateToDateField.onDateFromChanged);dateFromDateField.addListener("select",dateToDateField.onDateFromChanged);nightsComboBox=new Ext.form.ComboBox({id:"nightsComboBox",name:"nights",store:TourSearch.Data.NightsStore,onNightsStoreLoad:function(){if(Ext.isEmpty(dateFromDateField.getValue())){nightsComboBox.clearValue()}},onDateFromChanged:function(){var d=dateFromDateField.getValue();if(Ext.isEmpty(d)){nightsComboBox.clearValue()}},onDateToChanged:function(){var d=dateToDateField.getValue();if(Ext.isEmpty(d)){return}nightsComboBox.setValue(getDaysDiff(dateFromDateField.getValue(),d))},valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",readOnly:true,minChars:1,mode:"local",forceSelection:true,selectOnFocus:true,lazyInit:false,width:50,style:"margin-left: 3px"});TourSearch.Data.NightsStore.addListener("load",nightsComboBox.onNightsStoreLoad);dateFromDateField.addListener("changed",nightsComboBox.onDateFromChanged);dateFromDateField.addListener("select",nightsComboBox.onDateFromChanged);dateToDateField.addListener("changed",nightsComboBox.onDateToChanged);dateToDateField.addListener("select",nightsComboBox.onDateToChanged);nightsComboBox.addListener("focus",nightsComboBox.onTriggerClick);nightsComboBox.addListener("select",dateToDateField.onNightsChanged);if(TourSearch.Data.ResultsStore){nightsComboBox.addListener("select",TourSearch.Data.ResultsStore.onNightsChanged)}durationPanel=new Ext.Panel({layout:"table",fieldLabel:t("Period"),isFormField:true,layoutConfig:{columns:3},items:[dateFromDateField,nightsComboBox,dateToDateField]});starsComboBox=new Ext.form.ComboBox({id:"starsComboBox",name:"stars",fieldLabel:t("Category"),store:TourSearch.Data.StarsStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("Choose category"),selectOnFocus:true,lazyInit:false,listeners:{select:TourSearch.Data.HotelsStore.onStarsChanged},layout:"anchor",anchor:"100%"});starsComboBox.addListener("focus",starsComboBox.onTriggerClick);starsComboBox.addListener("select",TourSearch.Data.MealsStore.onStarsChanged);if(TourSearch.Data.ResultsStore){starsComboBox.addListener("select",TourSearch.Data.ResultsStore.onStarsChanged)}hotelComboBox=new Ext.form.ComboBox({id:"hotelComboBox",name:"hotel",fieldLabel:t("Hotel"),store:TourSearch.Data.HotelsStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,minChars:1,mode:"local",forceSelection:true,emptyText:t("Choose hotel"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});starsComboBox.addListener("select",function(){hotelComboBox.clearValue()});hotelComboBox.addListener("select",TourSearch.Data.MealsStore.onHotelChanged);hotelComboBox.addListener("focus",hotelComboBox.onTriggerClick);if(TourSearch.Data.ResultsStore){hotelComboBox.addListener("select",TourSearch.Data.ResultsStore.onHotelChanged)}mealComboBox=new Ext.form.ComboBox({id:"mealComboBox",name:"meal",fieldLabel:t("Meals"),store:TourSearch.Data.MealsStore,valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,minChars:3,mode:"local",forceSelection:true,emptyText:t("Choose the type of meals"),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%"});mealComboBox.addListener("focus",mealComboBox.onTriggerClick);if(TourSearch.Data.ResultsStore){mealComboBox.addListener("select",TourSearch.Data.ResultsStore.onMealChanged)}departureComboBox.addListener("select",function(){tourComboBox.clearValue();dateFromDateField.reset();dateToDateField.reset();nightsComboBox.clearValue();starsComboBox.clearValue();hotelComboBox.clearValue();mealComboBox.clearValue()});arrivalComboBox.addListener("select",function(){tourComboBox.clearValue();dateFromDateField.reset();dateToDateField.reset();nightsComboBox.clearValue();starsComboBox.clearValue();hotelComboBox.clearValue();mealComboBox.clearValue()});tourComboBox.addListener("select",function(){dateFromDateField.reset();dateToDateField.reset();nightsComboBox.clearValue();starsComboBox.clearValue();hotelComboBox.clearValue();mealComboBox.clearValue()});kidsAgesLabel=new Ext.form.Label({id:"kidsAgesLabel",html:t("Age of child:"),style:"font-size: 11px; margin-left: 4px;"});kidsAgesPanel=new Ext.Panel({layout:"table",fieldLabel:t("Age"),isFormField:true,layoutConfig:{columns:1,rows:4},colspan:3,items:[firstKidAgeComboBox,secondKidAgeComboBox,thirdKidAgeComboBox]});flightAllotmentCheckbox=new Ext.form.Checkbox({id:"flightAllotmentCheckbox",name:"flightAllotment",boxLabel:t("Places for flights"),triggerAction:"all",layout:"anchor",anchor:"100%"});if(TourSearch.Data.ResultsStore){flightAllotmentCheckbox.addListener("check",TourSearch.Data.ResultsStore.onFlightAllotmentChanged)}hotelAllotmentCheckbox=new Ext.form.Checkbox({id:"hotelAllotmentCheckbox",name:"hotelAllotment",boxLabel:t("Places in the hotel"),triggerAction:"all",layout:"anchor",anchor:"100%"});if(TourSearch.Data.ResultsStore){hotelAllotmentCheckbox.addListener("check",TourSearch.Data.ResultsStore.onHotelAllotmentChanged)}hotelAllAllotmentCheckbox=new Ext.form.Checkbox({id:"hotelAllAllotmentCheckbox",name:"hotelAllAllotment",boxLabel:t("Places in the hotel on all days"),triggerAction:"all",layout:"anchor",anchor:"100%"});if(TourSearch.Data.ResultsStore){hotelAllAllotmentCheckbox.addListener("check",TourSearch.Data.ResultsStore.onHotelAllAllotmentChanged)}priceFromNumberField=new Ext.form.ComboBox({id:"priceFromNumberField",name:"priceFrom",store:TourSearch.Data.PriceStore,value:"Any",valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",minChars:3,readOnly:true,mode:"local",forceSelection:true,emptyText:t("From...",1),selectOnFocus:true,lazyInit:false,layout:"anchor",anchor:"100%",width:113});priceFromNumberField.addListener("focus",priceFromNumberField.onTriggerClick);if(TourSearch.Data.ResultsStore){priceFromNumberField.addListener("change",TourSearch.Data.ResultsStore.onPriceFromChanged)}priceToNumberField=new Ext.form.ComboBox({id:"priceToNumberField",name:"priceTo",store:TourSearch.Data.PriceStore,value:"Any",valueField:"v",displayField:"t",allowBlank:false,triggerAction:"all",typeAhead:true,readOnly:true,minChars:3,mode:"local",forceSelection:true,emptyText:t("To...",1),selectOnFocus:true,lazyInit:false,width:113});priceToNumberField.addListener("focus",priceToNumberField.onTriggerClick);if(TourSearch.Data.ResultsStore){priceToNumberField.addListener("change",TourSearch.Data.ResultsStore.onPriceToChanged)}pricePanel=new Ext.Panel({layout:"table",fieldLabel:t("Price"),isFormField:true,layoutConfig:{columns:3},items:[priceFromNumberField,{html:"<b>&nbsp;-&nbsp;</b>",style:"font-size: 11px; margin-left: 4px;"},priceToNumberField]});toXLSButton=new Ext.Button({id:"toXLSButton",text:t("To Excel"),handler:function(){if(!searchFormPanel.getForm().isValid()){return false}var x="/tour_search/find?";var E=departureComboBox.getValue().toString(),r=arrivalComboBox.getValue().toString(),u=tourComboBox.getValue().toString(),q=nightsComboBox.getValue().toString(),C=dateFromDateField.getValue().format("m/d/Y"),y=adultsComboBox.getValue().toString(),f=kidsComboBox.getValue().toString(),o=firstKidAgeComboBox.getValue().toString(),n=secondKidAgeComboBox.getValue().toString(),l=thirdKidAgeComboBox.getValue().toString(),j=starsComboBox.getValue().toString(),D=hotelComboBox.getValue().toString(),A=mealComboBox.getValue().toString(),B=flightAllotmentCheckbox.getValue().toString(),d=hotelAllotmentCheckbox.getValue().toString(),g=hotelAllAllotmentCheckbox.getValue().toString(),e=priceFromNumberField.getValue().toString(),m=priceToNumberField.getValue().toString();x+="fromtown="+E+"&totown="+r+"&tour="+u+"&nights="+q+"&startDate="+C+"&adults_count="+y+"&kids_count="+f+"&kidsAge1="+o+"&kidsAge2="+n+"&kidsAge3="+l+"&stars="+j+"&hotels="+D+"&meal="+A+"&freight_block="+B+"&hotel_block="+d+"&hotel_block_all="+g+"&priceFrom="+e+"&priceTo="+m+"&toExcel=1";var v=800,z=600,k=window.open(x,"_blank","location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,directories=0,width="+v+",height="+z);if(!k.opener){k.opener=window}},minWidth:80});toXLSButton.disable();searchButton=new Ext.Button({id:"searchButton",text:t("Search"),minWidth:80});searchFormPanel=new Ext.form.FormPanel({frame:true,region:"center",labelWidth:60,items:[departureComboBox,arrivalComboBox,tourComboBox,durationPanel,starsComboBox,hotelComboBox,mealComboBox,Ext.isEmpty(adultsSlider)?adultsComboBox:adultsSlider,Ext.isEmpty(kidsSlider)?kidsComboBox:kidsSlider,kidsAgesPanel,{xtype:"panel",cls:"x-form-item",style:"margin-left: 85px;",items:[flightAllotmentCheckbox,hotelAllotmentCheckbox,hotelAllAllotmentCheckbox]},pricePanel,{xtype:"panel",buttonAlign:"center",buttons:[searchButton,toXLSButton]}]});ts_prepare_layout();var c=new Ext.LoadMask(viewport.getEl(),{onStart:function(){c.show()},onFinish:function(){c.hide()}});Ext.Ajax.on("beforerequest",c.onStart);Ext.Ajax.on("requestcomplete",c.onFinish);Ext.Ajax.on("requestexception",c.onFinish);if(!Ext.isEmpty(adultsSlider)){adultsSlider.show()}if(!Ext.isEmpty(kidsSlider)){kidsSlider.show()}var b=Ext.get("hotelAllotmentCheckbox"),a=Ext.get("hotelAllAllotmentCheckbox");b.on("click",function(){if(hotelAllotmentCheckbox.checked){hotelAllAllotmentCheckbox.disable()}else{hotelAllAllotmentCheckbox.enable()}});a.on("click",function(){if(hotelAllAllotmentCheckbox.checked){hotelAllotmentCheckbox.disable()}else{hotelAllotmentCheckbox.enable()}})});