/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var
window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this;}
if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])
selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])
return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret;}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))
return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context;}
return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector));},selector:"",jquery:"1.3.2",size:function(){return this.length;},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num];},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find")
ret.selector=this.selector+(this.selector?" ":"")+selector;else if(name)
ret.selector=this.selector+"."+name+"("+selector+")";return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(typeof name==="string")
if(value===undefined)
return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}
return this.each(function(i){for(name in options)
jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)
value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!=="object"&&text!=null)
return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)
ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode)
wrap.insertBefore(this[0]);wrap.map(function(){var elem=this;while(elem.firstChild)
elem=elem.firstChild;return elem;}).append(this);}
return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},push:[].push,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret;}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem);})),"find",selector);}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}
return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0];}else
return this.cloneNode(true);});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName)
return;var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}
i++;});}
return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1;})),"filter",selector);},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur;}
cur=cur.parentNode;closer++;}});},not:function(selector){if(typeof selector==="string")
if(isSimple.test(selector))
return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector);else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return!!selector&&this.is("."+selector);},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,'option'))
return(elem.attributes.value||{}).specified?elem.value:elem.text;if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)
return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)
return value;values.push(value);}}
return values;}
return(elem.value||"").replace(/\r/g,"");}
return undefined;}
if(typeof value==="number")
value+='';return this.each(function(){if(this.nodeType!=1)
return;if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type))
this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)
this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value===undefined?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,+i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild;if(first)
for(var i=0,l=this.length;i<l;i++)
callback.call(root(this[i],first),this.length>1||i>0?fragment.cloneNode(true):fragment);if(scripts)
jQuery.each(scripts,evalScript);}
return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)
jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)
elem.parentNode.removeChild(elem);}
function now(){return+new Date;}
jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
if(typeof target!=="object"&&!jQuery.isFunction(target))
target={};if(length==i){target=this;--i;}
for(;i<length;i++)
if((options=arguments[i])!=null)
for(var name in options){var src=target[name],copy=options[name];if(target===copy)
continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)
target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)
target[name]=copy;}
return target;};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)
window.jQuery=_jQuery;return jQuery;},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument);},globalEval:function(data){if(data&&/\S/.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval)
script.appendChild(document.createTextNode(data));else
script.text=data;head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object)
if(callback.apply(object[name],args)===false)
break;}else
for(;i<length;)
if(callback.apply(object[i++],args)===false)
break;}else{if(length===undefined){for(name in object)
if(callback.call(object[name],name,object[name])===false)
break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}
return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))
value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))
elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)
elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
callback.call(elem);for(var name in options)
elem.style[name]=old[name];},css:function(elem,name,force,extra){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border")
return;jQuery.each(which,function(){if(!extra)
val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;if(extra==="margin")
val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;else
val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});}
if(elem.offsetWidth!==0)
getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,Math.round(val));}
return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}
if(name.match(/float/i))
name=styleFloat;if(!force&&style&&style[name])
ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))
name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle)
ret=computedStyle.getPropertyValue(name);if(name=="opacity"&&ret=="")
ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
return ret;},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")
context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match)
return[context.createElement(match[1])];}
var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number")
elem+='';if(!elem)
return;if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)
div=div.lastChild;if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)
if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)
tbody[j].parentNode.removeChild(tbody[j]);}
if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))
div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes);}
if(elem.nodeType)
ret.push(elem);else
ret=jQuery.merge(ret,elem);});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1)
ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i]);}}
return scripts;}
return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)
elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)
throw"type property can't be changed";elem[name]=value;}
if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))
return elem.getAttributeNode(name).nodeValue;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined;}
return elem[name];}
if(!jQuery.support.style&&notxml&&name=="style")
return jQuery.attr(elem.style,"cssText",value);if(set)
elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+
(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}
return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}
name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)
try{elem[name]=value;}catch(err){}
return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)
ret[0]=array;else
while(i)
ret[--i]=array[i];}
return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)
if(array[i]===elem)
return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)
if(elem.nodeType!=8)
first[pos++]=elem;}else
while((elem=second[i++])!=null)
first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}
return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)
if(!inv!=!callback(elems[i],i))
ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)
ret[ret.length]=value;}
return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")
ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
return this.pushStack(ret,name,selector);};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)
this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames,state){if(typeof state!=="boolean")
state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)
jQuery.discardElement(this);}},empty:function(){jQuery(this).children().remove();while(this.firstChild)
this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}
var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},discardElement:function(element){var jqGCID='jqGarbageCollector';var jqGC=document.getElementById(jqGCID);if(!jqGC){jqGC=document.createElement('div');jqGC.id=jqGCID;jqGC.style.display='none';document.body.appendChild(jqGC);}
jqGC.appendChild(element);jqGC.innerHTML='';},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)
id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])
jQuery.cache[id]={};if(data!==undefined)
jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])
break;if(!name)
jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)
elem.removeAttribute(expando);}
delete jQuery.cache[id];}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))
q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)
q.push(data);}
return q;},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")
fn=queue[0];if(fn!==undefined)
fn.call(elem);}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)
data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
if(data===undefined)
return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)
queue[0].call(this);});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)
return[];if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector+=parts.shift();set=posProcess(selector,set);}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,isXML(context));}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,context,results,seed);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}}
return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.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(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return /h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return /input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false;}
if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false;}
return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
return ret;};}
(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument);};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0;};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0;};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")";}
return Sizzle.matches(expr,elems);};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)
matched.push(cur);cur=cur[dir];}
return matched;};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])
if(cur.nodeType==1&&++num==result)
break;return cur;};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)
r.push(n);}
return r;};return;window.Sizzle=Sizzle;})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)
return;if(elem.setInterval&&elem!=window)
elem=window;if(!handler.guid)
handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data;}
var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener)
elem.addEventListener(type,handle,false);else if(elem.attachEvent)
elem.attachEvent("on"+type,handle);}}
handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)
return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)=="."))
for(var type in events)
this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}
jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)
delete events[type][handler.guid];else
for(var handle in events[type])
if(namespace.test(events[type][handle].type))
delete events[type][handle];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener)
elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)
elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}
ret=null;delete events[type];}}});}
for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
if(!elem){event.stopPropagation();if(this.global[type])
jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])
jQuery.event.trigger(event,data,this.handle.elem);});}
if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)
handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)
event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}
this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)
jQuery.event.trigger(event,data,parent,true);}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
if(event.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(event){if(event[expando])
return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
if(!event.target)
event.target=event.srcElement||document;if(event.target.nodeType==3)
event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)
event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}
if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))
event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)
event.metaKey=event.ctrlKey;if(!event.which&&event.button)
event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))
remove++;});if(remove<1)
jQuery.event.remove(this,namespaces[0],liveHandler);}}}}};jQuery.Event=function(src){if(!this.preventDefault)
return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type;}else
this.type=src;this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
function returnTrue(){return true;}
jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.preventDefault)
e.preventDefault();e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.stopPropagation)
e.stopPropagation();e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)
try{parent=parent.parentNode;}
catch(e){parent=this;}
if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix);},teardown:function(){jQuery.event.remove(this,orig,withinElement);}};});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)
jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)
fn.call(document,jQuery);else
jQuery.readyList.push(fn);return this;},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this;},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this;}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)
elems.push({elem:elem,fn:fn});}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest");});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
return(stop=false);});return stop;}
function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".");}
jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery);});jQuery.readyList=null;}
jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready();}});if(document.documentElement.doScroll&&window==window.top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
jQuery.ready();})();}
jQuery.event.add(window,"load",jQuery.ready);}
jQuery.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(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)
if(id!=1&&jQuery.cache[id].handle)
jQuery.event.remove(jQuery.cache[id].handle.elem);});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.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 all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee);});div.cloneNode(true).fireEvent("onclick");}
jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';});})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")
return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
var type="GET";if(params)
if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params);type="POST";}
var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")
self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)
self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray: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)||/text|hidden|password|search/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}
return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}
return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.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(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string")
s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))
s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))
s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}
if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)
s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}
if(head)
head.removeChild(script);};}
if(s.dataType=="script"&&s.cache==null)
s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}
if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}
if(s.global&&!jQuery.active++)
jQuery.event.trigger("ajaxStart");var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)
script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;head.removeChild(script);}};}
head.appendChild(script);return undefined;}
var requestDone=false;var xhr=s.xhr();if(s.username)
xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)
xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)
xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}
if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");xhr.abort();return false;}
if(s.global)
jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}}else if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}
status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(e){status="parsererror";}}
if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}
if(s.ifModified&&modRes)
jQuery.lastModified[s.url]=modRes;if(!jsonp)
success();}else
jQuery.handleError(s,xhr,status);complete();if(isTimeout)
xhr.abort();if(s.async)
xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)
setTimeout(function(){if(xhr&&!requestDone)
onreadystatechange("timeout");},s.timeout);}
try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}
if(!s.async)
onreadystatechange();function success(){if(s.success)
s.success(data,status);if(s.global)
jQuery.event.trigger("ajaxSuccess",[xhr,s]);}
function complete(){if(s.complete)
s.complete(xhr,status);if(s.global)
jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}
return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)
jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223;}catch(e){}
return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url];}catch(e){}
return false;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")
throw"parsererror";if(s&&s.dataFilter)
data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")
jQuery.globalEval(data);if(type=="json")
data=window["eval"]("("+data+")");}
return data;},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value);};if(jQuery.isArray(a)||a.jquery)
jQuery.each(a,function(){add(this.name,this.value);});else
for(var j in a)
if(jQuery.isArray(a[j]))
jQuery.each(a[j],function(){add(j,this);});else
add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+");}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName];}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")
display="block";elem.remove();elemdisplay[tagName]=display;}
jQuery.data(this[i],"olddisplay",display);}}
for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||"";}
return this;}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")
jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}
for(var i=0,l=this.length;i<l;i++){this[i].style.display="none";}
return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();}):this.animate(genFx("toggle",3),fn,fn2);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)
return opt.complete.call(this);if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}
if(opt.overflow!=null)
this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))
e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}
if(parts[1])
end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)
this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)
if(timers[i].elem==this){if(gotoEnd)
timers[i](true);timers.splice(i,1);}});if(!gotoEnd)
this.dequeue();return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)
jQuery(this).dequeue();if(jQuery.isFunction(opt.old))
opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)
options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)
this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)
this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))
return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)
if(!timers[i]())
timers.splice(i--,1);if(!timers.length){clearInterval(timerId);timerId=undefined;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)
if(this.options.curAnim[i]!==true)
done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")
this.elem.style.display="block";}
if(this.options.hide)
jQuery(this.elem).hide();if(this.options.hide||this.options.show)
for(var p in this.options.curAnim)
jQuery.attr(this.elem.style,p,this.options.orig[p]);this.options.complete.call(this.elem);}
return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}
return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)
fx.elem.style[fx.prop]=fx.now+fx.unit;else
fx.elem[fx.prop]=fx.now;}}});if(document.documentElement["getBoundingClientRect"])
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};else
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left};};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<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>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true;},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)
top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left};}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return null;return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null;};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");};});})();;(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)data=attr;}if(data.indexOf('{')<0)data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);if(!Array.prototype.push){Array.prototype.push=function(){for(var b=0,a=arguments.length;b<a;b++){this[this.length]=arguments[b]}return this.length}}if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var c=this[0];for(var b=0,a=this.length-1;b<a;b++){this[b]=this[b+1]}this.length=this.length-1;return c}}}if(!Array.prototype.splice){Array.prototype.splice=function(h,e){var b=this.slice(h+e);var c=this.slice(h,h+e);this.length=h;var f=[];for(var d=0,a=arguments.length;d<a;d++){f[d]=arguments[d]}var g=(f.length>2)?b=f.slice(2).concat(b):b;for(d=0,a=g.length;d<a;d++){this.push(g[d])}return c}}var log4javascript;(function(){function isUndefined(obj){return typeof obj=="undefined"}function EventSupport(){}EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(eventTypesParam){if(eventTypesParam instanceof Array){this.eventTypes=eventTypesParam;this.eventListeners={};for(var i=0,len=this.eventTypes.length;i<len;i++){this.eventListeners[this.eventTypes[i]]=[]}}else{handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array")}},addEventListener:function(eventType,listener){if(typeof listener=="function"){if(!array_contains(this.eventTypes,eventType)){handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+eventType+"'")}this.eventListeners[eventType].push(listener)}else{handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function")}},removeEventListener:function(eventType,listener){if(typeof listener=="function"){if(!array_contains(this.eventTypes,eventType)){handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+eventType+"'")}array_remove(this.eventListeners[eventType],listener)}else{handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function")}},dispatchEvent:function(eventType,eventArgs){if(array_contains(this.eventTypes,eventType)){var listeners=this.eventListeners[eventType];for(var i=0,len=listeners.length;i<len;i++){listeners[i](this,eventType,eventArgs)}}else{handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+eventType+"'")}}};var applicationStartDate=new Date();var uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+Math.floor(Math.random()*100000000);var emptyFunction=function(){};var newLine="\r\n";var pageLoaded=false;function Log4JavaScript(){}Log4JavaScript.prototype=new EventSupport();log4javascript=new Log4JavaScript();log4javascript.version="1.4.1";log4javascript.edition="log4javascript";function toStr(obj){if(obj&&obj.toString){return obj.toString()}else{return String(obj)}}function getExceptionMessage(ex){if(ex.message){return ex.message}else{if(ex.description){return ex.description}else{return toStr(ex)}}}function getUrlFileName(url){var lastSlashIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));return url.substr(lastSlashIndex+1)}function getExceptionStringRep(ex){if(ex){var exStr="Exception: "+getExceptionMessage(ex);try{if(ex.lineNumber){exStr+=" on line number "+ex.lineNumber}if(ex.fileName){exStr+=" in file "+getUrlFileName(ex.fileName)}}catch(localEx){logLog.warn("Unable to obtain file and line information for error")}if(showStackTraces&&ex.stack){exStr+=newLine+"Stack trace:"+newLine+ex.stack}return exStr}return null}function bool(obj){return Boolean(obj)}function trim(str){return str.replace(/^\s+/,"").replace(/\s+$/,"")}function splitIntoLines(text){var text2=text.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return text2.split("\n")}function urlEncode(str){return escape(str).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D")}function urlDecode(str){return unescape(str).replace(/%2B/g,"+").replace(/%22/g,'"').replace(/%27/g,"'").replace(/%2F/g,"/").replace(/%3D/g,"=")}function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break}}if(index>=0){arr.splice(index,1);return true}else{return false}}function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true}}return false}function extractBooleanFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue}else{return bool(param)}}function extractStringFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue}else{return String(param)}}function extractIntFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue}else{try{var value=parseInt(param,10);return isNaN(value)?defaultValue:value}catch(ex){logLog.warn("Invalid int param "+param,ex);return defaultValue}}}function extractFunctionFromParam(param,defaultValue){if(typeof param=="function"){return param}else{return defaultValue}}function isError(err){return(err instanceof Error)}if(!Function.prototype.apply){Function.prototype.apply=function(obj,args){var methodName="__apply__";if(typeof obj[methodName]!="undefined"){methodName+=String(Math.random()).substr(2)}obj[methodName]=this;var argsStrings=[];for(var i=0,len=args.length;i<len;i++){argsStrings[i]="args["+i+"]"}var script="obj."+methodName+"("+argsStrings.join(",")+")";var returnValue=eval(script);delete obj[methodName];return returnValue}}if(!Function.prototype.call){Function.prototype.call=function(obj){var args=[];for(var i=1,len=arguments.length;i<len;i++){args[i-1]=arguments[i]}return this.apply(obj,args)}}function getListenersPropertyName(eventName){return"__log4javascript_listeners__"+eventName}function addEvent(node,eventName,listener,useCapture,win){win=win?win:window;if(node.addEventListener){node.addEventListener(eventName,listener,useCapture)}else{if(node.attachEvent){node.attachEvent("on"+eventName,listener)}else{var propertyName=getListenersPropertyName(eventName);if(!node[propertyName]){node[propertyName]=[];node["on"+eventName]=function(evt){evt=getEvent(evt,win);var listenersPropertyName=getListenersPropertyName(eventName);var listeners=this[listenersPropertyName].concat([]);var currentListener;while((currentListener=listeners.shift())){currentListener.call(this,evt)}}}node[propertyName].push(listener)}}}function removeEvent(node,eventName,listener,useCapture){if(node.removeEventListener){node.removeEventListener(eventName,listener,useCapture)}else{if(node.detachEvent){node.detachEvent("on"+eventName,listener)}else{var propertyName=getListenersPropertyName(eventName);if(node[propertyName]){array_remove(node[propertyName],listener)}}}}function getEvent(evt,win){win=win?win:window;return evt?evt:win.event}function stopEventPropagation(evt){if(evt.stopPropagation){evt.stopPropagation()}else{if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true}}evt.returnValue=false}var logLog={quietMode:false,debugMessages:[],setQuietMode:function(quietMode){this.quietMode=bool(quietMode)},numberOfErrors:0,alertAllErrors:false,setAlertAllErrors:function(alertAllErrors){this.alertAllErrors=alertAllErrors},debug:function(message){this.debugMessages.push(message)},displayDebug:function(){alert(this.debugMessages.join(newLine))},warn:function(message,exception){},error:function(message,exception){if(++this.numberOfErrors==1||this.alertAllErrors){if(!this.quietMode){var alertMessage="log4javascript error: "+message;if(exception){alertMessage+=newLine+newLine+"Original error: "+getExceptionStringRep(exception)}alert(alertMessage)}}}};log4javascript.logLog=logLog;log4javascript.setEventTypes(["load","error"]);function handleError(message,exception){logLog.error(message,exception);log4javascript.dispatchEvent("error",{message:message,exception:exception})}log4javascript.handleError=handleError;var enabled=!((typeof log4javascript_disabled!="undefined")&&log4javascript_disabled);log4javascript.setEnabled=function(enable){enabled=bool(enable)};log4javascript.isEnabled=function(){return enabled};var useTimeStampsInMilliseconds=true;log4javascript.setTimeStampsInMilliseconds=function(timeStampsInMilliseconds){useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds)};log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds};log4javascript.evalInScope=function(expr){return eval(expr)};var showStackTraces=false;log4javascript.setShowStackTraces=function(show){showStackTraces=bool(show)};var Level=function(level,name){this.level=level;this.name=name};Level.prototype={toString:function(){return this.name},equals:function(level){return this.level==level.level},isGreaterOrEqual:function(level){return this.level>=level.level}};Level.ALL=new Level(Number.MIN_VALUE,"ALL");Level.TRACE=new Level(10000,"TRACE");Level.DEBUG=new Level(20000,"DEBUG");Level.INFO=new Level(30000,"INFO");Level.WARN=new Level(40000,"WARN");Level.ERROR=new Level(50000,"ERROR");Level.FATAL=new Level(60000,"FATAL");Level.OFF=new Level(Number.MAX_VALUE,"OFF");log4javascript.Level=Level;function Timer(name,level){this.name=name;this.level=isUndefined(level)?Level.INFO:level;this.start=new Date()}Timer.prototype.getElapsedTime=function(){return new Date().getTime()-this.start.getTime()};var anonymousLoggerName="[anonymous]";var defaultLoggerName="[default]";var nullLoggerName="[null]";var rootLoggerName="root";function Logger(name){this.name=name;this.parent=null;this.children=[];var appenders=[];var loggerLevel=null;var isRoot=(this.name===rootLoggerName);var isNull=(this.name===nullLoggerName);var appenderCache=null;var appenderCacheInvalidated=false;this.addChild=function(childLogger){this.children.push(childLogger);childLogger.parent=this;childLogger.invalidateAppenderCache()};var additive=true;this.getAdditivity=function(){return additive};this.setAdditivity=function(additivity){var valueChanged=(additive!=additivity);additive=additivity;if(valueChanged){this.invalidateAppenderCache()}};this.addAppender=function(appender){if(isNull){handleError("Logger.addAppender: you may not add an appender to the null logger")}else{if(appender instanceof log4javascript.Appender){if(!array_contains(appenders,appender)){appenders.push(appender);appender.setAddedToLogger(this);this.invalidateAppenderCache()}}else{handleError("Logger.addAppender: appender supplied ('"+toStr(appender)+"') is not a subclass of Appender")}}};this.removeAppender=function(appender){array_remove(appenders,appender);appender.setRemovedFromLogger(this);this.invalidateAppenderCache()};this.removeAllAppenders=function(){var appenderCount=appenders.length;if(appenderCount>0){for(var i=0;i<appenderCount;i++){appenders[i].setRemovedFromLogger(this)}appenders.length=0;this.invalidateAppenderCache()}};this.getEffectiveAppenders=function(){if(appenderCache===null||appenderCacheInvalidated){var parentEffectiveAppenders=(isRoot||!this.getAdditivity())?[]:this.parent.getEffectiveAppenders();appenderCache=parentEffectiveAppenders.concat(appenders);appenderCacheInvalidated=false}return appenderCache};this.invalidateAppenderCache=function(){appenderCacheInvalidated=true;for(var i=0,len=this.children.length;i<len;i++){this.children[i].invalidateAppenderCache()}};this.log=function(level,params){if(level.isGreaterOrEqual(this.getEffectiveLevel())){var exception;var finalParamIndex=params.length-1;var lastParam=params[params.length-1];if(params.length>1&&isError(lastParam)){exception=lastParam;finalParamIndex--}var messages=[];for(var i=0;i<=finalParamIndex;i++){messages[i]=params[i]}var loggingEvent=new LoggingEvent(this,new Date(),level,messages,exception);this.callAppenders(loggingEvent)}};this.callAppenders=function(loggingEvent){var effectiveAppenders=this.getEffectiveAppenders();for(var i=0,len=effectiveAppenders.length;i<len;i++){effectiveAppenders[i].doAppend(loggingEvent)}};this.setLevel=function(level){if(isRoot&&level===null){handleError("Logger.setLevel: you cannot set the level of the root logger to null")}else{if(level instanceof Level){loggerLevel=level}else{handleError("Logger.setLevel: level supplied to logger "+this.name+" is not an instance of log4javascript.Level")}}};this.getLevel=function(){return loggerLevel};this.getEffectiveLevel=function(){for(var logger=this;logger!==null;logger=logger.parent){var level=logger.getLevel();if(level!==null){return level}}};this.group=function(name,initiallyExpanded){var effectiveAppenders=this.getEffectiveAppenders();for(var i=0,len=effectiveAppenders.length;i<len;i++){effectiveAppenders[i].group(name,initiallyExpanded)}};this.groupEnd=function(name){var effectiveAppenders=this.getEffectiveAppenders();for(var i=0,len=effectiveAppenders.length;i<len;i++){effectiveAppenders[i].groupEnd()}};var timers={};this.time=function(name,level){if(isUndefined(name)){handleError("Logger.time: a name for the timer must be supplied")}else{if(level&&!(level instanceof Level)){handleError("Logger.time: level supplied to timer "+name+" is not an instance of log4javascript.Level")}else{timers[name]=new Timer(name,level)}}};this.timeEnd=function(name){if(isUndefined(name)){handleError("Logger.timeEnd: a name for the timer must be supplied")}else{if(timers[name]){var timer=timers[name];var milliseconds=timer.getElapsedTime();this.log(timer.level,["Timer "+toStr(name)+" completed in "+milliseconds+"ms"]);delete timers[name]}else{logLog.warn("Logger.timeEnd: no timer found with name "+name)}}};this.assert=function(expr){if(!expr){var args=[];for(var i=1,len=arguments.length;i<len;i++){args.push(arguments[i])}args=(args.length>0)?args:["Assertion Failure"];args.push(newLine);args.push(expr);this.log(Level.ERROR,args)}};this.toString=function(){return"Logger["+this.name+"]"}}Logger.prototype={trace:function(){this.log(Level.TRACE,arguments)},debug:function(){this.log(Level.DEBUG,arguments)},info:function(){this.log(Level.INFO,arguments)},warn:function(){this.log(Level.WARN,arguments)},error:function(){this.log(Level.ERROR,arguments)},fatal:function(){this.log(Level.FATAL,arguments)},isEnabledFor:function(level){return level.isGreaterOrEqual(this.getEffectiveLevel())},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE)},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG)},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO)},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN)},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR)},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL)}};Logger.prototype.trace.isEntryPoint=true;Logger.prototype.debug.isEntryPoint=true;Logger.prototype.info.isEntryPoint=true;Logger.prototype.warn.isEntryPoint=true;Logger.prototype.error.isEntryPoint=true;Logger.prototype.fatal.isEntryPoint=true;var loggers={};var loggerNames=[];var ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG;var rootLogger=new Logger(rootLoggerName);rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL);log4javascript.getRootLogger=function(){return rootLogger};log4javascript.getLogger=function(loggerName){if(!(typeof loggerName=="string")){loggerName=anonymousLoggerName;logLog.warn("log4javascript.getLogger: non-string logger name "+toStr(loggerName)+" supplied, returning anonymous logger")}if(loggerName==rootLoggerName){handleError("log4javascript.getLogger: root logger may not be obtained by name")}if(!loggers[loggerName]){var logger=new Logger(loggerName);loggers[loggerName]=logger;loggerNames.push(loggerName);var lastDotIndex=loggerName.lastIndexOf(".");var parentLogger;if(lastDotIndex>-1){var parentLoggerName=loggerName.substring(0,lastDotIndex);parentLogger=log4javascript.getLogger(parentLoggerName)}else{parentLogger=rootLogger}parentLogger.addChild(logger)}return loggers[loggerName]};var defaultLogger=null;log4javascript.getDefaultLogger=function(){if(!defaultLogger){defaultLogger=log4javascript.getLogger(defaultLoggerName);var a=new log4javascript.PopUpAppender();defaultLogger.addAppender(a)}return defaultLogger};var nullLogger=null;log4javascript.getNullLogger=function(){if(!nullLogger){nullLogger=new Logger(nullLoggerName);nullLogger.setLevel(Level.OFF)}return nullLogger};log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL);loggers={}};var LoggingEvent=function(logger,timeStamp,level,messages,exception){this.logger=logger;this.timeStamp=timeStamp;this.timeStampInMilliseconds=timeStamp.getTime();this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1000);this.milliseconds=this.timeStamp.getMilliseconds();this.level=level;this.messages=messages;this.exception=exception};LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):""},getCombinedMessages:function(){return(this.messages.length==1)?this.messages[0]:this.messages.join(newLine)},toString:function(){return"LoggingEvent["+this.level+"]"}};log4javascript.LoggingEvent=LoggingEvent;var Layout=function(){};Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:false,overrideTimeStampsSetting:false,useTimeStampsInMilliseconds:null,format:function(loggingEvent){handleError("Layout.format: layout supplied has no format() method")},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method")},getContentType:function(){return"text/plain"},allowBatching:function(){return true},setTimeStampsInMilliseconds:function(timeStampsInMilliseconds){this.overrideTimeStampsSetting=true;this.useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds)},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds},getTimeStampValue:function(loggingEvent){return this.isTimeStampsInMilliseconds()?loggingEvent.timeStampInMilliseconds:loggingEvent.timeStampInSeconds},getDataValues:function(loggingEvent,combineMessages){var dataValues=[[this.loggerKey,loggingEvent.logger.name],[this.timeStampKey,this.getTimeStampValue(loggingEvent)],[this.levelKey,loggingEvent.level.name],[this.urlKey,window.location.href],[this.messageKey,combineMessages?loggingEvent.getCombinedMessages():loggingEvent.messages]];if(!this.isTimeStampsInMilliseconds()){dataValues.push([this.millisecondsKey,loggingEvent.milliseconds])}if(loggingEvent.exception){dataValues.push([this.exceptionKey,getExceptionStringRep(loggingEvent.exception)])}if(this.hasCustomFields()){for(var i=0,len=this.customFields.length;i<len;i++){var val=this.customFields[i].value;if(typeof val==="function"){val=val(this,loggingEvent)}dataValues.push([this.customFields[i].name,val])}}return dataValues},setKeys:function(loggerKey,timeStampKey,levelKey,messageKey,exceptionKey,urlKey,millisecondsKey){this.loggerKey=extractStringFromParam(loggerKey,this.defaults.loggerKey);this.timeStampKey=extractStringFromParam(timeStampKey,this.defaults.timeStampKey);this.levelKey=extractStringFromParam(levelKey,this.defaults.levelKey);this.messageKey=extractStringFromParam(messageKey,this.defaults.messageKey);this.exceptionKey=extractStringFromParam(exceptionKey,this.defaults.exceptionKey);this.urlKey=extractStringFromParam(urlKey,this.defaults.urlKey);this.millisecondsKey=extractStringFromParam(millisecondsKey,this.defaults.millisecondsKey)},setCustomField:function(name,value){var fieldUpdated=false;for(var i=0,len=this.customFields.length;i<len;i++){if(this.customFields[i].name===name){this.customFields[i].value=value;fieldUpdated=true}}if(!fieldUpdated){this.customFields.push({name:name,value:value})}},hasCustomFields:function(){return(this.customFields.length>0)},toString:function(){handleError("Layout.toString: all layouts must override this method")}};log4javascript.Layout=Layout;var Appender=function(){};Appender.prototype=new EventSupport();Appender.prototype.layout=new PatternLayout();Appender.prototype.threshold=Level.ALL;Appender.prototype.loggers=[];Appender.prototype.doAppend=function(loggingEvent){if(enabled&&loggingEvent.level.level>=this.threshold.level){this.append(loggingEvent)}};Appender.prototype.append=function(loggingEvent){};Appender.prototype.setLayout=function(layout){if(layout instanceof Layout){this.layout=layout}else{handleError("Appender.setLayout: layout supplied to "+this.toString()+" is not a subclass of Layout")}};Appender.prototype.getLayout=function(){return this.layout};Appender.prototype.setThreshold=function(threshold){if(threshold instanceof Level){this.threshold=threshold}else{handleError("Appender.setThreshold: threshold supplied to "+this.toString()+" is not a subclass of Level")}};Appender.prototype.getThreshold=function(){return this.threshold};Appender.prototype.setAddedToLogger=function(logger){this.loggers.push(logger)};Appender.prototype.setRemovedFromLogger=function(logger){array_remove(this.loggers,logger)};Appender.prototype.group=emptyFunction;Appender.prototype.groupEnd=emptyFunction;Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method")};log4javascript.Appender=Appender;function SimpleLayout(){this.customFields=[]}SimpleLayout.prototype=new Layout();SimpleLayout.prototype.format=function(loggingEvent){return loggingEvent.level.name+" - "+loggingEvent.getCombinedMessages()};SimpleLayout.prototype.ignoresThrowable=function(){return true};SimpleLayout.prototype.toString=function(){return"SimpleLayout"};log4javascript.SimpleLayout=SimpleLayout;function NullLayout(){this.customFields=[]}NullLayout.prototype=new Layout();NullLayout.prototype.format=function(loggingEvent){return loggingEvent.messages};NullLayout.prototype.ignoresThrowable=function(){return true};NullLayout.prototype.toString=function(){return"NullLayout"};log4javascript.NullLayout=NullLayout;function XmlLayout(combineMessages){this.combineMessages=extractBooleanFromParam(combineMessages,true);this.customFields=[]}XmlLayout.prototype=new Layout();XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages};XmlLayout.prototype.getContentType=function(){return"text/xml"};XmlLayout.prototype.escapeCdata=function(str){return str.replace(/\]\]>/,"]]>]]&gt;<![CDATA[")};XmlLayout.prototype.format=function(loggingEvent){var layout=this;var i,len;function formatMessage(message){message=(typeof message==="string")?message:toStr(message);return"<log4javascript:message><![CDATA["+layout.escapeCdata(message)+"]]></log4javascript:message>"}var str='<log4javascript:event logger="'+loggingEvent.logger.name+'" timestamp="'+this.getTimeStampValue(loggingEvent)+'"';if(!this.isTimeStampsInMilliseconds()){str+=' milliseconds="'+loggingEvent.milliseconds+'"'}str+=' level="'+loggingEvent.level.name+'">'+newLine;if(this.combineMessages){str+=formatMessage(loggingEvent.getCombinedMessages())}else{str+="<log4javascript:messages>"+newLine;for(i=0,len=loggingEvent.messages.length;i<len;i++){str+=formatMessage(loggingEvent.messages[i])+newLine}str+="</log4javascript:messages>"+newLine}if(this.hasCustomFields()){for(i=0,len=this.customFields.length;i<len;i++){str+='<log4javascript:customfield name="'+this.customFields[i].name+'"><![CDATA['+this.customFields[i].value.toString()+"]]></log4javascript:customfield>"+newLine}}if(loggingEvent.exception){str+="<log4javascript:exception><![CDATA["+getExceptionStringRep(loggingEvent.exception)+"]]></log4javascript:exception>"+newLine}str+="</log4javascript:event>"+newLine+newLine;return str};XmlLayout.prototype.ignoresThrowable=function(){return false};XmlLayout.prototype.toString=function(){return"XmlLayout"};log4javascript.XmlLayout=XmlLayout;function escapeNewLines(str){return str.replace(/\r\n|\r|\n/g,"\\r\\n")}function JsonLayout(readable,combineMessages){this.readable=extractBooleanFromParam(readable,false);this.combineMessages=extractBooleanFromParam(combineMessages,true);this.batchHeader=this.readable?"["+newLine:"[";this.batchFooter=this.readable?"]"+newLine:"]";this.batchSeparator=this.readable?","+newLine:",";this.setKeys();this.colon=this.readable?": ":":";this.tab=this.readable?"\t":"";this.lineBreak=this.readable?newLine:"";this.customFields=[]}JsonLayout.prototype=new Layout();JsonLayout.prototype.isReadable=function(){return this.readable};JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages};JsonLayout.prototype.format=function(loggingEvent){var layout=this;var dataValues=this.getDataValues(loggingEvent,this.combineMessages);var str="{"+this.lineBreak;var i;function formatValue(val,prefix,expand){var formattedValue;var valType=typeof val;if(val instanceof Date){formattedValue=String(val.getTime())}else{if(expand&&(val instanceof Array)){formattedValue="["+layout.lineBreak;for(i=0,len=val.length;i<len;i++){var childPrefix=prefix+layout.tab;formattedValue+=childPrefix+formatValue(val[i],childPrefix,false);if(i<val.length-1){formattedValue+=","}formattedValue+=layout.lineBreak}formattedValue+=prefix+"]"}else{if(valType!=="number"&&valType!=="boolean"){formattedValue='"'+escapeNewLines(toStr(val).replace(/\"/g,'\\"'))+'"'}else{formattedValue=val}}}return formattedValue}for(i=0,len=dataValues.length;i<len;i++){str+=this.tab+'"'+dataValues[i][0]+'"'+this.colon+formatValue(dataValues[i][1],this.tab,true);if(i<dataValues.length-1){str+=","}str+=this.lineBreak}str+="}"+this.lineBreak;return str};JsonLayout.prototype.ignoresThrowable=function(){return false};JsonLayout.prototype.toString=function(){return"JsonLayout"};JsonLayout.prototype.getContentType=function(){return"application/json"};log4javascript.JsonLayout=JsonLayout;function HttpPostDataLayout(){this.setKeys();this.customFields=[];this.returnsPostData=true}HttpPostDataLayout.prototype=new Layout();HttpPostDataLayout.prototype.allowBatching=function(){return false};HttpPostDataLayout.prototype.format=function(loggingEvent){var dataValues=this.getDataValues(loggingEvent);var queryBits=[];for(var i=0,len=dataValues.length;i<len;i++){var val=(dataValues[i][1]instanceof Date)?String(dataValues[i][1].getTime()):dataValues[i][1];queryBits.push(urlEncode(dataValues[i][0])+"="+urlEncode(val))}return queryBits.join("&")};HttpPostDataLayout.prototype.ignoresThrowable=function(loggingEvent){return false};HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout"};log4javascript.HttpPostDataLayout=HttpPostDataLayout;function formatObjectExpansion(obj,depth,indentation){var objectsExpanded=[];function doFormat(obj,depth,indentation){var i,j,len,childDepth,childIndentation,childLines,expansion,childExpansion;if(!indentation){indentation=""}function formatString(text){var lines=splitIntoLines(text);for(var j=1,jLen=lines.length;j<jLen;j++){lines[j]=indentation+lines[j]}return lines.join(newLine)}if(obj===null){return"null"}else{if(typeof obj=="undefined"){return"undefined"}else{if(typeof obj=="string"){return formatString(obj)}else{if(typeof obj=="object"&&array_contains(objectsExpanded,obj)){try{expansion=toStr(obj)}catch(ex){expansion="Error formatting property. Details: "+getExceptionStringRep(ex)}return expansion+" [already expanded]"}else{if((obj instanceof Array)&&depth>0){objectsExpanded.push(obj);expansion="["+newLine;childDepth=depth-1;childIndentation=indentation+"  ";childLines=[];for(i=0,len=obj.length;i<len;i++){try{childExpansion=doFormat(obj[i],childDepth,childIndentation);childLines.push(childIndentation+childExpansion)}catch(ex){childLines.push(childIndentation+"Error formatting array member. Details: "+getExceptionStringRep(ex)+"")}}expansion+=childLines.join(","+newLine)+newLine+indentation+"]";return expansion}else{if(typeof obj=="object"&&depth>0){objectsExpanded.push(obj);expansion="{"+newLine;childDepth=depth-1;childIndentation=indentation+"  ";childLines=[];for(i in obj){try{childExpansion=doFormat(obj[i],childDepth,childIndentation);childLines.push(childIndentation+i+": "+childExpansion)}catch(ex){childLines.push(childIndentation+i+": Error formatting property. Details: "+getExceptionStringRep(ex))}}expansion+=childLines.join(","+newLine)+newLine+indentation+"}";return expansion}else{return formatString(toStr(obj))}}}}}}}return doFormat(obj,depth,indentation)}var SimpleDateFormat;(function(){var regex=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/;var monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];var dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var TEXT2=0,TEXT3=1,NUMBER=2,YEAR=3,MONTH=4,TIMEZONE=5;var types={G:TEXT2,y:YEAR,M:MONTH,w:NUMBER,W:NUMBER,D:NUMBER,d:NUMBER,F:NUMBER,E:TEXT3,a:TEXT2,H:NUMBER,k:NUMBER,K:NUMBER,h:NUMBER,m:NUMBER,s:NUMBER,S:NUMBER,Z:TIMEZONE};var ONE_DAY=24*60*60*1000;var ONE_WEEK=7*ONE_DAY;var DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK=1;var newDateAtMidnight=function(year,month,day){var d=new Date(year,month,day,0,0,0);d.setMilliseconds(0);return d};Date.prototype.getDifference=function(date){return this.getTime()-date.getTime()};Date.prototype.isBefore=function(d){return this.getTime()<d.getTime()};Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};Date.prototype.getTimeSince=function(d){return this.getUTCTime()-d.getUTCTime()};Date.prototype.getPreviousSunday=function(){var midday=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0);var previousSunday=new Date(midday.getTime()-this.getDay()*ONE_DAY);return newDateAtMidnight(previousSunday.getFullYear(),previousSunday.getMonth(),previousSunday.getDate())};Date.prototype.getWeekInYear=function(minimalDaysInFirstWeek){if(isUndefined(this.minimalDaysInFirstWeek)){minimalDaysInFirstWeek=DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK}var previousSunday=this.getPreviousSunday();var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);var numberOfSundays=previousSunday.isBefore(startOfYear)?0:1+Math.floor(previousSunday.getTimeSince(startOfYear)/ONE_WEEK);var numberOfDaysInFirstWeek=7-startOfYear.getDay();var weekInYear=numberOfSundays;if(numberOfDaysInFirstWeek<minimalDaysInFirstWeek){weekInYear--}return weekInYear};Date.prototype.getWeekInMonth=function(minimalDaysInFirstWeek){if(isUndefined(this.minimalDaysInFirstWeek)){minimalDaysInFirstWeek=DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK}var previousSunday=this.getPreviousSunday();var startOfMonth=newDateAtMidnight(this.getFullYear(),this.getMonth(),1);var numberOfSundays=previousSunday.isBefore(startOfMonth)?0:1+Math.floor(previousSunday.getTimeSince(startOfMonth)/ONE_WEEK);var numberOfDaysInFirstWeek=7-startOfMonth.getDay();var weekInMonth=numberOfSundays;if(numberOfDaysInFirstWeek>=minimalDaysInFirstWeek){weekInMonth++}return weekInMonth};Date.prototype.getDayInYear=function(){var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);return 1+Math.floor(this.getTimeSince(startOfYear)/ONE_DAY)};SimpleDateFormat=function(formatString){this.formatString=formatString};SimpleDateFormat.prototype.setMinimalDaysInFirstWeek=function(days){this.minimalDaysInFirstWeek=days};SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK:this.minimalDaysInFirstWeek};var padWithZeroes=function(str,len){while(str.length<len){str="0"+str}return str};var formatText=function(data,numberOfLetters,minLength){return(numberOfLetters>=4)?data:data.substr(0,Math.max(minLength,numberOfLetters))};var formatNumber=function(data,numberOfLetters){var dataString=""+data;return padWithZeroes(dataString,numberOfLetters)};SimpleDateFormat.prototype.format=function(date){var formattedString="";var result;var searchString=this.formatString;while((result=regex.exec(searchString))){var quotedString=result[1];var patternLetters=result[2];var otherLetters=result[3];var otherCharacters=result[4];if(quotedString){if(quotedString=="''"){formattedString+="'"}else{formattedString+=quotedString.substring(1,quotedString.length-1)}}else{if(otherLetters){}else{if(otherCharacters){formattedString+=otherCharacters}else{if(patternLetters){var patternLetter=patternLetters.charAt(0);var numberOfLetters=patternLetters.length;var rawData="";switch(patternLetter){case"G":rawData="AD";break;case"y":rawData=date.getFullYear();break;case"M":rawData=date.getMonth();break;case"w":rawData=date.getWeekInYear(this.getMinimalDaysInFirstWeek());break;case"W":rawData=date.getWeekInMonth(this.getMinimalDaysInFirstWeek());break;case"D":rawData=date.getDayInYear();break;case"d":rawData=date.getDate();break;case"F":rawData=1+Math.floor((date.getDate()-1)/7);break;case"E":rawData=dayNames[date.getDay()];break;case"a":rawData=(date.getHours()>=12)?"PM":"AM";break;case"H":rawData=date.getHours();break;case"k":rawData=date.getHours()||24;break;case"K":rawData=date.getHours()%12;break;case"h":rawData=(date.getHours()%12)||12;break;case"m":rawData=date.getMinutes();break;case"s":rawData=date.getSeconds();break;case"S":rawData=date.getMilliseconds();break;case"Z":rawData=date.getTimezoneOffset();break}switch(types[patternLetter]){case TEXT2:formattedString+=formatText(rawData,numberOfLetters,2);break;case TEXT3:formattedString+=formatText(rawData,numberOfLetters,3);break;case NUMBER:formattedString+=formatNumber(rawData,numberOfLetters);break;case YEAR:if(numberOfLetters<=3){var dataString=""+rawData;formattedString+=dataString.substr(2,2)}else{formattedString+=formatNumber(rawData,numberOfLetters)}break;case MONTH:if(numberOfLetters>=3){formattedString+=formatText(monthNames[rawData],numberOfLetters,numberOfLetters)}else{formattedString+=formatNumber(rawData+1,numberOfLetters)}break;case TIMEZONE:var isPositive=(rawData>0);var prefix=isPositive?"-":"+";var absData=Math.abs(rawData);var hours=""+Math.floor(absData/60);hours=padWithZeroes(hours,2);var minutes=""+(absData%60);minutes=padWithZeroes(minutes,2);formattedString+=prefix+hours+minutes;break}}}}}searchString=searchString.substr(result.index+result[0].length)}return formattedString}})();log4javascript.SimpleDateFormat=SimpleDateFormat;function PatternLayout(pattern){if(pattern){this.pattern=pattern}else{this.pattern=PatternLayout.DEFAULT_CONVERSION_PATTERN}this.customFields=[]}PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n";PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n";PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS";PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS";PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS";PatternLayout.prototype=new Layout();PatternLayout.prototype.format=function(loggingEvent){var regex=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/;var formattedString="";var result;var searchString=this.pattern;while((result=regex.exec(searchString))){var matchedString=result[0];var padding=result[1];var truncation=result[2];var conversionCharacter=result[3];var specifier=result[5];var text=result[6];if(text){formattedString+=""+text}else{var replacement="";switch(conversionCharacter){case"a":case"m":var depth=0;if(specifier){depth=parseInt(specifier,10);if(isNaN(depth)){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character '"+conversionCharacter+"' - should be a number");depth=0}}var messages=(conversionCharacter==="a")?loggingEvent.messages[0]:loggingEvent.messages;for(var i=0,len=messages.length;i<len;i++){if(i>0&&(replacement.charAt(replacement.length-1)!==" ")){replacement+=" "}if(depth===0){replacement+=messages[i]}else{replacement+=formatObjectExpansion(messages[i],depth)}}break;case"c":var loggerName=loggingEvent.logger.name;if(specifier){var precision=parseInt(specifier,10);var loggerNameBits=loggingEvent.logger.name.split(".");if(precision>=loggerNameBits.length){replacement=loggerName}else{replacement=loggerNameBits.slice(loggerNameBits.length-precision).join(".")}}else{replacement=loggerName}break;case"d":var dateFormat=PatternLayout.ISO8601_DATEFORMAT;if(specifier){dateFormat=specifier;if(dateFormat=="ISO8601"){dateFormat=PatternLayout.ISO8601_DATEFORMAT}else{if(dateFormat=="ABSOLUTE"){dateFormat=PatternLayout.ABSOLUTETIME_DATEFORMAT}else{if(dateFormat=="DATE"){dateFormat=PatternLayout.DATETIME_DATEFORMAT}}}}replacement=(new SimpleDateFormat(dateFormat)).format(loggingEvent.timeStamp);break;case"f":if(this.hasCustomFields()){var fieldIndex=0;if(specifier){fieldIndex=parseInt(specifier,10);if(isNaN(fieldIndex)){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - should be a number")}else{if(fieldIndex===0){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - must be greater than zero")}else{if(fieldIndex>this.customFields.length){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - there aren't that many custom fields")}else{fieldIndex=fieldIndex-1}}}}replacement=this.customFields[fieldIndex].value}break;case"n":replacement=newLine;break;case"p":replacement=loggingEvent.level.name;break;case"r":replacement=""+loggingEvent.timeStamp.getDifference(applicationStartDate);break;case"%":replacement="%";break;default:replacement=matchedString;break}var l;if(truncation){l=parseInt(truncation.substr(1),10);var strLen=replacement.length;if(l<strLen){replacement=replacement.substring(strLen-l,strLen)}}if(padding){if(padding.charAt(0)=="-"){l=parseInt(padding.substr(1),10);while(replacement.length<l){replacement+=" "}}else{l=parseInt(padding,10);while(replacement.length<l){replacement=" "+replacement}}}formattedString+=replacement}searchString=searchString.substr(result.index+result[0].length)}return formattedString};PatternLayout.prototype.ignoresThrowable=function(){return true};PatternLayout.prototype.toString=function(){return"PatternLayout"};log4javascript.PatternLayout=PatternLayout;function AlertAppender(){}AlertAppender.prototype=new Appender();AlertAppender.prototype.layout=new SimpleLayout();AlertAppender.prototype.append=function(loggingEvent){var formattedMessage=this.getLayout().format(loggingEvent);if(this.getLayout().ignoresThrowable()){formattedMessage+=loggingEvent.getThrowableStrRep()}alert(formattedMessage)};AlertAppender.prototype.toString=function(){return"AlertAppender"};log4javascript.AlertAppender=AlertAppender;function BrowserConsoleAppender(){}BrowserConsoleAppender.prototype=new log4javascript.Appender();BrowserConsoleAppender.prototype.layout=new NullLayout();BrowserConsoleAppender.prototype.threshold=Level.DEBUG;BrowserConsoleAppender.prototype.append=function(loggingEvent){var appender=this;var getFormattedMessage=function(){var layout=appender.getLayout();var formattedMessage=layout.format(loggingEvent);if(layout.ignoresThrowable()&&loggingEvent.exception){formattedMessage+=loggingEvent.getThrowableStrRep()}return formattedMessage};if((typeof opera!="undefined")&&opera.postError){opera.postError(getFormattedMessage())}else{if(window.console&&window.console.log){var formattedMesage=getFormattedMessage();if(window.console.debug&&Level.DEBUG.isGreaterOrEqual(loggingEvent.level)){window.console.debug(formattedMesage)}else{if(window.console.info&&Level.INFO.equals(loggingEvent.level)){window.console.info(formattedMesage)}else{if(window.console.warn&&Level.WARN.equals(loggingEvent.level)){window.console.warn(formattedMesage)}else{if(window.console.error&&loggingEvent.level.isGreaterOrEqual(Level.ERROR)){window.console.error(formattedMesage)}else{window.console.log(formattedMesage)}}}}}}};BrowserConsoleAppender.prototype.group=function(name){if(window.console&&window.console.group){window.console.group(name)}};BrowserConsoleAppender.prototype.groupEnd=function(){if(window.console&&window.console.groupEnd){window.console.groupEnd()}};BrowserConsoleAppender.prototype.toString=function(){return"BrowserConsoleAppender"};log4javascript.BrowserConsoleAppender=BrowserConsoleAppender;function getXmlHttp(errorHandler){var xmlHttp=null;if(typeof XMLHttpRequest=="object"||typeof XMLHttpRequest=="function"){xmlHttp=new XMLHttpRequest()}else{try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e1){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e2){if(errorHandler){errorHandler()}else{handleError("getXmlHttp: unable to obtain XMLHttpRequest object")}}}}return xmlHttp}function isHttpRequestSuccessful(xmlHttp){return(isUndefined(xmlHttp.status)||xmlHttp.status===0||(xmlHttp.status>=200&&xmlHttp.status<300))}function AjaxAppender(url){var appender=this;var isSupported=true;if(!url){handleError("AjaxAppender: URL must be specified in constructor");isSupported=false}var timed=this.defaults.timed;var waitForResponse=this.defaults.waitForResponse;var batchSize=this.defaults.batchSize;var timerInterval=this.defaults.timerInterval;var requestSuccessCallback=this.defaults.requestSuccessCallback;var failCallback=this.defaults.failCallback;var postVarName=this.defaults.postVarName;var sendAllOnUnload=this.defaults.sendAllOnUnload;var sessionId=null;var queuedLoggingEvents=[];var queuedRequests=[];var sending=false;var initialized=false;function checkCanConfigure(configOptionName){if(initialized){handleError("AjaxAppender: configuration option '"+configOptionName+"' may not be set after the appender has been initialized");return false}return true}this.getSessionId=function(){return sessionId};this.setSessionId=function(sessionIdParam){sessionId=extractStringFromParam(sessionIdParam,null);this.layout.setCustomField("sessionid",sessionId)};this.setLayout=function(layoutParam){if(checkCanConfigure("layout")){this.layout=layoutParam;if(sessionId!==null){this.setSessionId(sessionId)}}};this.isTimed=function(){return timed};this.setTimed=function(timedParam){if(checkCanConfigure("timed")){timed=bool(timedParam)}};this.getTimerInterval=function(){return timerInterval};this.setTimerInterval=function(timerIntervalParam){if(checkCanConfigure("timerInterval")){timerInterval=extractIntFromParam(timerIntervalParam,timerInterval)}};this.isWaitForResponse=function(){return waitForResponse};this.setWaitForResponse=function(waitForResponseParam){if(checkCanConfigure("waitForResponse")){waitForResponse=bool(waitForResponseParam)}};this.getBatchSize=function(){return batchSize};this.setBatchSize=function(batchSizeParam){if(checkCanConfigure("batchSize")){batchSize=extractIntFromParam(batchSizeParam,batchSize)}};this.isSendAllOnUnload=function(){return sendAllOnUnload};this.setSendAllOnUnload=function(sendAllOnUnloadParam){if(checkCanConfigure("sendAllOnUnload")){sendAllOnUnload=extractIntFromParam(sendAllOnUnloadParam,sendAllOnUnload)}};this.setRequestSuccessCallback=function(requestSuccessCallbackParam){requestSuccessCallback=extractFunctionFromParam(requestSuccessCallbackParam,requestSuccessCallback)};this.setFailCallback=function(failCallbackParam){failCallback=extractFunctionFromParam(failCallbackParam,failCallback)};this.getPostVarName=function(){return postVarName};this.setPostVarName=function(postVarNameParam){if(checkCanConfigure("postVarName")){postVarName=extractStringFromParam(postVarNameParam,postVarName)}};function sendAll(){if(isSupported&&enabled){sending=true;var currentRequestBatch;if(waitForResponse){if(queuedRequests.length>0){currentRequestBatch=queuedRequests.shift();sendRequest(preparePostData(currentRequestBatch),sendAll)}else{sending=false;if(timed){scheduleSending()}}}else{while((currentRequestBatch=queuedRequests.shift())){sendRequest(preparePostData(currentRequestBatch))}sending=false;if(timed){scheduleSending()}}}}this.sendAll=sendAll;function sendAllRemaining(){if(isSupported&&enabled){var actualBatchSize=appender.getLayout().allowBatching()?batchSize:1;var currentLoggingEvent;var postData="";var batchedLoggingEvents=[];while((currentLoggingEvent=queuedLoggingEvents.shift())){batchedLoggingEvents.push(currentLoggingEvent);if(queuedLoggingEvents.length>=actualBatchSize){queuedRequests.push(batchedLoggingEvents);batchedLoggingEvents=[]}}if(batchedLoggingEvents.length>0){queuedRequests.push(batchedLoggingEvents)}waitForResponse=false;timed=false;sendAll()}}function preparePostData(batchedLoggingEvents){var formattedMessages=[];var currentLoggingEvent;var postData="";while((currentLoggingEvent=batchedLoggingEvents.shift())){var currentFormattedMessage=appender.getLayout().format(currentLoggingEvent);if(appender.getLayout().ignoresThrowable()){currentFormattedMessage+=loggingEvent.getThrowableStrRep()}formattedMessages.push(currentFormattedMessage)}if(batchedLoggingEvents.length==1){postData=formattedMessages.join("")}else{postData=appender.getLayout().batchHeader+formattedMessages.join(appender.getLayout().batchSeparator)+appender.getLayout().batchFooter}postData=appender.getLayout().returnsPostData?postData:urlEncode(postVarName)+"="+urlEncode(postData);if(postData.length>0){postData+="&"}return postData+"layout="+urlEncode(appender.getLayout().toString())}function scheduleSending(){setTimeout(sendAll,timerInterval)}function xmlHttpErrorHandler(){var msg="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";handleError(msg);isSupported=false;if(failCallback){failCallback(msg)}}function sendRequest(postData,successCallback){try{var xmlHttp=getXmlHttp(xmlHttpErrorHandler);if(isSupported){if(xmlHttp.overrideMimeType){xmlHttp.overrideMimeType(appender.getLayout().getContentType())}xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(isHttpRequestSuccessful(xmlHttp)){if(requestSuccessCallback){requestSuccessCallback(xmlHttp)}if(successCallback){successCallback(xmlHttp)}}else{var msg="AjaxAppender.append: XMLHttpRequest request to URL "+url+" returned status code "+xmlHttp.status;handleError(msg);if(failCallback){failCallback(msg)}}xmlHttp.onreadystatechange=emptyFunction;xmlHttp=null}};xmlHttp.open("POST",url,true);try{xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(headerEx){var msg="AjaxAppender.append: your browser's XMLHttpRequest implementation does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";handleError(msg);isSupported=false;if(failCallback){failCallback(msg)}return}xmlHttp.send(postData)}}catch(ex){var errMsg="AjaxAppender.append: error sending log message to "+url;handleError(errMsg,ex);isSupported=false;if(failCallback){failCallback(errMsg+". Details: "+getExceptionStringRep(ex))}}}this.append=function(loggingEvent){if(isSupported){if(!initialized){init()}queuedLoggingEvents.push(loggingEvent);var actualBatchSize=this.getLayout().allowBatching()?batchSize:1;if(queuedLoggingEvents.length>=actualBatchSize){var currentLoggingEvent;var postData="";var batchedLoggingEvents=[];while((currentLoggingEvent=queuedLoggingEvents.shift())){batchedLoggingEvents.push(currentLoggingEvent)}queuedRequests.push(batchedLoggingEvents);if(!timed){if(!waitForResponse||(waitForResponse&&!sending)){sendAll()}}}}};function init(){initialized=true;if(sendAllOnUnload){addEvent(window,"unload",sendAllRemaining)}if(timed){scheduleSending()}}}AjaxAppender.prototype=new Appender();AjaxAppender.prototype.defaults={waitForResponse:false,timed:false,timerInterval:1000,batchSize:1,sendAllOnUnload:true,requestSuccessCallback:null,failCallback:null,postVarName:"data"};AjaxAppender.prototype.layout=new HttpPostDataLayout();AjaxAppender.prototype.toString=function(){return"AjaxAppender"};log4javascript.AjaxAppender=AjaxAppender;function setCookie(name,value,days,path){var expires;path=path?"; path="+path:"";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString()}else{expires=""}document.cookie=escape(name)+"="+escape(value)+expires+path}function getCookie(name){var nameEquals=escape(name)+"=";var ca=document.cookie.split(";");for(var i=0,len=ca.length;i<len;i++){var c=ca[i];while(c.charAt(0)===" "){c=c.substring(1,c.length)}if(c.indexOf(nameEquals)===0){return unescape(c.substring(nameEquals.length,c.length))}}return null}function getBaseUrl(){var scripts=document.getElementsByTagName("script");for(var i=0,len=scripts.length;i<len;++i){if(scripts[i].src.indexOf("log4javascript")!=-1){var lastSlash=scripts[i].src.lastIndexOf("/");return(lastSlash==-1)?"":scripts[i].src.substr(0,lastSlash+1)}}return null}function isLoaded(win){try{return bool(win.loaded)}catch(ex){return false}}var ConsoleAppender;(function(){var getConsoleHtmlLines=function(){return['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">',"<head>","<title>log4javascript</title>",'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',"<!-- Make IE8 behave like IE7, having gone to all the trouble of making IE work -->",'<meta http-equiv="X-UA-Compatible" content="IE=7" />','<script type="text/javascript">var isIe = false, isIePre7 = false;<\/script>','<!--[if IE]><script type="text/javascript">isIe = true<\/script><![endif]-->','<!--[if lt IE 7]><script type="text/javascript">isIePre7 = true<\/script><![endif]-->','<script type="text/javascript">',"//<![CDATA[","var loggingEnabled=true;var logQueuedEventsTimer=null;var logEntries=[];var logEntriesAndSeparators=[];var logItems=[];var renderDelay=100;var unrenderedLogItemsExist=false;var rootGroup,currentGroup=null;var loaded=false;var currentLogItem=null;var logMainContainer;function copyProperties(obj,props){for(var i in props){obj[i]=props[i];}}","function LogItem(){}","LogItem.prototype={mainContainer:null,wrappedContainer:null,unwrappedContainer:null,group:null,appendToLog:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].appendToLog();}","this.group.update();},doRemove:function(doUpdate,removeFromGroup){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].remove();}","this.unwrappedElementContainer=null;this.wrappedElementContainer=null;this.mainElementContainer=null;}","if(this.group&&removeFromGroup){this.group.removeChild(this,doUpdate);}","if(this===currentLogItem){currentLogItem=null;}},remove:function(doUpdate,removeFromGroup){this.doRemove(doUpdate,removeFromGroup);},render:function(){},accept:function(visitor){visitor.visit(this);},getUnwrappedDomContainer:function(){return this.group.unwrappedElementContainer.contentDiv;},getWrappedDomContainer:function(){return this.group.wrappedElementContainer.contentDiv;},getMainDomContainer:function(){return this.group.mainElementContainer.contentDiv;}};LogItem.serializedItemKeys={LOG_ENTRY:0,GROUP_START:1,GROUP_END:2};function LogItemContainerElement(){}",'LogItemContainerElement.prototype={appendToLog:function(){var insertBeforeFirst=(newestAtTop&&this.containerDomNode.hasChildNodes());if(insertBeforeFirst){this.containerDomNode.insertBefore(this.mainDiv,this.containerDomNode.firstChild);}else{this.containerDomNode.appendChild(this.mainDiv);}}};function SeparatorElementContainer(containerDomNode){this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="separator";this.mainDiv.innerHTML="&nbsp;";}',"SeparatorElementContainer.prototype=new LogItemContainerElement();SeparatorElementContainer.prototype.remove=function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;};function Separator(){this.rendered=false;}","Separator.prototype=new LogItem();copyProperties(Separator.prototype,{render:function(){var containerDomNode=this.group.contentDiv;if(isIe){this.unwrappedElementContainer=new SeparatorElementContainer(this.getUnwrappedDomContainer());this.wrappedElementContainer=new SeparatorElementContainer(this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new SeparatorElementContainer(this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}",'this.content=this.formattedMessage;this.rendered=true;}});function GroupElementContainer(group,containerDomNode,isRoot,isWrapped){this.group=group;this.containerDomNode=containerDomNode;this.isRoot=isRoot;this.isWrapped=isWrapped;this.expandable=false;if(this.isRoot){if(isIe){this.contentDiv=logMainContainer.appendChild(document.createElement("div"));this.contentDiv.id=this.isWrapped?"log_wrapped":"log_unwrapped";}else{this.contentDiv=logMainContainer;}}else{var groupElementContainer=this;this.mainDiv=document.createElement("div");this.mainDiv.className="group";this.headingDiv=this.mainDiv.appendChild(document.createElement("div"));this.headingDiv.className="groupheading";this.expander=this.headingDiv.appendChild(document.createElement("span"));this.expander.className="expander unselectable greyedout";this.expander.unselectable=true;var expanderText=this.group.expanded?"-":"+";this.expanderTextNode=this.expander.appendChild(document.createTextNode(expanderText));this.headingDiv.appendChild(document.createTextNode(" "+this.group.name));this.contentDiv=this.mainDiv.appendChild(document.createElement("div"));var contentCssClass=this.group.expanded?"expanded":"collapsed";this.contentDiv.className="groupcontent "+contentCssClass;this.expander.onclick=function(){if(groupElementContainer.group.expandable){groupElementContainer.group.toggleExpanded();}};}}','GroupElementContainer.prototype=new LogItemContainerElement();copyProperties(GroupElementContainer.prototype,{toggleExpanded:function(){if(!this.isRoot){var oldCssClass,newCssClass,expanderText;if(this.group.expanded){newCssClass="expanded";oldCssClass="collapsed";expanderText="-";}else{newCssClass="collapsed";oldCssClass="expanded";expanderText="+";}',"replaceClass(this.contentDiv,newCssClass,oldCssClass);this.expanderTextNode.nodeValue=expanderText;}},remove:function(){if(!this.isRoot){this.headingDiv=null;this.expander.onclick=null;this.expander=null;this.expanderTextNode=null;this.contentDiv=null;this.containerDomNode=null;this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;}},reverseChildren:function(){var node=null;var childDomNodes=[];while((node=this.contentDiv.firstChild)){this.contentDiv.removeChild(node);childDomNodes.push(node);}",'while((node=childDomNodes.pop())){this.contentDiv.appendChild(node);}},update:function(){if(!this.isRoot){if(this.group.expandable){removeClass(this.expander,"greyedout");}else{addClass(this.expander,"greyedout");}}},clear:function(){if(this.isRoot){this.contentDiv.innerHTML="";}}});function Group(name,isRoot,initiallyExpanded){this.name=name;this.group=null;this.isRoot=isRoot;this.initiallyExpanded=initiallyExpanded;this.elementContainers=[];this.children=[];this.expanded=initiallyExpanded;this.rendered=false;this.expandable=false;}',"Group.prototype=new LogItem();copyProperties(Group.prototype,{addChild:function(logItem){this.children.push(logItem);logItem.group=this;},render:function(){if(isIe){var unwrappedDomContainer,wrappedDomContainer;if(this.isRoot){unwrappedDomContainer=logMainContainer;wrappedDomContainer=logMainContainer;}else{unwrappedDomContainer=this.getUnwrappedDomContainer();wrappedDomContainer=this.getWrappedDomContainer();}","this.unwrappedElementContainer=new GroupElementContainer(this,unwrappedDomContainer,this.isRoot,false);this.wrappedElementContainer=new GroupElementContainer(this,wrappedDomContainer,this.isRoot,true);this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{var mainDomContainer=this.isRoot?logMainContainer:this.getMainDomContainer();this.mainElementContainer=new GroupElementContainer(this,mainDomContainer,this.isRoot,false);this.elementContainers=[this.mainElementContainer];}","this.rendered=true;},toggleExpanded:function(){this.expanded=!this.expanded;for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].toggleExpanded();}},expand:function(){if(!this.expanded){this.toggleExpanded();}},accept:function(visitor){visitor.visitGroup(this);},reverseChildren:function(){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].reverseChildren();}}},update:function(){var previouslyExpandable=this.expandable;this.expandable=(this.children.length!==0);if(this.expandable!==previouslyExpandable){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].update();}}},flatten:function(){var visitor=new GroupFlattener();this.accept(visitor);return visitor.logEntriesAndSeparators;},removeChild:function(child,doUpdate){array_remove(this.children,child);child.group=null;if(doUpdate){this.update();}},remove:function(doUpdate,removeFromGroup){for(var i=0,len=this.children.length;i<len;i++){this.children[i].remove(false,false);}","this.children=[];this.update();if(this===currentGroup){currentGroup=this.group;}","this.doRemove(doUpdate,removeFromGroup);},serialize:function(items){items.push([LogItem.serializedItemKeys.GROUP_START,this.name]);for(var i=0,len=this.children.length;i<len;i++){this.children[i].serialize(items);}","if(this!==currentGroup){items.push([LogItem.serializedItemKeys.GROUP_END]);}},clear:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clear();}}});function LogEntryElementContainer(){}",'LogEntryElementContainer.prototype=new LogItemContainerElement();copyProperties(LogEntryElementContainer.prototype,{remove:function(){this.doRemove();},doRemove:function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;this.contentElement=null;this.containerDomNode=null;},setContent:function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=content;}},setSearchMatch:function(isMatch){var oldCssClass=isMatch?"searchnonmatch":"searchmatch";var newCssClass=isMatch?"searchmatch":"searchnonmatch";replaceClass(this.mainDiv,newCssClass,oldCssClass);},clearSearch:function(){removeClass(this.mainDiv,"searchmatch");removeClass(this.mainDiv,"searchnonmatch");}});function LogEntryWrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.mainDiv.className="logentry wrapped "+this.logEntry.level;this.contentElement=this.mainDiv;}','LogEntryWrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryWrappedElementContainer.prototype.setContent=function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=wrappedContent;}};function LogEntryUnwrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry unwrapped "+this.logEntry.level;this.pre=this.mainDiv.appendChild(document.createElement("pre"));this.pre.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.pre.className="unwrapped";this.contentElement=this.pre;}','LogEntryUnwrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryUnwrappedElementContainer.prototype.remove=function(){this.doRemove();this.pre=null;};function LogEntryMainElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry nonielogentry "+this.logEntry.level;this.contentElement=this.mainDiv.appendChild(document.createElement("span"));this.contentElement.appendChild(document.createTextNode(this.logEntry.formattedMessage));}',"LogEntryMainElementContainer.prototype=new LogEntryElementContainer();function LogEntry(level,formattedMessage){this.level=level;this.formattedMessage=formattedMessage;this.rendered=false;}",'LogEntry.prototype=new LogItem();copyProperties(LogEntry.prototype,{render:function(){var logEntry=this;var containerDomNode=this.group.contentDiv;if(isIe){this.formattedMessage=this.formattedMessage.replace(/\\r\\n/g,"\\r");this.unwrappedElementContainer=new LogEntryUnwrappedElementContainer(this,this.getUnwrappedDomContainer());this.wrappedElementContainer=new LogEntryWrappedElementContainer(this,this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new LogEntryMainElementContainer(this,this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;},setContent:function(content,wrappedContent){if(content!=this.content){if(isIe&&(content!==this.formattedMessage)){content=content.replace(/\\r\\n/g,"\\r");}',"for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setContent(content,wrappedContent);}",'this.content=content;}},getSearchMatches:function(){var matches=[];var i,len;if(isIe){var unwrappedEls=getElementsByClass(this.unwrappedElementContainer.mainDiv,"searchterm","span");var wrappedEls=getElementsByClass(this.wrappedElementContainer.mainDiv,"searchterm","span");for(i=0,len=unwrappedEls.length;i<len;i++){matches[i]=new Match(this.level,null,unwrappedEls[i],wrappedEls[i]);}}else{var els=getElementsByClass(this.mainElementContainer.mainDiv,"searchterm","span");for(i=0,len=els.length;i<len;i++){matches[i]=new Match(this.level,els[i]);}}',"return matches;},setSearchMatch:function(isMatch){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setSearchMatch(isMatch);}},clearSearch:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clearSearch();}},accept:function(visitor){visitor.visitLogEntry(this);},serialize:function(items){items.push([LogItem.serializedItemKeys.LOG_ENTRY,this.level,this.formattedMessage]);}});function LogItemVisitor(){}","LogItemVisitor.prototype={visit:function(logItem){},visitParent:function(logItem){if(logItem.group){logItem.group.accept(this);}},visitChildren:function(logItem){for(var i=0,len=logItem.children.length;i<len;i++){logItem.children[i].accept(this);}},visitLogEntry:function(logEntry){this.visit(logEntry);},visitSeparator:function(separator){this.visit(separator);},visitGroup:function(group){this.visit(group);}};function GroupFlattener(){this.logEntriesAndSeparators=[];}",'GroupFlattener.prototype=new LogItemVisitor();GroupFlattener.prototype.visitGroup=function(group){this.visitChildren(group);};GroupFlattener.prototype.visitLogEntry=function(logEntry){this.logEntriesAndSeparators.push(logEntry);};GroupFlattener.prototype.visitSeparator=function(separator){this.logEntriesAndSeparators.push(separator);};window.onload=function(){if(location.search){var queryBits=unescape(location.search).substr(1).split("&"),nameValueBits;for(var i=0,len=queryBits.length;i<len;i++){nameValueBits=queryBits[i].split("=");if(nameValueBits[0]=="log4javascript_domain"){document.domain=nameValueBits[1];break;}}}','logMainContainer=$("log");if(isIePre7){addClass(logMainContainer,"oldIe");}','rootGroup=new Group("root",true);rootGroup.render();currentGroup=rootGroup;setCommandInputWidth();setLogContainerHeight();toggleLoggingEnabled();toggleSearchEnabled();toggleSearchFilter();toggleSearchHighlight();applyFilters();checkAllLevels();toggleWrap();toggleNewestAtTop();toggleScrollToLatest();renderQueuedLogItems();loaded=true;$("command").value="";$("command").autocomplete="off";$("command").onkeydown=function(evt){evt=getEvent(evt);if(evt.keyCode==10||evt.keyCode==13){evalCommandLine();stopPropagation(evt);}else if(evt.keyCode==27){this.value="";this.focus();}else if(evt.keyCode==38&&commandHistory.length>0){currentCommandIndex=Math.max(0,currentCommandIndex-1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}else if(evt.keyCode==40&&commandHistory.length>0){currentCommandIndex=Math.min(commandHistory.length-1,currentCommandIndex+1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}};$("command").onkeypress=function(evt){evt=getEvent(evt);if(evt.keyCode==38&&commandHistory.length>0&&evt.preventDefault){evt.preventDefault();}};$("command").onkeyup=function(evt){evt=getEvent(evt);if(evt.keyCode==27&&evt.preventDefault){evt.preventDefault();this.focus();}};document.onkeydown=function keyEventHandler(evt){evt=getEvent(evt);switch(evt.keyCode){case 69:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){evalLastCommand();cancelKeyEvent(evt);return false;}',"break;case 75:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusSearch();cancelKeyEvent(evt);return false;}","break;case 40:case 76:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusCommandLine();cancelKeyEvent(evt);return false;}","break;}};setTimeout(setLogContainerHeight,20);setShowCommandLine(showCommandLine);doSearch();};window.onunload=function(){if(mainWindowExists()){appender.unload();}",'appender=null;};function toggleLoggingEnabled(){setLoggingEnabled($("enableLogging").checked);}',"function setLoggingEnabled(enable){loggingEnabled=enable;}","var appender=null;function setAppender(appenderParam){appender=appenderParam;}",'function setShowCloseButton(showCloseButton){$("closeButton").style.display=showCloseButton?"inline":"none";}','function setShowHideButton(showHideButton){$("hideButton").style.display=showHideButton?"inline":"none";}',"var newestAtTop=false;function LogItemContentReverser(){}","LogItemContentReverser.prototype=new LogItemVisitor();LogItemContentReverser.prototype.visitGroup=function(group){group.reverseChildren();this.visitChildren(group);};function setNewestAtTop(isNewestAtTop){var oldNewestAtTop=newestAtTop;var i,iLen,j,jLen;newestAtTop=Boolean(isNewestAtTop);if(oldNewestAtTop!=newestAtTop){var visitor=new LogItemContentReverser();rootGroup.accept(visitor);if(currentSearch){var currentMatch=currentSearch.matches[currentMatchIndex];var matchIndex=0;var matches=[];var actOnLogEntry=function(logEntry){var logEntryMatches=logEntry.getSearchMatches();for(j=0,jLen=logEntryMatches.length;j<jLen;j++){matches[matchIndex]=logEntryMatches[j];if(currentMatch&&logEntryMatches[j].equals(currentMatch)){currentMatchIndex=matchIndex;}","matchIndex++;}};if(newestAtTop){for(i=logEntries.length-1;i>=0;i--){actOnLogEntry(logEntries[i]);}}else{for(i=0,iLen=logEntries.length;i<iLen;i++){actOnLogEntry(logEntries[i]);}}","currentSearch.matches=matches;if(currentMatch){currentMatch.setCurrent();}}else if(scrollToLatest){doScrollToLatest();}}",'$("newestAtTop").checked=isNewestAtTop;}','function toggleNewestAtTop(){var isNewestAtTop=$("newestAtTop").checked;setNewestAtTop(isNewestAtTop);}',"var scrollToLatest=true;function setScrollToLatest(isScrollToLatest){scrollToLatest=isScrollToLatest;if(scrollToLatest){doScrollToLatest();}",'$("scrollToLatest").checked=isScrollToLatest;}','function toggleScrollToLatest(){var isScrollToLatest=$("scrollToLatest").checked;setScrollToLatest(isScrollToLatest);}','function doScrollToLatest(){var l=logMainContainer;if(typeof l.scrollTop!="undefined"){if(newestAtTop){l.scrollTop=0;}else{var latestLogEntry=l.lastChild;if(latestLogEntry){l.scrollTop=l.scrollHeight;}}}}',"var closeIfOpenerCloses=true;function setCloseIfOpenerCloses(isCloseIfOpenerCloses){closeIfOpenerCloses=isCloseIfOpenerCloses;}","var maxMessages=null;function setMaxMessages(max){maxMessages=max;pruneLogEntries();}",'var showCommandLine=false;function setShowCommandLine(isShowCommandLine){showCommandLine=isShowCommandLine;if(loaded){$("commandLine").style.display=showCommandLine?"block":"none";setCommandInputWidth();setLogContainerHeight();}}','function focusCommandLine(){if(loaded){$("command").focus();}}','function focusSearch(){if(loaded){$("searchBox").focus();}}',"function getLogItems(){var items=[];for(var i=0,len=logItems.length;i<len;i++){logItems[i].serialize(items);}","return items;}","function setLogItems(items){var loggingReallyEnabled=loggingEnabled;loggingEnabled=true;for(var i=0,len=items.length;i<len;i++){switch(items[i][0]){case LogItem.serializedItemKeys.LOG_ENTRY:log(items[i][1],items[i][2]);break;case LogItem.serializedItemKeys.GROUP_START:group(items[i][1]);break;case LogItem.serializedItemKeys.GROUP_END:groupEnd();break;}}","loggingEnabled=loggingReallyEnabled;}","function log(logLevel,formattedMessage){if(loggingEnabled){var logEntry=new LogEntry(logLevel,formattedMessage);logEntries.push(logEntry);logEntriesAndSeparators.push(logEntry);logItems.push(logEntry);currentGroup.addChild(logEntry);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}","logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function renderQueuedLogItems(){logQueuedEventsTimer=null;var pruned=pruneLogEntries();var initiallyHasMatches=currentSearch?currentSearch.hasMatches():false;for(var i=0,len=logItems.length;i<len;i++){if(!logItems[i].rendered){logItems[i].render();logItems[i].appendToLog();if(currentSearch&&(logItems[i]instanceof LogEntry)){currentSearch.applyTo(logItems[i]);}}}","if(currentSearch){if(pruned){if(currentSearch.hasVisibleMatches()){if(currentMatchIndex===null){setCurrentMatchIndex(0);}","displayMatches();}else{displayNoMatches();}}else if(!initiallyHasMatches&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}}","if(scrollToLatest){doScrollToLatest();}","unrenderedLogItemsExist=false;}","function pruneLogEntries(){if((maxMessages!==null)&&(logEntriesAndSeparators.length>maxMessages)){var numberToDelete=logEntriesAndSeparators.length-maxMessages;var prunedLogEntries=logEntriesAndSeparators.slice(0,numberToDelete);if(currentSearch){currentSearch.removeMatches(prunedLogEntries);}","var group;for(var i=0;i<numberToDelete;i++){group=logEntriesAndSeparators[i].group;array_remove(logItems,logEntriesAndSeparators[i]);array_remove(logEntries,logEntriesAndSeparators[i]);logEntriesAndSeparators[i].remove(true,true);if(group.children.length===0&&group!==currentGroup&&group!==rootGroup){array_remove(logItems,group);group.remove(true,true);}}","logEntriesAndSeparators=array_removeFromStart(logEntriesAndSeparators,numberToDelete);return true;}","return false;}",'function group(name,startExpanded){if(loggingEnabled){initiallyExpanded=(typeof startExpanded==="undefined")?true:Boolean(startExpanded);var newGroup=new Group(name,false,initiallyExpanded);currentGroup.addChild(newGroup);currentGroup=newGroup;logItems.push(newGroup);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}',"logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function groupEnd(){currentGroup=(currentGroup===rootGroup)?rootGroup:currentGroup.group;}","function mainPageReloaded(){currentGroup=rootGroup;var separator=new Separator();logEntriesAndSeparators.push(separator);logItems.push(separator);currentGroup.addChild(separator);}","function closeWindow(){if(appender&&mainWindowExists()){appender.close(true);}else{window.close();}}","function hide(){if(appender&&mainWindowExists()){appender.hide();}}",'var mainWindow=window;var windowId="log4javascriptConsoleWindow_"+new Date().getTime()+"_"+(""+Math.random()).substr(2);function setMainWindow(win){mainWindow=win;mainWindow[windowId]=window;if(opener&&closeIfOpenerCloses){pollOpener();}}',"function pollOpener(){if(closeIfOpenerCloses){if(mainWindowExists()){setTimeout(pollOpener,500);}else{closeWindow();}}}","function mainWindowExists(){try{return(mainWindow&&!mainWindow.closed&&mainWindow[windowId]==window);}catch(ex){}","return false;}",'var logLevels=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function getCheckBox(logLevel){return $("switch_"+logLevel);}','function getIeWrappedLogContainer(){return $("log_wrapped");}','function getIeUnwrappedLogContainer(){return $("log_unwrapped");}',"function applyFilters(){for(var i=0;i<logLevels.length;i++){if(getCheckBox(logLevels[i]).checked){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}","updateSearchFromFilters();}",'function toggleAllLevels(){var turnOn=$("switch_ALL").checked;for(var i=0;i<logLevels.length;i++){getCheckBox(logLevels[i]).checked=turnOn;if(turnOn){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}}','function checkAllLevels(){for(var i=0;i<logLevels.length;i++){if(!getCheckBox(logLevels[i]).checked){getCheckBox("ALL").checked=false;return;}}','getCheckBox("ALL").checked=true;}',"function clearLog(){rootGroup.clear();currentGroup=rootGroup;logEntries=[];logItems=[];logEntriesAndSeparators=[];doSearch();}",'function toggleWrap(){var enable=$("wrap").checked;if(enable){addClass(logMainContainer,"wrap");}else{removeClass(logMainContainer,"wrap");}',"refreshCurrentMatch();}","var searchTimer=null;function scheduleSearch(){try{clearTimeout(searchTimer);}catch(ex){}","searchTimer=setTimeout(doSearch,500);}","function Search(searchTerm,isRegex,searchRegex,isCaseSensitive){this.searchTerm=searchTerm;this.isRegex=isRegex;this.searchRegex=searchRegex;this.isCaseSensitive=isCaseSensitive;this.matches=[];}","Search.prototype={hasMatches:function(){return this.matches.length>0;},hasVisibleMatches:function(){if(this.hasMatches()){for(var i=0;i<this.matches.length;i++){if(this.matches[i].isVisible()){return true;}}}","return false;},match:function(logEntry){var entryText=String(logEntry.formattedMessage);var matchesSearch=false;if(this.isRegex){matchesSearch=this.searchRegex.test(entryText);}else if(this.isCaseSensitive){matchesSearch=(entryText.indexOf(this.searchTerm)>-1);}else{matchesSearch=(entryText.toLowerCase().indexOf(this.searchTerm.toLowerCase())>-1);}","return matchesSearch;},getNextVisibleMatchIndex:function(){for(var i=currentMatchIndex+1;i<this.matches.length;i++){if(this.matches[i].isVisible()){return i;}}","for(i=0;i<=currentMatchIndex;i++){if(this.matches[i].isVisible()){return i;}}","return-1;},getPreviousVisibleMatchIndex:function(){for(var i=currentMatchIndex-1;i>=0;i--){if(this.matches[i].isVisible()){return i;}}","for(var i=this.matches.length-1;i>=currentMatchIndex;i--){if(this.matches[i].isVisible()){return i;}}",'return-1;},applyTo:function(logEntry){var doesMatch=this.match(logEntry);if(doesMatch){logEntry.group.expand();logEntry.setSearchMatch(true);var logEntryContent;var wrappedLogEntryContent;var searchTermReplacementStartTag="<span class=\\"searchterm\\">";var searchTermReplacementEndTag="<"+"/span>";var preTagName=isIe?"pre":"span";var preStartTag="<"+preTagName+" class=\\"pre\\">";var preEndTag="<"+"/"+preTagName+">";var startIndex=0;var searchIndex,matchedText,textBeforeMatch;if(this.isRegex){var flags=this.isCaseSensitive?"g":"gi";var capturingRegex=new RegExp("("+this.searchRegex.source+")",flags);var rnd=(""+Math.random()).substr(2);var startToken="%%s"+rnd+"%%";var endToken="%%e"+rnd+"%%";logEntryContent=logEntry.formattedMessage.replace(capturingRegex,startToken+"$1"+endToken);logEntryContent=escapeHtml(logEntryContent);var result;var searchString=logEntryContent;logEntryContent="";wrappedLogEntryContent="";while((searchIndex=searchString.indexOf(startToken,startIndex))>-1){var endTokenIndex=searchString.indexOf(endToken,searchIndex);matchedText=searchString.substring(searchIndex+startToken.length,endTokenIndex);textBeforeMatch=searchString.substring(startIndex,searchIndex);logEntryContent+=preStartTag+textBeforeMatch+preEndTag;logEntryContent+=searchTermReplacementStartTag+preStartTag+matchedText+',"preEndTag+searchTermReplacementEndTag;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=endTokenIndex+endToken.length;}",'logEntryContent+=preStartTag+searchString.substr(startIndex)+preEndTag;if(isIe){wrappedLogEntryContent+=searchString.substr(startIndex);}}else{logEntryContent="";wrappedLogEntryContent="";var searchTermReplacementLength=searchTermReplacementStartTag.length+',"this.searchTerm.length+searchTermReplacementEndTag.length;var searchTermLength=this.searchTerm.length;var searchTermLowerCase=this.searchTerm.toLowerCase();var logTextLowerCase=logEntry.formattedMessage.toLowerCase();while((searchIndex=logTextLowerCase.indexOf(searchTermLowerCase,startIndex))>-1){matchedText=escapeHtml(logEntry.formattedMessage.substr(searchIndex,this.searchTerm.length));textBeforeMatch=escapeHtml(logEntry.formattedMessage.substring(startIndex,searchIndex));var searchTermReplacement=searchTermReplacementStartTag+","preStartTag+matchedText+preEndTag+searchTermReplacementEndTag;logEntryContent+=preStartTag+textBeforeMatch+preEndTag+searchTermReplacement;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=searchIndex+searchTermLength;}","var textAfterLastMatch=escapeHtml(logEntry.formattedMessage.substr(startIndex));logEntryContent+=preStartTag+textAfterLastMatch+preEndTag;if(isIe){wrappedLogEntryContent+=textAfterLastMatch;}}","logEntry.setContent(logEntryContent,wrappedLogEntryContent);var logEntryMatches=logEntry.getSearchMatches();this.matches=this.matches.concat(logEntryMatches);}else{logEntry.setSearchMatch(false);logEntry.setContent(logEntry.formattedMessage,logEntry.formattedMessage);}","return doesMatch;},removeMatches:function(logEntries){var matchesToRemoveCount=0;var currentMatchRemoved=false;var matchesToRemove=[];var i,iLen,j,jLen;for(i=0,iLen=this.matches.length;i<iLen;i++){for(j=0,jLen=logEntries.length;j<jLen;j++){if(this.matches[i].belongsTo(logEntries[j])){matchesToRemove.push(this.matches[i]);if(i===currentMatchIndex){currentMatchRemoved=true;}}}}","var newMatch=currentMatchRemoved?null:this.matches[currentMatchIndex];if(currentMatchRemoved){for(i=currentMatchIndex,iLen=this.matches.length;i<iLen;i++){if(this.matches[i].isVisible()&&!array_contains(matchesToRemove,this.matches[i])){newMatch=this.matches[i];break;}}}","for(i=0,iLen=matchesToRemove.length;i<iLen;i++){array_remove(this.matches,matchesToRemove[i]);matchesToRemove[i].remove();}","if(this.hasVisibleMatches()){if(newMatch===null){setCurrentMatchIndex(0);}else{var newMatchIndex=0;for(i=0,iLen=this.matches.length;i<iLen;i++){if(newMatch===this.matches[i]){newMatchIndex=i;break;}}","setCurrentMatchIndex(newMatchIndex);}}else{currentMatchIndex=null;displayNoMatches();}}};function getPageOffsetTop(el,container){var currentEl=el;var y=0;while(currentEl&&currentEl!=container){y+=currentEl.offsetTop;currentEl=currentEl.offsetParent;}","return y;}",'function scrollIntoView(el){var logContainer=logMainContainer;if(!$("wrap").checked){var logContainerLeft=logContainer.scrollLeft;var logContainerRight=logContainerLeft+logContainer.offsetWidth;var elLeft=el.offsetLeft;var elRight=elLeft+el.offsetWidth;if(elLeft<logContainerLeft||elRight>logContainerRight){logContainer.scrollLeft=elLeft-(logContainer.offsetWidth-el.offsetWidth)/2;}}',"var logContainerTop=logContainer.scrollTop;var logContainerBottom=logContainerTop+logContainer.offsetHeight;var elTop=getPageOffsetTop(el)-getToolBarsHeight();var elBottom=elTop+el.offsetHeight;if(elTop<logContainerTop||elBottom>logContainerBottom){logContainer.scrollTop=elTop-(logContainer.offsetHeight-el.offsetHeight)/2;}}","function Match(logEntryLevel,spanInMainDiv,spanInUnwrappedPre,spanInWrappedDiv){this.logEntryLevel=logEntryLevel;this.spanInMainDiv=spanInMainDiv;if(isIe){this.spanInUnwrappedPre=spanInUnwrappedPre;this.spanInWrappedDiv=spanInWrappedDiv;}","this.mainSpan=isIe?spanInUnwrappedPre:spanInMainDiv;}",'Match.prototype={equals:function(match){return this.mainSpan===match.mainSpan;},setCurrent:function(){if(isIe){addClass(this.spanInUnwrappedPre,"currentmatch");addClass(this.spanInWrappedDiv,"currentmatch");var elementToScroll=$("wrap").checked?this.spanInWrappedDiv:this.spanInUnwrappedPre;scrollIntoView(elementToScroll);}else{addClass(this.spanInMainDiv,"currentmatch");scrollIntoView(this.spanInMainDiv);}},belongsTo:function(logEntry){if(isIe){return isDescendant(this.spanInUnwrappedPre,logEntry.unwrappedPre);}else{return isDescendant(this.spanInMainDiv,logEntry.mainDiv);}},setNotCurrent:function(){if(isIe){removeClass(this.spanInUnwrappedPre,"currentmatch");removeClass(this.spanInWrappedDiv,"currentmatch");}else{removeClass(this.spanInMainDiv,"currentmatch");}},isOrphan:function(){return isOrphan(this.mainSpan);},isVisible:function(){return getCheckBox(this.logEntryLevel).checked;},remove:function(){if(isIe){this.spanInUnwrappedPre=null;this.spanInWrappedDiv=null;}else{this.spanInMainDiv=null;}}};var currentSearch=null;var currentMatchIndex=null;function doSearch(){var searchBox=$("searchBox");var searchTerm=searchBox.value;var isRegex=$("searchRegex").checked;var isCaseSensitive=$("searchCaseSensitive").checked;var i;if(searchTerm===""){$("searchReset").disabled=true;$("searchNav").style.display="none";removeClass(document.body,"searching");removeClass(searchBox,"hasmatches");removeClass(searchBox,"nomatches");for(i=0;i<logEntries.length;i++){logEntries[i].clearSearch();logEntries[i].setContent(logEntries[i].formattedMessage,logEntries[i].formattedMessage);}','currentSearch=null;setLogContainerHeight();}else{$("searchReset").disabled=false;$("searchNav").style.display="block";var searchRegex;var regexValid;if(isRegex){try{searchRegex=isCaseSensitive?new RegExp(searchTerm,"g"):new RegExp(searchTerm,"gi");regexValid=true;replaceClass(searchBox,"validregex","invalidregex");searchBox.title="Valid regex";}catch(ex){regexValid=false;replaceClass(searchBox,"invalidregex","validregex");searchBox.title="Invalid regex: "+(ex.message?ex.message:(ex.description?ex.description:"unknown error"));return;}}else{searchBox.title="";removeClass(searchBox,"validregex");removeClass(searchBox,"invalidregex");}','addClass(document.body,"searching");currentSearch=new Search(searchTerm,isRegex,searchRegex,isCaseSensitive);for(i=0;i<logEntries.length;i++){currentSearch.applyTo(logEntries[i]);}',"setLogContainerHeight();if(currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}else{displayNoMatches();}}}","function updateSearchFromFilters(){if(currentSearch){if(currentSearch.hasMatches()){if(currentMatchIndex===null){currentMatchIndex=0;}","var currentMatch=currentSearch.matches[currentMatchIndex];if(currentMatch.isVisible()){displayMatches();setCurrentMatchIndex(currentMatchIndex);}else{currentMatch.setNotCurrent();var nextVisibleMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextVisibleMatchIndex>-1){setCurrentMatchIndex(nextVisibleMatchIndex);displayMatches();}else{displayNoMatches();}}}else{displayNoMatches();}}}","function refreshCurrentMatch(){if(currentSearch&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(currentMatchIndex);}}",'function displayMatches(){replaceClass($("searchBox"),"hasmatches","nomatches");$("searchBox").title=""+currentSearch.matches.length+" matches found";$("searchNav").style.display="block";setLogContainerHeight();}','function displayNoMatches(){replaceClass($("searchBox"),"nomatches","hasmatches");$("searchBox").title="No matches found";$("searchNav").style.display="none";setLogContainerHeight();}','function toggleSearchEnabled(enable){enable=(typeof enable=="undefined")?!$("searchDisable").checked:enable;$("searchBox").disabled=!enable;$("searchReset").disabled=!enable;$("searchRegex").disabled=!enable;$("searchNext").disabled=!enable;$("searchPrevious").disabled=!enable;$("searchCaseSensitive").disabled=!enable;$("searchNav").style.display=(enable&&($("searchBox").value!=="")&&currentSearch&&currentSearch.hasVisibleMatches())?"block":"none";if(enable){removeClass($("search"),"greyedout");addClass(document.body,"searching");if($("searchHighlight").checked){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}','if($("searchFilter").checked){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','$("searchDisable").checked=!enable;}else{addClass($("search"),"greyedout");removeClass(document.body,"searching");removeClass(logMainContainer,"searchhighlight");removeClass(logMainContainer,"searchfilter");}',"setLogContainerHeight();}",'function toggleSearchFilter(){var enable=$("searchFilter").checked;if(enable){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}',"refreshCurrentMatch();}",'function toggleSearchHighlight(){var enable=$("searchHighlight").checked;if(enable){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}}','function clearSearch(){$("searchBox").value="";doSearch();}','function searchNext(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var nextMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextMatchIndex>currentMatchIndex||confirm("Reached the end of the page. Start from the top?")){setCurrentMatchIndex(nextMatchIndex);}}}','function searchPrevious(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var previousMatchIndex=currentSearch.getPreviousVisibleMatchIndex();if(previousMatchIndex<currentMatchIndex||confirm("Reached the start of the page. Continue from the bottom?")){setCurrentMatchIndex(previousMatchIndex);}}}',"function setCurrentMatchIndex(index){currentMatchIndex=index;currentSearch.matches[currentMatchIndex].setCurrent();}",'function addClass(el,cssClass){if(!hasClass(el,cssClass)){if(el.className){el.className+=" "+cssClass;}else{el.className=cssClass;}}}','function hasClass(el,cssClass){if(el.className){var classNames=el.className.split(" ");return array_contains(classNames,cssClass);}',"return false;}",'function removeClass(el,cssClass){if(hasClass(el,cssClass)){var existingClasses=el.className.split(" ");var newClasses=[];for(var i=0,len=existingClasses.length;i<len;i++){if(existingClasses[i]!=cssClass){newClasses[newClasses.length]=existingClasses[i];}}','el.className=newClasses.join(" ");}}',"function replaceClass(el,newCssClass,oldCssClass){removeClass(el,oldCssClass);addClass(el,newCssClass);}","function getElementsByClass(el,cssClass,tagName){var elements=el.getElementsByTagName(tagName);var matches=[];for(var i=0,len=elements.length;i<len;i++){if(hasClass(elements[i],cssClass)){matches.push(elements[i]);}}","return matches;}","function $(id){return document.getElementById(id);}","function isDescendant(node,ancestorNode){while(node!=null){if(node===ancestorNode){return true;}","node=node.parentNode;}","return false;}","function isOrphan(node){var currentNode=node;while(currentNode){if(currentNode==document.body){return false;}","currentNode=currentNode.parentNode;}","return true;}",'function escapeHtml(str){return str.replace(/&/g,"&amp;").replace(/[<]/g,"&lt;").replace(/>/g,"&gt;");}',"function getWindowWidth(){if(window.innerWidth){return window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth;}else if(document.body){return document.body.clientWidth;}","return 0;}","function getWindowHeight(){if(window.innerHeight){return window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}","return 0;}",'function getToolBarsHeight(){return $("switches").offsetHeight;}','function getChromeHeight(){var height=getToolBarsHeight();if(showCommandLine){height+=$("commandLine").offsetHeight;}',"return height;}",'function setLogContainerHeight(){if(logMainContainer){var windowHeight=getWindowHeight();$("body").style.height=getWindowHeight()+"px";logMainContainer.style.height=""+','Math.max(0,windowHeight-getChromeHeight())+"px";}}','function setCommandInputWidth(){if(showCommandLine){$("command").style.width=""+Math.max(0,$("commandLineContainer").offsetWidth-','($("evaluateButton").offsetWidth+13))+"px";}}',"window.onresize=function(){setCommandInputWidth();setLogContainerHeight();};if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];}","return this.length;};}","if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length>0){var val=this[this.length-1];this.length=this.length-1;return val;}};}","if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];}","this.length=this.length-1;return firstItem;}};}","if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];}","var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);}","return itemsDeleted;};}","function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}}","if(index>=0){arr.splice(index,1);return index;}else{return false;}}","function array_removeFromStart(array,numberToRemove){if(Array.prototype.splice){array.splice(0,numberToRemove);}else{for(var i=numberToRemove,len=array.length;i<len;i++){array[i-numberToRemove]=array[i];}","array.length=array.length-numberToRemove;}","return array;}","function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}}","return false;}","function getErrorMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}",'return""+ex;}',"function moveCaretToEnd(input){if(input.setSelectionRange){input.focus();var length=input.value.length;input.setSelectionRange(length,length);}else if(input.createTextRange){var range=input.createTextRange();range.collapse(false);range.select();}","input.focus();}",'function stopPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;}}',"function getEvent(evt){return evt?evt:event;}","function getTarget(evt){return evt.target?evt.target:evt.srcElement;}",'function getRelatedTarget(evt){if(evt.relatedTarget){return evt.relatedTarget;}else if(evt.srcElement){switch(evt.type){case"mouseover":return evt.fromElement;case"mouseout":return evt.toElement;default:return evt.srcElement;}}}',"function cancelKeyEvent(evt){evt.returnValue=false;stopPropagation(evt);}",'function evalCommandLine(){var expr=$("command").value;evalCommand(expr);$("command").value="";}',"function evalLastCommand(){if(lastCommand!=null){evalCommand(lastCommand);}}",'var lastCommand=null;var commandHistory=[];var currentCommandIndex=0;function evalCommand(expr){if(appender){appender.evalCommandAndAppend(expr);}else{var prefix=">>> "+expr+"\\r\\n";try{log("INFO",prefix+eval(expr));}catch(ex){log("ERROR",prefix+"Error: "+getErrorMessage(ex));}}',"if(expr!=commandHistory[commandHistory.length-1]){commandHistory.push(expr);if(appender){appender.storeCommandHistory(commandHistory);}}","currentCommandIndex=(expr==commandHistory[currentCommandIndex])?currentCommandIndex+1:commandHistory.length;lastCommand=expr;}","//]]>","<\/script>",'<style type="text/css">',"body{background-color:white;color:black;padding:0;margin:0;font-family:tahoma,verdana,arial,helvetica,sans-serif;overflow:hidden}div#switchesContainer input{margin-bottom:0}div.toolbar{border-top:solid #ffffff 1px;border-bottom:solid #aca899 1px;background-color:#f1efe7;padding:3px 5px;font-size:68.75%}div.toolbar,div#search input{font-family:tahoma,verdana,arial,helvetica,sans-serif}div.toolbar input.button{padding:0 5px;font-size:100%}div.toolbar input.hidden{display:none}div#switches input#clearButton{margin-left:20px}div#levels label{font-weight:bold}div#levels label,div#options label{margin-right:5px}div#levels label#wrapLabel{font-weight:normal}div#search label{margin-right:10px}div#search label.searchboxlabel{margin-right:0}div#search input{font-size:100%}div#search input.validregex{color:green}div#search input.invalidregex{color:red}div#search input.nomatches{color:white;background-color:#ff6666}div#search input.nomatches{color:white;background-color:#ff6666}div#searchNav{display:none}div#commandLine{display:none}div#commandLine input#command{font-size:100%;font-family:Courier New,Courier}div#commandLine input#evaluateButton{}*.greyedout{color:gray !important;border-color:gray !important}*.greyedout *.alwaysenabled{color:black}*.unselectable{-khtml-user-select:none;-moz-user-select:none;user-select:none}div#log{font-family:Courier New,Courier;font-size:75%;width:100%;overflow:auto;clear:both;position:relative}div.group{border-color:#cccccc;border-style:solid;border-width:1px 0 1px 1px;overflow:visible}div.oldIe div.group,div.oldIe div.group *,div.oldIe *.logentry{height:1%}div.group div.groupheading span.expander{border:solid black 1px;font-family:Courier New,Courier;font-size:0.833em;background-color:#eeeeee;position:relative;top:-1px;color:black;padding:0 2px;cursor:pointer;cursor:hand;height:1%}div.group div.groupcontent{margin-left:10px;padding-bottom:2px;overflow:visible}div.group div.expanded{display:block}div.group div.collapsed{display:none}*.logentry{overflow:visible;display:none;white-space:pre}span.pre{white-space:pre}pre.unwrapped{display:inline !important}pre.unwrapped pre.pre,div.wrapped pre.pre{display:inline}div.wrapped pre.pre{white-space:normal}div.wrapped{display:none}body.searching *.logentry span.currentmatch{color:white !important;background-color:green !important}body.searching div.searchhighlight *.logentry span.searchterm{color:black;background-color:yellow}div.wrap *.logentry{white-space:normal !important;border-width:0 0 1px 0;border-color:#dddddd;border-style:dotted}div.wrap #log_wrapped,#log_unwrapped{display:block}div.wrap #log_unwrapped,#log_wrapped{display:none}div.wrap *.logentry span.pre{overflow:visible;white-space:normal}div.wrap *.logentry pre.unwrapped{display:none}div.wrap *.logentry span.wrapped{display:inline}div.searchfilter *.searchnonmatch{display:none !important}div#log *.TRACE,label#label_TRACE{color:#666666}div#log *.DEBUG,label#label_DEBUG{color:green}div#log *.INFO,label#label_INFO{color:#000099}div#log *.WARN,label#label_WARN{color:#999900}div#log *.ERROR,label#label_ERROR{color:red}div#log *.FATAL,label#label_FATAL{color:#660066}div.TRACE#log *.TRACE,div.DEBUG#log *.DEBUG,div.INFO#log *.INFO,div.WARN#log *.WARN,div.ERROR#log *.ERROR,div.FATAL#log *.FATAL{display:block}div#log div.separator{background-color:#cccccc;margin:5px 0;line-height:1px}","</style>","</head>",'<body id="body">','<div id="switchesContainer">','<div id="switches">','<div id="levels" class="toolbar">',"Filters:",'<input type="checkbox" id="switch_TRACE" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide trace messages" /><label for="switch_TRACE" id="label_TRACE">trace</label>','<input type="checkbox" id="switch_DEBUG" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide debug messages" /><label for="switch_DEBUG" id="label_DEBUG">debug</label>','<input type="checkbox" id="switch_INFO" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide info messages" /><label for="switch_INFO" id="label_INFO">info</label>','<input type="checkbox" id="switch_WARN" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide warn messages" /><label for="switch_WARN" id="label_WARN">warn</label>','<input type="checkbox" id="switch_ERROR" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide error messages" /><label for="switch_ERROR" id="label_ERROR">error</label>','<input type="checkbox" id="switch_FATAL" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide fatal messages" /><label for="switch_FATAL" id="label_FATAL">fatal</label>','<input type="checkbox" id="switch_ALL" onclick="toggleAllLevels(); applyFilters()" checked="checked" title="Show/hide all messages" /><label for="switch_ALL" id="label_ALL">all</label>',"</div>",'<div id="search" class="toolbar">','<label for="searchBox" class="searchboxlabel">Search:</label> <input type="text" id="searchBox" onclick="toggleSearchEnabled(true)" onkeyup="scheduleSearch()" size="20" />','<input type="button" id="searchReset" disabled="disabled" value="Reset" onclick="clearSearch()" class="button" title="Reset the search" />','<input type="checkbox" id="searchRegex" onclick="doSearch()" title="If checked, search is treated as a regular expression" /><label for="searchRegex">Regex</label>','<input type="checkbox" id="searchCaseSensitive" onclick="doSearch()" title="If checked, search is case sensitive" /><label for="searchCaseSensitive">Match case</label>','<input type="checkbox" id="searchDisable" onclick="toggleSearchEnabled()" title="Enable/disable search" /><label for="searchDisable" class="alwaysenabled">Disable</label>','<div id="searchNav">','<input type="button" id="searchNext" disabled="disabled" value="Next" onclick="searchNext()" class="button" title="Go to the next matching log entry" />','<input type="button" id="searchPrevious" disabled="disabled" value="Previous" onclick="searchPrevious()" class="button" title="Go to the previous matching log entry" />','<input type="checkbox" id="searchFilter" onclick="toggleSearchFilter()" title="If checked, non-matching log entries are filtered out" /><label for="searchFilter">Filter</label>','<input type="checkbox" id="searchHighlight" onclick="toggleSearchHighlight()" title="Highlight matched search terms" /><label for="searchHighlight" class="alwaysenabled">Highlight all</label>',"</div>","</div>",'<div id="options" class="toolbar">',"Options:",'<input type="checkbox" id="enableLogging" onclick="toggleLoggingEnabled()" checked="checked" title="Enable/disable logging" /><label for="enableLogging" id="enableLoggingLabel">Log</label>','<input type="checkbox" id="wrap" onclick="toggleWrap()" title="Enable / disable word wrap" /><label for="wrap" id="wrapLabel">Wrap</label>','<input type="checkbox" id="newestAtTop" onclick="toggleNewestAtTop()" title="If checked, causes newest messages to appear at the top" /><label for="newestAtTop" id="newestAtTopLabel">Newest at the top</label>','<input type="checkbox" id="scrollToLatest" onclick="toggleScrollToLatest()" checked="checked" title="If checked, window automatically scrolls to a new message when it is added" /><label for="scrollToLatest" id="scrollToLatestLabel">Scroll to latest</label>','<input type="button" id="clearButton" value="Clear" onclick="clearLog()" class="button" title="Clear all log messages"  />','<input type="button" id="hideButton" value="Hide" onclick="hide()" class="hidden button" title="Hide the console" />','<input type="button" id="closeButton" value="Close" onclick="closeWindow()" class="hidden button" title="Close the window" />',"</div>","</div>","</div>",'<div id="log" class="TRACE DEBUG INFO WARN ERROR FATAL"></div>','<div id="commandLine" class="toolbar">','<div id="commandLineContainer">','<input type="text" id="command" title="Enter a JavaScript command here and hit return or press \'Evaluate\'" />','<input type="button" id="evaluateButton" value="Evaluate" class="button" title="Evaluate the command" onclick="evalCommandLine()" />',"</div>","</div>","</body>","</html>",""]};var defaultCommandLineFunctions=[];ConsoleAppender=function(){};var consoleAppenderIdCounter=1;ConsoleAppender.prototype=new Appender();ConsoleAppender.prototype.create=function(inPage,container,lazyInit,initiallyMinimized,useDocumentWrite,width,height,focusConsoleWindow){var appender=this;var initialized=false;var consoleWindowCreated=false;var consoleWindowLoaded=false;var consoleClosed=false;var queuedLoggingEvents=[];var isSupported=true;var consoleAppenderId=consoleAppenderIdCounter++;initiallyMinimized=extractBooleanFromParam(initiallyMinimized,this.defaults.initiallyMinimized);lazyInit=extractBooleanFromParam(lazyInit,this.defaults.lazyInit);useDocumentWrite=extractBooleanFromParam(useDocumentWrite,this.defaults.useDocumentWrite);var newestMessageAtTop=this.defaults.newestMessageAtTop;var scrollToLatestMessage=this.defaults.scrollToLatestMessage;width=width?width:this.defaults.width;height=height?height:this.defaults.height;var maxMessages=this.defaults.maxMessages;var showCommandLine=this.defaults.showCommandLine;var commandLineObjectExpansionDepth=this.defaults.commandLineObjectExpansionDepth;var showHideButton=this.defaults.showHideButton;var showCloseButton=this.defaults.showCloseButton;var showLogEntryDeleteButtons=this.defaults.showLogEntryDeleteButtons;this.setLayout(this.defaults.layout);var init,createWindow,safeToAppend,getConsoleWindow,open;var appenderName=inPage?"InPageAppender":"PopUpAppender";var checkCanConfigure=function(configOptionName){if(consoleWindowCreated){handleError(appenderName+": configuration option '"+configOptionName+"' may not be set after the appender has been initialized");return false}return true};var consoleWindowExists=function(){return(consoleWindowLoaded&&isSupported&&!consoleClosed)};this.isNewestMessageAtTop=function(){return newestMessageAtTop};this.setNewestMessageAtTop=function(newestMessageAtTopParam){newestMessageAtTop=bool(newestMessageAtTopParam);if(consoleWindowExists()){getConsoleWindow().setNewestAtTop(newestMessageAtTop)}};this.isScrollToLatestMessage=function(){return scrollToLatestMessage};this.setScrollToLatestMessage=function(scrollToLatestMessageParam){scrollToLatestMessage=bool(scrollToLatestMessageParam);if(consoleWindowExists()){getConsoleWindow().setScrollToLatest(scrollToLatestMessage)}};this.getWidth=function(){return width};this.setWidth=function(widthParam){if(checkCanConfigure("width")){width=extractStringFromParam(widthParam,width)}};this.getHeight=function(){return height};this.setHeight=function(heightParam){if(checkCanConfigure("height")){height=extractStringFromParam(heightParam,height)}};this.getMaxMessages=function(){return maxMessages};this.setMaxMessages=function(maxMessagesParam){maxMessages=extractIntFromParam(maxMessagesParam,maxMessages);if(consoleWindowExists()){getConsoleWindow().setMaxMessages(maxMessages)}};this.isShowCommandLine=function(){return showCommandLine};this.setShowCommandLine=function(showCommandLineParam){showCommandLine=bool(showCommandLineParam);if(consoleWindowExists()){getConsoleWindow().setShowCommandLine(showCommandLine)}};this.isShowHideButton=function(){return showHideButton};this.setShowHideButton=function(showHideButtonParam){showHideButton=bool(showHideButtonParam);if(consoleWindowExists()){getConsoleWindow().setShowHideButton(showHideButton)}};this.isShowCloseButton=function(){return showCloseButton};this.setShowCloseButton=function(showCloseButtonParam){showCloseButton=bool(showCloseButtonParam);if(consoleWindowExists()){getConsoleWindow().setShowCloseButton(showCloseButton)}};this.getCommandLineObjectExpansionDepth=function(){return commandLineObjectExpansionDepth};this.setCommandLineObjectExpansionDepth=function(commandLineObjectExpansionDepthParam){commandLineObjectExpansionDepth=extractIntFromParam(commandLineObjectExpansionDepthParam,commandLineObjectExpansionDepth)};var minimized=initiallyMinimized;this.isInitiallyMinimized=function(){return initiallyMinimized};this.setInitiallyMinimized=function(initiallyMinimizedParam){if(checkCanConfigure("initiallyMinimized")){initiallyMinimized=bool(initiallyMinimizedParam);minimized=initiallyMinimized}};this.isUseDocumentWrite=function(){return useDocumentWrite};this.setUseDocumentWrite=function(useDocumentWriteParam){if(checkCanConfigure("useDocumentWrite")){useDocumentWrite=bool(useDocumentWriteParam)}};function QueuedLoggingEvent(loggingEvent,formattedMessage){this.loggingEvent=loggingEvent;this.levelName=loggingEvent.level.name;this.formattedMessage=formattedMessage}QueuedLoggingEvent.prototype.append=function(){getConsoleWindow().log(this.levelName,this.formattedMessage)};function QueuedGroup(name,initiallyExpanded){this.name=name;this.initiallyExpanded=initiallyExpanded}QueuedGroup.prototype.append=function(){getConsoleWindow().group(this.name,this.initiallyExpanded)};function QueuedGroupEnd(){}QueuedGroupEnd.prototype.append=function(){getConsoleWindow().groupEnd()};var checkAndAppend=function(){safeToAppend();if(!initialized){init()}else{if(consoleClosed&&reopenWhenClosed){createWindow()}}if(safeToAppend()){appendQueuedLoggingEvents()}};this.append=function(loggingEvent){if(isSupported){var formattedMessage=appender.getLayout().format(loggingEvent);if(this.getLayout().ignoresThrowable()){formattedMessage+=loggingEvent.getThrowableStrRep()}queuedLoggingEvents.push(new QueuedLoggingEvent(loggingEvent,formattedMessage));checkAndAppend()}};this.group=function(name,initiallyExpanded){if(isSupported){queuedLoggingEvents.push(new QueuedGroup(name,initiallyExpanded));checkAndAppend()}};this.groupEnd=function(){if(isSupported){queuedLoggingEvents.push(new QueuedGroupEnd());checkAndAppend()}};var appendQueuedLoggingEvents=function(){var currentLoggingEvent;while(queuedLoggingEvents.length>0){queuedLoggingEvents.shift().append()}if(focusConsoleWindow){getConsoleWindow().focus()}};this.setAddedToLogger=function(logger){this.loggers.push(logger);if(enabled&&!lazyInit){init()}};this.clear=function(){if(consoleWindowExists()){getConsoleWindow().clearLog()}queuedLoggingEvents.length=0};this.focus=function(){if(consoleWindowExists()){getConsoleWindow().focus()}};this.focusCommandLine=function(){if(consoleWindowExists()){getConsoleWindow().focusCommandLine()}};this.focusSearch=function(){if(consoleWindowExists()){getConsoleWindow().focusSearch()}};var commandWindow=window;this.getCommandWindow=function(){return commandWindow};this.setCommandWindow=function(commandWindowParam){commandWindow=commandWindowParam};this.executeLastCommand=function(){if(consoleWindowExists()){getConsoleWindow().evalLastCommand()}};var commandLayout=new PatternLayout("%m");this.getCommandLayout=function(){return commandLayout};this.setCommandLayout=function(commandLayoutParam){commandLayout=commandLayoutParam};this.evalCommandAndAppend=function(expr){var commandReturnValue={appendResult:true,isError:false};var commandOutput="";try{var result,i;if(!commandWindow.eval&&commandWindow.execScript){commandWindow.execScript("null")}var commandLineFunctionsHash={};for(i=0,len=commandLineFunctions.length;i<len;i++){commandLineFunctionsHash[commandLineFunctions[i][0]]=commandLineFunctions[i][1]}var objectsToRestore=[];var addObjectToRestore=function(name){objectsToRestore.push([name,commandWindow[name]])};addObjectToRestore("appender");commandWindow.appender=appender;addObjectToRestore("commandReturnValue");commandWindow.commandReturnValue=commandReturnValue;addObjectToRestore("commandLineFunctionsHash");commandWindow.commandLineFunctionsHash=commandLineFunctionsHash;var addFunctionToWindow=function(name){addObjectToRestore(name);commandWindow[name]=function(){return this.commandLineFunctionsHash[name](appender,arguments,commandReturnValue)}};for(i=0,len=commandLineFunctions.length;i<len;i++){addFunctionToWindow(commandLineFunctions[i][0])}if(commandWindow===window&&commandWindow.execScript){addObjectToRestore("evalExpr");addObjectToRestore("result");window.evalExpr=expr;commandWindow.execScript("window.result=eval(window.evalExpr);");result=window.result}else{result=commandWindow.eval(expr)}commandOutput=isUndefined(result)?result:formatObjectExpansion(result,commandLineObjectExpansionDepth);for(i=0,len=objectsToRestore.length;i<len;i++){commandWindow[objectsToRestore[i][0]]=objectsToRestore[i][1]}}catch(ex){commandOutput="Error evaluating command: "+getExceptionStringRep(ex);commandReturnValue.isError=true}if(commandReturnValue.appendResult){var message=">>> "+expr;if(!isUndefined(commandOutput)){message+=newLine+commandOutput}var level=commandReturnValue.isError?Level.ERROR:Level.INFO;var loggingEvent=new LoggingEvent(null,new Date(),level,[message],null);var mainLayout=this.getLayout();this.setLayout(commandLayout);this.append(loggingEvent);this.setLayout(mainLayout)}};var commandLineFunctions=defaultCommandLineFunctions.concat([]);this.addCommandLineFunction=function(functionName,commandLineFunction){commandLineFunctions.push([functionName,commandLineFunction])};var commandHistoryCookieName="log4javascriptCommandHistory";this.storeCommandHistory=function(commandHistory){setCookie(commandHistoryCookieName,commandHistory.join(","))};var writeHtml=function(doc){var lines=getConsoleHtmlLines();doc.open();for(var i=0,len=lines.length;i<len;i++){doc.writeln(lines[i])}doc.close()};this.setEventTypes(["load","unload"]);var consoleWindowLoadHandler=function(){var win=getConsoleWindow();win.setAppender(appender);win.setNewestAtTop(newestMessageAtTop);win.setScrollToLatest(scrollToLatestMessage);win.setMaxMessages(maxMessages);win.setShowCommandLine(showCommandLine);win.setShowHideButton(showHideButton);win.setShowCloseButton(showCloseButton);win.setMainWindow(window);var storedValue=getCookie(commandHistoryCookieName);if(storedValue){win.commandHistory=storedValue.split(",");win.currentCommandIndex=win.commandHistory.length}appender.dispatchEvent("load",{win:win})};this.unload=function(){logLog.debug("unload "+this+", caller: "+this.unload.caller);if(!consoleClosed){logLog.debug("really doing unload "+this);consoleClosed=true;consoleWindowLoaded=false;consoleWindowCreated=false;appender.dispatchEvent("unload",{})}};var pollConsoleWindow=function(windowTest,interval,successCallback,errorMessage){function doPoll(){try{if(consoleClosed){clearInterval(poll)}if(windowTest(getConsoleWindow())){clearInterval(poll);successCallback()}}catch(ex){clearInterval(poll);isSupported=false;handleError(errorMessage,ex)}}var poll=setInterval(doPoll,interval)};var getConsoleUrl=function(){var documentDomainSet=(document.domain!=location.hostname);return useDocumentWrite?"":getBaseUrl()+"console.html"+(documentDomainSet?"?log4javascript_domain="+escape(document.domain):"")};if(inPage){var containerElement=null;var cssProperties=[];this.addCssProperty=function(name,value){if(checkCanConfigure("cssProperties")){cssProperties.push([name,value])}};var windowCreationStarted=false;var iframeContainerDiv;var iframeId=uniqueId+"_InPageAppender_"+consoleAppenderId;this.hide=function(){if(initialized&&consoleWindowCreated){if(consoleWindowExists()){getConsoleWindow().$("command").blur()}iframeContainerDiv.style.display="none";minimized=true}};this.show=function(){if(initialized){if(consoleWindowCreated){iframeContainerDiv.style.display="block";this.setShowCommandLine(showCommandLine);minimized=false}else{if(!windowCreationStarted){createWindow(true)}}}};this.isVisible=function(){return!minimized&&!consoleClosed};this.close=function(fromButton){if(!consoleClosed&&(!fromButton||confirm("This will permanently remove the console from the page. No more messages will be logged. Do you wish to continue?"))){iframeContainerDiv.parentNode.removeChild(iframeContainerDiv);this.unload()}};open=function(){var initErrorMessage="InPageAppender.open: unable to create console iframe";function finalInit(){try{if(!initiallyMinimized){appender.show()}consoleWindowLoadHandler();consoleWindowLoaded=true;appendQueuedLoggingEvents()}catch(ex){isSupported=false;handleError(initErrorMessage,ex)}}function writeToDocument(){try{var windowTest=function(win){return isLoaded(win)};if(useDocumentWrite){writeHtml(getConsoleWindow().document)}if(windowTest(getConsoleWindow())){finalInit()}else{pollConsoleWindow(windowTest,100,finalInit,initErrorMessage)}}catch(ex){isSupported=false;handleError(initErrorMessage,ex)}}minimized=false;iframeContainerDiv=containerElement.appendChild(document.createElement("div"));iframeContainerDiv.style.width=width;iframeContainerDiv.style.height=height;iframeContainerDiv.style.border="solid gray 1px";for(var i=0,len=cssProperties.length;i<len;i++){iframeContainerDiv.style[cssProperties[i][0]]=cssProperties[i][1]}var iframeSrc=useDocumentWrite?"":" src='"+getConsoleUrl()+"'";iframeContainerDiv.innerHTML="<iframe id='"+iframeId+"' name='"+iframeId+"' width='100%' height='100%' frameborder='0'"+iframeSrc+"scrolling='no'></iframe>";consoleClosed=false;var iframeDocumentExistsTest=function(win){try{return bool(win)&&bool(win.document)}catch(ex){return false}};if(iframeDocumentExistsTest(getConsoleWindow())){writeToDocument()}else{pollConsoleWindow(iframeDocumentExistsTest,100,writeToDocument,initErrorMessage)}consoleWindowCreated=true};createWindow=function(show){if(show||!initiallyMinimized){var pageLoadHandler=function(){if(!container){containerElement=document.createElement("div");containerElement.style.position="fixed";containerElement.style.left="0";containerElement.style.right="0";containerElement.style.bottom="0";document.body.appendChild(containerElement);appender.addCssProperty("borderWidth","1px 0 0 0");appender.addCssProperty("zIndex",1000000);open()}else{try{var el=document.getElementById(container);if(el.nodeType==1){containerElement=el}open()}catch(ex){handleError("InPageAppender.init: invalid container element '"+container+"' supplied",ex)}}};if(pageLoaded&&container&&container.appendChild){containerElement=container;open()}else{if(pageLoaded){pageLoadHandler()}else{log4javascript.addEventListener("load",pageLoadHandler)}}windowCreationStarted=true}};init=function(){createWindow();initialized=true};getConsoleWindow=function(){var iframe=window.frames[iframeId];if(iframe){return iframe}};safeToAppend=function(){if(isSupported&&!consoleClosed){if(consoleWindowCreated&&!consoleWindowLoaded&&getConsoleWindow()&&isLoaded(getConsoleWindow())){consoleWindowLoaded=true}return consoleWindowLoaded}return false}}else{var useOldPopUp=appender.defaults.useOldPopUp;var complainAboutPopUpBlocking=appender.defaults.complainAboutPopUpBlocking;var reopenWhenClosed=this.defaults.reopenWhenClosed;this.isUseOldPopUp=function(){return useOldPopUp};this.setUseOldPopUp=function(useOldPopUpParam){if(checkCanConfigure("useOldPopUp")){useOldPopUp=bool(useOldPopUpParam)}};this.isComplainAboutPopUpBlocking=function(){return complainAboutPopUpBlocking};this.setComplainAboutPopUpBlocking=function(complainAboutPopUpBlockingParam){if(checkCanConfigure("complainAboutPopUpBlocking")){complainAboutPopUpBlocking=bool(complainAboutPopUpBlockingParam)}};this.isFocusPopUp=function(){return focusConsoleWindow};this.setFocusPopUp=function(focusPopUpParam){focusConsoleWindow=bool(focusPopUpParam)};this.isReopenWhenClosed=function(){return reopenWhenClosed};this.setReopenWhenClosed=function(reopenWhenClosedParam){reopenWhenClosed=bool(reopenWhenClosedParam)};this.close=function(){logLog.debug("close "+this);try{popUp.close();this.unload()}catch(ex){}};this.hide=function(){logLog.debug("hide "+this);if(consoleWindowExists()){this.close()}};this.show=function(){logLog.debug("show "+this);if(!consoleWindowCreated){open()}};this.isVisible=function(){return safeToAppend()};var popUp;open=function(){var windowProperties="width="+width+",height="+height+",status,resizable";var windowName="PopUp_"+location.host.replace(/[^a-z0-9]/gi,"_")+"_"+consoleAppenderId;if(!useOldPopUp||!useDocumentWrite){windowName=windowName+"_"+uniqueId}var checkPopUpClosed=function(win){if(consoleClosed){return true}else{try{return bool(win)&&win.closed}catch(ex){}}return false};var popUpClosedCallback=function(){if(!consoleClosed){appender.unload()}};function finalInit(){getConsoleWindow().setCloseIfOpenerCloses(!useOldPopUp||!useDocumentWrite);consoleWindowLoadHandler();consoleWindowLoaded=true;appendQueuedLoggingEvents();pollConsoleWindow(checkPopUpClosed,500,popUpClosedCallback,"PopUpAppender.checkPopUpClosed: error checking pop-up window")}try{popUp=window.open(getConsoleUrl(),windowName,windowProperties);consoleClosed=false;consoleWindowCreated=true;if(popUp){if(useDocumentWrite&&useOldPopUp&&isLoaded(popUp)){popUp.mainPageReloaded();finalInit()}else{if(useDocumentWrite){writeHtml(popUp.document)}var popUpLoadedTest=function(win){return bool(win)&&isLoaded(win)};if(isLoaded(popUp)){finalInit()}else{pollConsoleWindow(popUpLoadedTest,100,finalInit,"PopUpAppender.init: unable to create console window")}}}else{isSupported=false;logLog.warn("PopUpAppender.init: pop-ups blocked, please unblock to use PopUpAppender");if(complainAboutPopUpBlocking){handleError("log4javascript: pop-up windows appear to be blocked. Please unblock them to use pop-up logging.")}}}catch(ex){handleError("PopUpAppender.init: error creating pop-up",ex)}};createWindow=function(){if(!initiallyMinimized){open()}};init=function(){createWindow();initialized=true};getConsoleWindow=function(){return popUp};safeToAppend=function(){if(isSupported&&!isUndefined(popUp)&&!consoleClosed){if(popUp.closed||(consoleWindowLoaded&&isUndefined(popUp.closed))){appender.unload();logLog.debug("PopUpAppender: pop-up closed");return false}if(!consoleWindowLoaded&&isLoaded(popUp)){consoleWindowLoaded=true}}return isSupported&&consoleWindowLoaded&&!consoleClosed}}this.getConsoleWindow=getConsoleWindow};ConsoleAppender.addGlobalCommandLineFunction=function(functionName,commandLineFunction){defaultCommandLineFunctions.push([functionName,commandLineFunction])};function PopUpAppender(lazyInit,initiallyMinimized,useDocumentWrite,width,height){this.create(false,null,lazyInit,initiallyMinimized,useDocumentWrite,width,height,this.defaults.focusPopUp)}PopUpAppender.prototype=new ConsoleAppender();PopUpAppender.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:false,focusPopUp:false,lazyInit:true,useOldPopUp:true,complainAboutPopUpBlocking:true,newestMessageAtTop:false,scrollToLatestMessage:true,width:"600",height:"400",reopenWhenClosed:false,maxMessages:null,showCommandLine:true,commandLineObjectExpansionDepth:1,showHideButton:false,showCloseButton:true,showLogEntryDeleteButtons:true,useDocumentWrite:true};PopUpAppender.prototype.toString=function(){return"PopUpAppender"};log4javascript.PopUpAppender=PopUpAppender;function InPageAppender(container,lazyInit,initiallyMinimized,useDocumentWrite,width,height){this.create(true,container,lazyInit,initiallyMinimized,useDocumentWrite,width,height,false)}InPageAppender.prototype=new ConsoleAppender();InPageAppender.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:false,lazyInit:true,newestMessageAtTop:false,scrollToLatestMessage:true,width:"100%",height:"220px",maxMessages:null,showCommandLine:true,commandLineObjectExpansionDepth:1,showHideButton:false,showCloseButton:false,showLogEntryDeleteButtons:true,useDocumentWrite:true};InPageAppender.prototype.toString=function(){return"InPageAppender"};log4javascript.InPageAppender=InPageAppender;log4javascript.InlineAppender=InPageAppender})();function padWithSpaces(str,len){if(str.length<len){var spaces=[];var numberOfSpaces=Math.max(0,len-str.length);for(var i=0;i<numberOfSpaces;i++){spaces[i]=" "}str+=spaces.join("")}return str}(function(){function dir(obj){var maxLen=0;for(var p in obj){maxLen=Math.max(toStr(p).length,maxLen)}var propList=[];for(p in obj){var propNameStr="  "+padWithSpaces(toStr(p),maxLen+2);var propVal;try{propVal=splitIntoLines(toStr(obj[p])).join(padWithSpaces(newLine,maxLen+6))}catch(ex){propVal="[Error obtaining property. Details: "+getExceptionMessage(ex)+"]"}propList.push(propNameStr+propVal)}return propList.join(newLine)}var nodeTypes={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};var preFormattedElements=["script","pre"];var emptyElements=["br","img","hr","param","link","area","input","col","base","meta"];var indentationUnit="  ";function getXhtml(rootNode,includeRootNode,indentation,startNewLine,preformatted){includeRootNode=(typeof includeRootNode=="undefined")?true:(includeRootNode?true:false);if(typeof indentation!="string"){indentation=""}startNewLine=startNewLine?true:false;preformatted=preformatted?true:false;var xhtml;function isWhitespace(node){return((node.nodeType==nodeTypes.TEXT_NODE)&&/^[ \t\r\n]*$/.test(node.nodeValue))}function fixAttributeValue(attrValue){return attrValue.toString().replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")}function getStyleAttributeValue(el){var stylePairs=el.style.cssText.split(";");var styleValue="";var isFirst=true;for(var j=0,len=stylePairs.length;j<len;j++){var nameValueBits=stylePairs[j].split(":");var props=[];if(!/^\s*$/.test(nameValueBits[0])){props.push(trim(nameValueBits[0]).toLowerCase()+":"+trim(nameValueBits[1]))}styleValue=props.join(";")}return styleValue}function getNamespace(el){if(el.prefix){return el.prefix}else{if(el.outerHTML){var regex=new RegExp("<([^:]+):"+el.tagName+"[^>]*>","i");if(regex.test(el.outerHTML)){return RegExp.$1.toLowerCase()}}}return""}var lt="<";var gt=">";if(includeRootNode&&rootNode.nodeType!=nodeTypes.DOCUMENT_FRAGMENT_NODE){switch(rootNode.nodeType){case nodeTypes.ELEMENT_NODE:var tagName=rootNode.tagName.toLowerCase();xhtml=startNewLine?newLine+indentation:"";xhtml+=lt;var prefix=getNamespace(rootNode);var hasPrefix=prefix?true:false;if(hasPrefix){xhtml+=prefix+":"}xhtml+=tagName;for(i=0,len=rootNode.attributes.length;i<len;i++){var currentAttr=rootNode.attributes[i];if(!currentAttr.specified||currentAttr.nodeValue===null||currentAttr.nodeName.toLowerCase()==="style"||typeof currentAttr.nodeValue!=="string"||currentAttr.nodeName.indexOf("_moz")===0){continue}xhtml+=" "+currentAttr.nodeName.toLowerCase()+'="';xhtml+=fixAttributeValue(currentAttr.nodeValue);xhtml+='"'}if(rootNode.style.cssText){var styleValue=getStyleAttributeValue(rootNode);if(styleValue!==""){xhtml+=' style="'+getStyleAttributeValue(rootNode)+'"'}}if(array_contains(emptyElements,tagName)||(hasPrefix&&!rootNode.hasChildNodes())){xhtml+="/"+gt}else{xhtml+=gt;var childStartNewLine=!(rootNode.childNodes.length===1&&rootNode.childNodes[0].nodeType===nodeTypes.TEXT_NODE);var childPreformatted=array_contains(preFormattedElements,tagName);for(var i=0,len=rootNode.childNodes.length;i<len;i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation+indentationUnit,childStartNewLine,childPreformatted)}var endTag=lt+"/"+tagName+gt;xhtml+=childStartNewLine?newLine+indentation+endTag:endTag}return xhtml;case nodeTypes.TEXT_NODE:if(isWhitespace(rootNode)){xhtml=""}else{if(preformatted){xhtml=rootNode.nodeValue}else{var lines=splitIntoLines(trim(rootNode.nodeValue));var trimmedLines=[];for(var i=0,len=lines.length;i<len;i++){trimmedLines[i]=trim(lines[i])}xhtml=trimmedLines.join(newLine+indentation)}if(startNewLine){xhtml=newLine+indentation+xhtml}}return xhtml;case nodeTypes.CDATA_SECTION_NODE:return"<![CDATA["+rootNode.nodeValue+"]]>"+newLine;case nodeTypes.DOCUMENT_NODE:xhtml="";for(var i=0,len=rootNode.childNodes.length;i<len;i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation)}return xhtml;default:return""}}else{xhtml="";for(var i=0,len=rootNode.childNodes.length;i<len;i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation+indentationUnit)}return xhtml}}var layouts={};function createCommandLineFunctions(appender){ConsoleAppender.addGlobalCommandLineFunction("$",function(appender,args,returnValue){return document.getElementById(args[0])});ConsoleAppender.addGlobalCommandLineFunction("dir",function(appender,args,returnValue){var lines=[];for(var i=0,len=args.length;i<len;i++){lines[i]=dir(args[i])}return lines.join(newLine+newLine)});ConsoleAppender.addGlobalCommandLineFunction("dirxml",function(appender,args,returnValue){var lines=[];for(var i=0,len=args.length;i<len;i++){var win=appender.getCommandWindow();lines[i]=getXhtml(args[i])}return lines.join(newLine+newLine)});ConsoleAppender.addGlobalCommandLineFunction("cd",function(appender,args,returnValue){var win,message;if(args.length===0||args[0]===""){win=window;message="Command line set to run in main window"}else{if(args[0].window==args[0]){win=args[0];message="Command line set to run in frame '"+args[0].name+"'"}else{win=window.frames[args[0]];if(win){message="Command line set to run in frame '"+args[0]+"'"}else{returnValue.isError=true;message="Frame '"+args[0]+"' does not exist";win=appender.getCommandWindow()}}}appender.setCommandWindow(win);return message});ConsoleAppender.addGlobalCommandLineFunction("clear",function(appender,args,returnValue){returnValue.appendResult=false;appender.clear()});ConsoleAppender.addGlobalCommandLineFunction("keys",function(appender,args,returnValue){var keys=[];for(var k in args[0]){keys.push(k)}return keys});ConsoleAppender.addGlobalCommandLineFunction("values",function(appender,args,returnValue){var values=[];for(var k in args[0]){try{values.push(args[0][k])}catch(ex){logLog.warn("values(): Unable to obtain value for key "+k+". Details: "+getExceptionMessage(ex))}}return values});ConsoleAppender.addGlobalCommandLineFunction("expansionDepth",function(appender,args,returnValue){var expansionDepth=parseInt(args[0],10);if(isNaN(expansionDepth)||expansionDepth<0){returnValue.isError=true;return""+args[0]+" is not a valid expansion depth"}else{appender.setCommandLineObjectExpansionDepth(expansionDepth);return"Object expansion depth set to "+expansionDepth}})}function init(){createCommandLineFunctions();initialized=true}init()})();function addWindowLoadListener(listener){var oldOnload=window.onload;if(typeof window.onload!="function"){window.onload=listener}else{window.onload=function(evt){if(oldOnload){oldOnload(evt)}listener(evt)}}}addWindowLoadListener(function(){pageLoaded=true;log4javascript.dispatchEvent("load",{})});window.log4javascript=log4javascript})();var xtlLog=new log4javascript.getLogger();var popUpAppender=new log4javascript.PopUpAppender();xtlLog.addAppender(popUpAppender);(function($){$.metadata.setType('attr','xtldata');})(jQuery);var containers=new Array();var listeners=new Array();var components=new Array();var dataviews=new Array();;function Map()
{this.keyArray=new Array();this.valArray=new Array();}
Map.prototype={put:function(key,val){var elementIndex=this.findIt(key);if(elementIndex==(-1))
{this.keyArray.push(key);this.valArray.push(val);}
else
{this.valArray[elementIndex]=val;}},get:function(key){var result=null;var elementIndex=this.findIt(key);if(elementIndex!=(-1))
{result=this.valArray[elementIndex];}
return result;},remove:function(key){var result=null;var elementIndex=this.findIt(key);if(elementIndex!=(-1))
{this.keyArray=this.removeAt(this.keyArray,elementIndex);this.valArray=this.removeAt(this.valArray,elementIndex);}
return;},size:function(){return(this.keyArray.length);},clear:function(){for(var i=0;i<this.keyArray.length;i++)
{this.keyArray.pop();this.valArray.pop();}},keySet:function(){return(this.keyArray);},valSet:function(){return(this.valArray);},showMe:function(){var result="";for(var i=0;i<this.keyArray.length;i++)
{result+="Key: "+this.keyArray[i]+"\tValues: "+this.valArray[i]+"\n";}
return result;},findIt:function(key){var result=(-1);for(var i=0;i<this.keyArray.length;i++)
{if(this.keyArray[i]==key)
{result=i;break;}}
return result;},removeAt:function(array,index){var part1=array.slice(0,index);var part2=array.slice(index+1);return(part1.concat(part2));}};function StyleManager(element){this.styleHistory=new Map();this.styleCustom=new Map();this.styleOrigin=new Map();this.element=null;if($(element)&&$(element).size()>=1){this.element=$(element);}}
StyleManager.prototype={applyStyle:function(styleName,style){var customName,customValue,customOrigin;if($.xtlvalidate.object(style)&&this.element!==null){if(!$.xtlvalidate.string(styleName)){styleName='default';}
if(this.styleHistory.findIt(styleName)!==(-1)){this.removeStyle(styleName);}
if($.xtlvalidate.string(style.classes)){this.element.addClass(style.classes);}
for(customName in style.customs){customValue=style.customs[customName];if(this.styleOrigin.findIt(customName)===(-1)){customOrigin=this.element.css(customName);this.styleOrigin.put(customName,customOrigin);}
if(customValue!==null){this.applyCustom(customName,customValue);this.styleCustom.put(customName,styleName);}}
this.styleHistory.put(styleName,style);}},removeStyle:function(styleName){var style,customName;if(this.element!==null&&this.styleHistory.findIt(styleName)!==(-1)){style=this.styleHistory.get(styleName);this.styleHistory.remove(styleName);this.element.removeClass(style.classes);for(customName in style.customs){this.applyNextStyleForCustom(customName);}}},applyNextStyleForCustom:function(customName){var stylesLenght,stylesIndex,styleName,style,customValue;if(this.element!==null){stylesLenght=this.styleHistory.keyArray.length-1;for(stylesIndex=stylesLenght;stylesIndex>=0;stylesIndex--){styleName=this.styleHistory.keyArray[stylesIndex];style=this.styleHistory.get(styleName);customValue=style.customs[customName];if(customValue!==undefined){this.applyCustom(customName,customValue);this.styleCustom.put(customName,styleName);return;}}
customValue=this.styleOrigin.get(customName);this.applyCustom(customName,customValue);}},applyCustom:function(name,value){if(this.element!==null&&$.xtlvalidate.string(name)&&value!==undefined){if(name==='opacity'&&!$.support.opacity){}
else if(name!=='backgroundColor'&&value==='transparent'&&!$.support.opacity){this.element.css('border-color','fuchsia');this.element.css('filter','chroma(color=fuchsia)');}
else{this.element.css(name,value);}}}};;(function($){$.xtl={version:"0.1",debug:true,error:true,callWidgetsFromArray:function(liste){for(var i=0;i<liste.length;i++){liste[i]();}},arrayToString:function(data_array){var ret='',i,j,value,length;for(i in data_array){if(typeof(data_array[i])!=="function"){if($.isArray(data_array[i])){length=data_array[i].length;for(j=0;j<length;j++){ret+=(i+'='+data_array[i][j]+'&');}}else{ret+=(i+'='+data_array[i]+'&');}}}
ret=ret.substr(0,ret.length-1);return ret;},arrayToParam:function(param_name,data_array){var param=param_name+'[]=';var array_length=data_array.length;for(i=0;i<array_length;i++){param+=data_array[i];if(i<(array_length-1)){param+='&'+param_name+'[]=';}}
return param;},stringToArray:function(data_string){var arr=[],a=[],b=[];a=data_string.split('&');$.each(a,function(i,field){b=field.split('=');if(arr[b[0]]!==null){arr[b[0]]=arr[b[0]]+'XTL_SEPARATOR'+b[1];}else{arr[b[0]]=b[1];}});return arr;},ajax:function(oldCookie,options){var oldError,oldsuccess,newCookie;if($.xtlvalidate.func(options.success)){oldsuccess=options.success;options.sucess=function(html){newCookie=$.cookie('symfony');if(newCookie!=oldCookie){window.location=document.location;}else{oldSuccess.apply(this,[html]);}};}
if($.xtlvalidate.func(options.error)){oldError=options.error;}
options.error=function(XMLHttpRequest,textStatus,errorThrown){newCookie=$.cookie('symfony');if(newCookie!=oldCookie||XMLHttpRequest.status==401){window.location=document.location;}else if($.xtlvalidate.func(oldError)){oldError.apply(this,[XMLHttpRequest,textStatus,errorThrown]);}};$.ajax(options);}};$.xtleffect={show:function(target,effect){if(target.size()>0&&$.xtlvalidate.string(effect)){switch(effect){case'show':target.show();break;case'slide':target.slideDown("normal");default:break;}}},hide:function(target,effect){if(target.size()>0&&$.xtlvalidate.string(effect)){switch(effect){case'hide':target.hide();break;case'slide':target.slideUp("normal");default:break;}}}};$.xtlprepare={callback:function(callback){var callbackPrepared=callback;if($.isArray(callback)){if(callback.length===1){callbackPrepared=[null,callback[0]];}}else if($.xtlvalidate.func(callback)){callbackPrepared=[null,callback];}else{callbackPrepared=[null,null];}
return callbackPrepared;},trigger:function(trigger){var triggerPrepared=trigger;if($.isArray(trigger)){if(trigger.length===1){triggerPrepared=[trigger[0],trigger[0]];}}else if($.xtlvalidate.string(trigger)){triggerPrepared=[trigger,trigger];}else{triggerPrepared=[null,null];}
return triggerPrepared;},switchFunc:function(switchFunc){var switchPrepared=switchFunc;if($.xtlvalidate.array(switchFunc)&&switchFunc.length==2){switchPrepared=switchFunc;}else{switchPrepared=[null,null];}
return switchPrepared;},action:function(action){var actionPrepared=action;if($.xtlvalidate.func(action)){actionPrepared=$.xtlobject.action(null,null,action);}else if(!$.xtlvalidate.string(action)&&!$.xtlvalidate.object(action)){actionPrepared=null;}
return actionPrepared;},array:function(array){var arrayPrepared=array;if($.xtlvalidate.string(array)){arrayPrepared=array.replace(/ /,'').split(',');}else if(!$.isArray(array)||array.length===0){arrayPrepared=[];}
return arrayPrepared;},string:function(string){var stringPrepared=string;if(!$.xtlvalidate.string(string)||string==''){stringPrepared=null;}
return stringPrepared;},object:function(object){var objectPrepared=object;if(!$.xtlvalidate.object(object)){objectPrepared={};}
return objectPrepared;},style:function(style){var stylePrepared=style;if($.xtlvalidate.string(style)){stylePrepared=$.xtlobject.style(style);}
return stylePrepared;},func:function(func){var funcPrepared=func;if(!$.xtlvalidate.func(func)){funcPrepared=null;}
return funcPrepared;}};$.xtlvalidate={func:function(func){if(func!==null&&$.isFunction(func)){return true;}
return false;},string:function(string){if(string!==null&&typeof string==='string'){return true;}
return false;},object:function(object){if(object!==null&&typeof object==='object'){return true;}
return false;},objectId:function(objectId){if($.xtlvalidate.string(objectId)&&$('#'+objectId).size()===1){return true;}
return false;},array:function(array){if(array!==null&&$.isArray(array)&&array.length>0){return true;}
return false;}};$.xtlobject={action:function(ajaxUrl,ajaxParam,actionBehavior,successBehavior){return{url:ajaxUrl,param:ajaxParam,behavior:actionBehavior,successBehavior:successBehavior};},actionCall:function(actionName,actionArgs){return{name:actionName,args:actionArgs};},observable:function(observableType,observableId,observableAttr,ajaxUrl,ajaxParam,targetId,behavior){return{type:observableType,id:observableId,attribute:observableAttr,url:ajaxUrl,param:ajaxParam,target:targetId,behavior:behavior};},dependency:function(dependencyTypeCall,dependencyTypeName,dependencyId,dependencyAttr,behavior){return{callType:dependencyTypeCall,type:dependencyTypeName,id:dependencyId,attribute:dependencyAttr,behavior:behavior};},target:function(targetType,targetId){return{type:targetType,id:targetId};},view:function(viewId,viewMethod,viewOptions){return{id:viewId,method:viewMethod,options:viewOptions};},style:function(cssClass,cssCustomOptions){cssClass=$.xtlprepare.string(cssClass);cssCustomOptions=$.xtlprepare.object(cssCustomOptions);return{classes:cssClass,customs:cssCustomOptions};},truncate:function(originalText,originalSize,tooltipElem){return{text:originalText,size:originalSize,tooltip:tooltipElem};}};$.xtllog={debug:function(message,object){if($.xtl.debug&&xtlLog){if(object===undefined){xtlLog.debug(message);}else{xtlLog.debug(message,object);}}},error:function(message,object){if($.xtl.error&&xtlLog){if(object===undefined){xtlLog.error(message);}else{xtlLog.error(message,object);}}}};$.fn.extend({findPos:function(){obj=$(this).get(0);var curleft,curtop;if(obj.offsetLeft){curleft=obj.offsetLeft;}else{curleft=0;}
if(obj.offsetTop){curtop=obj.offsetTop;}else{curtop=0;}
obj=obj.offsetParent;while(obj){curleft+=obj.offsetLeft;curtop+=obj.offsetTop;obj=obj.offsetParent;}
return{x:curleft,y:curtop};},callFrom:function(targetType,actionName,actionArgs){var targetWidget=$(this).data(targetType),applyArgs=[actionName];if($.xtlvalidate.string(targetWidget)&&$.xtlvalidate.string(actionName)){if($.isArray(actionArgs)){applyArgs=applyArgs.concat(actionArgs);}else{applyArgs=[actionName,actionArgs];}
return $.fn[targetWidget].apply($(this),applyArgs);}/*else{$.xtllog.error("callFrom with bad arguments : "
+targetType+"=>"+targetWidget,actionName,actionArgs);$.xtllog.error("callFrom element : ",this);}*/},verticalAlign:function(parentHeight,align){var height=$(this).outerHeight(),heightDiff;heightDiff=parentHeight-height;if(heightDiff>0){switch(align){case'bottom':$(this).css('margin-top',heightDiff);break;case'center':default:$(this).css('margin-top',heightDiff/2);break;}}},applyStyle:function(styleName,style){var styleManager=$(this).data('styleManager');if(styleManager===undefined||styleManager===null){styleManager=new StyleManager(this);$(this).data('styleManager',styleManager);}
styleManager.applyStyle(styleName,style);},removeStyle:function(styleName){var styleManager=$(this).data('styleManager');if(styleManager===undefined){return;}
styleManager.removeStyle(styleName);},truncate:function(elementSize,tooltipTarget){var truncateObj,originalText,originalSize,tooltipElem,tooltipExist=false,textWithPoints,textWithPointsSize,textLength,charSize,dotDotDot,nbChars,truncatedText;truncateObj=$(this).data('truncate');if(!$.xtlvalidate.object(truncateObj)){originalText=$(this).text();originalSize=$(this).textSize(originalText);truncateObj=$.xtlobject.truncate(originalText,originalSize);}
if(!$.xtlvalidate.object(truncateObj.tooltip)){if($.xtlvalidate.object(tooltipTarget)){tooltipElem=tooltipTarget;}else{tooltipElem=$(this);}}else{tooltipExist=true;tooltipElem=truncateObj.tooltip;}
if(truncateObj.size>elementSize){charSize=truncateObj.size/parseInt(truncateObj.text.length);charSize++;dotDotDot=3*charSize;nbChars=(elementSize-dotDotDot)/charSize;truncatedText=truncateObj.text.substr(0,nbChars)+'...';$(this).text(truncatedText);if(tooltipTarget!==false&&!tooltipExist){tooltipElem.viewTooltip({contentText:truncateObj.text,positions:'top',styleOptions:{padding:'5px'}});truncateObj.tooltip=tooltipElem;}else if(tooltipTarget!==false&&tooltipExist){}else if(!tooltipTarget&&tooltipExist){tooltipElem.viewTooltip("destroy");truncateObj.tooltip=undefined;}}else{$(this).text(truncateObj.text);if(tooltipExist){tooltipElem.viewTooltip("destroy");truncateObj.tooltip=undefined;}}
$(this).data('truncate',truncateObj);},textSize:function(text){var textSizeElement=$('body').data("text-size-element");if(!$.xtlvalidate.object(textSizeElement)){textSizeElement=$('<span></span>').css('position','absolute').css('left','-1000px').css('top','-1000px').attr("id","text-size-element-id");$('body').append(textSizeElement);$('body').data("text-size-element",textSizeElement);}else{textSizeElement.text('');}
textSizeElement.css('font-family',$(this).css('font-family'));textSizeElement.css('font-style',$(this).css('font-style'));textSizeElement.css('font-weight',$(this).css('font-weight'));textSizeElement.css('letter-spacing',$(this).css('letter-spacing'));textSizeElement.css('padding',$(this).css('padding'));textSizeElement.css('border',$(this).css('border'));textSizeElement.append(text);return textSizeElement.outerWidth();},replaceHtml:function(el,html){var oldEl=typeof el==="string"?document.getElementById(el):el;oldEl.innerHTML=html;var x=oldEl.getElementsByTagName("script");for(var i=0;i<x.length;i++)
{eval(x[i].text);}
return oldEl;var newEl=oldEl.cloneNode(false);newEl.innerHTML=html;oldEl.parentNode.replaceChild(newEl,oldEl);return newEl;}});$.xtlcore=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1),instance;if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isfunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlcore.defaults,$.xtlcore.params,$[namespace][name].defaults,$[namespace][name].params,$.metadata&&$.metadata.get(element),options);};$[namespace][name].prototype=$.extend({},$.xtlcore.prototype,prototype);};$.xtlcore.prototype={_init:function(){this.selectors={};this.css={};this.constants={};this.back={};this.functions={};this.components={};this.components.builds=[];this.id=this.element.attr("id");this._prepareOptions();this._build();this.element.addClass(this.options.typecss);this.element.addClass(this.options.customcss);this._bind();this._log("initialized...");},destroy:function(){this._unbind();this._destroy();this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace
+'-state-disabled').removeAttr('aria-disabled');this.element.removeClass(this.options.typecss);this.element.removeClass(this.options.customcss);$(this.components.builds).each(function(){$(this).remove();});this._log("destroyed...");return this;},_prepareOptions:function(){this.targets={};},_build:function(){},_destroy:function(){},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},addTarget:function(targetKey,targetId){if($.xtlvalidate.string(targetKey)&&$.xtlvalidate.string(targetId)){this.targets[targetKey]=targetId;}},getTarget:function(targetKey){var id=this.targets[targetKey];if($.xtlvalidate.string(id)&&$.xtlvalidate.objectId(id)){return $('#'+id);}},getTargetId:function(targetKey){var id=this.targets[targetKey];if($.xtlvalidate.string(id)&&$.xtlvalidate.objectId(id)){return id;}},_bind:function(){},_unbind:function(){},_log:function(message,object){var id='undefined';if(this.element){id=this.element.attr("id");}
/*if(this.options.logDebug===true){$.xtllog.debug(this.widgetName+" '"+id+"' : "+message,object);}*/},_logError:function(message,object){var id='undefined';if(this.element){id=this.element.attr("id");}
/*if(this.options.logError===true){$.xtllog.error(this.widgetName+" '"+id+"' : "+message,object);}*/},option:function(key,value){var options=key,self=this;if(typeof key==="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key==='disabled'){this.element[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '
+this.namespace+'-state-disabled').attr("aria-disabled",value);}},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+"-"+type),i;event=$.Event(event);event.type=eventName;if(event.originalEvent){for(i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isfunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.xtlcore.defaults={disabled:false};$.xtlcore.params={logDebug:false,logError:true,typecss:'xtlcore',customcss:''};})(jQuery);;(function($){$.xtlview=function(name,prototype){var namespace=name.split(".")[0],instance;name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlview.defaults,$.xtlview.params,$.xtlview.observe,$.xtlview.labels,$.xtlview.dimensions,$.xtlview.states,$.xtlview.styles,$[namespace][name].defaults,$[namespace][name].params,$[namespace][name].observe,$[namespace][name].dimensions,$[namespace][name].states,$[namespace][name].styles,$.metadata&&$.metadata.get(element)[name],options);this.options.states=$.extend({},$.xtlview.states.states,($[namespace][name].states!=undefined&&$[namespace][name].states.states!=undefined)?$[namespace][name].states.states:{},($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].states!==undefined)?$.metadata.get(element)[name].states:{},(options!==undefined&&options.states!==undefined)?options.states:{});this.options.statesStyle=$.extend({},$.xtlview.styles.statesStyle,($[namespace][name].styles!=undefined&&$[namespace][name].styles.statesStyle!=undefined)?$[namespace][name].styles.statesStyle:{},($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].statesStyle!==undefined)?$.metadata.get(element)[name].statesStyle:{},(options!==undefined&&options.statesStyle!==undefined)?options.statesStyle:{});this.options.styles=$.extend({},$.xtlview.styles.styles,($[namespace][name].styles!=undefined&&$[namespace][name].styles.styles!=undefined)?$[namespace][name].styles.styles:{},($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].styles!==undefined)?$.metadata.get(element)[name].styles:{},(options!==undefined&&options.styles!==undefined)?options.styles:{});};$[namespace][name].prototype=$.extend({},$.xtlview.prototype,prototype);};$.xtlview.prototype=$.extend({},$.xtlcore.prototype,{_prepareOptions:function(){var observers=this.options.observers,self=this;if(!$.xtlvalidate.object(this.options.stateTarget)){this.options.stateTarget=this.element;}
this.observers=$.xtlprepare.array(observers);this.observables={};if($.xtlvalidate.object(this.options.observables)){this.observables=this.options.observables;}
this.options.show=$.xtlprepare.callback(this.options.show);this.options.hide=$.xtlprepare.callback(this.options.hide);this.options.showEffect=$.xtlprepare.trigger(this.options.showEffect);this.options.stateDefaultAction=$.xtlprepare.switchFunc(this.options.stateDefaultAction);this.options.stateStyleAction=$.xtlprepare.switchFunc(this.options.stateStyleAction);this.options.styleAction=$.xtlprepare.switchFunc(this.options.styleAction);this.options.styles=$.xtlprepare.object(this.options.styles);this.functions.modelReloaded=function(event){self._subscribeToObservables();self._eventModelReloaded(event);};},_build:function(){this.isShow=this.options.shown;this.back.state=null;this._subscribeToObservables();this._buildStaticView();if(this.options.state!=='disabled'){this._enableDynamicView();}
if(this.options.styles.init!==undefined){this.element.applyStyle('init',$.xtlprepare.style(this.options.styles.init));}
this._updateView();$.xtlcore.prototype._build.apply(this,arguments);},_destroy:function(){var state=this.options.state;this._callState(state,true);if(this.options.styles.init!==undefined){this.element.removeStyle('init');}
this._disableDynamicView();this._destroyStaticView();$('.xtlview',this.element).each(function(){$(this).callFrom('view','destroy');});},_buildStaticView:function(){},_destroyStaticView:function(){},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){this._updateState();this._updateSize();this._updateShow();},_getStyle:function(styleName){var styles=this.options.styles;if($.xtlvalidate.object(styles)&&$.xtlvalidate.string(styleName)){return $.xtlprepare.style(styles[styleName]);}},_getStateStyle:function(state){var defaultStylesCss=this.options.statesStyle,styleCss=null;if($.xtlvalidate.object(defaultStylesCss)){styleCss=defaultStylesCss[state];}
return $.xtlprepare.style(styleCss);},_stateSupported:function(newState){var states=this.options.states;if(states[newState]!==false&&states[newState]!==undefined){return true;}else{return false;}},_callState:function(state,clean){var indexOfCallback,states=this.options.states,stateDefaultAction=this.options.stateDefaultAction;if(clean!==true){indexOfCallback=0;}else{indexOfCallback=1;}
if(states[state]===true){if($.xtlvalidate.func(stateDefaultAction[indexOfCallback])){stateDefaultAction[indexOfCallback].apply(this,[state]);}else{this._logError("the state "+state+" is not a standard state so it must be define like : [apply(), clean()]");}}
else if($.xtlvalidate.array(states[state])&&$.xtlvalidate.func(states[state][indexOfCallback])){states[state][indexOfCallback].apply(this,[state]);}},_callStateStyle:function(state,clean){var indexOfCallback,stateStyleAction=this.options.stateStyleAction,styleAction=this.options.styleAction;if(clean!==true){indexOfCallback=0;}else{indexOfCallback=1;}
if($.xtlvalidate.func(stateStyleAction[indexOfCallback])){stateStyleAction[indexOfCallback].apply(this,[state]);}
if($.xtlvalidate.func(styleAction[indexOfCallback])){styleAction[indexOfCallback].apply(this);}},state:function(newState){if(newState===undefined){return this.options.state;}else{if(this._stateSupported(newState)){this.back.state=this.options.state;this.options.state=newState;this._updateState();}else{this._log("state "+newState+" is not supported");return;}}},_observable:function(observableName){var observables=this.observables;if($.xtlvalidate.object(observables)&&$.xtlvalidate.string(observableName)){return observables[observableName];}},_addToObservables:function(callType,type,id){var newObservable=$.xtlobject.observable(callType,id),newArray=[];if($.xtlvalidate.string(type)&&$.xtlvalidate.string(id)){if($.xtlvalidate.array(this.observables[type])&&!this._observableExist(this.observables[type],newObservable)){this.observables[type].push(newObservable);}
else if($.xtlvalidate.object(this.observables[type])&&!this._sameObservable(newObservable,this.observables[type])){newArray.push(this.observables[type]);newArray.push(newObservable);this.observables[type]=newArray;}
else if(!$.xtlvalidate.object(this.observables[type])){this.observables[type]=newObservable;}}},_observableExist:function(listObservables,observable){var result=false,currentObservable,observableIndex,observablesLenght;if($.xtlvalidate.object(listObservables)){observablesLenght=listObservables.lenght;for(observableIndex=0;observableIndex<observablesLenght;observableIndex++){currentObservable=listObservables[observableIndex];if(this._sameObservable(currentObservable,observable)){return true;}}}
return result;},_sameObservable:function(observable1,observable2){var result=false;if($.xtlvalidate.object(observable1)&&$.xtlvalidate.object(observable2)){if(observable1.type==observable2.type&&observable1.id==observable2.id){result=true;}}
return result;},_subscribeToObservables:function(){var self=this,observables=this.observables,observable;if($.xtlvalidate.object(observables)){for(obsName in observables){observable=observables[obsName];if($.xtlvalidate.array(observable)){$.each(observable,function(){if($.xtlvalidate.object(this)){$("#"+this.id).callFrom(this.type,'addObserver',self.id);}});}else if($.xtlvalidate.object(observable)){$("#"+observable.id).callFrom(observable.type,'addObserver',this.id);}}}},_triggerToObservers:function(eventName,observableAttribute,changeArgs){this._log("debut _triggerToObservers");var observers=this.observers,indexObservers,eventToObservers,observersLength;if($.isArray(observers)){eventToObservers=$.Event(eventName);eventToObservers.observableName=this.widgetName;if(observableAttribute!==undefined){eventToObservers.observableAttribute=observableAttribute;eventToObservers.changeArgs=changeArgs;}
observersLength=observers.length;for(indexObservers=0;indexObservers<observersLength;indexObservers++){$("#"+observers[indexObservers]).triggerHandler(eventToObservers);}}
this._log("fin _triggerToObservers");},_updateShow:function(){if(this.isShow){this.show();}else{this.hide();}},_updateState:function(){if($.xtlvalidate.string(this.options.state)){if(this.options.state==='disabled'||this.options.state==='readonly'){this._disableDynamicView();}else if($.xtlvalidate.string(this.back.state)){this._enableDynamicView();}
if($.xtlvalidate.string(this.back.state)&&this.options.state!=this.back.state){this._callState(this.back.state,true);}
this._callState(this.options.state);}},_updateSize:function(){var newWidth,newHeight;if(this.options.width!==null){newWidth=this.options.width;}else{newWidth=false;}
if(this.options.height!==null){newHeight=this.options.height;}else{newHeight=false;}
this.resize(newWidth,newHeight);},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_showEffect:function(target){var showEffect=this.options.showEffect;if($.xtlvalidate.func(showEffect)){showEffect[0].apply(this,[target]);}else{$.xtleffect.show.apply(this,[target,showEffect[0]]);}},_hideEffect:function(target){var showEffect=this.options.showEffect;if($.xtlvalidate.func(showEffect)){showEffect[1].apply(this,[target]);}else{$.xtleffect.hide.apply(this,[target,showEffect[1]]);}},addObserver:function(observerId){var index=-1;if(!$.isArray(this.observers)){this.observers=[];}
if(observerId!==undefined&&observerId!==null){index=$.inArray(observerId,this.observers);if(index===-1){this.observers.push(observerId);}}},switchShow:function(){if(this.isShow===true){this.hide();}else{this.show();}},show:function(){var callback=this.options.show;if($.xtlvalidate.func(callback[0])){callback[0].apply(this);}
this.isShow=true;this._showEffect(this.element);if($.xtlvalidate.func(callback[1])){callback[1].apply(this);}},hide:function(){var callback=this.options.hide;if($.xtlvalidate.func(callback[0])){callback[0].apply(this);}
this.isShow=false;this._hideEffect(this.element);if($.xtlvalidate.func(callback[1])){callback[1].apply(this);}},resize:function(width,height){var res={width:true,height:true},minWidth=this.options.minWidth,maxWidth=this.options.maxWidth,minHeight=this.options.minHeight,maxHeight=this.options.maxHeight;if(width!==false&&typeof width!=="string"){if(minWidth!==false&&width<minWidth){res.width=minWidth;}else if(maxWidth!==false&&width>maxWidth){res.width=maxWidth;}else{this._resizeWidth(width);}}
if(height!==false&&typeof height!=="string"){if(minHeight!==false&&height<minHeight){res.height=minHeight;}else if(maxHeight!==false&&height>maxHeight){res.height=maxHeight;}else{this._resizeHeight(height);}}
return res;},_bind:function(){this._bindObservableEvent();},_unbind:function(){this._unbindObservableEvent();},_bindObservableEvent:function(){var self=this;this.element.bind("xtl-observable-change",function(event){self._eventObservableChange(event);}).bind("xtl-model-after-reload",this.functions.modelReloaded);},_unbindObservableEvent:function(){this.element.unbind('xtl-observable-change').unbind("xtl-model-after-reload",this.functions.modelReloaded);},_eventObservableChange:function(event){},_eventModelReloaded:function(event){}});$.xtlview.defaults=$.extend({},$.xtlcore.defaults,{shown:true,showEffect:["show","hide"],show:null,hide:null});$.xtlview.observe={observables:{},observers:[]};$.xtlview.params=$.extend({},$.xtlcore.params,{typecss:'xtlview'});$.xtlview.labels={noValue:null,searchItems:null,deleteSearch:null,searchCriteria:null,from:null,to:null,isEmpty:null,pagerTo:null,pagerOn:null,pagerResults:null,deleteAllSearch:null,pagerFirst:null,pagerBefore:null,pagerNext:null,pagerLast:null};$.xtlview.dimensions={height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150};$.xtlview.states={state:'normal',states:{normal:true,error:true,highlight:true,disabled:true},stateTarget:null,stateDefaultAction:[function(state){this._callStateStyle(state);},function(state){this._callStateStyle(state,true);}]};$.xtlview.styles={styles:{init:null},statesStyle:{normal:null,error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'},stateStyleAction:[function(state){var element=this.options.stateTarget,styleCss=this._getStateStyle(state);if($.xtlvalidate.object(styleCss)){element.each(function(){$(this).applyStyle(state,styleCss);});}},function(state){var element=this.options.stateTarget,styleCss=this._getStateStyle(state);if($.xtlvalidate.object(styleCss)){element.each(function(){$(this).removeStyle(state);});}}],styleAction:[null,null]};})(jQuery);;(function($){$.xtlcontroller=function(name,prototype){var namespace=name.split(".")[0],instance;name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlcontroller.defaults,$.xtlcontroller.params,$.xtlcontroller.actions,$[namespace][name].defaults,$[namespace][name].params,$[namespace][name].actions,$.metadata&&$.metadata.get(element)[name],options);this.options.actions=$.extend({},$.xtlcontroller.actions.actions,$[namespace][name].actions.actions,($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].actions!==undefined)?$.metadata.get(element)[name].actions:{},(options!==undefined&&options.actions!==undefined)?options.actions:{});};$[namespace][name].prototype=$.extend({},$.xtlcontroller.prototype,prototype);};$.xtlcontroller.prototype=$.extend({},$.xtlcore.prototype,{_prepareOptions:function(){$.xtlcore.prototype._prepareOptions.apply(this);},_build:function(){$.xtlcore.prototype._build.apply(this);},_destroy:function(){$.xtlcore.prototype._destroy.apply(this);},_model:function(){this._log("model...get");return this._getData("model");},_action:function(key){if(key!==undefined){this._log("action...get : ",key);return this._getData("actions")[key];}
return null;},_callback:function(key){if(key!==undefined){this._log("callback...get : ",key);return this._getData("callbacks")[key];}
return null;},_controller:function(key){if(key!==undefined){this._log("controller...get : ",key);return this._getData("controllers")[key];}
return null;},_execute:function(controllerName,actionCall){var controller=this._controller(controllerName);if($.xtlvalidate.string(controller)){$("#"+controller).callFrom("controller","execute",actionCall);}},_refresh:function(ajaxUrl,ajaxData,successBehavior){var model=this._model();if($.xtlvalidate.objectId(model)){$("#"+model).callFrom("model","reload",[ajaxUrl,ajaxData,successBehavior]);}},execute:function(actionCall){this._log("debut execute");var action=this._action(actionCall.name),callback=this._callback(actionCall.name),defaultAction=this.options.actionDefaultBehavior;action=$.xtlprepare.action(action);if(action!==null){if($.xtlvalidate.string(action)){this._log("renvoi action à son controller : ",action);this._execute(action,actionCall);}else{callback=$.xtlprepare.callback(callback);if($.xtlvalidate.func(callback[0])){this._log("execute le callback avant l'action");callback[0].apply(this,[actionCall.args]);}
if($.xtlvalidate.func(action.behavior)){this._log("execute l'action redéfinie");action.behavior.apply(this,[action,actionCall.args]);}else if($.xtlvalidate.func(defaultAction)){this._log("execute l'action par défaut");defaultAction.apply(this,[action,actionCall.args]);}
if($.xtlvalidate.func(callback[1])){this._log("execute le callback apres l'action");callback[1].apply(this,[actionCall.args]);}}}else{this._log("renvoi action à mon pere");this._execute("parent",actionCall);}
this._log("fin execute");}});$.xtlcontroller.defaults=$.extend({},$.xtlcore.defaults,{model:null,controllers:{}});$.xtlcontroller.params=$.extend({},$.xtlcore.params,{typecss:'xtlcontroller'});$.xtlcontroller.actions={actions:{},callbacks:{},actionDefaultUrl:null,actionDefaultBehavior:function(action,args){var ajaxData='',ajaxUrl=action.url,defaultUrl=this.options.actionDefaultUrl;if($.xtlvalidate.string(action.param)){ajaxData+=action.param+"=";ajaxData+=args;}else if($.xtlvalidate.func(action.param)){ajaxData=action.param.apply(this,[action,args]);}else if(action.param===null){ajaxData='';}else{return;}
this._log('ajaxData : '+ajaxData);if(!$.xtlvalidate.string(ajaxUrl)&&$.xtlvalidate.string(defaultUrl)){ajaxUrl=defaultUrl;}else if(!$.xtlvalidate.string(ajaxUrl)){return;}
this._log('ajaxUrl : '+ajaxUrl);this._refresh(ajaxUrl,ajaxData,action.successBehavior);}};})(jQuery);;(function($){$.xtlmodel=function(name,prototype){var namespace=name.split(".")[0],instance;name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isfunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlmodel.defaults,$.xtlmodel.params,$.xtlmodel.observe,$[namespace][name].defaults,$[namespace][name].params,$[namespace][name].observe,$.metadata&&$.metadata.get(element)[name],options);};$[namespace][name].prototype=$.extend({},$.xtlmodel.prototype,prototype);};$.xtlmodel.prototype=$.extend({},$.xtlcore.prototype,{_prepareOptions:function(){var observers=this.options.observers;this.observers=$.xtlprepare.array(observers);},_build:function(){this._subscribeToObservables();$.xtlcore.prototype._build.apply(this,arguments);},_ajaxData:function(){return null;},_subscribeToObservables:function(){var self=this,observables=this.options.observables,observable;if(observables!==null&&$.param(observables).length>0){for(obsName in observables){observable=observables[obsName];if($.isArray(observable)){$.each(observable,function(){$("#"+this.id).callFrom(this.type,'addObserver',self.id);});}else{$("#"+observable.id).callFrom(observable.type,'addObserver',this.id);}}}},_triggerToObservers:function(eventName,observableAttribute,changeArgs){this._log("debut _triggerToObservers");var observers=this.observers,indexObservers,eventToObservers,observersLength;if($.isArray(observers)){eventToObservers=$.Event(eventName);eventToObservers.observableName=this.widgetName;if(observableAttribute!==undefined){eventToObservers.observableAttribute=observableAttribute;eventToObservers.changeArgs=changeArgs;}
observersLength=observers.length;for(indexObservers=0;indexObservers<observersLength;indexObservers++){$("#"+observers[indexObservers]).triggerHandler(eventToObservers);}}
this._log("fin _triggerToObservers");},refresh:function(htmlContent){this._log("debut refresh");var self=this,beforeReloadCallback=this.options.beforeReload,afterReloadCallback=this.options.afterReload;if(beforeReloadCallback!==undefined&&beforeReloadCallback!==null&&$.isfunction(beforeReloadCallback)){beforeReloadCallback.apply(this,[ajaxUrl,ajaxData]);}
this._triggerToObservers('xtl-model-before-reload');this._triggerToObservers('xtl-observable-change','reload-begin');$("#"+this.id).callFrom("view","destroy");this.element.empty();this.element.html(htmlContent);if(afterReloadCallback!==undefined&&afterReloadCallback!==null&&$.isfunction(afterReloadCallback)){afterReloadCallback.apply(this,[ajaxUrl,ajaxData]);}
this._triggerToObservers('xtl-model-after-reload');this._triggerToObservers('xtl-observable-change','reload-end');this._log("fin refresh");},reload:function(ajaxUrl,ajaxData){this._log("debut reload");var self=this,beforeReloadCallback=this.options.beforeReload,afterReloadCallback=this.options.afterReload,oldCookie;if(ajaxData===undefined){ajaxData=this._ajaxData();}else if(typeof ajaxData!=="string"){ajaxData=$.param(ajaxData);}
if(beforeReloadCallback!==undefined&&beforeReloadCallback!==null&&$.isfunction(beforeReloadCallback)){beforeReloadCallback.apply(this,[ajaxUrl,ajaxData]);}
oldCookie=$.cookie('symfony');this._log("reload... ajaxUrl : ",ajaxUrl);this._triggerToObservers('xtl-model-before-reload');this._triggerToObservers('xtl-observable-change','reload-begin');$.xtl.ajax(oldCookie,{type:"GET",url:ajaxUrl,data:ajaxData,success:function(html){$("#"+self.id).callFrom("view","destroy");self.element.empty();var start=new Date();self.element.html(html);self._triggerToObservers('xtl-model-after-reload');self._triggerToObservers('xtl-observable-change','reload-end');}});if(afterReloadCallback!==undefined&&afterReloadCallback!==null&&$.isfunction(afterReloadCallback)){afterReloadCallback.apply(this,[ajaxUrl,ajaxData]);}
this._log("fin reload");},addObserver:function(observerId){var index=-1;if(!$.isArray(this.observers)){this.observers=[];}
if(observerId!==undefined&&observerId!==null){index=$.inArray(observerId,this.observers);if(index===-1){this.observers.push(observerId);}}},_bind:function(){var self=this;this.element.bind("xtl-observable-change",function(event){self._eventObservableChange(event);}).bind("xtl-reload",function(event){self._eventReload(event);});},_unbind:function(){this.element.unbind('xtl-observable-change').unbind('xtl-reload');},_eventReload:function(event){var ajaxUrl=event.originalEvent.ajaxUrl,ajaxData=event.originalEvent.ajaxData;if(ajaxUrl!==null){this.reload(ajaxUrl,ajaxData);}},_eventObservableChange:function(event){}});$.xtlmodel.defaults=$.extend({},$.xtlcore.defaults,{beforeReload:null,afterReload:null});$.xtlmodel.params=$.extend({},$.xtlcore.params,{typecss:'xtlmodel'});$.xtlmodel.observe={observables:{},observers:[]};})(jQuery);;(function($){$.xtlmodelview=function(name,prototype){var namespace=name.split(".")[0],instance;name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlmodelview.defaults,$.xtlmodelview.params,$.xtlmodelview.observe,$[namespace][name].defaults,$[namespace][name].params,$[namespace][name].observe,$.metadata&&$.metadata.get(element)[name],options);};$[namespace][name].prototype=$.extend({},$.xtlmodelview.prototype,prototype);};$.xtlmodelview.prototype=$.extend({},$.xtlcore.prototype,{_prepareOptions:function(){var self=this,observers=this.options.observers;this.observers=$.xtlprepare.array(observers);this._prepareItemsAndObservables();this.functions.bindDependencyChange=function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute,observable=self.options.observables[observableName],behaviors=self.observablesBehavior,observableBehaviors,attributeBehaviors;if($.xtlvalidate.object(behaviors)&&$.xtlvalidate.object(behaviors[observableName])){observableBehaviors=behaviors[observableName];if($.xtlvalidate.string(observableAttribute)&&$.xtlvalidate.array(observableBehaviors[observableAttribute])){attributeBehavior=observableBehaviors[observableAttribute];}else{attributeBehavior=observableBehaviors['undefined'];}
if($.xtlvalidate.array(attributeBehavior)){$.each(attributeBehavior,function(){if($.xtlvalidate.func(this)){this.apply(self,[]);}});}}};$.xtlcore.prototype._prepareOptions.apply(this);},_prepareItemsAndObservables:function(){this._log("debut _prepareItemsAndObservables");var observables=this.options.observables,items=this.options.items,itemChilds=this.options.itemChilds,itemKey,item,childs,dependency,dependencyIndex,dependenciesLength;this.observables={};if($.xtlvalidate.object(observables)){this.observables=observables;}
this.observablesBehavior={};this.items={};this.itemsChanges={};if($.xtlvalidate.object(items)){for(itemKey in items){item=items[itemKey];if($.xtlvalidate.array(item.dependencies)){dependenciesLength=item.dependencies.length;for(dependencyIndex=0;dependencyIndex<dependenciesLength;dependencyIndex++){dependency=item.dependencies[dependencyIndex];if($.xtlvalidate.object(dependency)){this._addToObservables(dependency.callType,dependency.type,dependency.id);this._addBehaviorToObservable(dependency.type,dependency.attribute,dependency.behavior);}}}
childs=itemChilds[itemKey];if($.xtlvalidate.array(childs)){item.childs=childs;}
this.itemsChanges[itemKey]={};this.items[itemKey]=item;}}
this._log("fin _prepareItemsAndObservables");},_build:function(){$.xtlcore.prototype._build.apply(this);this._subscribeToObservables();},_destroy:function(){$.xtlcore.prototype._destroy.apply(this);},item:function(itemKey){if($.xtlvalidate.string(itemKey)&&$.xtlvalidate.object(this.items)){return this.items[itemKey];}else{return undefined;}},_addToObservables:function(callType,type,id){var newObservable=$.xtlobject.observable(callType,id),newArray=[];if($.xtlvalidate.string(type)&&$.xtlvalidate.string(id)){if($.xtlvalidate.array(this.observables[type])&&!this._observableExist(this.observables[type],newObservable)){this.observables[type].push(newObservable);}
else if($.xtlvalidate.object(this.observables[type])&&!this._sameObservable(newObservable,this.observables[type])){newArray.push(this.observables[type]);newArray.push(newObservable);this.observables[type]=newArray;}
else if(!$.xtlvalidate.object(this.observables[type])){this.observables[type]=newObservable;}}},_addBehaviorToObservable:function(type,attribute,behavior){var preparedAttribute=attribute,typeBehaviors;if($.xtlvalidate.string(type)&&$.xtlvalidate.func(behavior)){if(!$.xtlvalidate.object(this.observablesBehavior[type])){this.observablesBehavior[type]={};}
if(!$.xtlvalidate.string(preparedAttribute)){preparedAttribute='undefined';}
typeBehaviors=this.observablesBehavior[type];if($.xtlvalidate.array(typeBehaviors[preparedAttribute])){this.observablesBehavior[type][preparedAttribute].push(behavior);}else{this.observablesBehavior[type][preparedAttribute]=[];this.observablesBehavior[type][preparedAttribute].push(behavior);}}},_observableExist:function(listObservables,observable){var result=false,currentObservable,observableIndex,observablesLenght;if($.xtlvalidate.object(listObservables)){observablesLenght=listObservables.lenght;for(observableIndex=0;observableIndex<observablesLenght;observableIndex++){currentObservable=listObservables[observableIndex];if(this._sameObservable(currentObservable,observable)){return true;}}}
return result;},_sameObservable:function(observable1,observable2){var result=false;if($.xtlvalidate.object(observable1)&&$.xtlvalidate.object(observable2)){if(observable1.type==observable2.type&&observable1.id==observable2.id){result=true;}}
return result;},_subscribeToObservables:function(){this._log("debut _subscribeToObservables");var self=this,observables=this.observables,observable;if($.xtlvalidate.object(observables)){for(obsName in observables){observable=observables[obsName];if($.xtlvalidate.array(observable)){$.each(observable,function(){$("#"+this.id).callFrom(this.type,'addObserver',self.id);});}else{$("#"+observable.id).callFrom(observable.type,'addObserver',self.id);}}}
this._log("fin _subscribeToObservables");},_triggerToObservers:function(eventName,observableAttribute,changeArgs){this._log("debut _triggerToObservers");var observers=this.observers,indexObservers,eventToObservers,observersLength;if($.isArray(observers)){eventToObservers=$.Event(eventName);eventToObservers.observableName=this.widgetName;if(observableAttribute!==undefined){eventToObservers.observableAttribute=observableAttribute;eventToObservers.changeArgs=changeArgs;}
observersLength=observers.length;for(indexObservers=0;indexObservers<observersLength;indexObservers++){$("#"+observers[indexObservers]).triggerHandler(eventToObservers);}}
this._log("fin _triggerToObservers");},initializeFromObservables:function(){this._log("debut _initializeFromObservables");var self=this,typeBehaviors,attributeBehaviors;if($.xtlvalidate.object(this.observablesBehavior)&&!this.options.isReloaded){for(typeBehaviors in this.observablesBehavior){for(attributeBehaviors in this.observablesBehavior[typeBehaviors]){if($.xtlvalidate.array(this.observablesBehavior[typeBehaviors][attributeBehaviors])){$.each(this.observablesBehavior[typeBehaviors][attributeBehaviors],function(){this.apply(self);});}}}}
this._log("fin _initializeFromObservables");},addObserver:function(observerId){this._log("debut addObserver");var index=-1;if(!$.isArray(this.observers)){this.observers=[];}
if(observerId!==undefined&&observerId!==null){index=$.inArray(observerId,this.observers);if(index===-1){this.observers.push(observerId);}}
this._log("fin addObserver");},itemState:function(itemKey,state){if($.xtlvalidate.string(itemKey)&&$.xtlvalidate.object(this.itemsChanges[itemKey])){if(state===undefined){return this.itemsChanges[itemKey]["state"];}else{if($.xtlvalidate.string(state)){this.itemsChanges[itemKey]["state"]=state;this._triggerToObservers('xtl-observable-change','itemState',itemKey);}}}else{return undefined;}},itemVisibility:function(itemKey,visibility){if($.xtlvalidate.string(itemKey)&&$.xtlvalidate.object(this.itemsChanges[itemKey])){if(visibility===undefined){return this.itemsChanges[itemKey]["visibility"];}else{this.itemsChanges[itemKey]["visibility"]=visibility;this._triggerToObservers('xtl-observable-change','itemVisibility',itemKey);}}else{return undefined;}},itemCustom:function(itemKey,custom){if($.xtlvalidate.string(itemKey)&&$.xtlvalidate.object(this.itemsChanges[itemKey])){if(custom===undefined){return this.itemsChanges[itemKey]["custom"];}else{if($.xtlvalidate.func(custom)){this.itemsChanges[itemKey]["custom"]=custom;this._triggerToObservers('xtl-observable-change','itemCustom',itemKey);}}}else{return undefined;}},_bind:function(){this.element.bind('xtl-observable-change',this.functions.bindDependencyChange);},_unbind:function(){this.element.unbind('xtl-observable-change',this.functions.bindDependencyChange);}});$.xtlmodelview.defaults=$.extend({},$.xtlcore.defaults,{itemChilds:{},items:{},isReloaded:false});$.xtlmodelview.observe={observables:{},observers:[]};$.xtlmodelview.params=$.extend({},$.xtlcore.params,{typecss:'xtlmodelview'});})(jQuery);;(function($){$.xtlmanager=function(name,prototype){var namespace=name.split(".")[0],instance;name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isfunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlmanager.defaults,$.xtlmanager.params,$.xtlmanager.observe,$.xtlmanager.actions,$[namespace][name].defaults,$[namespace][name].params,$[namespace][name].observe,$[namespace][name].actions,$.metadata&&$.metadata.get(element)[name],options);this.options.actions=$.extend({},$.xtlmanager.actions.actions,$[namespace][name].actions.actions,($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].actions!==undefined)?$.metadata.get(element)[name].actions:{},(options!==undefined&&options.actions!==undefined)?options.actions:{});};$[namespace][name].prototype=$.extend({},$.xtlmanager.prototype,prototype);};$.xtlmanager.prototype=$.extend({},$.xtlcore.prototype,{_prepareOptions:function(){var observers=this.options.observers,managers=this.options.managers;this.observers=$.xtlprepare.array(observers);this.managers=$.xtlprepare.array(managers);this.options.reload=$.xtlprepare.callback(this.options.reload);},_build:function(){this._subscribeToObservables();this._subscribeToManager();$.xtlcore.prototype._build.apply(this,arguments);},_ajaxData:function(){return null;},_manager:function(){this._log("manager...get");return this._getData("manager");},_action:function(key){if(key!==undefined){this._log("action...get : ",key);return this._getData("actions")[key];}
return null;},_callback:function(key){if(key!==undefined){this._log("callback...get : ",key);return this._getData("callbacks")[key];}
return null;},_controller:function(key){if(key!==undefined){this._log("controller...get : ",key);return this._getData("controllers")[key];}
return null;},_subscribeToObservables:function(){var self=this,observables=this.options.observables,observable;if(observables!==null&&$.param(observables).length>0){for(obsName in observables){observable=observables[obsName];if($.isArray(observable)){$.each(observable,function(){$("#"+this.id).callFrom(this.type,'addObserver',self.id);});}else{$("#"+observable.id).callFrom(observable.type,'addObserver',this.id);}}}},_triggerToObservers:function(eventName,observableAttribute,changeArgs){this._log("debut _triggerToObservers");var observers=this.observers,indexObservers,eventToObservers,observersLength;if($.isArray(observers)){eventToObservers=$.Event(eventName);eventToObservers.observableName=this.widgetName;if(observableAttribute!==undefined){eventToObservers.observableAttribute=observableAttribute;eventToObservers.changeArgs=changeArgs;}
observersLength=observers.length;for(indexObservers=0;indexObservers<observersLength;indexObservers++){$("#"+observers[indexObservers]).triggerHandler(eventToObservers);}}
this._log("fin _triggerToObservers");},_subscribeToManager:function(){var self=this,manager=this.options.manager;if($.xtlvalidate.string(manager)){$('#'+manager).callFrom('manager','addManager',this.id);}},_triggerToManagers:function(eventName,observableAttribute,changeArgs){this._log("debut _triggerToManagers");var managers=this.managers,indexManagers,eventToManagers,managersLength;if($.isArray(managers)){eventToManagers=$.Event(eventName);eventToManagers.observableName=this.widgetName;if(observableAttribute!==undefined){eventToManagers.observableAttribute=observableAttribute;eventToManagers.changeArgs=changeArgs;}
managersLength=managers.length;for(indexManagers=0;indexManagers<managersLength;indexManagers++){$("#"+managers[indexManagers]).triggerHandler(eventToManagers);}}
this._log("fin _triggerToManagers");},_execute:function(controllerName,actionCall){var controller=this._controller(controllerName);if(controller!==undefined&&controller!==null){xtlLog.debug(controller,actionCall);$("#"+controller).callFrom("controller","execute",actionCall);}},refresh:function(htmlContent){this._log("debut refresh");var self=this,callback=this.options.reload;if($.xtlvalidate.func(callback[0])){callback[0].apply(this,[ajaxUrl,ajaxData]);}
this._triggerToObservers('xtl-model-before-reload');this._triggerToObservers('xtl-observable-change','reload-begin');this.element.empty();this.element.html(htmlContent);if($.xtlvalidate.func(callback[1])){callback[1].apply(this,[ajaxUrl,ajaxData]);}
this._triggerToObservers('xtl-model-after-reload');this._triggerToObservers('xtl-observable-change','reload-end');this._log("fin refresh");},reload:function(ajaxUrl,ajaxData){this._log("debut reload");var self=this,callback=this.options.reload,oldCookie;if(ajaxData===undefined){ajaxData=this._ajaxData();}else if(typeof ajaxData!=="string"){ajaxData=$.param(ajaxData);}
if($.xtlvalidate.func(callback[0])){callback[0].apply(this,[ajaxUrl,ajaxData]);}
oldCookie=$.cookie('symfony');this._log("reload... ajaxUrl : ",ajaxUrl);this._triggerToObservers('xtl-model-before-reload');this._triggerToObservers('xtl-observable-change','reload-begin');$.xtl.ajax(oldCookie,{type:"GET",url:ajaxUrl,data:ajaxData,success:function(html){$("#"+self.id).callFrom("view","destroy");self.element.empty();self.element.html(html);self._triggerToObservers('xtl-observable-change','reload-end');}});if($.xtlvalidate.func(callback[1])){callback[1].apply(this,[ajaxUrl,ajaxData]);}
this._log("fin reload");},addObserver:function(observerId){var index=-1;if(!$.isArray(this.observers)){this.observers=[];}
if($.xtlvalidate.string(observerId)){index=$.inArray(observerId,this.observers);if(index===-1){this.observers.push(observerId);}}},addManager:function(managerId){var index=-1;if(!$.isArray(this.managers)){this.managers=[];}
if($.xtlvalidate.string(managerId)){index=$.inArray(managerId,this.managers);if(index===-1){this.managers.push(managerId);}}},execute:function(actionCall){this._log("debut execute");var action=this._action(actionCall.name),callback=this._callback(actionCall.name),defaultAction=this.options.actionDefaultBehavior;action=$.xtlprepare.action(action);if(action!==null){if(typeof action==="string"){this._log("renvoi action à son controller : ",action);this._execute(action,actionCall);}else{callback=$.xtlprepare.callback(callback);if($.xtlvalidate.func(callback[0])){this._log("execute le callback avant l'action");callback[0].apply(this,[actionCall.args]);}
if($.xtlvalidate.func(action.behavior)){this._log("execute l'action redéfinie");action.behavior.apply(this,[action,actionCall.args]);}else if($.xtlvalidate.func(defaultAction)){this._log("execute l'action par défaut");defaultAction.apply(this,[action,actionCall.args]);}
if($.xtlvalidate.func(callback[1])){this._log("execute le callback apres l'action");callback[1].apply(this,[actionCall.args]);}}}else{this._log("renvoi action à mon pere");this._execute("parent",actionCall);}
this._log("fin execute");},_bind:function(){var self=this;this.element.bind("xtl-observable-change",function(event){self._eventObservableChange(event);}).bind("xtl-reload",function(event){self._eventReload(event);});},_unbind:function(){this.element.unbind('xtl-observable-change').unbind('xtl-reload');},_eventReload:function(event){var ajaxUrl=event.originalEvent.ajaxUrl,ajaxData=event.originalEvent.ajaxData;if(ajaxUrl!==null){this.reload(ajaxUrl,ajaxData);}},_eventObservableChange:function(event){},_eventManagerChange:function(event){}});$.xtlmanager.defaults=$.extend({},$.xtlcore.defaults,{manager:null,controllers:{},reload:null});$.xtlmanager.params=$.extend({},$.xtlcore.params,{typecss:'xtlmanager'});$.xtlmanager.actions={actions:{},callbacks:{},actionDefaultUrl:null,actionDefaultBehavior:function(action,args){var ajaxData=action.param+"=",ajaxUrl=action.url,defaultUrl=this.options.actionDefaultUrl;ajaxData+=args;if(!$.xtlvalidate.string(ajaxUrl)&&$.xtlvalidate.string(defaultUrl)){ajaxUrl=defaultUrl;}else{return;}
this.reload(ajaxUrl,ajaxData);}};$.xtlmanager.observe={observables:{},observers:[],managers:[]};})(jQuery);;(function($){_subscribe_topics={};_subscribe_handlers={};_subscribe_getDocumentWindow=function(document){return document.parentWindow||document.defaultView;};$.fn.extend({createTopic:function(topic){if(topic&&!_subscribe_topics[topic]){_subscribe_topics[topic]={};_subscribe_topics[topic].objects={};_subscribe_topics[topic].objects['__noId__']=[];}
return this;},destroyTopic:function(topic){if(topic&&_subscribe_topics[topic]){for(i in _subscribe_topics[topic].objects){var object=_subscribe_topics[topic].objects[i];if($.isArray(object)){if(object.length>0){for(j in object){object[j].unbind(topic);}}}else{object.unbind(topic,data);}}}
delete _subscribe_topics[topic];return this;},subscribe:function(topic,handler,data){if(this[0]&&topic&&handler){this.createTopic(topic);if(this.attr('id')){_subscribe_topics[topic].objects[this.attr('id')]=this;}else{var noIdObjects=_subscribe_topics[topic].objects['__noId__'];if(this[0].nodeType==9){for(var index in noIdObjects){var noIdObject=noIdObjects[index];if(noIdObject[0].nodeType==9&&_subscribe_getDocumentWindow(this[0]).frameElement==_subscribe_getDocumentWindow(noIdObject[0]).frameElement){return this;}}}
var exists=false;for(var i=0;i<noIdObjects.length;i++){if(noIdObjects[i]==this){exists=true;break;}}
if(!exists){_subscribe_topics[topic].objects['__noId__'].push(this);}}
if(typeof(handler)=='function'){this.bind(topic,data,handler);}else if(typeof(handler)=='string'&&typeof(_subscribe_handlers[handler])=='function'){this.bind(topic,data,_subscribe_handlers[handler]);}}
return this;},unsubscribe:function(topic){if(topic){if(_subscribe_topics[topic]){if(this.attr('id')){var object=_subscribe_topics[topic].objects[this.attr('id')];if(object){delete _subscribe_topics[topic].objects[this.attr('id')];}}else{var noIdObjects=_subscribe_topics[topic].objects['__noId__'];for(var i=0;i<noIdObjects.length;i++){if(noIdObjects[i]==this){subscribe_topics[topic].objects['__noId__'].splice(index,1);break;}}}}
this.unbind(topic);}
return this;},publish:function(topic,data,originalEvent){if(topic){this.createTopic(topic);var subscriberStopPropagation=function(){this.isImmediatePropagationStopped=function(){return true;};(new $.Event).stopPropagation();if(this.originalEvent){this.originalEvent.isImmediatePropagationStopped=function(){return true;};this.originalEvent.stopPropagation=subscriberStopPropagation;}}
var event=jQuery.Event(topic);$.extend(event,{originalEvent:originalEvent,stopPropagation:subscriberStopPropagation});for(i in _subscribe_topics[topic].objects){var object=_subscribe_topics[topic].objects[i];if($.isArray(object)){if(object.length>0){for(j in object){object[j].trigger(event,data);}}}else{object.trigger(event,data);}}}
return this;},publishOnEvent:function(event,topic,data){if(event&&topic){this.createTopic(topic);this.bind(event,data,function(e){$(this).publish(topic,e.data,e);});}
return this;}});$.extend({subscribe:function(topic,handler,data){return $().subscribe(topic,handler,data);},unsubscribe:function(topic,handler,data){return $().unsubscribe(topic,handler,data);},subscribeHandler:function(name,handler){if(name&&handler&&typeof(handler)=="function"){_subscribe_handlers[name]=handler;}
return $();},publish:function(topic,data){return $().publish(topic,data);},createTopic:function(topic){return $().createTopic(topic);},destroyTopic:function(topic){return $().destroyTopic(topic);}});})(jQuery);;;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);;;(function($){$.fn.supersubs=function(options){var opts=$.extend({},$.fn.supersubs.defaults,options);return this.each(function(){var $$=$(this);var o=$.meta?$.extend({},opts,$$.data()):opts;var fontsize=$('<li id="menu-fontsize">&#8212;</li>').css({'padding':0,'position':'absolute','top':'-999em','width':'auto'}).appendTo($$).width();$('#menu-fontsize').remove();$ULs=$$.find('ul');$ULs.each(function(i){var $ul=$ULs.eq(i);var $LIs=$ul.children();var $As=$LIs.children('a');var liFloat=$LIs.css('white-space','nowrap').css('float');var emWidth=$ul.add($LIs).add($As).css({'float':'none','width':'auto'}).end().end()[0].clientWidth/fontsize;emWidth+=o.extraWidth;if(emWidth>o.maxWidth){emWidth=o.maxWidth;}
else if(emWidth<o.minWidth){emWidth=o.minWidth;}
emWidth+='em';$ul.css('width',emWidth);$LIs.css({'float':liFloat,'width':'100%','white-space':'normal'}).each(function(){var $childUl=$('>ul',this);var offsetDirection=$childUl.css('left')!==undefined?'left':'right';$childUl.css(offsetDirection,emWidth);});});});};$.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0};})(jQuery);;(function($){var PROP_NAME='datepick';function Datepick(){this._uuid=new Date().getTime();this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional['']={clearText:'Clear',clearStatus:'Erase the current date',closeText:'Close',closeStatus:'Close without change',prevText:'&#x3c;Prev',prevStatus:'Show the previous month',prevBigText:'&#x3c;&#x3c;',prevBigStatus:'Show the previous year',nextText:'Next&#x3e;',nextStatus:'Show the next month',nextBigText:'&#x3e;&#x3e;',nextBigStatus:'Show the next year',currentText:'Today',currentStatus:'Show the current month',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'],monthStatus:'Show a different month',yearStatus:'Show a different year',weekHeader:'Wk',weekStatus:'Week of the year',dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],dayStatus:'Set DD as first week day',dateStatus:'Select DD, M d',dateFormat:'mm/dd/yy',firstDay:0,initStatus:'Select a date',isRTL:false,showMonthAfterYear:false,yearSuffix:''};this._defaults={useThemeRoller:false,showOn:'focus',showAnim:'show',showOptions:{},duration:'normal',buttonText:'...',buttonImage:'',buttonImageOnly:false,alignment:'bottom',autoSize:false,defaultDate:null,showDefault:false,appendText:'',closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,showBigPrevNext:false,stepMonths:1,stepBigMonths:12,gotoCurrent:false,changeMonth:true,changeYear:true,yearRange:'-10:+10',changeFirstDay:false,showOtherMonths:false,selectOtherMonths:false,highlightWeek:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,numberOfMonths:1,showCurrentAtPos:0,rangeSelect:false,rangeSeparator:' - ',multiSelect:0,multiSeparator:',',beforeShow:null,beforeShowDay:null,onChangeMonthYear:null,onHover:null,onSelect:null,onClose:null,altField:'',altFormat:'',constrainInput:true};$.extend(this._defaults,this.regional['']);this.dpDiv=$('<div style="display: none;"></div>');}
$.extend(Datepick.prototype,{version:'3.7.0',markerClassName:'hasDatepick',_mainDivId:['datepick-div','ui-datepicker-div'],_mainDivClass:['','ui-datepicker '+'ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'],_inlineClass:['datepick-inline','ui-datepicker-inline ui-datepicker '+'ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'],_multiClass:['datepick-multi','ui-datepicker-multi'],_rtlClass:['datepick-rtl','ui-datepicker-rtl'],_appendClass:['datepick-append','ui-datepicker-append'],_triggerClass:['datepick-trigger','ui-datepicker-trigger'],_dialogClass:['datepick-dialog','ui-datepicker-dialog'],_promptClass:['datepick-prompt','ui-datepicker-prompt'],_disableClass:['datepick-disabled','ui-datepicker-disabled'],_controlClass:['datepick-control','ui-datepicker-header '+'ui-widget-header ui-helper-clearfix ui-corner-all'],_clearClass:['datepick-clear','ui-datepicker-clear'],_closeClass:['datepick-close','ui-datepicker-close'],_linksClass:['datepick-links','ui-datepicker-header '+'ui-widget-header ui-helper-clearfix ui-corner-all'],_prevClass:['datepick-prev','ui-datepicker-prev'],_nextClass:['datepick-next','ui-datepicker-next'],_currentClass:['datepick-current','ui-datepicker-current'],_oneMonthClass:['datepick-one-month','ui-datepicker-group'],_newRowClass:['datepick-new-row','ui-datepicker-row-break'],_monthYearClass:['datepick-header','ui-datepicker-header '+'ui-widget-header ui-helper-clearfix ui-corner-all'],_monthSelectClass:['datepick-new-month','ui-datepicker-month'],_monthClass:['','ui-datepicker-month'],_yearSelectClass:['datepick-new-year','ui-datepicker-year'],_yearClass:['','ui-datepicker-year'],_tableClass:['datepick','ui-datepicker-calendar'],_tableHeaderClass:['datepick-title-row',''],_weekColClass:['datepick-week-col','ui-datepicker-week-col'],_weekRowClass:['datepick-days-row',''],_weekendClass:['datepick-week-end-cell','ui-datepicker-week-end'],_dayClass:['datepick-days-cell',''],_otherMonthClass:['datepick-other-month','ui-datepicker-other-month'],_todayClass:['datepick-today','ui-state-highlight'],_selectableClass:['','ui-state-default'],_unselectableClass:['datepick-unselectable','ui-datepicker-unselectable ui-state-disabled'],_selectedClass:['datepick-current-day','ui-state-active'],_dayOverClass:['datepick-days-cell-over','ui-state-hover'],_weekOverClass:['datepick-week-over','ui-state-hover'],_statusClass:['datepick-status','ui-datepicker-status'],_statusId:['datepick-status-','ui-datepicker-status-'],_coverClass:['datepick-cover','ui-datepicker-cover'],setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepick:function(target,settings){if(!target.id)
target.id='dp'+(++this._uuid);var nodeName=target.nodeName.toLowerCase();var inst=this._newInst($(target),(nodeName=='div'||nodeName=='span'));var inlineSettings=($.fn.metadata?$(target).metadata():{});inst.settings=$.extend({},settings||{},inlineSettings||{});if(inst.inline){inst.dpDiv.addClass(this._inlineClass[this._get(inst,'useThemeRoller')?1:0]);this._inlineDatepick(target,inst);}
else
this._connectDatepick(target,inst);},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.\$])/g,'\\\\$1');return{id:id,input:target,cursorDate:this._daylightSavingAdjust(new Date()),drawMonth:0,drawYear:0,dates:[],inline:inline,dpDiv:(!inline?this.dpDiv:$('<div></div>')),siblings:$([])};},_connectDatepick:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName))
return;var appendText=this._get(inst,'appendText');var isRTL=this._get(inst,'isRTL');var useTR=this._get(inst,'useThemeRoller')?1:0;if(appendText){var append=$('<span class="'+this._appendClass[useTR]+'">'+appendText+'</span>');input[isRTL?'before':'after'](append);inst.siblings=inst.siblings.add(append);}
var showOn=this._get(inst,'showOn');if(showOn=='focus'||showOn=='both')
input.focus(this._showDatepick);if(showOn=='button'||showOn=='both'){var buttonText=this._get(inst,'buttonText');var buttonImage=this._get(inst,'buttonImage');var trigger=$(this._get(inst,'buttonImageOnly')?$('<img/>').addClass(this._triggerClass[useTR]).attr({src:buttonImage,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass[useTR]).html(buttonImage==''?buttonText:$('<img/>').attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?'before':'after'](trigger);inst.siblings=inst.siblings.add(trigger);trigger.click(function(){if($.datepick._datepickerShowing&&$.datepick._lastInput==target)
$.datepick._hideDatepick();else
$.datepick._showDatepick(target);return false;});}
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp);if(this._get(inst,'showDefault')&&!inst.input.val()){inst.dates=[this._getDefaultDate(inst)];this._showDate(inst);}
this._autoSize(inst);$.data(target,PROP_NAME,inst);},_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);}},_inlineDatepick:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName))
return;divSpan.addClass(this.markerClassName);$.data(target,PROP_NAME,inst);inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();$('body').append(inst.dpDiv);this._updateDatepick(inst);inst.dpDiv.width(this._getNumberOfMonths(inst)[1]*$('.'+this._oneMonthClass[this._get(inst,'useThemeRoller')?1:0],inst.dpDiv)[0].offsetWidth);divSpan.append(inst.dpDiv);this._updateAlternate(inst);},_dialogDatepick:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id='dp'+(++this._uuid);this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; width: 1px; z-index: -1"/>');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?(isArray(pos)?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(document.documentElement.clientWidth/2)-100+scrollX,(document.documentElement.clientHeight/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._get(inst,'useThemeRoller')?1:0]);this._showDatepick(this._dialogInput[0]);if($.blockUI)
$.blockUI(this.dpDiv);$.data(this._dialogInput[0],PROP_NAME,inst);},_destroyDatepick:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return;}
var inst=$.data(target,PROP_NAME);$.removeData(target,PROP_NAME);if(inst.inline)
$target.removeClass(this.markerClassName).empty();else{$(inst.siblings).remove();$target.removeClass(this.markerClassName).unbind('focus',this._showDatepick).unbind('keydown',this._doKeyDown).unbind('keypress',this._doKeyPress).unbind('keyup',this._doKeyUp);}},_enableDatepick:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName))
return;var inst=$.data(target,PROP_NAME);var useTR=this._get(inst,'useThemeRoller')?1:0;if(inst.inline)
$target.children('.'+this._disableClass[useTR]).remove().end().find('select').attr('disabled','');else{target.disabled=false;inst.siblings.filter('button.'+this._triggerClass[useTR]).each(function(){this.disabled=false;}).end().filter('img.'+this._triggerClass[useTR]).css({opacity:'1.0',cursor:''});}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});},_disableDatepick:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName))
return;var inst=$.data(target,PROP_NAME);var useTR=this._get(inst,'useThemeRoller')?1:0;if(inst.inline){var inline=$target.children('.'+this._inlineClass[useTR]);var offset=inline.offset();var relOffset={left:0,top:0};inline.parents().each(function(){if($(this).css('position')=='relative'){relOffset=$(this).offset();return false;}});$target.prepend('<div class="'+this._disableClass[useTR]+'" style="'+'width: '+inline.width()+'px; height: '+inline.height()+'px; left: '+(offset.left-relOffset.left)+'px; top: '+(offset.top-relOffset.top)+'px;"></div>').find('select').attr('disabled','disabled');}
else{target.disabled=true;inst.siblings.filter('button.'+this._triggerClass[useTR]).each(function(){this.disabled=true;}).end().filter('img.'+this._triggerClass[useTR]).css({opacity:'0.5',cursor:'default'});}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});this._disabledInputs.push(target);},_isDisabledDatepick:function(target){return(!target?false:$.inArray(target,this._disabledInputs)>-1);},_getInst:function(target){try{return $.data(target,PROP_NAME);}
catch(err){throw'Missing instance data for this datepicker';}},_optionDatepick:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=='string'){return(name=='defaults'?$.extend({},$.datepick._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._hideDatepick(null);}
var dates=this._getDateDatepick(target);extendRemove(inst.settings,settings);this._autoSize(inst);extendRemove(inst,{dates:[]});var blank=(!dates||isArray(dates));if(isArray(dates))
for(var i=0;i<dates.length;i++)
if(dates[i]){blank=false;break;}
if(!blank)
this._setDateDatepick(target,dates);if(inst.inline)
$(target).children('div').removeClass(this._inlineClass.join(' ')).addClass(this._inlineClass[this._get(inst,'useThemeRoller')?1:0]);this._updateDatepick(inst);}},_changeDatepick:function(target,name,value){this._optionDatepick(target,name,value);},_refreshDatepick:function(target){var inst=this._getInst(target);if(inst){this._updateDatepick(inst);}},_setDateDatepick:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepick(inst);this._updateAlternate(inst);}},_getDateDatepick:function(target){var inst=this._getInst(target);if(inst&&!inst.inline)
this._setDateFromField(inst);return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var inst=$.datepick._getInst(event.target);inst.keyEvent=true;var handled=true;var isRTL=$.datepick._get(inst,'isRTL');var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;if($.datepick._datepickerShowing)
switch(event.keyCode){case 9:$.datepick._hideDatepick(null,'');break;case 13:var sel=$('td.'+$.datepick._dayOverClass[useTR],inst.dpDiv);if(sel.length==0)
sel=$('td.'+$.datepick._selectedClass[useTR]+':first',inst.dpDiv);if(sel[0])
$.datepick._selectDay(sel[0],event.target,inst.cursorDate.getTime());else
$.datepick._hideDatepick(null,$.datepick._get(inst,'duration'));break;case 27:$.datepick._hideDatepick(null,$.datepick._get(inst,'duration'));break;case 33:$.datepick._adjustDate(event.target,(event.ctrlKey?-$.datepick._get(inst,'stepBigMonths'):-$.datepick._get(inst,'stepMonths')),'M');break;case 34:$.datepick._adjustDate(event.target,(event.ctrlKey?+$.datepick._get(inst,'stepBigMonths'):+$.datepick._get(inst,'stepMonths')),'M');break;case 35:if(event.ctrlKey||event.metaKey)
$.datepick._clearDate(event.target);handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey)
$.datepick._gotoToday(event.target);handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey)
$.datepick._adjustDate(event.target,(isRTL?+1:-1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey)
$.datepick._adjustDate(event.target,(event.ctrlKey?-$.datepick._get(inst,'stepBigMonths'):-$.datepick._get(inst,'stepMonths')),'M');break;case 38:if(event.ctrlKey||event.metaKey)
$.datepick._adjustDate(event.target,-7,'D');handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey)
$.datepick._adjustDate(event.target,(isRTL?-1:+1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey)
$.datepick._adjustDate(event.target,(event.ctrlKey?+$.datepick._get(inst,'stepBigMonths'):+$.datepick._get(inst,'stepMonths')),'M');break;case 40:if(event.ctrlKey||event.metaKey)
$.datepick._adjustDate(event.target,+7,'D');handled=event.ctrlKey||event.metaKey;break;default:handled=false;}
else if(event.keyCode==36&&event.ctrlKey)
$.datepick._showDatepick(this);else
handled=false;if(handled){event.preventDefault();event.stopPropagation();}
inst.ctrlKey=(event.keyCode<48);return!handled;},_doKeyPress:function(event){var inst=$.datepick._getInst(event.target);if($.datepick._get(inst,'constrainInput')){var chars=$.datepick._possibleChars(inst);var chr=String.fromCharCode(event.keyCode||event.charCode);return inst.ctrlKey||(chr<' '||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var inst=$.datepick._getInst(event.target);if(inst.input.val()!=inst.lastVal){try{var separator=($.datepick._get(inst,'rangeSelect')?$.datepick._get(inst,'rangeSeparator'):($.datepick._get(inst,'multiSelect')?$.datepick._get(inst,'multiSeparator'):''));var dates=(inst.input?inst.input.val():'');dates=(separator?dates.split(separator):[dates]);var ok=true;for(var i=0;i<dates.length;i++){if(!$.datepick.parseDate($.datepick._get(inst,'dateFormat'),dates[i],$.datepick._getFormatConfig(inst))){ok=false;break;}}
if(ok){$.datepick._setDateFromField(inst);$.datepick._updateAlternate(inst);$.datepick._updateDatepick(inst);}}
catch(event){}}
return true;},_possibleChars:function(inst){var dateFormat=$.datepick._get(inst,'dateFormat');var chars=($.datepick._get(inst,'rangeSelect')?$.datepick._get(inst,'rangeSeparator'):($.datepick._get(inst,'multiSelect')?$.datepick._get(inst,'multiSeparator'):''));var literal=false;for(var iFormat=0;iFormat<dateFormat.length;iFormat++)
if(literal)
if(dateFormat.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
chars+=dateFormat.charAt(iFormat);else
switch(dateFormat.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+=dateFormat.charAt(iFormat);}
return chars;},_doMouseOver:function(td,id,timestamp){var inst=$.datepick._getInst($('#'+id)[0]);var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;$(td).parents('tbody').find('td').removeClass($.datepick._dayOverClass[useTR]).end().end().addClass($.datepick._dayOverClass[useTR]);if($.datepick._get(inst,'highlightWeek'))
$(td).parent().parent().find('tr').removeClass($.datepick._weekOverClass[useTR]).end().end().addClass($.datepick._weekOverClass[useTR]);if($(td).text()){var date=new Date(timestamp);if($.datepick._get(inst,'showStatus')){var status=($.datepick._get(inst,'statusForDate').apply((inst.input?inst.input[0]:null),[date,inst])||$.datepick._get(inst,'initStatus'));$('#'+$.datepick._statusId[useTR]+id).html(status);}
if($.datepick._get(inst,'onHover'))
$.datepick._doHover(td,'#'+id,date.getFullYear(),date.getMonth());}},_doMouseOut:function(td,id){var inst=$.datepick._getInst($('#'+id)[0]);var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;$(td).removeClass($.datepick._dayOverClass[useTR]).removeClass($.datepick._weekOverClass[useTR]);if($.datepick._get(inst,'showStatus'))
$('#'+$.datepick._statusId[useTR]+id).html($.datepick._get(inst,'initStatus'));if($.datepick._get(inst,'onHover'))
$.datepick._doHover(td,'#'+id);},_doHover:function(td,id,year,month){var inst=this._getInst($(id)[0]);var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;if($(td).hasClass(this._unselectableClass[useTR]))
return;var onHover=this._get(inst,'onHover');var date=(year?this._daylightSavingAdjust(new Date(year,month,$(td).text())):null);onHover.apply((inst.input?inst.input[0]:null),[(date?this._formatDate(inst,date):''),date,inst]);},_showDatepick:function(input){input=input.target||input;if($.datepick._isDisabledDatepick(input)||$.datepick._lastInput==input)
return;var inst=$.datepick._getInst(input);var beforeShow=$.datepick._get(inst,'beforeShow');var useTR=$.datepick._get(inst,'useThemeRoller')?1:0;extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepick._hideDatepick(null,'');$.datepick._lastInput=input;$.datepick._setDateFromField(inst);if($.datepick._inDialog)
input.value='';if(!$.datepick._pos){$.datepick._pos=$.datepick._findPos(input);$.datepick._pos[1]+=input.offsetHeight;}
var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';return!isFixed;});if(isFixed&&$.browser.opera){$.datepick._pos[0]-=document.documentElement.scrollLeft;$.datepick._pos[1]-=document.documentElement.scrollTop;}
var offset={left:$.datepick._pos[0],top:$.datepick._pos[1]};$.datepick._pos=null;inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});$.datepick._updateDatepick(inst);inst.dpDiv.width($.datepick._getNumberOfMonths(inst)[1]*$('.'+$.datepick._oneMonthClass[useTR],inst.dpDiv).width());offset=$.datepick._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepick._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute')),display:'none',left:offset.left+'px',top:offset.top+'px'});if(!inst.inline){var showAnim=$.datepick._get(inst,'showAnim')||'show';var duration=$.datepick._get(inst,'duration');var postProcess=function(){$.datepick._datepickerShowing=true;var borders=$.datepick._getBorders(inst.dpDiv);inst.dpDiv.find('iframe.'+$.datepick._coverClass[useTR]).css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()});};if($.effects&&$.effects[showAnim])
inst.dpDiv.show(showAnim,$.datepick._get(inst,'showOptions'),duration,postProcess);else
inst.dpDiv[showAnim](duration,postProcess);if(duration=='')
postProcess();if(inst.input[0].type!='hidden')
inst.input.focus();$.datepick._curInst=inst;}},_updateDatepick:function(inst){var borders=this._getBorders(inst.dpDiv);var useTR=this._get(inst,'useThemeRoller')?1:0;inst.dpDiv.empty().append(this._generateHTML(inst)).find('iframe.'+this._coverClass[useTR]).css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()});var numMonths=this._getNumberOfMonths(inst);if(!inst.inline)
inst.dpDiv.attr('id',this._mainDivId[useTR]);inst.dpDiv.removeClass(this._mainDivClass[1-useTR]).addClass(this._mainDivClass[useTR]).removeClass(this._multiClass.join(' ')).addClass(numMonths[0]!=1||numMonths[1]!=1?this._multiClass[useTR]:'').removeClass(this._rtlClass.join(' ')).addClass(this._get(inst,'isRTL')?this._rtlClass[useTR]:'');if(inst.input&&inst.input[0].type!='hidden'&&inst==$.datepick._curInst)
$(inst.input).focus();},_getBorders:function(elem){var convert=function(value){var extra=($.browser.msie?1:0);return{thin:1+extra,medium:3+extra,thick:5+extra}[value]||value;};return[parseFloat(convert(elem.css('border-left-width'))),parseFloat(convert(elem.css('border-top-width')))];},_checkOffset:function(inst,offset,isFixed){var alignment=this._get(inst,'alignment');var isRTL=this._get(inst,'isRTL');var pos=inst.input?this._findPos(inst.input[0]):null;var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;if(browserWidth==0)
return offset;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var above=pos[1]-(this._inDialog?0:inst.dpDiv.outerHeight())-
(isFixed&&$.browser.opera?document.documentElement.scrollTop:0);var below=offset.top;var alignL=offset.left;var alignR=pos[0]+(inst.input?inst.input.outerWidth():0)-inst.dpDiv.outerWidth()-
(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0);var tooWide=(offset.left+inst.dpDiv.outerWidth()-scrollX)>browserWidth;var tooHigh=(offset.top+inst.dpDiv.outerHeight()-scrollY)>browserHeight;if(alignment=='topLeft'){offset={left:alignL,top:above};}
else if(alignment=='topRight'){offset={left:alignR,top:above};}
else if(alignment=='bottomLeft'){offset={left:alignL,top:below};}
else if(alignment=='bottomRight'){offset={left:alignR,top:below};}
else if(alignment=='top'){offset={left:(isRTL||tooWide?alignR:alignL),top:above};}
else{offset={left:(isRTL||tooWide?alignR:alignL),top:(tooHigh?above:below)};}
offset.left=Math.max((isFixed?0:scrollX),offset.left-(isFixed?scrollX:0));offset.top=Math.max((isFixed?0:scrollY),offset.top-(isFixed?scrollY:0));return offset;},_findPos:function(elem){while(elem&&(elem.type=='hidden'||elem.nodeType!=1)){elem=elem.nextSibling;}
var position=$(elem).offset();return[position.left,position.top];},_hideDatepick:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME)))
return false;var rangeSelect=this._get(inst,'rangeSelect');if(rangeSelect&&inst.stayOpen)
this._updateInput('#'+inst.id);inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,'duration'));var showAnim=this._get(inst,'showAnim');var postProcess=function(){$.datepick._tidyDialog(inst);};if(duration!=''&&$.effects&&$.effects[showAnim])
inst.dpDiv.hide(showAnim,$.datepick._get(inst,'showOptions'),duration,postProcess);else
inst.dpDiv[(duration==''?'hide':(showAnim=='slideDown'?'slideUp':(showAnim=='fadeIn'?'fadeOut':'hide')))](duration,postProcess);if(duration=='')
this._tidyDialog(inst);var onClose=this._get(inst,'onClose');if(onClose)
onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():''),this._getDate(inst),inst]);this._datepickerShowing=false;this._lastInput=null;inst.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:'absolute',left:'0',top:'-100px'});this.dpDiv.removeClass(this._dialogClass[this._get(inst,'useThemeRoller')?1:0]);if($.blockUI){$.unblockUI();$('body').append(this.dpDiv);}}
this._inDialog=false;}
this._curInst=null;return false;},_tidyDialog:function(inst){var useTR=this._get(inst,'useThemeRoller')?1:0;inst.dpDiv.removeClass(this._dialogClass[useTR]).unbind('.datepick');$('.'+this._promptClass[useTR],inst.dpDiv).remove();},_checkExternalClick:function(event){if(!$.datepick._curInst)
return;var $target=$(event.target);var useTR=$.datepick._get($.datepick._curInst,'useThemeRoller')?1:0;if(!$target.parents().andSelf().is('#'+$.datepick._mainDivId[useTR])&&!$target.hasClass($.datepick.markerClassName)&&!$target.parents().andSelf().hasClass($.datepick._triggerClass[useTR])&&$.datepick._datepickerShowing&&!($.datepick._inDialog&&$.blockUI))
$.datepick._hideDatepick(null,'');},_adjustDate:function(id,offset,period){var inst=this._getInst($(id)[0]);this._adjustInstDate(inst,offset+
(period=='M'?this._get(inst,'showCurrentAtPos'):0),period);this._updateDatepick(inst);return false;},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'gotoCurrent')&&inst.dates[0])
inst.cursorDate=new Date(inst.dates[0].getTime());else
inst.cursorDate=this._daylightSavingAdjust(new Date());inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();this._notifyChange(inst);this._adjustDate(target);return false;},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst.selectingMonthYear=false;var value=parseInt(select.options[select.selectedIndex].value,10);inst['selected'+(period=='M'?'Month':'Year')]=inst['draw'+(period=='M'?'Month':'Year')]=value;inst.cursorDate.setDate(Math.min(inst.cursorDate.getDate(),$.datepick._getDaysInMonth(inst.drawYear,inst.drawMonth)));inst.cursorDate['set'+(period=='M'?'Month':'FullYear')](value);this._notifyChange(inst);this._adjustDate(target);},_clickMonthYear:function(id){var inst=this._getInst($(id)[0]);if(inst.input&&inst.selectingMonthYear&&!$.browser.msie)
inst.input.focus();inst.selectingMonthYear=!inst.selectingMonthYear;},_changeFirstDay:function(id,day){var inst=this._getInst($(id)[0]);inst.settings.firstDay=day;this._updateDatepick(inst);return false;},_selectDay:function(td,id,timestamp){var inst=this._getInst($(id)[0]);var useTR=this._get(inst,'useThemeRoller')?1:0;if($(td).hasClass(this._unselectableClass[useTR]))
return false;var rangeSelect=this._get(inst,'rangeSelect');var multiSelect=this._get(inst,'multiSelect');if(rangeSelect)
inst.stayOpen=!inst.stayOpen;else if(multiSelect)
inst.stayOpen=true;if(inst.stayOpen){$('.datepick td',inst.dpDiv).removeClass(this._selectedClass[useTR]);$(td).addClass(this._selectedClass[useTR]);}
inst.cursorDate=this._daylightSavingAdjust(new Date(timestamp));var date=new Date(inst.cursorDate.getTime());if(rangeSelect&&!inst.stayOpen)
inst.dates[1]=date;else if(multiSelect){var pos=-1;for(var i=0;i<inst.dates.length;i++)
if(inst.dates[i]&&date.getTime()==inst.dates[i].getTime()){pos=i;break;}
if(pos>-1)
inst.dates.splice(pos,1);else if(inst.dates.length<multiSelect){if(inst.dates[0])
inst.dates.push(date);else
inst.dates=[date];inst.stayOpen=(inst.dates.length!=multiSelect);}}
else
inst.dates=[date];this._updateInput(id);if(inst.stayOpen)
this._updateDatepick(inst);else if((rangeSelect||multiSelect)&&inst.inline)
this._updateDatepick(inst);return false;},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'mandatory'))
return false;inst.stayOpen=false;inst.dates=(this._get(inst,'showDefault')?[this._getDefaultDate(inst)]:[]);this._updateInput(target);return false;},_updateInput:function(id){var inst=this._getInst($(id)[0]);var dateStr=this._showDate(inst);this._updateAlternate(inst);var onSelect=this._get(inst,'onSelect');if(onSelect)
onSelect.apply((inst.input?inst.input[0]:null),[dateStr,this._getDate(inst),inst]);else if(inst.input)
inst.input.trigger('change');if(inst.inline)
this._updateDatepick(inst);else if(!inst.stayOpen){this._hideDatepick(null,this._get(inst,'duration'));this._lastInput=inst.input[0];if(typeof(inst.input[0])!='object')
inst.input.focus();this._lastInput=null;}
return false;},_showDate:function(inst){var dateStr='';if(inst.input){dateStr=(inst.dates.length==0?'':this._formatDate(inst,inst.dates[0]));if(dateStr){if(this._get(inst,'rangeSelect'))
dateStr+=this._get(inst,'rangeSeparator')+
this._formatDate(inst,inst.dates[1]||inst.dates[0]);else if(this._get(inst,'multiSelect'))
for(var i=1;i<inst.dates.length;i++)
dateStr+=this._get(inst,'multiSeparator')+
this._formatDate(inst,inst.dates[i]);}
inst.input.val(dateStr);}
return dateStr;},_updateAlternate:function(inst){var altField=this._get(inst,'altField');if(altField){var altFormat=this._get(inst,'altFormat')||this._get(inst,'dateFormat');var settings=this._getFormatConfig(inst);var dateStr=this.formatDate(altFormat,inst.dates[0],settings);if(dateStr&&this._get(inst,'rangeSelect'))
dateStr+=this._get(inst,'rangeSeparator')+this.formatDate(altFormat,inst.dates[1]||inst.dates[0],settings);else if(this._get(inst,'multiSelect'))
for(var i=1;i<inst.dates.length;i++)
dateStr+=this._get(inst,'multiSeparator')+
this.formatDate(altFormat,inst.dates[i],settings);$(altField).val(dateStr);}},noWeekends:function(date){return[(date.getDay()||7)<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;},dateStatus:function(date,inst){return $.datepick.formatDate($.datepick._get(inst,'dateStatus'),date,$.datepick._getFormatConfig(inst));},parseDate:function(format,value,settings){if(format==null||value==null)
throw'Invalid arguments';value=(typeof value=='object'?value.toString():value+'');if(value=='')
return null;settings=settings||{};var shortYearCutoff=settings.shortYearCutoff||this._defaults.shortYearCutoff;shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));var dayNamesShort=settings.dayNamesShort||this._defaults.dayNamesShort;var dayNames=settings.dayNames||this._defaults.dayNames;var monthNamesShort=settings.monthNamesShort||this._defaults.monthNamesShort;var monthNames=settings.monthNames||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){lookAhead(match);var size=(match=='@'?14:(match=='!'?20:(match=='y'?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=(lookAhead(match)?longNames:shortNames);for(var i=0;i<names.length;i++){if(value.substr(iValue,names[i].length)==names[i]){iValue+=names[i].length;return i+1;}}
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'w':getNumber('w');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'Additional text found at end';if(year==-1)
year=new Date().getFullYear();else if(year<100)
year+=(shortYearCutoff==-1?1900: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'';settings=settings||{};var dayNamesShort=settings.dayNamesShort||this._defaults.dayNamesShort;var dayNames=settings.dayNames||this._defaults.dayNames;var monthNamesShort=settings.monthNamesShort||this._defaults.monthNamesShort;var monthNames=settings.monthNames||this._defaults.monthNames;var calculateWeek=settings.calculateWeek||this._defaults.calculateWeek;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',(date.getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000,3);break;case'w':output+=formatNumber('w',calculateWeek(date),2);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.getFullYear()%100<10?'0':'')+date.getFullYear()%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;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst){var dateFormat=this._get(inst,'dateFormat');var rangeSelect=this._get(inst,'rangeSelect');var multiSelect=this._get(inst,'multiSelect');inst.lastVal=(inst.input?inst.input.val():'');var dates=inst.lastVal;dates=(rangeSelect?dates.split(this._get(inst,'rangeSeparator')):(multiSelect?dates.split(this._get(inst,'multiSeparator')):[dates]));inst.dates=[];var settings=this._getFormatConfig(inst);for(var i=0;i<dates.length;i++)
try{inst.dates[i]=this.parseDate(dateFormat,dates[i],settings);}
catch(event){inst.dates[i]=null;}
for(var i=inst.dates.length-1;i>=0;i--)
if(!inst.dates[i])
inst.dates.splice(i,1);if(rangeSelect&&inst.dates.length<2)
inst.dates[1]=inst.dates[0];if(multiSelect&&inst.dates.length>multiSelect)
inst.dates.splice(multiSelect,inst.dates.length);inst.cursorDate=new Date((inst.dates[0]||this._getDefaultDate(inst)).getTime());inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();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 $.datepick.parseDate($.datepick._get(inst,'dateFormat'),offset,$.datepick._getFormatConfig(inst));}
catch(e){}
var date=(offset.toLowerCase().match(/^c/)?$.datepick._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|w|m|y)?/g;var matches=pattern.exec(offset.toLowerCase());while(matches){switch(matches[2]||'d'){case'd':day+=parseInt(matches[1],10);break;case'w':day+=parseInt(matches[1],10)*7;break;case'm':month+=parseInt(matches[1],10);day=Math.min(day,$.datepick._getDaysInMonth(year,month));break;case'y':year+=parseInt(matches[1],10);day=Math.min(day,$.datepick._getDaysInMonth(year,month));break;}
matches=pattern.exec(offset.toLowerCase());}
return new Date(year,month,day);};date=(date==null?defaultDate:(typeof date=='string'?offsetString(date):(typeof date=='number'?(isNaN(date)||date==Infinity||date==-Infinity?defaultDate:offsetNumeric(date)):date)));date=(date&&(date.toString()=='Invalid Date'||date.toString()=='NaN')?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}
return this._daylightSavingAdjust(date);},_daylightSavingAdjust:function(date){if(!date)return null;date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,endDate){date=(!date?[]:(isArray(date)?date:[date]));if(endDate)
date.push(endDate);var clear=(date.length==0);var origMonth=inst.cursorDate.getMonth();var origYear=inst.cursorDate.getFullYear();inst.dates=[this._restrictMinMax(inst,this._determineDate(inst,date[0],new Date()))];inst.cursorDate=new Date(inst.dates[0].getTime());inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();if(this._get(inst,'rangeSelect'))
inst.dates[1]=(date.length<1?inst.dates[0]:this._restrictMinMax(inst,this._determineDate(inst,date[1],null)));else if(this._get(inst,'multiSelect'))
for(var i=1;i<date.length;i++)
inst.dates[i]=this._restrictMinMax(inst,this._determineDate(inst,date[i],null));if(origMonth!=inst.cursorDate.getMonth()||origYear!=inst.cursorDate.getFullYear())
this._notifyChange(inst);this._adjustInstDate(inst);this._showDate(inst);},_getDate:function(inst){var startDate=(inst.input&&inst.input.val()==''?null:inst.dates[0]);if(this._get(inst,'rangeSelect'))
return(startDate?[inst.dates[0],inst.dates[1]||inst.dates[0]]:[null,null]);else if(this._get(inst,'multiSelect'))
return inst.dates.slice(0,inst.dates.length);else
return startDate;},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var showStatus=this._get(inst,'showStatus');var initStatus=this._get(inst,'initStatus')||'&#xa0;';var isRTL=this._get(inst,'isRTL');var useTR=this._get(inst,'useThemeRoller')?1:0;var clear=(this._get(inst,'mandatory')?'':'<div class="'+this._clearClass[useTR]+'"><a href="javascript:void(0)" '+'onclick="jQuery.datepick._clearDate(\'#'+inst.id+'\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'clearStatus'),initStatus)+'>'+this._get(inst,'clearText')+'</a></div>');var controls='<div class="'+this._controlClass[useTR]+'">'+(isRTL?'':clear)+'<div class="'+this._closeClass[useTR]+'"><a href="javascript:void(0)" '+'onclick="jQuery.datepick._hideDatepick();"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'closeStatus'),initStatus)+'>'+this._get(inst,'closeText')+'</a></div>'+(isRTL?clear:'')+'</div>';var prompt=this._get(inst,'prompt');var closeAtTop=this._get(inst,'closeAtTop');var hideIfNoPrevNext=this._get(inst,'hideIfNoPrevNext');var navigationAsDateFormat=this._get(inst,'navigationAsDateFormat');var showBigPrevNext=this._get(inst,'showBigPrevNext');var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,'showCurrentAtPos');var stepMonths=this._get(inst,'stepMonths');var stepBigMonths=this._get(inst,'stepBigMonths');var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate(inst,'min',true);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 prevBigText=(showBigPrevNext?this._get(inst,'prevBigText'):'');prevBigText=(!navigationAsDateFormat?prevBigText:this.formatDate(prevBigText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepBigMonths,1)),this._getFormatConfig(inst)));var prev='<div class="'+this._prevClass[useTR]+'">'+
(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?(showBigPrevNext?'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+
inst.id+'\', -'+stepBigMonths+', \'M\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'prevBigStatus'),initStatus)+'>'+prevBigText+'</a>':'')+'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+
inst.id+'\', -'+stepMonths+', \'M\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'prevStatus'),initStatus)+'>'+prevText+'</a>':(hideIfNoPrevNext?'&#xa0;':(showBigPrevNext?'<label>'+prevBigText+'</label>':'')+'<label>'+prevText+'</label>'))+'</div>';var nextText=this._get(inst,'nextText');nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var nextBigText=(showBigPrevNext?this._get(inst,'nextBigText'):'');nextBigText=(!navigationAsDateFormat?nextBigText:this.formatDate(nextBigText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepBigMonths,1)),this._getFormatConfig(inst)));var next='<div class="'+this._nextClass[useTR]+'">'+
(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+
inst.id+'\', +'+stepMonths+', \'M\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'nextStatus'),initStatus)+'>'+nextText+'</a>'+
(showBigPrevNext?'<a href="javascript:void(0)" onclick="jQuery.datepick._adjustDate(\'#'+
inst.id+'\', +'+stepBigMonths+', \'M\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'nextBigStatus'),initStatus)+'>'+nextBigText+'</a>':''):(hideIfNoPrevNext?'&#xa0;':'<label>'+nextText+'</label>'+
(showBigPrevNext?'<label>'+nextBigText+'</label>':'')))+'</div>';var currentText=this._get(inst,'currentText');var gotoDate=(this._get(inst,'gotoCurrent')&&inst.dates[0]?inst.dates[0]:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var html=(closeAtTop&&!inst.inline?controls:'')+'<div class="'+this._linksClass[useTR]+'">'+(isRTL?next:prev)+'<div class="'+this._currentClass[useTR]+'">'+(this._isInRange(inst,gotoDate)?'<a href="javascript:void(0)" onclick="jQuery.datepick._gotoToday(\'#'+inst.id+'\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'currentStatus'),initStatus)+'>'+
currentText+'</a>':(hideIfNoPrevNext?'&#xa0;':'<label>'+currentText+'</label>'))+'</div>'+(isRTL?prev:next)+'</div>'+
(prompt?'<div class="'+this._promptClass[useTR]+'"><span>'+
prompt+'</span></div>':'');var firstDay=parseInt(this._get(inst,'firstDay'),10);firstDay=(isNaN(firstDay)?0:firstDay);var changeFirstDay=this._get(inst,'changeFirstDay');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 beforeShowDay=this._get(inst,'beforeShowDay');var showOtherMonths=this._get(inst,'showOtherMonths');var selectOtherMonths=this._get(inst,'selectOtherMonths');var showWeeks=this._get(inst,'showWeeks');var calculateWeek=this._get(inst,'calculateWeek')||this.iso8601Week;var weekStatus=this._get(inst,'weekStatus');var status=(showStatus?this._get(inst,'dayStatus')||initStatus:'');var dateStatus=this._get(inst,'statusForDate')||this.dateStatus;var defaultDate=this._getDefaultDate(inst);for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var cursorDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.cursorDate.getDate()));html+='<div class="'+this._oneMonthClass[useTR]+
(col==0&&!useTR?' '+this._newRowClass[useTR]:'')+'">'+
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,cursorDate,row>0||col>0,useTR,showStatus,initStatus,monthNames)+'<table class="'+this._tableClass[useTR]+'" cellpadding="0" cellspacing="0"><thead>'+'<tr class="'+this._tableHeaderClass[useTR]+'">'+(showWeeks?'<th'+
this._addStatus(useTR,showStatus,inst.id,weekStatus,initStatus)+'>'+
this._get(inst,'weekHeader')+'</th>':'');for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var dayStatus=(!showStatus||!changeFirstDay?'':status.replace(/DD/,dayNames[day]).replace(/D/,dayNamesShort[day]));html+='<th'+((dow+firstDay+6)%7<5?'':' class="'+this._weekendClass[useTR]+'"')+'>'+
(!changeFirstDay?'<span'+
this._addStatus(useTR,showStatus,inst.id,dayNames[day],initStatus):'<a href="javascript:void(0)" onclick="jQuery.datepick._changeFirstDay(\'#'+
inst.id+'\', '+day+');"'+
this._addStatus(useTR,showStatus,inst.id,dayStatus,initStatus))+' title="'+dayNames[day]+'">'+
dayNamesMin[day]+(changeFirstDay?'</a>':'</span>')+'</th>';}
html+='</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.cursorDate.getFullYear()&&drawMonth==inst.cursorDate.getMonth())
inst.cursorDate.setDate(Math.min(inst.cursorDate.getDate(),daysInMonth));var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="'+this._weekRowClass[useTR]+'">'+
(showWeeks?'<td class="'+this._weekColClass[useTR]+'"'+
this._addStatus(useTR,showStatus,inst.id,weekStatus,initStatus)+'>'+
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);var selected=(this._get(inst,'rangeSelect')&&inst.dates[0]&&printDate.getTime()>=inst.dates[0].getTime()&&printDate.getTime()<=(inst.dates[1]||inst.dates[0]).getTime());for(var i=0;i<inst.dates.length;i++)
selected=selected||(inst.dates[i]&&printDate.getTime()==inst.dates[i].getTime());var empty=otherMonth&&!showOtherMonths;html+='<td class="'+this._dayClass[useTR]+
((dow+firstDay+6)%7>=5?' '+this._weekendClass[useTR]:'')+
(otherMonth?' '+this._otherMonthClass[useTR]:'')+
((printDate.getTime()==cursorDate.getTime()&&drawMonth==inst.cursorDate.getMonth()&&inst.keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==cursorDate.getTime())?' '+$.datepick._dayOverClass[useTR]:'')+
(unselectable?' '+this._unselectableClass[useTR]:' '+this._selectableClass[useTR])+
(empty?'':' '+daySettings[1]+
(selected?' '+this._selectedClass[useTR]:'')+
(printDate.getTime()==today.getTime()?' '+this._todayClass[useTR]:''))+'"'+
(!empty&&daySettings[2]?' title="'+daySettings[2]+'"':'')+
(unselectable?'':' onmouseover="'+'jQuery.datepick._doMouseOver(this,\''+
inst.id+'\','+printDate.getTime()+')"'+' onmouseout="jQuery.datepick._doMouseOut(this,\''+inst.id+'\')"'+' onclick="jQuery.datepick._selectDay(this,\'#'+
inst.id+'\','+printDate.getTime()+')"')+'>'+
(empty?'&#xa0;':(unselectable?printDate.getDate():'<a>'+printDate.getDate()+'</a>'))+'</td>';printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);}
html+='</tr>';}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
html+='</tbody></table></div>';}
if(useTR)
html+='<div class="'+this._newRowClass[useTR]+'"></div>';}
html+=(showStatus?'<div style="clear: both;"></div><div id="'+this._statusId[useTR]+
inst.id+'" class="'+this._statusClass[useTR]+'">'+initStatus+'</div>':'')+
(!closeAtTop&&!inst.inline?controls:'')+'<div style="clear: both;"></div>'+
($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="'+this._coverClass[useTR]+'"></iframe>':'');inst.keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,cursorDate,secondary,useTR,showStatus,initStatus,monthNames){var minDraw=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1));minDate=(minDate&&minDraw<minDate?minDraw:minDate);var changeMonth=this._get(inst,'changeMonth');var changeYear=this._get(inst,'changeYear');var showMonthAfterYear=this._get(inst,'showMonthAfterYear');var html='<div class="'+this._monthYearClass[useTR]+'">';var monthHtml='';if(secondary||!changeMonth)
monthHtml+='<span class="'+this._monthClass[useTR]+'">'+
monthNames[drawMonth]+'</span>';else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="'+this._monthSelectClass[useTR]+'" '+'onchange="jQuery.datepick._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+'onclick="jQuery.datepick._clickMonthYear(\'#'+inst.id+'\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'monthStatus'),initStatus)+'>';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth()))
monthHtml+='<option value="'+month+'"'+
(month==drawMonth?' selected="selected"':'')+'>'+monthNames[month]+'</option>';}
monthHtml+='</select>';}
if(!showMonthAfterYear)
html+=monthHtml+(secondary||!changeMonth||!changeYear?'&#xa0;':'');if(secondary||!changeYear)
html+='<span class="'+this._yearClass[useTR]+'">'+drawYear+'</span>';else{var years=this._get(inst,'yearRange').split(':');var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10;}else if(years[0].charAt(0)=='+'||years[0].charAt(0)=='-'){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10);}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10);}
year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="'+this._yearSelectClass[useTR]+'" '+'onchange="jQuery.datepick._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+'onclick="jQuery.datepick._clickMonthYear(\'#'+inst.id+'\');"'+
this._addStatus(useTR,showStatus,inst.id,this._get(inst,'yearStatus'),initStatus)+'>';for(;year<=endYear;year++){html+='<option value="'+year+'"'+
(year==drawYear?' selected="selected"':'')+'>'+year+'</option>';}
html+='</select>';}
html+=this._get(inst,'yearSuffix');if(showMonthAfterYear)
html+=(secondary||!changeMonth||!changeYear?'&#xa0;':'')+monthHtml;html+='</div>';return html;},_addStatus:function(useTR,showStatus,id,text,initStatus){return(showStatus?' onmouseover="jQuery(\'#'+this._statusId[useTR]+id+'\').html(\''+(text||initStatus)+'\');" '+'onmouseout="jQuery(\'#'+this._statusId[useTR]+id+'\').html(\''+initStatus+'\');"':'');},_adjustInstDate:function(inst,offset,period){var yearMonth=inst.drawYear+'/'+inst.drawMonth;var year=inst.drawYear+(period=='Y'?offset:0);var month=inst.drawMonth+(period=='M'?offset:0);var day=Math.min(inst.cursorDate.getDate(),this._getDaysInMonth(year,month))+
(period=='D'?offset:0);inst.cursorDate=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.drawMonth=inst.cursorDate.getMonth();inst.drawYear=inst.cursorDate.getFullYear();if(yearMonth!=inst.drawYear+'/'+inst.drawMonth)
this._notifyChange(inst);},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?new Date(minDate.getTime()):date);date=(maxDate&&date>maxDate?new Date(maxDate.getTime()):date);return date;},_notifyChange:function(inst){var onChange=this._get(inst,'onChangeMonthYear');if(onChange)
onChange.apply((inst.input?inst.input[0]:null),[inst.cursorDate.getFullYear(),inst.cursorDate.getMonth()+1,this._daylightSavingAdjust(new Date(inst.cursorDate.getFullYear(),inst.cursorDate.getMonth(),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,checkRange){var date=this._determineDate(inst,this._get(inst,minMax+'Date'),null);var rangeMin=this._getRangeMin(inst);return(checkRange&&rangeMin&&(!date||rangeMin>date)?rangeMin:date);},_getRangeMin:function(inst){return(this._get(inst,'rangeSelect')&&inst.dates[0]&&!inst.dates[1]?inst.dates[0]:null);},_getDaysInMonth:function(year,month){return 32-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._getRangeMin(inst)||this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));},_getFormatConfig:function(inst){return{shortYearCutoff:this._get(inst,'shortYearCutoff'),dayNamesShort:this._get(inst,'dayNamesShort'),dayNames:this._get(inst,'dayNames'),monthNamesShort:this._get(inst,'monthNamesShort'),monthNames:this._get(inst,'monthNames')};},_formatDate:function(inst,year,month,day){if(!year)
inst.dates[0]=new Date(inst.cursorDate.getTime());var date=(year?(typeof year=='object'?year:this._daylightSavingAdjust(new Date(year,month,day))):inst.dates[0]);return this.formatDate(this._get(inst,'dateFormat'),date,this._getFormatConfig(inst));}});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&&a.constructor==Array);};$.fn.datepick=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'||options=='settings'))
return $.datepick['_'+options+'Datepick'].apply($.datepick,[this[0]].concat(otherArgs));if(options=='option'&&arguments.length==2&&typeof arguments[1]=='string')
return $.datepick['_'+options+'Datepick'].apply($.datepick,[this[0]].concat(otherArgs));return this.each(function(){typeof options=='string'?$.datepick['_'+options+'Datepick'].apply($.datepick,[this].concat(otherArgs)):$.datepick._attachDatepick(this,options);});};$.datepick=new Datepick();$(function(){$(document).mousedown($.datepick._checkExternalClick).find('body').append($.datepick.dpDiv);});})(jQuery);;(function($){var pasteEventName=($.browser.msie?'paste':'input')+".mask";var iPhone=(window.orientation!=undefined);$.mask={definitions:{'9':"[0-9]",'a':"[A-Za-z]",'*':"[A-Za-z0-9]"}};$.fn.extend({caret:function(begin,end){if(this.length==0)return;if(typeof begin=='number'){end=(typeof end=='number')?end:begin;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(begin,end);}else if(this.createTextRange){var range=this.createTextRange();range.collapse(true);range.moveEnd('character',end);range.moveStart('character',begin);range.select();}});}else{if(this[0].setSelectionRange){begin=this[0].selectionStart;end=this[0].selectionEnd;}else if(document.selection&&document.selection.createRange){var range=document.selection.createRange();begin=0-range.duplicate().moveStart('character',-100000);end=begin+range.text.length;}
return{begin:begin,end:end};}},unmask:function(){return this.trigger("unmask");},mask:function(mask,settings){if(!mask&&this.length>0){var input=$(this[0]);var tests=input.data("tests");return $.map(input.data("buffer"),function(c,i){return tests[i]?c:null;}).join('');}
settings=$.extend({placeholder:"_",completed:null},settings);var defs=$.mask.definitions;var tests=[];var partialPosition=mask.length;var firstNonMaskPos=null;var len=mask.length;$.each(mask.split(""),function(i,c){if(c=='?'){len--;partialPosition=i;}else if(defs[c]){tests.push(new RegExp(defs[c]));if(firstNonMaskPos==null)
firstNonMaskPos=tests.length-1;}else{tests.push(null);}});return this.each(function(){var input=$(this);var buffer=$.map(mask.split(""),function(c,i){if(c!='?')return defs[c]?settings.placeholder:c});var ignore=false;var focusText=input.val();input.data("buffer",buffer).data("tests",tests);function seekNext(pos){while(++pos<=len&&!tests[pos]);return pos;};function shiftL(pos){while(!tests[pos]&&--pos>=0);for(var i=pos;i<len;i++){if(tests[i]){buffer[i]=settings.placeholder;var j=seekNext(i);if(j<len&&tests[i].test(buffer[j])){buffer[i]=buffer[j];}else
break;}}
writeBuffer();input.caret(Math.max(firstNonMaskPos,pos));};function shiftR(pos){for(var i=pos,c=settings.placeholder;i<len;i++){if(tests[i]){var j=seekNext(i);var t=buffer[i];buffer[i]=c;if(j<len&&tests[j].test(t))
c=t;else
break;}}};function keydownEvent(e){var pos=$(this).caret();var k=e.keyCode;ignore=(k<16||(k>16&&k<32)||(k>32&&k<41));if((pos.begin-pos.end)!=0&&(!ignore||k==8||k==46))
clearBuffer(pos.begin,pos.end);if(k==8||k==46||(iPhone&&k==127)){shiftL(pos.begin+(k==46?0:-1));return false;}else if(k==27){input.val(focusText);input.caret(0,checkVal());return false;}};function keypressEvent(e){if(ignore){ignore=false;return(e.keyCode==8)?false:null;}
e=e||window.event;var k=e.charCode||e.keyCode||e.which;var pos=$(this).caret();if(e.ctrlKey||e.altKey||e.metaKey){return true;}else if((k>=32&&k<=125)||k>186){var p=seekNext(pos.begin-1);if(p<len){var c=String.fromCharCode(k);if(tests[p].test(c)){shiftR(p);buffer[p]=c;writeBuffer();var next=seekNext(p);$(this).caret(next);if(settings.completed&&next==len)
settings.completed.call(input);}}}
return false;};function clearBuffer(start,end){for(var i=start;i<end&&i<len;i++){if(tests[i])
buffer[i]=settings.placeholder;}};function writeBuffer(){return input.val(buffer.join('')).val();};function checkVal(allow){var test=input.val();var lastMatch=-1;for(var i=0,pos=0;i<len;i++){if(tests[i]){buffer[i]=settings.placeholder;while(pos++<test.length){var c=test.charAt(pos-1);if(tests[i].test(c)){buffer[i]=c;lastMatch=i;break;}}
if(pos>test.length)
break;}else if(buffer[i]==test[pos]&&i!=partialPosition){pos++;lastMatch=i;}}
if(!allow&&lastMatch+1<partialPosition){input.val("");clearBuffer(0,len);}else if(allow||lastMatch+1>=partialPosition){writeBuffer();if(!allow)input.val(input.val().substring(0,lastMatch+1));}
return(partialPosition?i:firstNonMaskPos);};if(!input.attr("readonly"))
input.one("unmask",function(){input.unbind(".mask").removeData("buffer").removeData("tests");}).bind("focus.mask",function(){focusText=input.val();var pos=checkVal();writeBuffer();setTimeout(function(){if(pos==mask.length)
input.caret(0,pos);else
input.caret(pos);},0);}).bind("blur.mask",function(){checkVal();if(input.val()!=focusText)
input.change();}).bind("keydown.mask",keydownEvent).bind("keypress.mask",keypressEvent).bind(pasteEventName,function(){setTimeout(function(){input.caret(checkVal(true));},0);});checkVal();});}});})(jQuery);;;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}
break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}
break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}
break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}
break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}
break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}
if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}
$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])
cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)
return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}
v+=options.multipleSeparator;}
$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}
function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}
var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)
return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)
currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}
var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))
result[i]=$.trim(value);});return result;}
function lastWord(value){if(!options.multiple)
return value;var words=trimWords(value);return words[words.length-1];}
function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}
else
$input.val("");}});}
if(wasVisible)
$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)
term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}
return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)
s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}
if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}
if(!data[q]){length++;}
data[q]=value;}
function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)
continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])
stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}
setTimeout(populate,25);function flush(){data={};length=0;}
return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)
return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}
return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}
return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)
return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)
element.css("width",options.width);needsInit=false;}
function target(event){var element=event.target;while(element&&element.tagName!="LI")
element=element.parentNode;if(!element)
return[];return element;}
function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}
function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}
function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])
continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)
continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}
listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}
if($.fn.bgiframe)
list.bgiframe();}
return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).outerWidth()-2,top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}
field.focus();};})(jQuery);;(function($){$.xtlinput=function(name,prototype){var namespace=name.split(".")[0],instance;name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options==='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)==='_'){return this;}
else if(isMethodCall){instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||namespace+'-'+name;this.widgetBaseClass=namespace+'-'+name;this.element=$(element);this.options=$.extend({},$.xtlinput.defaults,$.xtlinput.params,$.xtlinput.observe,$.xtlinput.dimensions,$.xtlview.labels,$.xtlinput.states,$.xtlinput.styles,$[namespace][name].defaults,$[namespace][name].params,$[namespace][name].observe,$[namespace][name].dimensions,$[namespace][name].labels,$[namespace][name].states,$[namespace][name].styles,$.metadata&&$.metadata.get(element)[name],options);this.options.states=$.extend({},$.xtlinput.states.states,($[namespace][name].states!==undefined&&$[namespace][name].states.states!==undefined)?$[namespace][name].states.states:{},($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].states!==undefined)?$.metadata.get(element)[name].states:{},(options!==undefined&&options.states!==undefined)?options.states:{});this.options.statesStyle=$.extend({},$.xtlinput.styles.statesStyle,($[namespace][name].styles!=undefined&&$[namespace][name].styles.statesStyle!=undefined)?$[namespace][name].styles.statesStyle:{},($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].statesStyle!==undefined)?$.metadata.get(element)[name].statesStyle:{},(options!==undefined&&options.statesStyle!==undefined)?options.statesStyle:{});this.options.styles=$.extend({},$.xtlinput.styles.styles,($[namespace][name].styles!=undefined&&$[namespace][name].styles.styles!=undefined)?$[namespace][name].styles.styles:{},($.metadata&&$.metadata.get(element)[name]!==undefined&&$.metadata.get(element)[name].styles!==undefined)?$.metadata.get(element)[name].styles:{},(options!==undefined&&options.styles!==undefined)?options.styles:{});};$[namespace][name].prototype=$.extend({},$.xtlinput.prototype,prototype);};$.xtlinput.prototype=$.extend({},$.xtlview.prototype,{_prepareOptions:function(){var self=this,inputElem,inputBoxElem,emptyElem,labelElem,helpElem,errorElem,nbInputs=0,emptyExist=0,stateTarget=this.options.stateTarget,help=this.options.help,error=this.options.error,inputId;this.constants.value='input-value';this.constants.reset='reset-value';this.css.labelBox='input-label-box';this.css.inputBox='input-input-box';this.css.label='input-label';this.css.mandatory='input-mandatory';this.css.colon='input-colon';this.css.error='input-error';this.css.notiferror='input-notif-error';this.css.input='input-input';this.css.help='input-help';this.css.empty='input-empty';this.selectors.labelBox='#'+this.id+'-label-box';this.selectors.inputBox='#'+this.id+'-input-box';this.back.state='normal';this.selectors.label='#'+this.id+'-label';this.selectors.mandatory='#'+this.id+'-mandatory';this.selectors.colon='#'+this.id+'-colon';this.selectors.error='#'+this.id+'-error';this.selectors.notiferror='#'+this.id+'-error-notif';this.selectors.input='.'+this.css.input;this.selectors.help='#'+this.id+'-help';this.selectors.helpdiv='#'+this.id+'-help-div';this.selectors.empty='.'+this.css.empty;this.helpMessage=null;this.options.change=$.xtlprepare.callback(this.options.change);this.options.focusStyleBehavior=$.xtlprepare.switchFunc(this.options.focusStyleBehavior);this.functions.executeObservableBehavior=function(event,observable,first){var observablesDefaultBehavior=self.options.observablesDefaultBehavior,originalEvent=null;if($.xtlvalidate.object(event)){originalEvent=event.originalEvent;}
if($.xtlvalidate.array(observable)){$.each(observable,function(){if($.xtlvalidate.object(this)){if($.xtlvalidate.func(this.behavior)){this.behavior.apply(self,[originalEvent,this,first]);}else{observablesDefaultBehavior.apply(self,[null,this,first]);}}});}else if($.xtlvalidate.object(observable)){if($.xtlvalidate.func(observable.behavior)){observable.behavior.apply(self,[originalEvent,observable,first]);}else{observablesDefaultBehavior.apply(self,[null,observable,first]);}}};this.functions.bindObservableChange=function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute,observable=self.options.observables[observableName];self.functions.executeObservableBehavior.apply(self,[event,observable]);};this.functions.checkChange=function(event){var eventInput=event.target;self._checkChange(eventInput.name);};emptyElem=$(this.selectors.empty,this.element);this.functions.emptyClick=function(event){self.empty(emptyElem.is(':checked'));};inputElem=$(this.selectors.input,this.element);inputBoxElem=$(this.selectors.inputBox,this.element);labelElem=$(this.selectors.label,this.element);this.options.stateTarget=inputBoxElem;this.oneInput=true;if(stateTarget===null){nbInputs=$(this.selectors.input,this.element).size();emptyExist=$(this.selectors.empty,this.element).size();if((nbInputs+emptyExist)>1){this.oneInput=false;}else{this.oneInput=true;}}
this.functions.focusStyle=function(event){if($.xtlvalidate.func(self.options.focusStyleBehavior[0])){self.options.focusStyleBehavior[0].apply(self,[event]);}};this.functions.blurStyle=function(event){if($.xtlvalidate.func(self.options.focusStyleBehavior[1])){self.options.focusStyleBehavior[1].apply(self,[event]);}};$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){$.xtlview.prototype._build.apply(this,arguments);this._subscribeToObservables();this._initializeFromObservables();},_destroy:function(){var helpElem=$(this.selectors.help);helpElem.text(this.helpMessage);$.xtlview.prototype._destroy.apply(this,arguments);},_buildStaticView:function(){var inputElem=$(this.selectors.input,this.element),emptyElem=$(this.selectors.empty,this.element),labelBoxElem=$(this.selectors.labelBox,this.element),errorNotifElem=$(this.selectors.notiferror,this.element),value=this.value(),$this,self=this;this.element.data(this.constants.value,value);this.element.data(this.constants.reset,value);inputElem.each(function(){$this=$(this);$this.data('inputId',self.id);$this.applyStyle('default',self._getStyle('input'));});errorNotifElem.hide();this.errors(this.options.error,true);this.help(this.options.help);if(emptyElem.size()>0){emptyElem.bind('click',this.functions.emptyClick);}
this.labelPaddingBack=parseInt(labelBoxElem.css("padding-top"));$.xtlview.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){var helpElem=$(this.selectors.help,this.element),emptyElem=$(this.selectors.empty,this.element),inputElem=$(this.selectors.input,this.element);this.help(null);if(emptyElem.size()>0){emptyElem.bind('click',this.functions.emptyClick);}
this.element.removeData(this.constants.value);this.element.removeData(this.constants.reset);inputElem.each(function(){$(this).removeData('inputId',this.id);$(this).removeStyle('default');});$.xtlview.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){var trigger=this.options.trigger,helpElem=$(this.selectors.help,this.element),focusStyle=this.options.focusStyle,inputElem=$(this.selectors.input,this.element),functions=this.functions;if(trigger!==null){inputElem.bind(trigger,functions.checkChange);}
if(focusStyle===true){inputElem.bind('focus',functions.focusStyle);inputElem.bind('blur',functions.blurStyle);}
if(this.helpMessage!==null){helpElem.viewTooltip("state","normal");}
$.xtlview.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){var trigger=this.options.trigger,helpElem=$(this.selectors.help,this.element),focusStyle=this.options.focusStyle,inputElem=$(this.selectors.input,this.element),functions=this.functions;if(trigger!==null){this.element.unbind(trigger,functions.checkChange);}
if(focusStyle===true){inputElem.unbind('focus',functions.focusStyle);inputElem.unbind('blur',functions.blurStyle);}
if(this.helpMessage!==null){helpElem.viewTooltip("state","disabled");}
$.xtlview.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){this._updateMandatory();this._updateColon();$.xtlview.prototype._updateView.apply(this,arguments);this.functions.emptyClick.apply(this,[null]);},label:function(){var labelElem=$(this.selectors.label,this.element);if(this.element.data(this.element.attr("id"))!=undefined){return this.element.data(this.element.attr("id"));}
else{return labelElem.text();}},name:function(){var inputElem=$(this.selectors.input,this.element),name;if(inputElem.size()>1){name=[];inputElem.each(function(){name.push($(this).attr('name'));});}else{name=inputElem.attr('name');}
return name;},complex:function(){return this.options.isComplex;},valueByName:function(pName,pNewValue){if(pNewValue!==undefined){this._checkChange(pName);}},mandatory:function(){return this.options.mandatory;},validation:function(){var inputElem=$(this.selectors.input,this.element),metadata=$(inputElem).metadata();return(metadata!==undefined)?metadata['validationRules']:undefined;},defaultValue:function(pName){var defaultValue=this.options.defaultValue;if(pName!==undefined){if(defaultValue!==undefined&&defaultValue!==null&&defaultValue[pName]!=undefined&&defaultValue[pName]!=null){defaultValue=defaultValue[pName];}else{defaultValue='';}
this.valueByName(pName,defaultValue);}else if(defaultValue!==undefined&&defaultValue!==null){this.value(defaultValue);}else{this.value('');}},value:function(newValue){if(newValue!==undefined){this._checkChange(this.name());}},valueText:function(){return"";},errors:function(newErrors,initialize){if(!$.xtlvalidate.object(newErrors)){return this.options.error;}else{for(errorKey in newErrors){this.error(errorKey,newErrors[errorKey],initialize);}}},error:function(errorKey,error,initialize){var errorElem=$(this.selectors.error,this.element),manager=this.options.manager,addMethod=(errorKey==='client')?'addErrorClient':'addErrorServer',removeMethod=(errorKey==='client')?'removeErrorClient':'removeErrorServer',errorOpts=this.options.error,oldError,newState=null;if($.xtlvalidate.string(errorKey)){if(error===undefined){return errorOpts[errorKey];}else{oldError=errorOpts[errorKey];if(oldError!=error||(oldError==error&&initialize!=undefined)){if($.xtlvalidate.string(error)){this.options.error[errorKey]=error;if($.xtlvalidate.string(manager)){$('#'+manager).callFrom('manager',addMethod,[this.name(),error]);}}else{this.options.error[errorKey]=null;if($.xtlvalidate.string(manager)){$('#'+manager).callFrom('manager',removeMethod,this.name());}}
if($.xtlvalidate.string(errorOpts['client'])){this.errorMessage=errorOpts['client'];this.errorType='client';}else if($.xtlvalidate.string(errorOpts['server'])){this.errorMessage=errorOpts['server'];this.errorType='server';}else{this.errorMessage=null;this.errorType=null;}
if($.xtlvalidate.string(this.errorMessage)){errorElem.text(this.errorMessage);newState='error';}else{errorElem.text("");errorElem.hide();if(this.state()==='error'&&this.back.state!=='error'){newState=this.back.state;}else if(this.back.state==='error'){newState='normal';}}
if(newState!==null){this.state(newState);}}}}},help:function(newHelp){var helpOptions=this.options.helpOptions,helpElem=$(this.selectors.help,this.element),helpDivElem=$(this.selectors.helpdiv,this.element);if(newHelp===undefined){return this.options.help;}else{if($.xtlvalidate.string(newHelp)){this.options.help=$.xtlprepare.string(newHelp);this.helpMessage=this.options.help;}else if(newHelp===true){this.helpMessage=true;}
if(helpElem.hasClass('xtlview-tooltip')){helpElem.viewTooltip("destroy");}
if(this.helpMessage!==null){if(this.helpMessage===true){helpOptions=$.extend({},{contentSelector:$(this.selectors.helpdiv),positions:"right",triggerTarget:helpElem},helpOptions);}else{helpOptions=$.extend({},{contentText:this.helpMessage,positions:"right",triggerTarget:helpElem},helpOptions);}
helpElem.show();helpElem.viewTooltip(helpOptions);}else{helpElem.hide();}}},empty:function(pNewValue){var emptyElem=$(this.selectors.empty,this.element),checked;if(emptyElem.size()>0){checked=emptyElem.is(':checked');if(pNewValue===undefined){return checked;}else{emptyElem.attr('checked',pNewValue);if(emptyElem.is(':checked')&&this.state()!=='disabled'){this.state('disabled');}else if(this.state()==='disabled'){this.state(this.back.state);}}}else{return undefined;}},refreshSize:function(){this._updateSize();},_checkChange:function(inputName){var oldValue=this.element.data(this.constants.value),newValue=this.value(),resetValue=this.element.data(this.constants.reset),callback=this.options.change,manager=this.options.manager,changedStatus=false;if(!this.sameValue(oldValue,newValue)){if($.xtlvalidate.func(callback[0])){callback[0].apply(this,[oldValue,newValue]);}
this.element.data(this.constants.value,newValue);if(this._valid()){this._log('I m changed : '+newValue);this._log('myObservers : ',this.options.observers);this.element.trigger('xtlchange');this._triggerToObservers('xtl-observable-change','value',this.id);}
changedStatus=!(this.sameValue(resetValue,newValue));if($.xtlvalidate.objectId(manager)){if($.xtlvalidate.array(inputName)){for(i=0;i<inputName.length;i++){$('#'+manager).callFrom('manager','changedField',[inputName[i],changedStatus]);}}
else{$('#'+manager).callFrom('manager','changedField',[inputName,changedStatus]);}}
if($.xtlvalidate.func(callback[1])){callback[1].apply(this,[oldValue,newValue]);}}},_initializeFromObservables:function(){var self=this,observables=this.options.observables,observable;if($.xtlvalidate.object(observables)&&!this.options.isReloaded){for(obsName in observables){observable=observables[obsName];self.functions.executeObservableBehavior.apply(this,[null,observable,true]);}}},_reload:function(ajaxUrl,ajaxData,targetId){this._log("debut reload");var self=this,oldCookie;if(typeof ajaxData!=="string"){ajaxData=$.param(ajaxData);}
if(targetId===undefined){targetId=this.id;}
oldCookie=$.cookie('symfony');this._log("reload... ajaxUrl : ",ajaxUrl);this._triggerToObservers('xtl-observable-change','xtl-input-before-reload');$.xtl.ajax(oldCookie,{type:"GET",url:ajaxUrl,data:ajaxData,success:function(html){$("#"+self.id).callFrom("input","destroy");$("#"+targetId).empty();$("#"+targetId).html(html);self._triggerToObservers('xtl-observable-change','xtl-input-after-reload');}});this._log("fin reload");},_resizeWidth:function(newWidth,optionalWidth){},_resizeHeight:function(newHeight){},_resizeHeightLabel:function(){},_resizeInput:function(newWidth){$(this.selectors.input,this.element).width(newWidth);},_updateState:function(){var helpElem=$(this.selectors.help,this.element);if(this.helpMessage!==null){helpElem.viewTooltip('hide');}
$.xtlview.prototype._updateState.apply(this,[]);},_updateMandatory:function(){var mandatory=this.options.mandatory;if(mandatory){$(this.selectors.mandatory,this.element).show();}else{$(this.selectors.mandatory,this.element).hide();}},_updateColon:function(){var colon=this.options.colon;if(colon){$(this.selectors.colon,this.element).show();}else{$(this.selectors.colon,this.element).hide();}},_valid:function(){var manager=this.options.manager,validationRules=this.validation();if($.xtlvalidate.string(manager)&&$.xtlvalidate.object(validationRules)){return $('#'+manager).callFrom('manager','validate',this.id);}
else{return true;}},cleanErrors:function(){this.errors($.xtlinput.defaults.error);},reset:function(){var resetValue=this.element.data(this.constants.reset);var defaultValue=this.options.defaultValue;if(defaultValue!==undefined&&defaultValue!==null){this.value(defaultValue);}else{this.value(resetValue);}},sameValue:function(oldValue,newValue){if(oldValue===newValue){this._log("sameValue");return true;}else{this._log("differentValue");return false;}},isDefaultValue:function(){var value=this.value();var defaultValue=this.options.defaultValue;return this.sameValue(value,defaultValue);},_bindObservableEvent:function(){this.element.bind('xtl-observable-change',this.functions.bindObservableChange);},_unbindObservableEvent:function(){this.element.unbind('xtl-observable-change',this.functions.bindObservableChange);}});$.xtlinput.defaults=$.extend({},$.xtlview.defaults,{manager:null,trigger:'blur',error:{client:null,server:null},defaultValue:null,mandatory:false,colon:true,help:false,helpOptions:{},isReloaded:false,isComplex:false,change:null});$.xtlinput.observe=$.extend({},$.xtlview.observe,{observables:{},observablesDefaultBehavior:function(event,observable,init){var ajaxData='',newValue;if($.xtlvalidate.object(observable)){newValue=$('#'+observable.id).callFrom(observable.type,'value');if(newValue!=''&&(init===false||init===undefined)){if($.xtlvalidate.string(observable.param)){ajaxData=observable.param+"=";}else{ajaxData='value=';}
ajaxData+=newValue;if($.xtlvalidate.string(observable.url)){this._reload(observable.url,ajaxData,observable.target);}}else if(newValue==''){this.value('');this.state('disabled');}}},observers:[]});$.xtlinput.params=$.extend({},$.xtlview.params,{typecss:'xtlinput',logDebug:false});$.xtlinput.dimensions=$.extend({},$.xtlview.dimensions,{labelWidth:100,minLabelWidth:80,inputWidth:100,minInputWidth:40});$.xtlinput.states=$.extend({},$.xtlview.states,{state:'normal',states:{normal:true,error:[function(state){var errorElem=$(this.selectors.error,this.element),inputBoxElem=$(this.selectors.inputBox,this.element),inputElem=$(this.selectors.input,this.element),helpElem=$(this.selectors.help,this.element),errorNotifElem=$(this.selectors.notiferror,this.element),self=this;if(this.errorType==='client'){errorNotifElem.show();inputBoxElem.applyStyle('errorClient',$.xtlprepare.style(this.options.styles.errorClient));inputElem.each(function(){$(this).applyStyle('inputErrorClient',$.xtlprepare.style(self.options.styles.inputErrorClient));});errorNotifElem.viewTooltip({contentText:errorElem.text(),state:'error',positions:'bottom'});if(helpElem.is(':visible')){helpElem.viewTooltip('state','error');}
this._updateSize();this._resizeHeightLabel();this._callStateStyle('normal');}else if(this.errorType==='server'){if(errorNotifElem.is(':visible')){inputElem.each(function(){$(this).removeStyle('inputErrorClient');});inputBoxElem.removeStyle('errorClient');errorNotifElem.viewTooltip('destroy');if(helpElem.is(':visible')){helpElem.viewTooltip('state','normal');}
errorNotifElem.hide();this._updateSize();this._callStateStyle('normal',true);}
errorElem.show();this._resizeHeightLabel();this._callStateStyle(state);}},function(state){var errorElem=$(this.selectors.error,this.element),inputBoxElem=$(this.selectors.inputBox,this.element),inputElem=$(this.selectors.input,this.element),helpElem=$(this.selectors.help,this.element),errorNotifElem=$(this.selectors.notiferror,this.element);if(errorNotifElem.is(':visible')){inputElem.each(function(){$(this).removeStyle('inputErrorClient');});inputBoxElem.removeStyle('errorClient');errorNotifElem.viewTooltip('destroy');if(helpElem.is(':visible')){helpElem.viewTooltip('state','normal');}
errorNotifElem.hide();this._updateSize();this._callStateStyle('normal',true);}
if(errorElem.is(':visible')){errorElem.hide();this._callStateStyle(state,true);}
this._resizeHeightLabel();}],highlight:true,disabled:[function(state){var element=$(this.selectors.input,this.element);element.attr("disabled","disabled");element.css('opacity','0.8');this.back.stateTarget=this.options.stateTarget;this.options.stateTarget=element;this._callStateStyle(state);this.options.stateTarget=this.back.stateTarget;this._resizeHeightLabel();},function(state){var element=$(this.selectors.input,this.element);element.removeAttr("disabled");element.css('opacity','');this.back.stateTarget=this.options.stateTarget;this.options.stateTarget=element;this._callStateStyle(state,true);this.options.stateTarget=this.back.stateTarget;this._resizeHeightLabel();}],readonly:[function(state){var element=$(this.selectors.input,this.element);element.attr("readonly","readonly");element.removeAttr("disabled");element.css('opacity','0.8');this.back.stateTarget=this.options.stateTarget;this.options.stateTarget=element;this._callStateStyle(state);this.options.stateTarget=this.back.stateTarget;this._resizeHeightLabel();},function(state){var element=$(this.selectors.input,this.element);element.removeAttr("readonly");element.css('opacity','');this.back.stateTarget=this.options.stateTarget;this.options.stateTarget=element;this._callStateStyle(state,true);this.options.stateTarget=this.back.stateTarget;this._resizeHeightLabel();}],text:false}});$.xtlinput.styles=$.extend({},$.xtlview.styles,{styles:{init:$.xtlobject.style('ui-helper-clearfix',{backgroundColor:null,backgroundImage:null,borderColor:null}),focusInput:$.xtlobject.style('ui-state-highlight',{backgroundColor:'white',color:'black'}),focusBox:$.xtlobject.style('ui-state-highlight',{backgroundColor:'',borderColor:''}),input:$.xtlobject.style('ui-state-default',{backgroundColor:'white',backgroundImage:'none',borderColor:'',color:'black'}),errorClient:$.xtlobject.style('ui-state-error',{backgroundColor:'white',backgroundImage:'none',borderColor:''}),inputErrorClient:'ui-state-error'},statesStyle:{normal:$.xtlobject.style('ui-state-default',{backgroundColor:'transparent',backgroundImage:'none',borderColor:'transparent'}),error:$.xtlobject.style('ui-state-error',{backgroundColor:'',borderColor:''}),highlight:$.xtlobject.style('ui-state-highlight',{backgroundColor:'',borderColor:''}),disabled:$.xtlobject.style('ui-state-disabled',{backgroundColor:'',borderColor:''}),readonly:$.xtlobject.style('ui-state-disabled',{backgroundColor:'',borderColor:''})},focusStyle:true,focusStyleBehavior:[function(event){var labelElem=$(this.selectors.label,this.element),inputElem=$(event.target),inputBoxElem=$(this.selectors.inputBox,this.element),boxStyle=this._getStyle('focusBox'),inputStyle=this._getStyle('focusInput');labelElem.css('text-decoration','underline');inputElem.applyStyle('focus',inputStyle);if(!this.oneInput){inputBoxElem.removeStyle(this.state());inputBoxElem.applyStyle('focus',boxStyle);}},function(event){var labelElem=$(this.selectors.label,this.element),inputElem=$(this.selectors.input,this.element),inputBoxElem=$(this.selectors.inputBox,this.element);labelElem.css('text-decoration','none');inputElem.each(function(){$(this).removeStyle('focus');});if(!this.oneInput){inputBoxElem.removeStyle('focus');inputBoxElem.applyStyle(this.state(),this._getStateStyle(this.state()));}}],style:null});})(jQuery);;(function($){$.xtlinput("xtl.inputText",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){$.xtlinput.prototype._build.apply(this,arguments);this.element.data("input","inputText");},_buildStaticView:function(){$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},value:function(newValue){if(newValue===undefined){return $(this.selectors.input,this.element).val();}else{$(this.selectors.input,this.element).val(newValue);}
$.xtlinput.prototype.value.apply(this,[newValue]);},_resizeInput:function(newWidth){this._log("resize: ",newWidth);$(this.selectors.input,this.element).width(newWidth);}});$.extend($.xtl.inputText,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,change:null},params:{customcss:'xtlinput-text'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{text:[function(state){var value=this.value(),sizeInput=$(this.selectors.input,this.element).width();if(value.length==0){value=this.options.noValue;}
$(this.selectors.input,this.element).hide();$(".input-help",this.element).hide();$(".input-input",this.element).before("<span class=\"input-value\">"+value+"</span>");$(".input-value",this.element).truncate(sizeInput);},function(state){$(".input-value",this.element).remove();$(this.selectors.input,this.element).show();$(".input-help",this.element).show();}]}}});})(jQuery);;(function($){$.xtlinput("xtl.inputTextarea",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("input","inputTextarea");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},value:function(newValue){if(newValue===undefined){var val=$(this.selectors.input,this.element).val();return val;}
else{$(this.selectors.input,this.element).val(newValue);}
$.xtlinput.prototype.value.apply(this,[newValue]);},_resizeInput:function(newWidth){this._log("resize: ",newWidth);$(this.selectors.input,this.element).width(newWidth);},_bindObservableEvent:function(){$.xtlinput.prototype._bindObservableEvent.apply(this);},_unbindObservableEvent:function(){$.xtlinput.prototype._unbindObservableEvent.apply(this);}});$.extend($.xtl.inputTextarea,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,change:null},params:{customcss:'xtlinput-textarea'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{text:[function(state){var value=this.value();this._log("value",value);value=value.replace(/\n/g,"<br />");if(value.length==0){value=this.options.noValue;}
this._log("replaced",value);$(this.selectors.input,this.element).hide();$(".input-colon",this.element).after("<div class=\"input-value-block\">"+value+"</div>");$(".input-help",this.element).hide();},function(state){$(this.selectors.input,this.element).show();$(".input-help",this.element).show();$(".input-value-block",this.element).remove();}]}}});})(jQuery);;(function($){$.xtlinput("xtl.inputSelect",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("input","inputSelect");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},value:function(newValue){var val,self=this,inputElem=$(this.selectors.input,this.element),selectedInputElem,nbOptions;if(newValue===undefined){val=inputElem.val();if(val===undefined||val===null){val='';}
if(val.length==0){return'';}else{return val;}}
else if(newValue===""){selectedInputElem=inputElem.find(':selected');selectedInputElem.each(function()
{$(this).removeAttr('selected');});inputElem.val(newValue);}
else{inputElem.val(newValue);}
$.xtlinput.prototype.value.apply(this,[newValue]);},valueText:function(newValue){var val;if(newValue===undefined){val=new Array();$(this.selectors.input+' :selected',this.element).each(function()
{val.push($(this).text());});this._log("value",val);if(val.length===0){return'';}else{return val;}}
else
{$(this.selectors.input+' :selected',this.element).text(newValue);}},_resizeInput:function(newWidth){this._log("resize: ",newWidth);$(this.selectors.input,this.element).width(newWidth);},sameValue:function(oldValue,newValue){var i;if(oldValue==undefined||newValue==undefined){return false;}
if(oldValue.length!=undefined&&newValue.length!=undefined){if(oldValue.length!==newValue.length){return false;}
else{if(oldValue.length==1){if(oldValue!==newValue){return false;}}
else{for(i=0;i<oldValue.length;i++){if(oldValue[i]!=newValue[i]){return false;}}}
return true;}}else if(oldValue!=newValue){return false;}else{return true;}},_bindObservableEvent:function(){$.xtlinput.prototype._bindObservableEvent.apply(this);},_unbindObservableEvent:function(){$.xtlinput.prototype._unbindObservableEvent.apply(this);}});$.extend($.xtl.inputSelect,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,change:null},params:{customcss:'xtlinput-select'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{text:[function(state){var value=this.value(),ul,i,sizeInput=$(this.selectors.input,this.element).outerWidth(),style=this.options.style;$(this.selectors.input,this.element).hide();$(".input-help",this.element).hide();if(value.length==0){$(".input-colon",this.element).after("<span class=\"input-value\">"+this.options.noValue+"</span>");this._log("novalue",this.options.noValue);$(".input-value",this.element).truncate(sizeInput);}
else{$(".input-colon",this.element).after("<span class=\"input-value\"><ul></ul></span>");ul=$(".input-value  ul",this.element);for(i=0;i<value.length;i++){ul.append("<li>"+value[i]+"</li>");}}},function(state){$(".input-value",this.element).remove();$(this.selectors.input,this.element).show();$(".input-help",this.element).show();}]}}});})(jQuery);;(function($){$.xtlinput("xtl.inputAutocomplete",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.components.label=$(this.selectors.label,this.element);this.element.data("input","inputAutocomplete");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){this._resizeWidth(this.options.width);$.xtlinput.prototype._updateView.apply(this,arguments);},value:function(newValue){if(newValue===undefined){var val=$(this.selectors.input,this.element).val();this._log("value",val);return val;}
else{$(this.selectors.input,this.element).val(newValue);this._triggerToObservers('xtl-observable-change','value',this.id);}
$.xtlinput.prototype.value.apply(this,[newValue]);},_resizeWidth:function(newWidth){this._resizeInput(this.options.inputWidth-18);$.xtlinput.prototype._resizeWidth.apply(this,[newWidth]);},_resizeInput:function(newWidth){$(this.selectors.input,this.element).width(newWidth);},_bindObservableEvent:function(){$.xtlinput.prototype._bindObservableEvent.apply(this);},_unbindObservableEvent:function(){$.xtlinput.prototype._unbindObservableEvent.apply(this);}});$.extend($.xtl.inputAutocomplete,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,change:null},params:{customcss:'xtlinput-text'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},styles:{styles:{input:$.xtlobject.style('ui-state-default',{backgroundColor:'white',borderColor:'',color:'black'})}},states:{state:'normal',states:{text:[function(state){var value=this.value(),sizeInput=$(this.selectors.input,this.element).width();if(value.length==0){value=this.options.noValue;}
$(this.selectors.input,this.element).hide();$(".input-colon",this.element).after("<span class=\"input-value\">"+value+"</span>");$(".input-icon-autocomplete",this.element).hide();$(".input-value",this.element).truncate(sizeInput);$(".input-help",this.element).hide();},function(state){$(".input-value",this.element).remove();$(this.selectors.input,this.element).show();$(".input-icon-autocomplete",this.element).show();$(".input-help",this.element).show();}]}}});})(jQuery);;(function($){$.xtlinput("xtl.inputDate",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("input","inputDate");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){var inputElem=$(this.selectors.input,this.element),datepickerOptions=this.options.datepickerOptions,dateMask=this.options.dateMask;this.components.mask=inputElem.mask(dateMask);this.components.datepicker=inputElem.datepick($.extend({},datepickerOptions,{useThemeRoller:false,showBigPrevNext:true,showWeeks:true,showOtherMonths:true,buttonText:'Calendrier',showAnim:'fadeIn',duration:'fast',showOn:"button"}));$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){this.components.mask.unmask();this.components.datepicker.datepick('destroy');$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){this.components.datepicker.datepick('enable');$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){this.components.datepicker.datepick('disable');$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},value:function(newValue){var val,index,inputElem=$(this.selectors.input,this.element),inputLength=inputElem.length,self=this;if(newValue===undefined){if(inputLength==1){val=inputElem.val();this._log("value",val);if(val.length===0){return'';}else{return val;}}
else{val=[];for(index=0;index<inputLength;index++){val[index]=[inputElem.eq(index).val()];}
if(val[0].length==0&&val[1].length==0){this._log("valueNull",'');return'';}else{this._log("valueMultiple",val);return val;}}}
else{if(inputLength==1){val=inputElem.val(newValue);}
else{val=[];for(index=0;index<inputLength.length;index++){val[index]=[inputElem.eq(index).val(newValue)];}}}
$.xtlinput.prototype.value.apply(this,[newValue]);},_resizeWidth:function(newWidth){var calendarElem=$('img',this.element),calendarWidth,ieFix=4,optionalWidth;calendarWidth=calendarElem.outerWidth(true),optionalWidth=calendarElem+ieFix;$.xtlinput.prototype._resizeWidth.apply(this,[newWidth,optionalWidth]);},_resizeInput:function(newWidth){this._log("resize: ",newWidth);$(this.selectors.input,this.element).width(newWidth);},_bindObservableEvent:function(){$.xtlinput.prototype._bindObservableEvent.apply(this);},_unbindObservableEvent:function(){$.xtlinput.prototype._unbindObservableEvent.apply(this);}});$.extend($.xtl.inputDate,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,dateMask:'99/99/9999',datepickerOptions:{},change:null},params:{customcss:'xtlinput-date'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,minInputWidth:80},states:{state:'normal',states:{text:false}}});})(jQuery);;(function($){$.xtlinput("xtl.inputDaterange",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this);},_build:function(){this.element.data("input","inputDaterange");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){var inputElem=$(this.selectors.input,this.element),datepickerOptions=this.options.datepickerOptions,dateMask=this.options.dateMask;this.components.mask=inputElem.mask(dateMask);this.components.datepicker=inputElem.datepick($.extend({},datepickerOptions,{useThemeRoller:false,showBigPrevNext:true,showWeeks:true,showOtherMonths:true,buttonText:'Calendrier',showAnim:'fadeIn',duration:'fast',showOn:'button'}));$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){this.components.mask.unmask();this.components.datepicker.datepick('destroy');$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){this.components.datepicker.datepick('enable');$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){this.components.datepicker.datepick('disable');$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},value:function(newValue){var val,index,inputElem=$(this.selectors.input,this.element),inputLength=inputElem.length,self=this;if(newValue===undefined){if(inputLength==1){val=inputElem.val();return val;}
else{val=[];for(index=0;index<inputLength;index++){val[index]=inputElem.eq(index).val();}
if(val[0].length==0&&val[1].length==0){return'';}else{return val;}}}
else{if(inputLength==1){val=inputElem.val(newValue);}
else{for(index=0;index<inputLength;index++){if(newValue==""){value="";}
else{value=newValue[index];}
inputElem.eq(index).val(value);}}
this._triggerToObservers('xtl-observable-change','value',this.id);}
$.xtlinput.prototype.value.apply(this,[newValue]);},valueByName:function(pName,pNewValue){if(pNewValue===undefined){return $(this.selectors.input+" [name='"+pName+"']",this.element).val();}
else{$(this.selectors.input+" [name='"+pName+"']",this.element).val(pNewValue);}
$.xtlinput.prototype.valueByName.apply(this,[pName,pNewValue]);},_resizeWidth:function(newWidth){},_resizeInput:function(newWidth){$(this.selectors.input,this.element).width(newWidth);},sameValue:function(oldValue,newValue){var i;if(oldValue==undefined||newValue==undefined){return false;}
if(oldValue.length!==newValue.length){return false;}
else{for(i=0;i<oldValue.length;i++){if(oldValue[i]!=newValue[i]){return false;}}
return true;}}});$.extend($.xtl.inputDaterange,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,dateMask:'99/99/9999',datepickerOptions:{},isComplex:true,change:null},params:{customcss:'xtlinput-daterange'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,minInputWidth:50},states:{state:'normal',states:{text:false}}});})(jQuery);;(function($){$.xtlinput("xtl.inputRadio",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("input","inputRadio");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},name:function(){var inputElem=$(this.selectors.input,this.element),name;name=inputElem.attr('name');return name;},value:function(newValue){var name=this.name();if(newValue===undefined){var val=$(this.selectors.input+":checked",this.element).val();if(val===undefined){val='';}
return val;}
else{$(this.selectors.input+":checked",this.element).removeAttr('checked');$(this.selectors.input+"[value="+newValue+"]",this.element).attr('checked','true');this._log("changedValue",$(this.selectors.input+":checked",this.element).val());}
$.xtlinput.prototype.value.apply(this,[newValue]);},valueText:function(newValue){var val;if(newValue===undefined){val=$(this.selectors.input+':checked',this.element).parent().find('label').text();if(val.length===0){return'';}else{return val;}}
else
{$(this.selectors.input+' :selected',this.element).text(newValue);}},_resizeInput:function(newWidth){this.element.data.labels=[];var checkWidth=$(this.selectors.input,this.element).filter('input').width(),self=this;$(this.selectors.input,this.element).filter('label').each(function()
{self.element.data.labels[$(this).attr('for')]=$(this).text();$(this).truncate(newWidth-checkWidth);});},_bindObservableEvent:function(){$.xtlinput.prototype._bindObservableEvent.apply(this);},_unbindObservableEvent:function(){$.xtlinput.prototype._unbindObservableEvent.apply(this);}});$.extend($.xtl.inputRadio,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,change:null},params:{customcss:'xtlinput-radio'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{text:[function(state){var value;if(this.element.data.labels!==undefined){value=this.element.data.labels[$(this.selectors.input+":checked + label ",this.element).attr('for')];}
else{value=$(this.selectors.input+":checked + label ",this.element).text();}
if(value==undefined){value=this.options.noValue;}
$(this.selectors.input,this.element).hide();$(".input-input-text",this.element).hide();$(".input-colon",this.element).after("<span class=\"input-value\">"+value+"</span>");$(".input-help",this.element).hide();},function(state){$(".input-value",this.element).remove();$(this.selectors.input,this.element).show();$(".input-input",this.element).show();$(".input-input-text",this.element).show();$(".input-help",this.element).show();}]}}});})(jQuery);;(function($){$.xtlinput("xtl.inputCheckbox",{_prepareOptions:function(){$.xtlinput.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("input","inputCheckbox");$.xtlinput.prototype._build.apply(this,arguments);},_buildStaticView:function(){$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){$.xtlinput.prototype._updateView.apply(this,arguments);},name:function(){var inputElem=$(this.selectors.input,this.element),name;if(inputElem.size()>1){name=inputElem.eq(0).attr('name');}else{name=inputElem.attr('name');}
return name;},value:function(newValue){var checkedInputElem=$(this.selectors.input+":checked",this.element),val=[],newValue_lenght,newValue_index=0,current_val;if(newValue===undefined){checkedInputElem.each(function(){val.push($(this).val());});if(val.length===0){return'';}else if(val.length===1){return val[0];}else{return val;}}
else{newValue=$.xtlprepare.array(newValue);newValue_lenght=newValue.length;$(this.selectors.input+":checked",this.element).removeAttr('checked');for(newValue_index=0;newValue_index<newValue_lenght;newValue_index++){current_val=newValue[newValue_index];$(this.selectors.input+"[value="+current_val+"]",this.element).attr('checked','true');}}
$.xtlinput.prototype.value.apply(this,[newValue]);},valueText:function(newValue){if(newValue===undefined){var val=new Array();$(this.selectors.input+":checked + label",this.element).each(function(){val.push($(this).text());});return val;}
else{$(this.selectors.input+":checked",this.element).removeAttr('checked');for(newValue_index=0;newValue_index<newValue_lenght;newValue_index++){current_val=newValue[newValue_index];$(this.selectors.input+" + label:contains("+current_val+")",this.element).attr('checked','true');}
$(this.selectors.input+":checked + label",this.element).text(newValue);}},_resizeInput:function(newWidth){this.element.data.labels=[];var checkWidth=$(this.selectors.input,this.element).filter('input').width(),self=this;$(this.selectors.input,this.element).filter('label').each(function()
{self.element.data.labels[$(this).attr('for')]=$(this).text();$(this).truncate(newWidth-checkWidth);});},sameValue:function(oldValue,newValue){var i;if(oldValue==undefined||newValue==undefined){return false;}
if(oldValue.length!==newValue.length){return false;}
else{for(i=0;i<oldValue.length;i++){if(oldValue[i]!=newValue[i]){return false;}}
return true;}},_bindObservableEvent:function(){$.xtlinput.prototype._bindObservableEvent.apply(this);},_unbindObservableEvent:function(){$.xtlinput.prototype._unbindObservableEvent.apply(this);}});$.extend($.xtl.inputCheckbox,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,change:null},params:{customcss:'xtlinput-checkbox'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{text:[function(state){var value=new Array(),self=this;if(self.element.data.labels!=undefined){}
$(this.selectors.input+":checked + label ",this.element).each(function()
{if(self.element.data.labels!==undefined){value.push(self.element.data.labels[$(this).attr('for')]);}
else{value.push($(this).text());}});$(this.selectors.input,this.element).hide();$(".input-input-text",this.element).hide();$(".input-help",this.element).hide();if(value.length==0){$(".input-colon",this.element).after("<span class=\"input-value\">"+this.options.noValue+"</span>");}
else{$(".input-colon",this.element).after("<span class=\"input-value\"><ul></ul></span>");var ul=$(".input-value > ul",this.element);for(i=0;i<value.length;i++){ul.append("<li>"+value[i]+"</li>");}}},function(state){this._log("text",$(".input-value",this.element));$(".input-value",this.element).remove();$(this.selectors.input,this.element).show();$(".input-input",this.element).show();$(".input-input-text",this.element).show();$(".input-help",this.element).show();}]}}});})(jQuery);;(function($){$.xtlinput("xtl.inputLookup",{_prepareOptions:function(){var self=this;$.xtlinput.prototype._prepareOptions.apply(this,arguments);this.selectors.label='#'+this.id+'-label';this.selectors.inputText='.input-input[type=text]';this.selectors.inputHidden='.input-input[type=hidden]';this.selectors.del='#'+this.id+'_delete';this.selectors.search='#'+this.id+'_search';this.selectors.div='#'+this.id+'_div';this.functions.removeValue=function(event,ui){self.value('');self.valueText('');};this.functions.openDialog=function(){$(self.selectors.div).controllerLookup('execute',$.xtlobject.actionCall('openDialog'));};},_build:function(){$.xtlinput.prototype._build.apply(this,arguments);this.element.data("input","inputLookup");},_buildStaticView:function(){var dialogOpts=this.options.dialogOptions;if($(this.selectors.div).length==0){$("body").append('<div id="'+this.id+'_div'+'" ></div>');this._buildController();}
$(this.selectors.div).viewDialog({dialogOptions:$.extend({autoOpen:false,resizable:false},dialogOpts)});$(this.selectors.inputHidden,this.element).hide();$.xtlinput.prototype._buildStaticView.apply(this,arguments);},_destroyStaticView:function(){$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){$(this.selectors.search,this.element).bind('click',this.functions.openDialog);$(this.selectors.del,this.element).bind('click',this.functions.removeValue);$.xtlinput.prototype._enableDynamicView.apply(this,arguments);},_disableDynamicView:function(){$(this.selectors.search,this.element).unbind('click',this.functions.openDialog);$(this.selectors.del,this.element).unbind('click',this.functions.removeValue);$.xtlinput.prototype._disableDynamicView.apply(this,arguments);},_updateView:function(){this._updateIcons();$.xtlinput.prototype._updateView.apply(this,arguments);},_buildController:function(){var inputId=this.id;$(this.selectors.div).controllerLookup({actions:{openDialog:function(action,args){var dialog=$('#'+this.id),self=this,input=$('#'+inputId),inputValue=input.callFrom('input','value'),lookupOpts=input.callFrom('input','lookupOptions'),ajaxUrl=lookupOpts.url,ajaxData,selected=[];ajaxData={xtlcontext:lookupOpts.context,xtlprefix:lookupOpts.key,xtlglobal:this.id};if(inputValue!=''){selected.push(inputValue);}
dialog.callFrom('view','open');if($.xtlvalidate.string(this.getTargetId('list-controller'))){this.getTarget('list-model').callFrom('model','selectedItems',[selected]);this.getTarget('list-controller').callFrom('controller','execute',$.xtlobject.actionCall('listItems'));}else{$.ajax({type:"GET",url:ajaxUrl,data:ajaxData,success:function(msg){dialog.html(msg);self.getTarget('list-model').callFrom('model','selectedItems',[selected]);}});}},chooseItem:function(action,args){var model=this.getTarget('list-model'),itemId,itemValue,dialog=$('#'+this.id),input=$('#'+inputId);itemId=model.callFrom('model','selectedItems');itemValue=model.callFrom('model','selectedValues');input.callFrom('input','valueText',itemValue.label);input.callFrom('input','value',itemId);dialog.callFrom('view','close');}}});},value:function(newValue){if(newValue===undefined){return $(this.selectors.inputHidden,this.element).val();}
else{$(this.selectors.inputHidden,this.element).val(newValue);this._updateIcons();this._triggerToObservers('xtl-observable-change','value',this.id);$.xtlinput.prototype.value.apply(this,[newValue]);}},valueText:function(newValue){if(newValue===undefined){return $(this.selectors.inputText,this.element).val();}
else{$(this.selectors.inputText,this.element).val(newValue);}},lookupOptions:function(){return this.options.lookupOptions;},_resizeWidth:function(newWidth){},_resizeInput:function(newWidth){$(this.selectors.inputText,this.element).width(newWidth);},_updateIcons:function(){var value=this.value();if(!$.xtlvalidate.string(value)||value==""){$(this.selectors.del,this.element).hide();}else{$(this.selectors.del,this.element).show();}
this._updateSize();}});$.extend($.xtl.inputLookup,{version:"0.1",defaults:{controller:null,trigger:'blur',mandatory:false,error:{client:null,server:null},colon:true,style:null,help:false,url:null,dialogOptions:{width:700,height:500,title:null},lookupOptions:{url:null,context:'lookup',key:null},change:null},params:{customcss:'xtlinput-lookup'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{text:[function(state){var value=this.value(),sizeInput=$(this.selectors.input,this.element).width();if(value.length==0){value=this.options.noValue;}
$(this.selectors.input,this.element).hide();$(".input-help",this.element).hide();$(this.selectors.inputText).before("<span class=\"input-value\">"+value+"</span>");$(".input-value",this.element).truncate(sizeInput);},function(state){$(".input-value",this.element).remove();$(this.selectors.input,this.element).show();$(".input-help",this.element).show();}]}}});})(jQuery);;(function($){$.xtlcontroller("xtl.controllerLookup",{_build:function(){this.element.data("controller","controllerLookup");$.xtlcontroller.prototype._build.apply(this,arguments);},_manager:function(){this._log("manager...get");return this._getData("manager");},_refresh:function(ajaxUrl,ajaxData){var manager=this._manager();if($.xtlvalidate.string(manager)){$("#"+manager).callFrom("manager","reload",[ajaxUrl,ajaxData]);}}});$.extend($.xtl.controllerLookup,{version:"0.1",defaults:{manager:null,controllers:{parent:null}},params:{customcss:'xtlcontroller-search'},actions:{actions:{openDialog:function(action,args){},chooseItem:function(action,args){}},actionDefaultUrl:null}});})(jQuery);;(function($){jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires='; expires='+date.toUTCString()}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};})(jQuery);;;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.2",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);;(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{_init: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();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is('.ui-resizable-handle'))
return false;this.handle=this._getHandle(event);if(!this.handle)
return false;return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager)
$.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);if(o.containment)
this._setContainment();this._trigger("start",event);this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true;},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();this._trigger('drag',event,ui);this.position=ui.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($.ui.ddmanager)$.ui.ddmanager.drag(this,event);return false;},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)
dropped=$.ui.ddmanager.drop(this,event);if(this.dropped){dropped=this.dropped;this.dropped=false;}
if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){self._trigger("stop",event);self._clear();});}else{this._trigger("stop",event);this._clear();}
return false;},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target)handle=true;});return handle;},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)
helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))
helper.css("position","absolute");return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce)return;var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}else if(o.containment.constructor==Array){this.containment=o.containment;}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.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(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag")this.positionAbs=this._convertPositionTo("absolute");return $.widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs};}}));$.extend($.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,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}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,'sortable');if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=='original')
this.instance.currentItem.css({top:'auto',left:'auto'});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth);};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}
if(this.instance.currentItem)this.instance._mouseDrag(event);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger('out',event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._trigger("fromSortable",event);inst.dropped=false;}};});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$('body'),o=$(this).data('draggable').options;if(t.css("cursor"))o._cursor=t.css("cursor");t.css("cursor",o.cursor);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._cursor)$('body').css("cursor",o._cursor);}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data('draggable').options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<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($(this).offset()).appendTo("body");});},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data('draggable').options;if(t.css("opacity"))o._opacity=t.css("opacity");t.css('opacity',o.opacity);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._opacity)$(ui.helper).css('opacity',o._opacity);}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML')i.overflowOffset=i.scrollParent.offset();},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML'){if(!o.axis||o.axis!='x'){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}
if(!o.axis||o.axis!='y'){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(!o.axis||o.axis!='x'){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(!o.axis||o.axis!='y'){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(i,event);}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||':data(draggable)'):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0])i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}
if(o.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}
var first=(ts||bs||ls||rs);if(o.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))
(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||o.stack.min)-(parseInt($(b).css("zIndex"),10)||o.stack.min);});$(group).each(function(i){this.style.zIndex=o.stack.min+i;});this[0].style.zIndex=o.stack.min+group.length;}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex"))o._zIndex=t.css("zIndex");t.css('zIndex',o.zIndex);},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex)$(ui.helper).css('zIndex',o._zIndex);}});})(jQuery);;(function($){$.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable;}
this._tabify(true);},_setData:function(key,value){if(key=='selected'){if(this.options.collapsible&&value==this.options.selected){return;}
this.select(value);}
else{this.options[key]=value;if(key=='deselectable'){this.options.collapsible=value;}
this._tabify();}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},_sanitizeSelector:function(hash){return hash.replace(/:/g,'\\:');},_cookie:function(){var cookie=this.cookie||(this.cookie=this.options.cookie.name||'ui-tabs-'+$.data(this.list[0]));return $.cookie.apply(null,[cookie].concat($.makeArray(arguments)));},_ui:function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)};},_cleanup:function(){this.lis.filter('.ui-state-processing').removeClass('ui-state-processing').find('span:data(label.tabs)').each(function(){var el=$(this);el.html(el.data('label.tabs')).removeData('label.tabs');});},_tabify:function(init){this.list=this.element.children('ul:first');this.lis=$('li:has(a[href])',this.list);this.anchors=this.lis.map(function(){return $('a',this)[0];});this.panels=$([]);var self=this,o=this.options;var fragmentId=/^#.+/;this.anchors.each(function(i,a){var href=$(a).attr('href');var hrefBase=href.split('#')[0],baseEl;if(hrefBase&&(hrefBase===location.toString().split('#')[0]||(baseEl=$('base')[0])&&hrefBase===baseEl.href)){href=a.hash;a.href=href;}
if(fragmentId.test(href)){self.panels=self.panels.add(self._sanitizeSelector(href));}
else if(href!='#'){$.data(a,'href.tabs',href);$.data(a,'load.tabs',href.replace(/#.*$/,''));var id=self._tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom').insertAfter(self.panels[i-1]||self.list);$panel.data('destroy.tabs',true);}
self.panels=self.panels.add($panel);}
else{o.disabled.push(i);}});if(init){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(o.selected===undefined){if(location.hash){this.anchors.each(function(i,a){if(a.hash==location.hash){o.selected=i;return false;}});}
if(typeof o.selected!='number'&&o.cookie){o.selected=parseInt(self._cookie(),10);}
if(typeof o.selected!='number'&&this.lis.filter('.ui-tabs-selected').length){o.selected=this.lis.index(this.lis.filter('.ui-tabs-selected'));}
o.selected=o.selected||0;}
else if(o.selected===null){o.selected=-1;}
o.selected=((o.selected>=0&&this.anchors[o.selected])||o.selected<0)?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.lis.filter('.ui-state-disabled'),function(n,i){return self.lis.index(n);}))).sort();if($.inArray(o.selected,o.disabled)!=-1){o.disabled.splice($.inArray(o.selected,o.disabled),1);}
this.panels.addClass('ui-tabs-hide');this.lis.removeClass('ui-tabs-selected ui-state-active');if(o.selected>=0&&this.anchors.length){this.panels.eq(o.selected).removeClass('ui-tabs-hide');this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active');self.element.queue("tabs",function(){self._trigger('show',null,self._ui(self.anchors[o.selected],self.panels[o.selected]));});this.load(o.selected);}
$(window).bind('unload',function(){self.lis.add(self.anchors).unbind('.tabs');self.lis=self.anchors=self.panels=null;});}
else{o.selected=this.lis.index(this.lis.filter('.ui-tabs-selected'));}
this.element[o.collapsible?'addClass':'removeClass']('ui-tabs-collapsible');if(o.cookie){this._cookie(o.selected,o.cookie);}
for(var i=0,li;(li=this.lis[i]);i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass('ui-tabs-selected')?'addClass':'removeClass']('ui-state-disabled');}
if(o.cache===false){this.anchors.removeData('cache.tabs');}
this.lis.add(this.anchors).unbind('.tabs');if(o.event!='mouseover'){var addState=function(state,el){if(el.is(':not(.ui-state-disabled)')){el.addClass('ui-state-'+state);}};var removeState=function(state,el){el.removeClass('ui-state-'+state);};this.lis.bind('mouseover.tabs',function(){addState('hover',$(this));});this.lis.bind('mouseout.tabs',function(){removeState('hover',$(this));});this.anchors.bind('focus.tabs',function(){addState('focus',$(this).closest('li'));});this.anchors.bind('blur.tabs',function(){removeState('focus',$(this).closest('li'));});}
var hideFx,showFx;if(o.fx){if($.isArray(o.fx)){hideFx=o.fx[0];showFx=o.fx[1];}
else{hideFx=showFx=o.fx;}}
function resetStyle($el,fx){$el.css({display:''});if($.browser.msie&&fx.opacity){$el[0].style.removeAttribute('filter');}}
var showTab=showFx?function(clicked,$show){$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');$show.hide().removeClass('ui-tabs-hide').animate(showFx,showFx.duration||'normal',function(){resetStyle($show,showFx);self._trigger('show',null,self._ui(clicked,$show[0]));});}:function(clicked,$show){$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');$show.removeClass('ui-tabs-hide');self._trigger('show',null,self._ui(clicked,$show[0]));};var hideTab=hideFx?function(clicked,$hide){$hide.animate(hideFx,hideFx.duration||'normal',function(){self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');$hide.addClass('ui-tabs-hide');resetStyle($hide,hideFx);self.element.dequeue("tabs");});}:function(clicked,$hide,$show){self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');$hide.addClass('ui-tabs-hide');self.element.dequeue("tabs");};this.anchors.bind(o.event+'.tabs',function(){var el=this,$li=$(this).closest('li'),$hide=self.panels.filter(':not(.ui-tabs-hide)'),$show=$(self._sanitizeSelector(this.hash));if(($li.hasClass('ui-tabs-selected')&&!o.collapsible)||$li.hasClass('ui-state-disabled')||$li.hasClass('ui-state-processing')||self._trigger('select',null,self._ui(this,$show[0]))===false){this.blur();return false;}
o.selected=self.anchors.index(this);self.abort();if(o.collapsible){if($li.hasClass('ui-tabs-selected')){o.selected=-1;if(o.cookie){self._cookie(o.selected,o.cookie);}
self.element.queue("tabs",function(){hideTab(el,$hide);}).dequeue("tabs");this.blur();return false;}
else if(!$hide.length){if(o.cookie){self._cookie(o.selected,o.cookie);}
self.element.queue("tabs",function(){showTab(el,$show);});self.load(self.anchors.index(this));this.blur();return false;}}
if(o.cookie){self._cookie(o.selected,o.cookie);}
if($show.length){if($hide.length){self.element.queue("tabs",function(){hideTab(el,$hide);});}
self.element.queue("tabs",function(){showTab(el,$show);});self.load(self.anchors.index(this));}
else{throw'jQuery UI Tabs: Mismatching fragment identifier.';}
if($.browser.msie){this.blur();}});this.anchors.bind('click.tabs',function(){return false;});},destroy:function(){var o=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 href=$.data(this,'href.tabs');if(href){this.href=href;}
var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.lis.unbind('.tabs').add(this.panels).each(function(){if($.data(this,'destroy.tabs')){$(this).remove();}
else{$(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(o.cookie){this._cookie(null,o.cookie);}},add:function(url,label,index){if(index===undefined){index=this.anchors.length;}
var self=this,o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=!url.indexOf('#')?url.replace('#',''):this._tabId($('a',$li)[0]);$li.addClass('ui-state-default ui-corner-top').data('destroy.tabs',true);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).data('destroy.tabs',true);}
$panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');if(index>=this.lis.length){$li.appendTo(this.list);$panel.appendTo(this.list[0].parentNode);}
else{$li.insertBefore(this.lis[index]);$panel.insertBefore(this.panels[index]);}
o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n;});this._tabify();if(this.anchors.length==1){$li.addClass('ui-tabs-selected ui-state-active');$panel.removeClass('ui-tabs-hide');this.element.queue("tabs",function(){self._trigger('show',null,self._ui(self.anchors[0],self.panels[0]));});this.load(0);}
this._trigger('add',null,this._ui(this.anchors[index],this.panels[index]));},remove:function(index){var o=this.options,$li=this.lis.eq(index).remove(),$panel=this.panels.eq(index).remove();if($li.hasClass('ui-tabs-selected')&&this.anchors.length>1){this.select(index+(index+1<this.anchors.length?1:-1));}
o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index;}),function(n,i){return n>=index?--n:n;});this._tabify();this._trigger('remove',null,this._ui($li.find('a')[0],$panel[0]));},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1){return;}
this.lis.eq(index).removeClass('ui-state-disabled');o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this._trigger('enable',null,this._ui(this.anchors[index],this.panels[index]));},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.lis.eq(index).addClass('ui-state-disabled');o.disabled.push(index);o.disabled.sort();this._trigger('disable',null,this._ui(this.anchors[index],this.panels[index]));}},select:function(index){if(typeof index=='string'){index=this.anchors.index(this.anchors.filter('[href$='+index+']'));}
else if(index===null){index=-1;}
if(index==-1&&this.options.collapsible){index=this.options.selected;}
this.anchors.eq(index).trigger(this.options.event+'.tabs');},load:function(index){var self=this,o=this.options,a=this.anchors.eq(index)[0],url=$.data(a,'load.tabs');this.abort();if(!url||this.element.queue("tabs").length!==0&&$.data(a,'cache.tabs')){this.element.dequeue("tabs");return;}
this.lis.eq(index).addClass('ui-state-processing');if(o.spinner){var span=$('span',a);span.data('label.tabs',span.html()).html(o.spinner);}
this.xhr=$.ajax($.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(self._sanitizeSelector(a.hash)).html(r);self._cleanup();if(o.cache){$.data(a,'cache.tabs',true);}
self._trigger('load',null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.success(r,s);}
catch(e){}
self.element.dequeue("tabs");}}));},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr;}
this._cleanup();},url:function(index,url){this.anchors.eq(index).removeData('cache.tabs').data('load.tabs',url);},length:function(){return this.anchors.length;}});$.extend($.ui.tabs,{version:'1.7.2',getter:'length',defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:'click',fx:null,idPrefix:'ui-tabs-',panelTemplate:'<div></div>',spinner:'<em>Loading&#8230;</em>',tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){var self=this,o=this.options;var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation);self.rotation=setTimeout(function(){var t=o.selected;self.select(++t<self.anchors.length?t:0);},ms);if(e){e.stopPropagation();}});var stop=self._unrotate||(self._unrotate=!continuing?function(e){if(e.clientX){self.rotate(null);}}:function(e){t=o.selected;rotate();});if(ms){this.element.bind('tabsshow',rotate);this.anchors.bind(o.event+'.tabs',stop);rotate();}
else{clearTimeout(self.rotation);this.element.unbind('tabsshow',rotate);this.anchors.unbind(o.event+'.tabs',stop);delete this._rotate;delete this._unrotate;}}});})(jQuery);;(function($){var setDataSwitch={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},uiDialogClasses='ui-dialog '+'ui-widget '+'ui-widget-content '+'ui-corner-all ';$.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr('title');var self=this,options=this.options,title=options.title||this.originalTitle||'&nbsp;',titleId=$.ui.dialog.getTitleId(this.element),uiDialog=(this.uiDialog=$('<div/>')).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({position:'absolute',overflow:'hidden',zIndex:options.zIndex}).attr('tabIndex',-1).css('outline',0).keydown(function(event){(options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&self.close(event));}).attr({role:'dialog','aria-labelledby':titleId}).mousedown(function(event){self.moveToTop(false,event);}),uiDialogContent=this.element.show().removeAttr('title').addClass('ui-dialog-content '+'ui-widget-content').appendTo(uiDialog),uiDialogTitlebar=(this.uiDialogTitlebar=$('<div></div>')).addClass('ui-dialog-titlebar '+'ui-widget-header '+'ui-corner-all '+'ui-helper-clearfix').prependTo(uiDialog),uiDialogTitlebarClose=$('<a href="#"/>').addClass('ui-dialog-titlebar-close '+'ui-corner-all').attr('role','button').hover(function(){uiDialogTitlebarClose.addClass('ui-state-hover');},function(){uiDialogTitlebarClose.removeClass('ui-state-hover');}).focus(function(){uiDialogTitlebarClose.addClass('ui-state-focus');}).blur(function(){uiDialogTitlebarClose.removeClass('ui-state-focus');}).mousedown(function(ev){ev.stopPropagation();}).click(function(event){self.close(event);return false;}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(this.uiDialogTitlebarCloseText=$('<span/>')).addClass('ui-icon '+'ui-icon-closethick').text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$('<span/>').addClass('ui-dialog-title').attr('id',titleId).html(title).prependTo(uiDialogTitlebar);uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();(options.draggable&&$.fn.draggable&&this._makeDraggable());(options.resizable&&$.fn.resizable&&this._makeResizable());this._createButtons(options.buttons);this._isOpen=false;(options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe());(options.autoOpen&&this.open());},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind('.dialog').removeData('dialog').removeClass('ui-dialog-content ui-widget-content').hide().appendTo('body');this.uiDialog.remove();(this.originalTitle&&this.element.attr('title',this.originalTitle));},close:function(event){var self=this;if(false===self._trigger('beforeclose',event)){return;}
(self.overlay&&self.overlay.destroy());self.uiDialog.unbind('keypress.ui-dialog');(self.options.hide?self.uiDialog.hide(self.options.hide,function(){self._trigger('close',event);}):self.uiDialog.hide()&&self._trigger('close',event));$.ui.dialog.overlay.resize();self._isOpen=false;if(self.options.modal){var maxZ=0;$('.ui-dialog').each(function(){if(this!=self.uiDialog[0]){maxZ=Math.max(maxZ,$(this).css('z-index'));}});$.ui.dialog.maxZ=maxZ;}},isOpen:function(){return this._isOpen;},moveToTop:function(force,event){if((this.options.modal&&!force)||(!this.options.stack&&!this.options.modal)){return this._trigger('focus',event);}
if(this.options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=this.options.zIndex;}
(this.overlay&&this.overlay.$el.css('z-index',$.ui.dialog.overlay.maxZ=++$.ui.dialog.maxZ));var saveScroll={scrollTop:this.element.attr('scrollTop'),scrollLeft:this.element.attr('scrollLeft')};this.uiDialog.css('z-index',++$.ui.dialog.maxZ);this.element.attr(saveScroll);this._trigger('focus',event);},open:function(){if(this._isOpen){return;}
var options=this.options,uiDialog=this.uiDialog;this.overlay=options.modal?new $.ui.dialog.overlay(this):null;(uiDialog.next().length&&uiDialog.appendTo('body'));this._size();this._position(options.position);uiDialog.show(options.show);this.moveToTop(true);(options.modal&&uiDialog.bind('keypress.ui-dialog',function(event){if(event.keyCode!=$.ui.keyCode.TAB){return;}
var tabbables=$(':tabbable',this),first=tabbables.filter(':first')[0],last=tabbables.filter(':last')[0];if(event.target==last&&!event.shiftKey){setTimeout(function(){first.focus();},1);}else if(event.target==first&&event.shiftKey){setTimeout(function(){last.focus();},1);}}));$([]).add(uiDialog.find('.ui-dialog-content :tabbable:first')).add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')).add(uiDialog).filter(':first').focus();this._trigger('open');this._isOpen=true;},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$('<div></div>').addClass('ui-dialog-buttonpane '+'ui-widget-content '+'ui-helper-clearfix');this.uiDialog.find('.ui-dialog-buttonpane').remove();(typeof buttons=='object'&&buttons!==null&&$.each(buttons,function(){return!(hasButtons=true);}));if(hasButtons){$.each(buttons,function(name,fn){$('<button type="button"></button>').addClass('ui-state-default '+'ui-corner-all').text(name).click(function(){fn.apply(self.element[0],arguments);}).hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');}).focus(function(){$(this).addClass('ui-state-focus');}).blur(function(){$(this).removeClass('ui-state-focus');}).appendTo(uiDialogButtonPane);});uiDialogButtonPane.appendTo(this.uiDialog);}},_makeDraggable:function(){var self=this,options=this.options,heightBeforeDrag;this.uiDialog.draggable({cancel:'.ui-dialog-content',handle:'.ui-dialog-titlebar',containment:'document',start:function(){heightBeforeDrag=options.height;$(this).height($(this).height()).addClass("ui-dialog-dragging");(options.dragStart&&options.dragStart.apply(self.element[0],arguments));},drag:function(){(options.drag&&options.drag.apply(self.element[0],arguments));},stop:function(){$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);(options.dragStop&&options.dragStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}});},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=this.options,resizeHandles=typeof handles=='string'?handles:'n,e,s,w,se,sw,ne,nw';this.uiDialog.resizable({cancel:'.ui-dialog-content',alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:function(){$(this).addClass("ui-dialog-resizing");(options.resizeStart&&options.resizeStart.apply(self.element[0],arguments));},resize:function(){(options.resize&&options.resize.apply(self.element[0],arguments));},handles:resizeHandles,stop:function(){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();(options.resizeStop&&options.resizeStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}}).find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');},_position:function(pos){var wnd=$(window),doc=$(document),pTop=doc.scrollTop(),pLeft=doc.scrollLeft(),minTop=pTop;if($.inArray(pos,['center','top','right','bottom','left'])>=0){pos=[pos=='right'||pos=='left'?pos:'center',pos=='top'||pos=='bottom'?pos:'middle'];}
if(pos.constructor!=Array){pos=['center','middle'];}
if(pos[0].constructor==Number){pLeft+=pos[0];}else{switch(pos[0]){case'left':pLeft+=0;break;case'right':pLeft+=wnd.width()-this.uiDialog.outerWidth();break;default:case'center':pLeft+=(wnd.width()-this.uiDialog.outerWidth())/2;}}
if(pos[1].constructor==Number){pTop+=pos[1];}else{switch(pos[1]){case'top':pTop+=0;break;case'bottom':pTop+=wnd.height()-this.uiDialog.outerHeight();break;default:case'middle':pTop+=(wnd.height()-this.uiDialog.outerHeight())/2;}}
pTop=Math.max(pTop,minTop);this.uiDialog.css({top:pTop,left:pLeft});},_setData:function(key,value){(setDataSwitch[key]&&this.uiDialog.data(setDataSwitch[key],value));switch(key){case"buttons":this._createButtons(value);break;case"closeText":this.uiDialogTitlebarCloseText.text(value);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(uiDialogClasses+value);break;case"draggable":(value?this._makeDraggable():this.uiDialog.draggable('destroy'));break;case"height":this.uiDialog.height(value);break;case"position":this._position(value);break;case"resizable":var uiDialog=this.uiDialog,isResizable=this.uiDialog.is(':data(resizable)');(isResizable&&!value&&uiDialog.resizable('destroy'));(isResizable&&typeof value=='string'&&uiDialog.resizable('option','handles',value));(isResizable||this._makeResizable(value));break;case"title":$(".ui-dialog-title",this.uiDialogTitlebar).html(value||'&nbsp;');break;case"width":this.uiDialog.width(value);break;}
$.widget.prototype._setData.apply(this,arguments);},_size:function(){var options=this.options;this.element.css({height:0,minHeight:0,width:'auto'});var nonContentHeight=this.uiDialog.css({height:'auto',width:options.width}).height();this.element.css({minHeight:Math.max(options.minHeight-nonContentHeight,0),height:options.height=='auto'?'auto':Math.max(options.height-nonContentHeight,0)});}});$.extend($.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:'close',dialogClass:'',draggable:true,hide:null,height:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:'center',resizable:true,show:null,stack:true,title:'',width:300,zIndex:1000},getter:'isOpen',uuid:0,maxZ:0,getTitleId:function($el){return'ui-dialog-title-'+($el.attr('id')||++this.uuid);},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog);}});$.extend($.ui.dialog.overlay,{instances:[],maxZ:0,events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(event){return event+'.dialog-overlay';}).join(' '),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).bind($.ui.dialog.overlay.events,function(event){var dialogZ=$(event.target).parents('.ui-dialog').css('zIndex')||0;return(dialogZ>$.ui.dialog.overlay.maxZ);});}},1);$(document).bind('keydown.dialog-overlay',function(event){(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&dialog.close(event));});$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);}
var $el=$('<div></div>').appendTo(document.body).addClass('ui-widget-overlay').css({width:this.width(),height:this.height()});(dialog.options.bgiframe&&$.fn.bgiframe&&$el.bgiframe());this.instances.push($el);return $el;},destroy:function($el){this.instances.splice($.inArray(this.instances,$el),1);if(this.instances.length===0){$([document,window]).unbind('.dialog-overlay');}
$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css('z-index'));});this.maxZ=maxZ;},height:function(){if($.browser.msie&&$.browser.version<7){var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight<offsetHeight){return $(window).height()+'px';}else{return scrollHeight+'px';}}else{return $(document).height()+'px';}},width:function(){if($.browser.msie&&$.browser.version<7){var scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var offsetWidth=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(scrollWidth<offsetWidth){return $(window).width()+'px';}else{return scrollWidth+'px';}}else{return $(document).width()+'px';}},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this);});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()});}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el);}});})(jQuery);;(function($){$.widget("ui.selectable",$.extend({},$.ui.mouse,{_init:function(){var self=this;this.element.addClass("ui-selectable");this.dragged=false;var selectees;this.refresh=function(){selectees=$(self.options.filter,self.element[0]);selectees.each(function(){var $this=$(this);var pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,selected:$this.hasClass('ui-selected'),selecting:$this.hasClass('ui-selecting'),unselecting:$this.hasClass('ui-unselecting')});});};this.refresh();this.selectees=selectees.addClass("ui-selectee");this._mouseInit();this.helper=$(document.createElement('div')).css({border:'1px dotted black'}).addClass("ui-selectable-helper");},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();},_mouseStart:function(event){var self=this;this.opos=[event.pageX,event.pageY];if(this.options.disabled)
return;var options=this.options;this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"z-index":100,"position":"absolute","left":event.clientX,"top":event.clientY,"width":0,"height":0});if(options.autoRefresh){this.refresh();}
this.selectees.filter('.ui-selected').each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!event.metaKey){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self._trigger("unselecting",event,{unselecting:selectee.element});}});$(event.target).parents().andSelf().each(function(){var selectee=$.data(this,"selectable-item");if(selectee){selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');selectee.unselecting=false;selectee.selecting=true;selectee.selected=true;self._trigger("selecting",event,{selecting:selectee.element});return false;}});},_mouseDrag:function(event){var self=this;this.dragged=true;if(this.options.disabled)
return;var options=this.options;var x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){var tmp=x2;x2=x1;x1=tmp;}
if(y1>y2){var tmp=y2;y2=y1;y1=tmp;}
this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item");if(!selectee||selectee.element==self.element[0])
return;var hit=false;if(options.tolerance=='touch'){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1));}else if(options.tolerance=='fit'){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2);}
if(hit){if(selectee.selected){selectee.$element.removeClass('ui-selected');selectee.selected=false;}
if(selectee.unselecting){selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false;}
if(!selectee.selecting){selectee.$element.addClass('ui-selecting');selectee.selecting=true;self._trigger("selecting",event,{selecting:selectee.element});}}else{if(selectee.selecting){if(event.metaKey&&selectee.startselected){selectee.$element.removeClass('ui-selecting');selectee.selecting=false;selectee.$element.addClass('ui-selected');selectee.selected=true;}else{selectee.$element.removeClass('ui-selecting');selectee.selecting=false;if(selectee.startselected){selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;}
self._trigger("unselecting",event,{unselecting:selectee.element});}}
if(selectee.selected){if(!event.metaKey&&!selectee.startselected){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self._trigger("unselecting",event,{unselecting:selectee.element});}}}});return false;},_mouseStop:function(event){var self=this;this.dragged=false;var options=this.options;$('.ui-unselecting',this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false;selectee.startselected=false;self._trigger("unselected",event,{unselected:selectee.element});});$('.ui-selecting',this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-selecting').addClass('ui-selected');selectee.selecting=false;selectee.selected=true;selectee.startselected=true;self._trigger("selected",event,{selected:selectee.element});});this._trigger("stop",event);this.helper.remove();return false;}}));$.extend($.ui.selectable,{version:"1.7.2",defaults:{appendTo:'body',autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:'*',tolerance:'touch'}});})(jQuery);;;jQuery.effects||(function($){$.effects={version:"1.7.2",save:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null)element.data("ec.storage."+set[i],element[0].style[set[i]]);}},restore:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null)element.css(set[i],element.data("ec.storage."+set[i]));}},setMode:function(el,mode){if(mode=='toggle')mode=el.is(':hidden')?'show':'hide';return mode;},getBaseline:function(origin,original){var y,x;switch(origin[0]){case'top':y=0;break;case'middle':y=0.5;break;case'bottom':y=1;break;default:y=origin[0]/original.height;};switch(origin[1]){case'left':x=0;break;case'center':x=0.5;break;case'right':x=1;break;default:x=origin[1]/original.width;};return{x:x,y:y};},createWrapper:function(element){if(element.parent().is('.ui-effects-wrapper'))
return element.parent();var props={width:element.outerWidth(true),height:element.outerHeight(true),'float':element.css('float')};element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var wrapper=element.parent();if(element.css('position')=='static'){wrapper.css({position:'relative'});element.css({position:'relative'});}else{var top=element.css('top');if(isNaN(parseInt(top,10)))top='auto';var left=element.css('left');if(isNaN(parseInt(left,10)))left='auto';wrapper.css({position:element.css('position'),top:top,left:left,zIndex:element.css('z-index')}).show();element.css({position:'relative',top:0,left:0});}
wrapper.css(props);return wrapper;},removeWrapper:function(element){if(element.parent().is('.ui-effects-wrapper'))
return element.parent().replaceWith(element);return element;},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){unit=element.cssUnit(x);if(unit[0]>0)value[x]=unit[0]*factor+unit[1];});return value;},animateClass:function(value,duration,easing,callback){var cb=(typeof easing=="function"?easing:(callback?callback:null));var ea=(typeof easing=="string"?easing:null);return this.each(function(){var offset={};var that=$(this);var oldStyleAttr=that.attr("style")||'';if(typeof oldStyleAttr=='object')oldStyleAttr=oldStyleAttr["cssText"];if(value.toggle){that.hasClass(value.toggle)?value.remove=value.toggle:value.add=value.toggle;}
var oldStyle=$.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(value.add)that.addClass(value.add);if(value.remove)that.removeClass(value.remove);var newStyle=$.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(value.add)that.removeClass(value.add);if(value.remove)that.addClass(value.remove);for(var n in newStyle){if(typeof newStyle[n]!="function"&&newStyle[n]&&n.indexOf("Moz")==-1&&n.indexOf("length")==-1&&newStyle[n]!=oldStyle[n]&&(n.match(/color/i)||(!n.match(/color/i)&&!isNaN(parseInt(newStyle[n],10))))&&(oldStyle.position!="static"||(oldStyle.position=="static"&&!n.match(/left|top|bottom|right/))))offset[n]=newStyle[n];}
that.animate(offset,duration,ea,function(){if(typeof $(this).attr("style")=='object'){$(this).attr("style")["cssText"]="";$(this).attr("style")["cssText"]=oldStyleAttr;}else $(this).attr("style",oldStyleAttr);if(value.add)$(this).addClass(value.add);if(value.remove)$(this).removeClass(value.remove);if(cb)cb.apply(this,arguments);});});}};function _normalizeArguments(a,m){var o=a[1]&&a[1].constructor==Object?a[1]:{};if(m)o.mode=m;var speed=a[1]&&a[1].constructor!=Object?a[1]:(o.duration?o.duration:a[2]);speed=$.fx.off?0:typeof speed==="number"?speed:$.fx.speeds[speed]||$.fx.speeds._default;var callback=o.callback||($.isFunction(a[1])&&a[1])||($.isFunction(a[2])&&a[2])||($.isFunction(a[3])&&a[3]);return[a[0],o,speed,callback];}
$.fn.extend({_show:$.fn.show,_hide:$.fn.hide,__toggle:$.fn.toggle,_addClass:$.fn.addClass,_removeClass:$.fn.removeClass,_toggleClass:$.fn.toggleClass,effect:function(fx,options,speed,callback){return $.effects[fx]?$.effects[fx].call(this,{method:fx,options:options||{},duration:speed,callback:callback}):null;},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0])))
return this._show.apply(this,arguments);else{return this.effect.apply(this,_normalizeArguments(arguments,'show'));}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0])))
return this._hide.apply(this,arguments);else{return this.effect.apply(this,_normalizeArguments(arguments,'hide'));}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||($.isFunction(arguments[0])||typeof arguments[0]=='boolean')){return this.__toggle.apply(this,arguments);}else{return this.effect.apply(this,_normalizeArguments(arguments,'toggle'));}},addClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{add:classNames},speed,easing,callback]):this._addClass(classNames);},removeClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{remove:classNames},speed,easing,callback]):this._removeClass(classNames);},toggleClass:function(classNames,speed,easing,callback){return((typeof speed!=="boolean")&&speed)?$.effects.animateClass.apply(this,[{toggle:classNames},speed,easing,callback]):this._toggleClass(classNames,speed);},morph:function(remove,add,speed,easing,callback){return $.effects.animateClass.apply(this,[{add:add,remove:remove},speed,easing,callback]);},switchClass:function(){return this.morph.apply(this,arguments);},cssUnit:function(key){var style=this.css(key),val=[];$.each(['em','px','%','pt'],function(i,unit){if(style.indexOf(unit)>0)
val=[parseFloat(style),unit];});return val;}});$.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){$.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0],10),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1],10),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2],10),255),0)].join(",")+")";};});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10)];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent'];return colors[$.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=$.curCSS(elem,attr);if(color!=''&&color!='transparent'||$.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={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]};$.easing.jswing=$.easing.swing;$.extend($.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-$.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return $.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return $.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});})(jQuery);;(function($){$.widget("ui.droppable",{_init:function(){var o=this.options,accept=o.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&$.isFunction(this.options.accept)?this.options.accept:function(d){return d.is(accept);};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};$.ui.ddmanager.droppables[this.options.scope]=$.ui.ddmanager.droppables[this.options.scope]||[];$.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"));},destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];for(var i=0;i<drop.length;i++)
if(drop[i]==this)
drop.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");},_setData:function(key,value){if(key=='accept'){this.options.accept=value&&$.isFunction(value)?value:function(d){return d.is(value);};}else{$.widget.prototype._setData.apply(this,arguments);}},_activate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass)this.element.addClass(this.options.activeClass);(draggable&&this._trigger('activate',event,this.ui(draggable)));},_deactivate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass)this.element.removeClass(this.options.activeClass);(draggable&&this._trigger('deactivate',event,this.ui(draggable)));},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass)this.element.addClass(this.options.hoverClass);this._trigger('over',event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger('out',event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return false;var childrenIntersection=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var inst=$.data(this,'droppable');if(inst.options.greedy&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance)){childrenIntersection=true;return false;}});if(childrenIntersection)return false;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.activeClass)this.element.removeClass(this.options.activeClass);if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger('drop',event,this.ui(draggable));return this.element;}
return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,absolutePosition:c.positionAbs,offset:c.positionAbs};}});$.extend($.ui.droppable,{version:"1.7.2",eventPrefix:'drop',defaults:{accept:'*',activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:'default',tolerance:'intersect'}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return false;var x1=(draggable.positionAbs||draggable.position.absolute).left,x2=x1+draggable.helperProportions.width,y1=(draggable.positionAbs||draggable.position.absolute).top,y2=y1+draggable.helperProportions.height;var l=droppable.offset.left,r=l+droppable.proportions.width,t=droppable.offset.top,b=t+droppable.proportions.height;switch(toleranceMode){case'fit':return(l<x1&&x2<r&&t<y1&&y2<b);break;case'intersect':return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);break;case'pointer':var draggableLeft=((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left),draggableTop=((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top),isOver=$.ui.isOver(draggableTop,draggableLeft,t,l,droppable.proportions.height,droppable.proportions.width);return isOver;break;case'touch':return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));break;default:return false;break;}};$.ui.ddmanager={current:null,droppables:{'default':[]},prepareOffsets:function(t,event){var m=$.ui.ddmanager.droppables[t.options.scope];var type=event?event.type:null;var list=(t.currentItem||t.element).find(":data(droppable)").andSelf();droppablesLoop:for(var i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].options.accept.call(m[i].element[0],(t.currentItem||t.element))))continue;for(var j=0;j<list.length;j++){if(list[j]==m[i].element[0]){m[i].proportions.height=0;continue droppablesLoop;}};m[i].visible=m[i].element.css("display")!="none";if(!m[i].visible)continue;m[i].offset=m[i].element.offset();m[i].proportions={width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight};if(type=="mousedown")m[i]._activate.call(m[i],event);}},drop:function(draggable,event){var dropped=false;$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance))
dropped=this._drop.call(this,event);if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=1;this.isover=0;this._deactivate.call(this,event);}});return dropped;},drag:function(draggable,event){if(draggable.options.refreshPositions)$.ui.ddmanager.prepareOffsets(draggable,event);$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var intersects=$.ui.intersect(draggable,this,this.options.tolerance);var c=!intersects&&this.isover==1?'isout':(intersects&&this.isover==0?'isover':null);if(!c)return;var parentInstance;if(this.options.greedy){var parent=this.element.parents(':data(droppable):eq(0)');if(parent.length){parentInstance=$.data(parent[0],'droppable');parentInstance.greedyChild=(c=='isover'?1:0);}}
if(parentInstance&&c=='isover'){parentInstance['isover']=0;parentInstance['isout']=1;parentInstance._out.call(parentInstance,event);}
this[c]=1;this[c=='isout'?'isover':'isout']=0;this[c=="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c=='isout'){parentInstance['isout']=0;parentInstance['isover']=1;parentInstance._over.call(parentInstance,event);}});}};})(jQuery);;(function($){$.widget("ui.resizable",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||'ui-resizable-helper':null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css('position'))&&$.browser.opera)
this.element.css({position:'relative',top:'auto',left:'auto'});this.element.wrap($('<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=o.handles||(!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'});if(this.handles.constructor==String){if(this.handles=='all')this.handles='n,e,s,w,se,sw,ne,nw';var n=this.handles.split(",");this.handles={};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),hname='ui-resizable-'+handle;var axis=$('<div class="ui-resizable-handle '+hname+'"></div>');if(/sw|se|ne|nw/.test(handle))axis.css({zIndex:++o.zIndex});if('se'==handle){axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');};this.handles[handle]='.ui-resizable-'+handle;this.element.append(axis);}}
this._renderAxis=function(target){target=target||this.element;for(var i in this.handles){if(this.handles[i].constructor==String)
this.handles[i]=$(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var axis=$(this.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");target.css(padPos,padWrapper);this._proportionallyResize();}
if(!$(this.handles[i]).length)
continue;}};this._renderAxis(this.element);this._handles=$('.ui-resizable-handle',this.element).disableSelection();this._handles.mouseover(function(){if(!self.resizing){if(this.className)
var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=axis&&axis[1]?axis[1]:'se';}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");self._handles.show();},function(){if(!self.resizing){$(this).addClass("ui-resizable-autohide");self._handles.hide();}});}
this._mouseInit();},destroy:function(){this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();};if(this.elementIsWrapper){_destroy(this.element);var wrapper=this.element;wrapper.parent().append(this.originalElement.css({position:wrapper.css('position'),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css('top'),left:wrapper.css('left')})).end().remove();}
this.originalElement.css('resize',this.originalResizeStyle);_destroy(this.originalElement);},_mouseCapture:function(event){var handle=false;for(var i in this.handles){if($(this.handles[i])[0]==event.target)handle=true;}
return this.options.disabled||!!handle;},_mouseStart:function(event){var o=this.options,iniPos=this.element.position(),el=this.element;this.resizing=true;this.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){el.css({position:'absolute',top:iniPos.top,left:iniPos.left});}
if($.browser.opera&&(/relative/).test(el.css('position')))
el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;}
this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var cursor=$('.ui-resizable-'+this.axis).css('cursor');$('body').css('cursor',cursor=='auto'?this.axis+'-resize':cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[event,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(this._aspectRatio||event.shiftKey)
data=this._updateRatio(data,event);data=this._respectSize(data,event);this._propagate("resize",event);el.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(data);this._trigger('resize',event,this.ui());return false;},_mouseStop:function(event){this.resizing=false;var o=this.options,self=this;if(this._helper){var pr=this._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate)
this.element.css($.extend(s,{top:top,left:left}));self.helper.height(self.size.height);self.helper.width(self.size.width);if(this._helper&&!o.animate)this._proportionallyResize();}
$('body').css('cursor','auto');this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper)this.helper.remove();return false;},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(isNumber(data.left))this.position.left=data.left;if(isNumber(data.top))this.position.top=data.top;if(isNumber(data.height))this.size.height=data.height;if(isNumber(data.width))this.size.width=data.width;},_updateRatio:function(data,event){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height*this.aspectRatio);else if(data.width)data.height=(csize.width/this.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null;}
if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}
return data;},_respectSize:function(data,event){var el=this.helper,o=this.options,pRatio=this._aspectRatio||event.shiftKey,a=this.axis,ismaxw=isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height);if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ismaxw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else if(isNotwh&&!data.top&&data.left)data.left=null;return data;},_proportionallyResize:function(){var o=this.options;if(!this._proportionallyResizeElements.length)return;var element=this.helper||this.element;for(var i=0;i<this._proportionallyResizeElements.length;i++){var prel=this._proportionallyResizeElements[i];if(!this.borderDif){var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];this.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});}
if($.browser.msie&&!(!($(element).is(':hidden')||$(element).parents(':hidden').length)))
continue;prel.css({height:(element.height()-this.borderDif[0]-this.borderDif[2])||0,width:(element.width()-this.borderDif[1]-this.borderDif[3])||0});};},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+pxyoffset,height:this.element.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx,dy){return{width:this.originalSize.width+dx};},w:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!="resize"&&this._trigger(n,event,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};}}));$.extend($.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});$.ui.plugin.add("resizable","alsoResize",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options;_store=function(exp){$(exp).each(function(){$(this).data("resizable-alsoresize",{width:parseInt($(this).width(),10),height:parseInt($(this).height(),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).css('top'),10)});});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize);}
else{$.each(o.alsoResize,function(exp,c){_store(exp);});}}else{_store(o.alsoResize);}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0)
style[prop]=sum||null;});if(/relative/.test(el.css('position'))&&$.browser.opera){self._revertToRelativePosition=true;el.css({position:'absolute',top:'auto',left:'auto'});}
el.css(style);});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(event,ui){var self=$(this).data("resizable");if(self._revertToRelativePosition&&$.browser.opera){self._revertToRelativePosition=false;el.css({position:'relative'});}
$(this).removeData("resizable-alsoresize-start");}});$.ui.plugin.add("resizable","animate",{stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;var pr=self._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),left:parseInt(self.element.css('left'),10)};if(pr&&pr.length)$(pr[0]).css({width:data.width,height:data.height});self._updateCache(data);self._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;self.containerElement=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}
else{var element=$(ce),p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=num(element.css("padding"+name));});self.containerOffset=element.offset();self.containerPosition=element.position();self.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=self._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&(/static/).test(ce.css('position')))cop=co;if(cp.left<(self._helper?co.left:0)){self.size.width=self.size.width+(self._helper?(self.position.left-co.left):(self.position.left-cop.left));if(pRatio)self.size.height=self.size.width/o.aspectRatio;self.position.left=o.helper?co.left:0;}
if(cp.top<(self._helper?co.top:0)){self.size.height=self.size.height+(self._helper?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height*o.aspectRatio;self.position.top=self._helper?co.top:0;}
self.offset.left=self.parentData.left+self.position.left;self.offset.top=self.parentData.top+self.position.top;var woset=Math.abs((self._helper?self.offset.left-cop.left:(self.offset.left-cop.left))+self.sizeDiff.width),hoset=Math.abs((self._helper?self.offset.top-cop.top:(self.offset.top-co.top))+self.sizeDiff.height);var isParent=self.containerElement.get(0)==self.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(self.containerElement.css('position'));if(isParent&&isOffsetRelative)woset-=self.parentData.left;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width/self.aspectRatio;}
if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height*self.aspectRatio;}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options,cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.outerWidth()-self.sizeDiff.width,h=helper.outerHeight()-self.sizeDiff.height;if(self._helper&&!o.animate&&(/relative/).test(ce.css('position')))
$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});if(self._helper&&!o.animate&&(/static/).test(ce.css('position')))
$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}});$.ui.plugin.add("resizable","ghost",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size;self.ghost=self.originalElement.clone();self.ghost.css({opacity:.25,display:'block',position:'relative',height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper);},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("resizable","grid",{resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||event.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/(o.grid[0]||1))*(o.grid[0]||1),oy=Math.round((cs.height-os.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;}
else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;}
else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox;}
else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox;}}});var num=function(v){return parseInt(v,10)||0;};var isNumber=function(value){return!isNaN(parseInt(value,10));};})(jQuery);;(function($){$.widget("ui.slider",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"
+" ui-slider-"+this.orientation
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all");this.range=$([]);if(o.range){if(o.range===true){this.range=$('<div></div>');if(!o.values)o.values=[this._valueMin(),this._valueMin()];if(o.values.length&&o.values.length!=2){o.values=[o.values[0],o.values[0]];}}else{this.range=$('<div></div>');}
this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range=="min"||o.range=="max"){this.range.addClass("ui-slider-range-"+o.range);}
this.range.addClass("ui-widget-header");}
if($(".ui-slider-handle",this.element).length==0)
$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length<o.values.length)
$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");}
this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default"
+" ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(event){event.preventDefault();}).hover(function(){if(!o.disabled){$(this).addClass('ui-state-hover');}},function(){$(this).removeClass('ui-state-hover');}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass('ui-state-focus');$(this).addClass('ui-state-focus');}else{$(this).blur();}}).blur(function(){$(this).removeClass('ui-state-focus');});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i);});this.handles.keydown(function(event){var ret=true;var index=$(this).data("index.ui-slider-handle");if(self.options.disabled)
return;switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:ret=false;if(!self._keySliding){self._keySliding=true;$(this).addClass("ui-state-active");self._start(event,index);}
break;}
var curVal,newVal,step=self._step();if(self.options.values&&self.options.values.length){curVal=newVal=self.values(index);}else{curVal=newVal=self.value();}
switch(event.keyCode){case $.ui.keyCode.HOME:newVal=self._valueMin();break;case $.ui.keyCode.END:newVal=self._valueMax();break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal==self._valueMax())return;newVal=curVal+step;break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal==self._valueMin())return;newVal=curVal-step;break;}
self._slide(event,index,newVal);return ret;}).keyup(function(event){var index=$(this).data("index.ui-slider-handle");if(self._keySliding){self._stop(event,index);self._change(event,index);self._keySliding=false;$(this).removeClass("ui-state-active");}});this._refreshValue();},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();},_mouseCapture:function(event){var o=this.options;if(o.disabled)
return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);var distance=this._valueMax()-this._valueMin()+1,closestHandle;var self=this,index;this.handles.each(function(i){var thisDistance=Math.abs(normValue-self.values(i));if(distance>thisDistance){distance=thisDistance;closestHandle=$(this);index=i;}});if(o.range==true&&this.values(1)==o.min){closestHandle=$(this.handles[++index]);}
this._start(event,index);self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();var offset=closestHandle.offset();var mouseOverHandle=!$(event.target).parents().andSelf().is('.ui-slider-handle');this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top
-(closestHandle.height()/2)
-(parseInt(closestHandle.css('borderTopWidth'),10)||0)
-(parseInt(closestHandle.css('borderBottomWidth'),10)||0)
+(parseInt(closestHandle.css('marginTop'),10)||0)};normValue=this._normValueFromMouse(position);this._slide(event,index,normValue);return true;},_mouseStart:function(event){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false;},_detectOrientation:function(){this.orientation=this.options.orientation=='vertical'?'vertical':'horizontal';},_normValueFromMouse:function(position){var pixelTotal,pixelMouse;if('horizontal'==this.orientation){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}
var percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1)percentMouse=1;if(percentMouse<0)percentMouse=0;if('vertical'==this.orientation)
percentMouse=1-percentMouse;var valueTotal=this._valueMax()-this._valueMin(),valueMouse=percentMouse*valueTotal,valueMouseModStep=valueMouse%this.options.step,normValue=this._valueMin()+valueMouse-valueMouseModStep;if(valueMouseModStep>(this.options.step/2))
normValue+=this.options.step;return parseFloat(normValue.toFixed(5));},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("start",event,uiHash);},_slide:function(event,index,newVal){var handle=this.handles[index];if(this.options.values&&this.options.values.length){var otherVal=this.values(index?0:1);if((this.options.values.length==2&&this.options.range===true)&&((index==0&&newVal>otherVal)||(index==1&&newVal<otherVal))){newVal=otherVal;}
if(newVal!=this.values(index)){var newValues=this.values();newValues[index]=newVal;var allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal,values:newValues});var otherVal=this.values(index?0:1);if(allowed!==false){this.values(index,newVal,(event.type=='mousedown'&&this.options.animate),true);}}}else{if(newVal!=this.value()){var allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal});if(allowed!==false){this._setData('value',newVal,(event.type=='mousedown'&&this.options.animate));}}}},_stop:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("stop",event,uiHash);},_change:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("change",event,uiHash);},value:function(newValue){if(arguments.length){this._setData("value",newValue);this._change(null,0);}
return this._value();},values:function(index,newValue,animated,noPropagation){if(arguments.length>1){this.options.values[index]=newValue;this._refreshValue(animated);if(!noPropagation)this._change(null,index);}
if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(index);}else{return this.value();}}else{return this._values();}},_setData:function(key,value,animated){$.widget.prototype._setData.apply(this,arguments);switch(key){case'disabled':if(value){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");}else{this.handles.removeAttr("disabled");}
case'orientation':this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(animated);break;case'value':this._refreshValue(animated);break;}},_step:function(){var step=this.options.step;return step;},_value:function(){var val=this.options.value;if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;},_values:function(index){if(arguments.length){var val=this.options.values[index];if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;}else{return this.options.values;}},_valueMin:function(){var valueMin=this.options.min;return valueMin;},_valueMax:function(){var valueMax=this.options.max;return valueMax;},_refreshValue:function(animate){var oRange=this.options.range,o=this.options,self=this;if(this.options.values&&this.options.values.length){var vp0,vp1;this.handles.each(function(i,j){var valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';$(this).stop(1,1)[animate?'animate':'css'](_set,o.animate);if(self.options.range===true){if(self.orientation=='horizontal'){(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({left:valPercent+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({width:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}else{(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({bottom:(valPercent)+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({height:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}}
lastValPercent=valPercent;});}else{var value=this.value(),valueMin=this._valueMin(),valueMax=this._valueMax(),valPercent=valueMax!=valueMin?(value-valueMin)/(valueMax-valueMin)*100:0;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';this.handle.stop(1,1)[animate?'animate':'css'](_set,o.animate);(oRange=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[animate?'animate':'css']({width:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="horizontal")&&this.range[animate?'animate':'css']({width:(100-valPercent)+'%'},{queue:false,duration:o.animate});(oRange=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[animate?'animate':'css']({height:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="vertical")&&this.range[animate?'animate':'css']({height:(100-valPercent)+'%'},{queue:false,duration:o.animate});}}}));$.extend($.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:'horizontal',range:false,step:1,value:0,values:null}});})(jQuery);;(function($){$.widget("ui.sortable",$.extend({},$.ui.mouse,{_init:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css('float')):false;this.offset=this.element.offset();this._mouseInit();},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)
this.items[i].item.removeData("sortable-item");},_mouseCapture:function(event,overrideHandle){if(this.reverting){return false;}
if(this.options.disabled||this.options.type=='static')return false;this._refreshItems(event);var currentItem=null,self=this,nodes=$(event.target).parents().each(function(){if($.data(this,'sortable-item')==self){currentItem=$(this);return false;}});if($.data(event.target,'sortable-item')==self)currentItem=$(event.target);if(!currentItem)return false;if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==event.target)validHandle=true;});if(!validHandle)return false;}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var o=this.options,self=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);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};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.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(o.containment)
this._setContainment();if(o.cursor){if($('body').css("cursor"))this._storedCursor=$('body').css("cursor");$('body').css("cursor",o.cursor);}
if(o.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",o.opacity);}
if(o.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",o.zIndex);}
if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML')
this.overflowOffset=this.scrollParent.offset();this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions)
this._cacheHelperProportions();if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,self._uiHash(this));}}
if($.ui.ddmanager)
$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}
if(this.options.scroll){var o=this.options,scrolled=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML'){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);}
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 i=this.items.length-1;i>=0;i--){var item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item);if(!intersection)continue;if(itemElement!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=itemElement&&!$.ui.contains(this.placeholder[0],itemElement)&&(this.options.type=='semi-dynamic'?!$.ui.contains(this.element[0],itemElement):true)){this.direction=intersection==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);this._trigger('sort',event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event)return;if($.ui.ddmanager&&!this.options.dropBehaviour)
$.ui.ddmanager.drop(this,event);if(this.options.revert){var self=this;var cur=self.placeholder.offset();self.reverting=true;$(this.helper).animate({left:cur.left-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){self._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){var self=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original")
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else
this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,self._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,self._uiHash(this));this.containers[i].containerCache.over=0;}}}
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();$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}
return true;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1]+'[]')+'='+(o.key&&o.expression?res[1]:res[2]));});return str.join('&');},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||'id')||'');});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement)
return false;return this.floating?(((horizontalDirection&&horizontalDirection=="right")||verticalDirection=="down")?2:1):(verticalDirection&&(verticalDirection=="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection=="right"&&isOverRightHalf)||(horizontalDirection=="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection=="down"&&isOverBottomHalf)||(verticalDirection=="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!=0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!=0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this.refreshPositions();},_connectWith:function(){var options=this.options;return options.connectWith.constructor==String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];var connectWith=this._connectWith();if(connectWith&&connected){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper"),inst]);}};};}
queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){items.push(this);});};return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data(sortable-item)");for(var i=0;i<this.items.length;i++){for(var j=0;j<list.length;j++){if(list[j]==this.items[i].item[0])
this.items.splice(i,1);};};},_refreshItems:function(event){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]];var connectWith=this._connectWith();if(connectWith){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}};};}
for(var i=queries.length-1;i>=0;i--){var targetData=queries[i][1];var _queries=queries[i][0];for(var j=0,queriesLength=_queries.length;j<queriesLength;j++){var item=$(_queries[j]);item.data('sortable-item',targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});};};},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
for(var i=this.items.length-1;i>=0;i--){var item=this.items[i];if(item.instance!=this.currentContainer&&this.currentContainer&&item.item[0]!=this.currentItem[0])
continue;var t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
var p=t.offset();item.left=p.left;item.top=p.top;};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();};}},_createPlaceholder:function(that){var self=that||this,o=self.options;if(!o.placeholder||o.placeholder.constructor==String){var className=o.placeholder;o.placeholder={element:function(){var el=$(document.createElement(self.currentItem[0].nodeName)).addClass(className||self.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!className)
el.style.visibility="hidden";return el;},update:function(container,p){if(className&&!o.forcePlaceholderSize)return;if(!p.height()){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css('paddingTop')||0,10)-parseInt(self.currentItem.css('paddingBottom')||0,10));};if(!p.width()){p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css('paddingLeft')||0,10)-parseInt(self.currentItem.css('paddingRight')||0,10));};}};}
self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem));self.currentItem.after(self.placeholder);o.placeholder.update(self,self.placeholder);},_contactContainers:function(event){for(var i=this.containers.length-1;i>=0;i--){if(this._intersectsWith(this.containers[i].containerCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var dist=10000;var itemWithLeastDistance=null;var base=this.positionAbs[this.containers[i].floating?'left':'top'];for(var j=this.items.length-1;j>=0;j--){if(!$.ui.contains(this.containers[i].element[0],this.items[j].item[0]))continue;var cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j];}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty)
continue;this.currentContainer=this.containers[i];itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[i].element,true);this._trigger("change",event,this._uiHash());this.containers[i]._trigger("change",event,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);}
this.containers[i]._trigger("over",event,this._uiHash(this));this.containers[i].containerCache.over=1;}}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}};},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper=='clone'?this.currentItem.clone():this.currentItem);if(!helper.parents('body').length)
$(o.appendTo!='parent'?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);if(helper[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(helper[0].style.width==''||o.forceHelperSize)helper.width(this.currentItem.width());if(helper[0].style.height==''||o.forceHelperSize)helper.height(this.currentItem.height());return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.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 o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=='down'?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var self=this,counter=this.counter;window.setTimeout(function(){if(counter==self.counter)self.refreshPositions(!hardRefresh);},0);},_clear:function(event,noPropagation){this.reverting=false;var delayedTriggers=[],self=this;if(!this._noFinalSort&&this.currentItem[0].parentNode)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS){if(this._storedCSS[i]=='auto'||this._storedCSS[i]=='static')this._storedCSS[i]='';}
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation)delayedTriggers.push(function(event){this._trigger("receive",event,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])&&!noPropagation)delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});if(!$.ui.contains(this.element[0],this.currentItem[0])){if(!noPropagation)delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});for(var i=this.containers.length-1;i>=0;i--){if($.ui.contains(this.containers[i].element[0],this.currentItem[0])&&!noPropagation){delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.containers[i]));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.containers[i]));}};};for(var i=this.containers.length-1;i>=0;i--){if(!noPropagation)delayedTriggers.push((function(c){return function(event){c._trigger("deactivate",event,this._uiHash(this));};}).call(this,this.containers[i]));if(this.containers[i].containerCache.over){delayedTriggers.push((function(c){return function(event){c._trigger("out",event,this._uiHash(this));};}).call(this,this.containers[i]));this.containers[i].containerCache.over=0;}}
if(this._storedCursor)$('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(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
return false;}
if(!noPropagation)this._trigger("beforeStop",event,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0])this.helper.remove();this.helper=null;if(!noPropagation){for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return true;},_trigger:function(){if($.widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(inst){var self=inst||this;return{helper:self.helper,placeholder:self.placeholder||$([]),position:self.position,absolutePosition:self.positionAbs,offset:self.positionAbs,item:self.currentItem,sender:inst?inst.element:null};}}));$.extend($.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:'auto',cursorAt:false,delay:0,distance:1,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}});})(jQuery);;function round5(num,strokeWidth){var ret;strokeWidth=numb(strokeWidth);if(strokeWidth%2){ret=num;}
else{ret=Math.round(num-.5)+.5;}
return ret;};function numb(num){return parseInt(num)||0;};function arrayRemove(arr,elem){var x,newArr=new Array();for(x in arr){if(arr[x]!=elem){newArr.push(arr[x]);}}
return newArr;};function betweenPoint(point1,point2,dist){var y,x;if(point1.x==point2.x){y=point1.y<point2.y?point1.y+dist:point1.y-dist;return{x:point1.x,y:y};}
else if(point1.y==point2.y){x=point1.x<point2.x?point1.x+dist:point1.x-dist;return{x:x,y:point1.y};}};function centerPoint(arcStart,corner,arcEnd){var x=corner.x==arcStart.x?arcEnd.x:arcStart.x;var y=corner.y==arcStart.y?arcEnd.y:arcStart.y;var startAngle,endAngle;if(arcStart.x<arcEnd.x){if(arcStart.y>arcEnd.y){startAngle=(Math.PI/180)*180;endAngle=(Math.PI/180)*90;}
else{startAngle=(Math.PI/180)*90;endAngle=0;}}
else{if(arcStart.y>arcEnd.y){startAngle=(Math.PI/180)*270;endAngle=(Math.PI/180)*180;}
else{startAngle=0;endAngle=(Math.PI/180)*270;}}
return{x:x,y:y,type:'center',startAngle:startAngle,endAngle:endAngle};};function findIntersect(r1x1,r1y1,r1x2,r1y2,r2x1,r2y1,r2x2,r2y2){if(r2x1==r2x2){return findIntersectY(r1x1,r1y1,r1x2,r1y2,r2x1);}
if(r2y1==r2y2){return findIntersectX(r1x1,r1y1,r1x2,r1y2,r2y1);}
var r1m=(r1y1-r1y2)/(r1x1-r1x2);var r1b=r1y1-(r1m*r1x1);var r2m=(r2y1-r2y2)/(r2x1-r2x2);var r2b=r2y1-(r2m*r2x1);var x=(r2b-r1b)/(r1m-r2m);var y=r1m*x+r1b;return{x:x,y:y};};function findIntersectY(r1x1,r1y1,r1x2,r1y2,x){if(r1y1==r1y2){return{x:x,y:r1y1};}
var r1m=(r1y1-r1y2)/(r1x1-r1x2);var r1b=r1y1-(r1m*r1x1);var y=r1m*x+r1b;return{x:x,y:y};};function findIntersectX(r1x1,r1y1,r1x2,r1y2,y){if(r1x1==r1x2){return{x:r1x1,y:y};}
var r1m=(r1y1-r1y2)/(r1x1-r1x2);var r1b=r1y1-(r1m*r1x1);var x=(y-r1b)/r1m;return{x:x,y:y};};;function drawTooltip(points,strokeWidth){this.moveTo(points[0].x,points[0].y);for(i=1;i<points.length;i++){if(points[i-1].type==='arcStart'){this.quadraticCurveTo(round5(points[i].x,strokeWidth),round5(points[i].y,strokeWidth),round5(points[(i+1)%points.length].x,strokeWidth),round5(points[(i+1)%points.length].y,strokeWidth));i++;}else{this.lineTo(round5(points[i].x,strokeWidth),round5(points[i].y,strokeWidth));}}};;function showInDialog(pDialogId,pDialogParams,pAjaxUrl,pAjaxParam,pLoadingMessage){var dialogElem=$('#'+pDialogId);if(dialogElem.size()>0){$('#'+pDialogId).empty();$('#'+pDialogId).html(pLoadingMessage);}else{dialogElem=$('<div></div>').attr('id',pDialogId);$('body').append(dialogElem);dialogElem=$('#'+pDialogId).viewDialog(pDialogParams);$('#'+pDialogId).html(pLoadingMessage);}
oldCookie=$.cookie('symfony');$.xtl.ajax(oldCookie,{type:"POST",url:pAjaxUrl,data:pAjaxParam,success:function(html){$('#'+pDialogId).empty();$('#'+pDialogId).html(html);$('#'+pDialogId).callFrom('view','open');}});}
function linkToPopup(pFunctionName,pAjaxUrl,pAjaxParams){$(location).attr('href',"javascript: "+pFunctionName+"('"+pAjaxUrl+"', '"+pAjaxParams+"' );");}
function simpleDialog(title,content,pDialogParams){var dialogId='simple_dialog_container';if(pDialogParams==undefined){var pDialogParams={autoOpen:false,bgiframe:true,zIndex:3999,modal:true,closeOnEscape:true,resizable:false,width:500,height:200,title:''}}
pDialogParams.title=title;var dialogElem=$('#'+dialogId);if(dialogElem.size()>0){$('#'+dialogId).empty();}else{dialogElem=$('<div></div>').attr('id',dialogId);$('body').append(dialogElem);dialogElem=$('#'+dialogId).viewDialog({dialogOptions:pDialogParams});}
$('#'+dialogId).html(content);appendCloseButton(dialogId);$('#'+dialogId).dialog('open');$('#'+dialogId).dialog('option','title',title);};function appendCloseButton(dialogId) {var actionContainer = document.createElement('DIV');$(actionContainer).addClass('xtlaction');$(actionContainer).addClass('popup-actions');var closeButton = document.createElement('BUTTON');closeButton.value = labels.lbl_close;closeButton.innerHTML = labels.lbl_close;$(closeButton).addClass('xtlbutton');actionContainer.appendChild(closeButton);$(closeButton).attr('dialogId', dialogId);$('#' + dialogId)[0].appendChild(actionContainer);$(closeButton).bind('click', function() {$('#'+$(this).attr('dialogId')).dialog('close');});};(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'
+s.src
+'"'
+'style="display:block;position:absolute;z-index:-1;'
+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')
+'top:'
+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))
+';'
+'left:'
+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))
+';'
+'width:'
+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))
+';'
+'height:'
+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)
this.insertBefore(document.createElement(html),this.firstChild);});}
return this;};})(jQuery);;jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});;(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);;document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_||b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d<c.length;d++)this.initElement(c[d])},initElement:function(b){if(!b.getContext){b.getContext=X;b.innerHTML="";b.attachEvent("onpropertychange",Z);b.attachEvent("onresize",$);var a=b.attributes;if(a.width&&a.width.specified)b.style.width=a.width.nodeValue+"px";else b.width=b.clientWidth;if(a.height&&a.height.specified)b.style.height=a.height.nodeValue+"px";else b.height=b.clientHeight}return b}};function Z(b){var a=b.srcElement;switch(b.propertyName){case"width":a.style.width=a.attributes.width.nodeValue+"px";a.getContext().clearRect();break;case"height":a.style.height=a.attributes.height.nodeValue+"px";a.getContext().clearRect();break}}function $(b){var a=b.srcElement;if(a.firstChild){a.firstChild.style.width=a.clientWidth+"px";a.firstChild.style.height=a.clientHeight+"px"}}M.init();var N=[],B=0;for(;B<16;B++){var C=0;for(;C<16;C++)N[B*16+C]=B.toString(16)+C.toString(16)}function I(){return[[1,0,0],[0,1,0],[0,0,1]]}function y(b,a){var c=I(),d=0;for(;d<3;d++){var f=0;for(;f<3;f++){var h=0,g=0;for(;g<3;g++)h+=b[d][g]*a[g][f];c[d][f]=h}}return c}function O(b,a){a.fillStyle=b.fillStyle;a.lineCap=b.lineCap;a.lineJoin=b.lineJoin;a.lineWidth=b.lineWidth;a.miterLimit=b.miterLimit;a.shadowBlur=b.shadowBlur;a.shadowColor=b.shadowColor;a.shadowOffsetX=b.shadowOffsetX;a.shadowOffsetY=b.shadowOffsetY;a.strokeStyle=b.strokeStyle;a.globalAlpha=b.globalAlpha;a.arcScaleX_=b.arcScaleX_;a.arcScaleY_=b.arcScaleY_;a.lineScale_=b.lineScale_}function P(b){var a,c=1;b=String(b);if(b.substring(0,3)=="rgb"){var d=b.indexOf("(",3),f=b.indexOf(")",d+
1),h=b.substring(d+1,f).split(",");a="#";var g=0;for(;g<3;g++)a+=N[Number(h[g])];if(h.length==4&&b.substr(3,1)=="a")c=h[3]}else a=b;return{color:a,alpha:c}}function aa(b){switch(b){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function H(b){this.m_=I();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=k*1;this.globalAlpha=1;this.canvas=b;var a=b.ownerDocument.createElement("div");a.style.width=b.clientWidth+"px";a.style.height=b.clientHeight+"px";a.style.overflow="hidden";a.style.position="absolute";b.appendChild(a);this.element_=a;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}var i=H.prototype;i.clearRect=function(){this.element_.innerHTML=""};i.beginPath=function(){this.currentPath_=[]};i.moveTo=function(b,a){var c=this.getCoords_(b,a);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};i.lineTo=function(b,a){var c=this.getCoords_(b,a);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};i.bezierCurveTo=function(b,a,c,d,f,h){var g=this.getCoords_(f,h),l=this.getCoords_(b,a),e=this.getCoords_(c,d);Q(this,l,e,g)};function Q(b,a,c,d){b.currentPath_.push({type:"bezierCurveTo",cp1x:a.x,cp1y:a.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y});b.currentX_=d.x;b.currentY_=d.y}i.quadraticCurveTo=function(b,a,c,d){var f=this.getCoords_(b,a),h=this.getCoords_(c,d),g={x:this.currentX_+
0.6666666666666666*(f.x-this.currentX_),y:this.currentY_+0.6666666666666666*(f.y-this.currentY_)};Q(this,g,{x:g.x+(h.x-this.currentX_)/3,y:g.y+(h.y-this.currentY_)/3},h)};i.arc=function(b,a,c,d,f,h){c*=k;var g=h?"at":"wa",l=b+G(d)*c-v,e=a+F(d)*c-v,m=b+G(f)*c-v,r=a+F(f)*c-v;if(l==m&&!h)l+=0.125;var n=this.getCoords_(b,a),o=this.getCoords_(l,e),q=this.getCoords_(m,r);this.currentPath_.push({type:g,x:n.x,y:n.y,radius:c,xStart:o.x,yStart:o.y,xEnd:q.x,yEnd:q.y})};i.rect=function(b,a,c,d){this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath()};i.strokeRect=function(b,a,c,d){var f=this.currentPath_;this.beginPath();this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath();this.stroke();this.currentPath_=f};i.fillRect=function(b,a,c,d){var f=this.currentPath_;this.beginPath();this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath();this.fill();this.currentPath_=f};i.createLinearGradient=function(b,a,c,d){var f=new D("gradient");f.x0_=b;f.y0_=a;f.x1_=c;f.y1_=d;return f};i.createRadialGradient=function(b,a,c,d,f,h){var g=new D("gradientradial");g.x0_=b;g.y0_=a;g.r0_=c;g.x1_=d;g.y1_=f;g.r1_=h;return g};i.drawImage=function(b){var a,c,d,f,h,g,l,e,m=b.runtimeStyle.width,r=b.runtimeStyle.height;b.runtimeStyle.width="auto";b.runtimeStyle.height="auto";var n=b.width,o=b.height;b.runtimeStyle.width=m;b.runtimeStyle.height=r;if(arguments.length==3){a=arguments[1];c=arguments[2];h=g=0;l=d=n;e=f=o}else if(arguments.length==5){a=arguments[1];c=arguments[2];d=arguments[3];f=arguments[4];h=g=0;l=n;e=o}else if(arguments.length==9){h=arguments[1];g=arguments[2];l=arguments[3];e=arguments[4];a=arguments[5];c=arguments[6];d=arguments[7];f=arguments[8]}else throw Error("Invalid number of arguments");var q=this.getCoords_(a,c),t=[];t.push(" <g_vml_:group",' coordsize="',k*10,",",k*10,'"',' coordorigin="0,0"',' style="width:',10,"px;height:",10,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var E=[];E.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",j(q.x/k),",","Dy=",j(q.y/k),"");var p=q,z=this.getCoords_(a+d,c),w=this.getCoords_(a,c+f),x=this.getCoords_(a+d,c+f);p.x=s.max(p.x,z.x,w.x,x.x);p.y=s.max(p.y,z.y,w.y,x.y);t.push("padding:0 ",j(p.x/k),"px ",j(p.y/k),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",E.join(""),", sizingmethod='clip');")}else t.push("top:",j(q.y/k),"px;left:",j(q.x/k),"px;");t.push(' ">','<g_vml_:image src="',b.src,'"',' style="width:',k*d,"px;"," height:",k*f,'px;"',' cropleft="',h/n,'"',' croptop="',g/o,'"',' cropright="',(n-h-l)/n,'"',' cropbottom="',(o-g-e)/o,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("<g_vml_:shape",' filled="',!!b,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0 0" coordsize="',k*10," ",k*10,'"',' stroked="',!b,'"',' path="');var h={x:null,y:null},g={x:null,y:null},l=0;for(;l<this.currentPath_.length;l++){var e=this.currentPath_[l];switch(e.type){case"moveTo":a.push(" m ",j(e.x),",",j(e.y));break;case"lineTo":a.push(" l ",j(e.x),",",j(e.y));break;case"close":a.push(" x ");e=null;break;case"bezierCurveTo":a.push(" c ",j(e.cp1x),",",j(e.cp1y),",",j(e.cp2x),",",j(e.cp2y),",",j(e.x),",",j(e.y));break;case"at":case"wa":a.push(" ",e.type," ",j(e.x-this.arcScaleX_*e.radius),",",j(e.y-this.arcScaleY_*e.radius)," ",j(e.x+this.arcScaleX_*e.radius),",",j(e.y+this.arcScaleY_*e.radius)," ",j(e.xStart),",",j(e.yStart)," ",j(e.xEnd),",",j(e.yEnd));break}if(e){if(h.x==null||e.x<h.x)h.x=e.x;if(g.x==null||e.x>g.x)g.x=e.x;if(h.y==null||e.y<h.y)h.y=e.y;if(g.y==null||e.y>g.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_),z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l<J;l++){var T=u[l];S.push(T.offset*q+
o+" "+T.color)}a.push('<g_vml_:fill type="',m.type_,'"',' method="none" focus="100%"',' color="',da,'"',' color2="',ea,'"',' colors="',S.join(","),'"',' opacity="',ga,'"',' g_o_:opacity2="',fa,'"',' angle="',r,'"',' focusposition="',n.x,",",n.y,'" />')}else a.push('<g_vml_:fill color="',d,'" opacity="',f,'" />');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("<g_vml_:stroke",' opacity="',f,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',aa(this.lineCap),'"',' weight="',K,'px"',' color="',d,'" />')}a.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a,0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager=M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})();;(function($){function toIntegersAtLease(n)
{return n<10?'0'+n:n;}
Date.prototype.toJSON=function(date)
{return this.getUTCFullYear()+'-'+
toIntegersAtLease(this.getUTCMonth())+'-'+
toIntegersAtLease(this.getUTCDate());};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.quoteString=function(string)
{if(escapeable.test(string))
{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+'"';};$.toJSON=function(o,compact)
{var type=typeof(o);if(type=="undefined")
return"undefined";else if(type=="number"||type=="boolean")
return o+"";else if(o===null)
return"null";if(type=="string")
{return $.quoteString(o);}
if(type=="object"&&typeof o.toJSON=="function")
return o.toJSON(compact);if(type!="function"&&typeof(o.length)=="number")
{var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i],compact));}
if(compact)
return"["+ret.join(",")+"]";else
return"["+ret.join(", ")+"]";}
if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.");}
var ret=[];for(var k in o){var name;type=typeof(k);if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;var val=$.toJSON(o[k],compact);if(typeof(val)!="string"){continue;}
if(compact)
ret.push(name+":"+val);else
ret.push(name+": "+val);}
return"{"+ret.join(", ")+"}";};$.compactJSON=function(o)
{return $.toJSON(o,true);};$.evalJSON=function(src)
{return eval("("+src+")");};$.secureEvalJSON=function(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.");};})(jQuery);;(function($)
{var defaultMasks={pint:/[\d]/,'int':/[\d\-]/,pnum:/[\d\.]/,money:/[\d\.\s,]/,num:/[\d\-\.]/,hex:/[0-9a-f]/i,email:/[a-z0-9_\.\-@]/i,alpha:/[a-z_]/i,alphanum:/[a-z0-9_]/i};var Keys={TAB:9,RETURN:13,ESC:27,BACKSPACE:8,DELETE:46};var SafariKeys={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var isNavKeyPress=function(e)
{var k=e.keyCode;k=$.browser.safari?(SafariKeys[k]||k):k;return(k>=33&&k<=40)||k==Keys.RETURN||k==Keys.TAB||k==Keys.ESC;};var isSpecialKey=function(e)
{var k=e.keyCode;var c=e.charCode;return k==9||k==13||(k==40&&(!$.browser.opera||!e.shiftKey))||k==27||k==16||k==17||(k>=18&&k<=20)||($.browser.opera&&!e.shiftKey&&(k==8||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45)));};var getKey=function(e)
{var k=e.keyCode||e.charCode;return $.browser.safari?(SafariKeys[k]||k):k;};var getCharCode=function(e)
{return e.charCode||e.keyCode||e.which;};$.fn.keyfilter=function(re)
{return this.keypress(function(e)
{if(e.ctrlKey||e.altKey)
{return;}
var k=getKey(e);if($.browser.mozilla&&(isNavKeyPress(e)||k==Keys.BACKSPACE||(k==Keys.DELETE&&e.charCode==0)))
{return;}
var c=getCharCode(e),cc=String.fromCharCode(c),ok=true;if(!$.browser.mozilla&&(isSpecialKey(e)||!cc))
{return;}
if($.isFunction(re))
{ok=re.call(this,cc);}
else
{ok=re.test(cc);}
if(!ok)
{e.preventDefault();}});};$.extend($.fn.keyfilter,{defaults:{masks:defaultMasks},version:1.7});$(document).ready(function()
{var tags=$('input[class*=mask],textarea[class*=mask]');for(var key in $.fn.keyfilter.defaults.masks)
{tags.filter('.mask-'+key).keyfilter($.fn.keyfilter.defaults.masks[key]);}});})(jQuery);;(function($){$.xtlview("xtl.viewPanel",{_prepareOptions:function(){this.selectors.body='#'+this.id+'-body';this.selectors.header='#'+this.id+'-header';this.selectors.footer='#'+this.id+'-footer';this.options.label=$.xtlprepare.string(this.options.label);this.options.help=$.xtlprepare.string(this.options.help);this.options.error=$.xtlprepare.string(this.options.error);this.options.header=$.xtlprepare.object(this.options.header);this.options.header.items=$.xtlprepare.object(this.options.header.items);this.options.headerDefault=$.xtlprepare.object(this.options.headerDefault);this.options.headerDefault.items=$.xtlprepare.object(this.options.headerDefault.items);this.options.headerDefault.itemChilds=$.xtlprepare.object(this.options.headerDefault.itemChilds);this.options.footer=$.xtlprepare.object(this.options.footer);this.options.footer.viewItems=$.xtlprepare.array(this.options.footer.viewItems);this.options.footer.itemChilds=$.xtlprepare.object(this.options.footer.itemChilds);this.options.footer.items=$.xtlprepare.object(this.options.footer.items);this._prepareHeaderItems();this._prepareFooterItems();$.xtlview.prototype._prepareOptions.apply(this,arguments);},_prepareHeaderItems:function(){var header=this.options.header,headerDefault=this.options.headerDefault,itemName;this.header={};this.header.itemChilds=headerDefault.itemChilds;items=header.items;for(itemName in items){this.header.itemChilds.headerRightToolbar.push(itemName);}
this.header.items=$.extend({},headerDefault.items,items);this.header.itemChilds=$.extend({},headerDefault.itemChilds,header.itemChilds);},_prepareFooterItems:function(){this.footer={};this.footer.items=this.options.footer.items;this.footer.itemChilds=this.options.itemChilds;this.footerViewItems=this.options.footer.viewItems;},_build:function(){this.element.data("view","viewPanel");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){this._buildBody();this._buildHeader();this._buildFooter();},_destroyStaticView:function(){},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){this._updateLabel();this._updateError();this._updateNotice();this._updateHelp();$.xtlview.prototype._updateView.apply(this,arguments);},_buildBody:function(){var bodyElement=$('<div></div>');bodyElement.addClass('content-panel');bodyElement.attr('id',this.id+'-body');bodyElement.addClass('ui-widget-content');this.element.wrapInner(bodyElement);this.element.addClass('ui-corner-all');},_buildHeader:function(){var headerElement=$('<div></div>'),headerId=this.id+'-header';headerElement.attr('id',headerId);headerElement.addClass('header-panel');headerElement.addClass('ui-corner-top');headerElement.css('border-bottom-width','0px');this.element.prepend(headerElement);this._log('mes header options',this.header);headerElement.modelviewAction(this.header);headerElement.viewToolbar({modelview:$.xtlobject.target('modelviewAction',headerId),items:['headerLeftToolbar','headerRightToolbar'],statesStyle:{normal:'ui-widget-header'}});},_buildFooter:function(){var footerElement=$('<div></div>'),footerId=this.id+'-footer',footerHeight=this.options.footerHeight,height;footerElement.attr('id',footerId);footerElement.addClass('footer-panel');footerElement.addClass('ui-corner-bottom');footerElement.css('border-top-width','0px');this.element.append(footerElement);if(this.footerViewItems.length>0){height='auto';}else{height=footerHeight;}
footerElement.modelviewAction(this.footer);footerElement.viewToolbar({modelview:$.xtlobject.target('modelviewAction',footerId),items:this.footerViewItems,height:height,statesStyle:{normal:'ui-widget-header'}});},_updateLabel:function(){var label=this.options.label;if($.xtlvalidate.string(label)){$(this.selectors.header,this.element).callFrom('modelview','itemCustom',['headerLabel',function(item){item.text(label);}]);$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerLabel',true]);}else{$(this.selectors.header,this.element).callFrom('modelview','itemCustom',['headerLabel',function(item){item.text('');}]);$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerLabel',false]);}},_updateHelp:function(){var help=this.options.help;if($.xtlvalidate.string(help)){$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerHelp',true]);}else{$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerHelp',false]);}},_updateError:function(){var error=this.options.error;if($.xtlvalidate.string(error)){$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerError',true]);}else{$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerError',false]);}},_updateNotice:function(){var notice=this.options.notice;if($.xtlvalidate.string(notice)){$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerNotice',true]);}else{$(this.selectors.header,this.element).callFrom('modelview','itemVisibility',['headerNotice',false]);}},_resizeWidth:function(newWidth){this.element.css('width',newWidth);},_resizeHeight:function(newHeight){this.element.css('height',newHeight);},label:function(newLabel){if(newLabel===undefined){return this.options.label;}else{if($.xtlvalidate.string(newLabel)){this.options.label=newLabel;this._updateLabel();}}},help:function(newHelp){if(newHelp===undefined){return this.options.help;}else{if($.xtlvalidate.string(newHelp)){this.options.help=newHelp;this._updateHelp();}}},error:function(newError){if(newError===undefined){return this.options.error;}else{if($.xtlvalidate.string(newError)){this.options.error=newError;this._updateError();}}},_bindObservableEvent:function(){},_unbindObservableEvent:function(){}});$.extend($.xtl.viewPanel,{version:"0.1",defaults:{label:null,help:null,error:null,notice:null,header:{items:{}},footer:{itemChilds:{},items:{}},headerDefault:{itemChilds:{headerLeftToolbar:['headerLabel','headerHelp','headerNotice','headerError'],headerRightToolbar:[]},items:{headerLeftToolbar:{view:$.xtlobject.view(null,'viewToolbar',{height:20,statesStyle:{normal:'ui-widget-header'},styles:{init:'ui-corner-tl'}}),position:'left',type:'container',dependencies:[]},headerRightToolbar:{view:$.xtlobject.view(null,'viewToolbar',{height:20,statesStyle:{normal:'ui-widget-header'},styles:{init:'ui-corner-tr'}}),position:'right',type:'container',dependencies:[]},headerLabel:{view:null,type:'label',position:'left',dependencies:[]},headerHelp:{view:$.xtlobject.view(null,'viewButton',{icon:'ui-icon-help',tooltip:true,tooltipOptions:{contentText:'help',contentSelector:null},action:function(actionArgs){},statesStyle:{normal:$.xtlobject.style('ui-state-default',{backgroundColor:'transparent',backgroundImage:'none',borderColor:'transparent'})},border:'transparent'}),type:'simple',position:'left',dependencies:[]},headerNotice:{view:$.xtlobject.view(null,'viewButton',{icon:'ui-icon-comment',tooltip:true,tooltipOptions:{contentText:'notice',contentSelector:null},action:function(actionArgs){},statesStyle:{normal:$.xtlobject.style('ui-state-default',{backgroundColor:'transparent',backgroundImage:'none',borderColor:'transparent'})},border:'transparent'}),type:'simple',position:'left',dependencies:[]},headerError:{view:$.xtlobject.view(null,'viewButton',{icon:'ui-icon-alert',tooltip:true,tooltipOptions:{state:'error',contentText:'error',contentSelector:null},action:function(actionArgs){},styles:{hover:$.xtlobject.style(null,{backgroundColor:'',backgroundImage:'',borderColor:''})},statesStyle:{normal:$.xtlobject.style('ui-state-error',{backgroundColor:'transparent',backgroundImage:'none',borderColor:'transparent'})}}),type:'simple',position:'left',dependencies:[]}}}},params:{customcss:'xtlview-panel'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,footerHeight:10},states:{state:'normal',states:{normal:true,error:true,highlight:true,disabled:true}},styles:{statesStyle:{normal:null,error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'}}});})(jQuery);;(function($){$.xtlview("xtl.viewButton",{_prepareOptions:function(){var self=this,options=this.options;this.css.icon='ui-icon';this.css.label='button-label';this.selectors.icon='#'+this.id+'-icon';this.selectors.label='#'+this.id+'-label';this.options.icon=$.xtlprepare.string(options.icon);this.options.label=$.xtlprepare.string(options.label);this.options.action=$.xtlprepare.func(options.action);this.options.tooltipOptions=$.xtlprepare.object(options.tooltipOptions);if(!$.xtlvalidate.string(options.icon)){iconElem=$(this.selectors.icon);if($.xtlvalidate.object(iconElem)){iconElem.removeClass('ui-icon');this.options.icon=$.xtlprepare.string(iconElem.attr('class'));iconElem.addClass('ui-icon');}
delete iconElem;}
if(!$.xtlvalidate.string(options.label)){labelElem=$(this.selectors.label);if($.xtlvalidate.object(labelElem)){this.options.label=$.xtlprepare.string(labelElem.text());}else{this.options.label=$.xtlprepare.string(this.element.text());}
delete labelElem;}
this.tooltip=false;if(options.tooltip){this.tooltip='options';}
this.functions.click=function(event){self._action();return false;};this.functions.hoverOn=function(){var hoverStyle=self._getStyle('hover');if($.xtlvalidate.object(hoverStyle)){self.element.applyStyle('hover',hoverStyle);}};this.functions.hoverOff=function(){self.element.removeStyle('hover');};this.functions.focus=function(){self.element.addClass('ui-state-focus');};this.functions.blur=function(){self.element.removeClass('ui-state-focus');};this.functions.mouseDown=function(ev){self.element.addClass('ui-state-active');ev.stopPropagation();};this.functions.mouseUp=function(event){self.element.removeClass('ui-state-active');};$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewButton");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){var fragment=document.createDocumentFragment(),iconElem=$(this.selectors.icon),labelElem=$(this.selectors.label);this.element.attr('role','button');if(this.element.get(0).nodeName!=='TH'&&this.element.get(0).nodeName!=='TD'){this.element.addClass('ui-helper-clearfix');}
if(!iconElem.size()&&!labelElem.size()){this.element.toggleClass('ui-helper-hidden-accessible');this._buildIcon(fragment);this._buildLabel(fragment);this.element.append(fragment);this.element.toggleClass('ui-helper-hidden-accessible');iconElem=$(this.selectors.icon);labelElem=$(this.selectors.label);this.components.builds.push(iconElem);this.components.builds.push(labelElem);}
if($.xtlvalidate.string(this.tooltip)){this.element.viewTooltip(this.options.tooltipOptions);}},_buildIcon:function(fragment){var iconId=this.id+'-icon',htmlElem;htmlElem=document.createElement("span");htmlElem.id=iconId;htmlElem.className=this.css.icon;htmlElem.style.display="none";fragment.appendChild(htmlElem);},_buildLabel:function(fragment){var labelId=this.id+'-label',htmlElem;htmlElem=document.createElement("span");htmlElem.id=labelId;htmlElem.className=this.css.label;htmlElem.style.display="none";fragment.appendChild(htmlElem);},_destroyStaticView:function(){$(this).removeData('oldIcon');$(this.selectors.label).removeData('truncate');if($.xtlvalidate.string(this.tooltip)){this.element.viewTooltip("destroy");}},_enableDynamicView:function(){var functions=this.functions;this.element.bind('click',functions.click).bind('mousedown',functions.mouseDown).bind('mouseup',functions.mouseUp).bind('mouseover',functions.hoverOn).bind('mouseout',functions.hoverOff).bind('focus',functions.focus).bind('blur',functions.blur);if($.xtlvalidate.string(this.tooltip)){this.element.viewTooltip('state',this.options.state);}
if($.xtlvalidate.string(this.options.title)){this.element.attr('title',this.options.title);}},_disableDynamicView:function(){var functions=this.functions;this.element.unbind('click',functions.click).unbind('mousedown',functions.mouseDown).unbind('mouseup',functions.mouseUp).unbind('mouseover',functions.hoverOn).unbind('mouseout',functions.hoverOff).unbind('focus',functions.focus).unbind('blur',functions.blur);if($.xtlvalidate.string(this.tooltip)){this.element.viewTooltip('state','disabled');}
if($.xtlvalidate.string(this.options.title)){this.element.removeAttr('title');}},_updateView:function(){this._updateLabel();this._updateIcon();$.xtlview.prototype._updateView.apply(this);},_resizeWidth:function(newWidth){var textElem=$(this.selectors.label),iconElem,originalText='',truncate=textElem.data('truncate'),threeDotsWidth,globalWidth,globalPadding,iconWidth,textWidth,textInnerWidth,textPadding;this.resizeTooltip=false;if($.xtlvalidate.object(truncate)){originalText=truncate.text;if($.xtlvalidate.object(truncate.tooltip)){this.resizeTooltip=true;}}else{originalText=textElem.text();}
if(originalText.length>0){iconElem=$(this.selectors.icon);threeDotsWidth=10;globalWidth=this.element.outerWidth();globalPadding=globalWidth-this.element.innerWidth();iconWidth=iconElem.outerWidth(true);textWidth=textElem.outerWidth(true);textInnerWidth=textElem.innerWidth();textPadding=textWidth-textInnerWidth;textWidth=newWidth-iconWidth-textPadding-globalPadding;textElem.truncate(textWidth,this.element);if(textWidth>threeDotsWidth){textElem.show();}else{textElem.hide();}}else{}
this.element.width(newWidth);},_resizeHeight:function(newHeight){this.element.css('height',newHeight);},_updateIcon:function(){var iconElem=$(this.selectors.icon),oldIcon=$(this).data('oldIcon');if($.xtlvalidate.string(oldIcon)){iconElem.removeClass(oldIcon);$(this).removeData('oldIcon');}
if($.xtlvalidate.string(this.options.icon)){if(!iconElem.hasClass(this.options.icon)){iconElem.addClass(this.options.icon);}
iconElem.show();}else{iconElem.hide();}},_updateLabel:function(){var labelElem=$(this.selectors.label),label=this.options.label;if($.xtlvalidate.string(label)){labelElem.text(label).show();}else{labelElem.hide();}},_action:function(){var options=this.options;if($.xtlvalidate.func(options.action)){options.action.apply(this,[options.actionArgs]);}},buttonIcon:function(newIcon){if(newIcon===undefined){return this.options.icon;}else{$(this).data('oldIcon',this.options.icon);this.options.icon=$.xtlprepare.string(newIcon);this._updateIcon();}},updateActionArgs:function(newActionArgs){this._setData("actionArgs",newActionArgs);},tooltipContent:function(newTooltipContent){},_bindObservableEvent:function(){},_unbindObservableEvent:function(){}});$.extend($.xtl.viewButton,{version:"0.1",defaults:{icon:null,label:null,title:null,action:function(actionArgs){},actionArgs:[],tooltip:false,tooltipOptions:{contentText:null,contentSelector:null},behaviors:{mouseover:function(){},mouseout:function(){},focus:function(){},blur:function(){},mousedown:function(){},mouseup:function(){},click:function(){}}},params:{logDebug:false,customcss:'xtlview-button'},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:16,minWidth:16},states:{states:{normal:true,error:false,highlight:true,disabled:[function(state){this.options.stateTarget.removeStyle('hover');this._callStateStyle('disabled');},function(state){this._callStateStyle('disabled',true);}]}},styles:{styles:{init:$.xtlobject.style('ui-corner-all',{backgroundColor:null,backgroundImage:null,borderColor:null}),hover:$.xtlobject.style('ui-state-hover',{backgroundColor:'',backgroundImage:'',borderColor:''})},statesStyle:{normal:'ui-state-default',error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'},styleAction:[]}});})(jQuery);;(function($){$.xtlview("xtl.viewSimple",{_prepareOptions:function(){$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewSimple");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){},_destroyStaticView:function(){},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){$.xtlview.prototype._updateView.apply(this,arguments);},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_bindObservableEvent:function(){},_unbindObservableEvent:function(){}});$.extend($.xtl.viewSimple,{version:"0.1",defaults:{},params:{customcss:'xtlview-simple'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{normal:true,error:true,highlight:true,disabled:true}},styles:{statesStyle:{normal:null,error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'}}});})(jQuery);;(function($){$.xtlview("xtl.viewToolbar",{_prepareOptions:function(){var modelview=this.options.modelview;this.items={};this.containers={};this.simples={};this.globalItem=null;this.options.items=$.xtlprepare.array(this.options.items);$.xtlview.prototype._prepareOptions.apply(this,arguments);if($.xtlvalidate.object(modelview)){this._addToObservables('modelview',modelview.type,modelview.id);}},_build:function(){this.element.data("view","viewToolbar");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){this._buildElement();this._buildItems();},_destroyStaticView:function(){this._destroyItems();this._destroyElement();},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){$.xtlview.prototype._updateView.apply(this,arguments);this._updateItemsFromModel();},_buildElement:function(){var elem=$('<ul></ul>');this.element.append(elem);elem.applyStyle('toolbar',$.xtlprepare.style(this.options.styles.container));if(this.options.nested){this.options.stateTarget.css('borderWidth','0');}
this.globalItem=elem;},_buildItems:function(){var items=this.options.items,itemsIndex,itemsLength,itemName,item,itemTarget,modelview=this.options.modelview,modelviewElem;if($.xtlvalidate.array(items)&&$.xtlvalidate.object(modelview)&&$('#'+modelview.id).size()===1){itemsLength=items.length;modelviewElem=$('#'+modelview.id);for(itemsIndex=0;itemsIndex<itemsLength;itemsIndex++){itemName=items[itemsIndex];item=modelviewElem.callFrom('modelview','item',itemName);itemTarget=this._createItemTarget(itemName,item);this.items[itemName]=itemTarget;if($.xtlvalidate.object(item)&&$.xtlvalidate.string(item.type)){switch(item.type){case'simple':this._addItem(itemName,item);this.simples[itemName]=itemTarget;break;case'container':this._addContainer(itemName,item);this.containers[itemName]=itemTarget;break;case'separator':this._addSeparator(itemName,item);this.simples[itemName]=itemTarget;break;case'label':this._addLabel(itemName,item);this.simples[itemName]=itemTarget;break;}}}}},_createItemTarget:function(itemName,item){var itemId=this.id+"-"+itemName,itemType=null;if($.xtlvalidate.object(item)&&$.xtlvalidate.object(item.view)){itemType=item.view.method;}
return $.xtlobject.target(itemType,itemId);},_destroyElement:function(){this.globalItem.remove();},_destroyItems:function(){},_updateItemsFromModel:function(){var modelview=this.options.modelview;if($.xtlvalidate.object(modelview)&&$('#'+modelview.id).size()===1){$('#'+modelview.id).callFrom('modelview','initializeFromObservables');}},_buildItemElement:function(itemName,item){var itemElement=$('<li></li>'),itemId=this.id+"-"+itemName,itemType=null,itemTarget=null;itemElement.attr("id",itemId);this.globalItem.append(itemElement);if($.xtlvalidate.string(item.position)){itemElement.css('float',item.position);}
return itemElement;},_addContainer:function(itemName,item){var itemElement,viewOptions,nested=false,modelview=this.options.modelview;itemElement=this._buildItemElement(itemName,item);if($.xtlvalidate.object(item.view)){if($.xtlvalidate.string(item.view.id)){}else if($.xtlvalidate.string(item.view.method)&&$.xtlvalidate.object(item.view.options)){viewOptions=item.view.options;if(item.view.method===this.widgetName){nested=true;this.globalItem.removeStyle('toolbar');this.globalItem.applyStyle('globalToolbar',$.xtlprepare.style(this.options.styles.globalContainer));}
if($.xtlvalidate.array(item.childs)&&$.xtlvalidate.object(modelview)){viewOptions=$.extend({},item.view.options,{modelview:modelview,items:item.childs,nested:nested});}
$.fn[item.view.method].apply(itemElement,[viewOptions]);}}},_addItem:function(itemName,item){var itemElement;itemElement=this._buildItemElement(itemName,item);if($.xtlvalidate.object(item.view)){if($.xtlvalidate.string(item.view.id)){}else if($.xtlvalidate.string(item.view.method)&&$.xtlvalidate.object(item.view.options)){$.fn[item.view.method].apply(itemElement,[item.view.options]);}}},_addLabel:function(itemName,item){var itemElement;itemElement=this._buildItemElement(itemName,item);itemElement.addClass('label');if($.xtlvalidate.string(item.view)){itemElement.text(item.view);}},_addSeparator:function(itemName,item){var itemElement;itemElement=this._buildItemElement(itemName,item);itemElement.applyStyle('separator',$.xtlprepare.style(this.options.styles.separator));itemElement.css('height',this.element.height()-2);},_updateSize:function(){var itemName,itemTarget;$.xtlview.prototype._updateSize.apply(this);for(itemName in this.simples){itemTarget=this.items[itemName];this._updateItemFromParent(itemTarget.id);}},_resizeWidth:function(newWidth){this.element.css('width',newWidth);},_resizeHeight:function(newHeight){this.element.css('height',newHeight);},_updateItemState:function(itemName){var newState,modelview=this.options.modelview,itemTarget;if($.xtlvalidate.string(itemName)&&$.xtlvalidate.object(modelview)&&$('#'+modelview.id).size()===1){newState=$('#'+modelview.id).callFrom('modelview','itemState',itemName);itemTarget=this.items[itemName];if($.xtlvalidate.object(itemTarget)&&$.xtlvalidate.string(itemTarget.type)){$.fn[itemTarget.type].apply($('#'+itemTarget.id),["state",newState]);this._updateItemFromParent(itemTarget.id);}else if($.xtlvalidate.object(itemTarget)){}}},_updateItemVisibility:function(itemName){var newVisibility,modelview=this.options.modelview,itemTarget,visibilityAction='hide';if($.xtlvalidate.string(itemName)&&$.xtlvalidate.object(modelview)&&$('#'+modelview.id).size()===1){newVisibility=$('#'+modelview.id).callFrom('modelview','itemVisibility',itemName);itemTarget=this.items[itemName];if($.xtlvalidate.object(itemTarget)&&$.xtlvalidate.string(itemTarget.type)){if(newVisibility){visibilityAction='show';}
$.fn[itemTarget.type].apply($('#'+itemTarget.id),[visibilityAction]);this._updateItemFromParent(itemTarget.id);}else if($.xtlvalidate.object(itemTarget)){}}},_updateItemCustom:function(itemName){var newCustom,modelview=this.options.modelview,itemTarget;if($.xtlvalidate.string(itemName)&&$.xtlvalidate.object(modelview)&&$('#'+modelview.id).size()===1){newCustom=$('#'+modelview.id).callFrom('modelview','itemCustom',itemName);itemTarget=this.items[itemName];if($.xtlvalidate.object(itemTarget)){if($.xtlvalidate.func(newCustom)){newCustom.apply(this,[$('#'+itemTarget.id)]);this._updateItemFromParent(itemTarget.id);}}}},_updateItemFromParent:function(itemId){if($.xtlvalidate.objectId(itemId)){$('#'+itemId).verticalAlign(this.element.innerHeight());}},_eventObservableChange:function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute
observableArgs=event.originalEvent.changeArgs;if(observableName.indexOf('modelview')>-1){if($.xtlvalidate.object(this.items[observableArgs])){switch(observableAttribute){case'itemState':this._updateItemState(observableArgs);break;case'itemVisibility':this._updateItemVisibility(observableArgs);break;case'itemCustom':this._updateItemCustom(observableArgs);break;}}}},_eventModelReloaded:function(event){}});$.extend($.xtl.viewToolbar,{version:"0.1",defaults:{modelview:null,items:[],nested:false},params:{customcss:'xtlview-toolbar'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:10,minWidth:150},states:{state:'normal',states:{normal:true,error:true,highlight:false,disabled:true}},styles:{styles:{init:null,globalContainer:$.xtlobject.style('ui-helper-reset ui-helper-clearfix',{padding:'0'}),container:$.xtlobject.style('ui-helper-reset ui-helper-clearfix',{paddingLeft:'5px',paddingRight:'5px'}),separator:$.xtlobject.style('ui-state-default separator',{width:'1px'})},statesStyle:{normal:'ui-state-default',error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'}}});})(jQuery);;(function($){$.xtlview("xtl.viewTooltip",{_prepareOptions:function(){this._log("debut _prepareOptions");var self=this;if($.fn.hoverIntent&&this.options.trigger=='hover'){this.options.trigger='hoverIntent';}
if(this.options.canvasOptions.shadow&&!shadowSupport()){this.options.canvasOptions.shadow=false;$.extend(this.options.canvasOptions,this.options.canvasOptions.noShadowOpts);}
this.options.canvasOptions.spikeLength=numb(this.options.canvasOptions.spikeLength);this.options.canvasOptions.spikeGirth=numb(this.options.canvasOptions.spikeGirth);this.options.canvasOptions.overlap=numb(this.options.canvasOptions.overlap);this.options.positions=$.xtlprepare.array(this.options.positions);if($.xtlvalidate.string(this.options.trigger)){this.options.trigger=[this.options.trigger];}
this.generatedId=0;this._generateUniqueId();this.position=false;this.back.title=null;this.back.style=null;this.disabled=false;this.content=null;this.textOutHeight=0;this.textOutWidth=0;this.shadowMarginX=0;this.shadowMarginY=0;this.shadowShiftX=0;this.shadowShiftY=0;this.shadowOverlap=0;this.width=0;this.height=0;this.scrollTop=0;this.scrollLeft=0;this.docWidth=0;this.docHeight=0;this.winRight=0;this.winBottom=0;this.space={};this.offsetParent=null;this.pos=null;this.top=0;this.left=0;this.css.active="tooltip-active";this.css.content="tooltip-content";this.css.box="tooltip-box";this.selectors.boxId='tooltip-'+this.generatedId;this.selectors.box='#tooltip-'+this.generatedId;this.selectors.text=this.selectors.box+' .'+this.css.content;this.selectors.canvas=this.selectors.box+' canvas';this.functions.show=function(){self.show();};this.functions.hide=function(){self.hide();};this.functions.switchShow=function(){if(self.element.hasClass(self.css.activeTooltip)){self.hide();}else{self.show();}
return false;};this.functions.closeOnClick=function(event){if(!event){var event=window.event;};if(!$(event.target).parents().andSelf().filter('.tooltip-box, .bt-active').length){$.each($.tooltip.vars.clickAnywhereStack,function(){this.hide();});$(document).unbind('click',self.functions.closeOnClick);}};$.xtlview.prototype._prepareOptions.apply(this,arguments);this._log("fin _prepareOptions");},_build:function(){this._log("debut _build");$.xtlview.prototype._build.apply(this,arguments);this._log("fin _build");},_buildStaticView:function(){this._log("debut _buildStaticView");if(this.options.behaviorOptions.killTitle){this.back.title=this.element.attr("title");this.element.attr("title","");}
this._log("fin _buildStaticView");},_destroyStaticView:function(){this._log("debut _destroyStaticView");boxElem=$(this.selectors.box);if(this.options.behaviorOptions.killTitle){this.element.attr("title",this.back.title);}
if($.xtlvalidate.object(boxElem)){boxElem.remove();}
delete this.generatedId,this.position,this.back,this.disabled,this.content,this.textOutHeight,this.textOutWidth
this.shadowMarginX,this.shadowMarginY,this.shadowShiftX,this.shadowShiftY,this.shadowOverlap,this.width,this.height,this.scrollTop,this.scrollLeft,this.docWidth,this.docHeight,this.winRight,this.winRight,this.winRight,this.winBottom,this.space,this.offsetParent,this.pos,this.top,this.left;delete boxElem;this._log("fin _destroyStaticView");},_enableDynamicView:function(){this._log("debut _enableDynamicView");this._applyTrigger();this._log("fin _enableDynamicView");},_disableDynamicView:function(){this._log("debut _disableDynamicView");this._removeTrigger();this._log("fin _disableDynamicView");},_applyTrigger:function(){this._log("debut _applyTrigger");var self=this;triggerTarget=this.options.triggerTarget,hoverIntentOps=this.options.hoverIntentOptions,trigger=this.options.trigger;element=this.element;if(triggerTarget!==null&&typeof triggerTarget==='object'){element=triggerTarget;}
if(trigger[0]==="hoverIntent"){hoverIntentOps=$.extend(hoverIntentOps,{over:function(){self.show();},out:function(){self.hide();}});element.hoverIntent(hoverIntentOps);}else if(trigger[0]==="hover"){element.bind('mouseover',this.functions.show);element.bind('mouseout',this.functions.hide);}else if(trigger[0]==="now"){if(this.element.hasClass(this.css.active)){this.hide();}else{this.show();}}else if(trigger[0]==="none"){}
else if(trigger.length>1&&trigger[0]!==trigger[1]){element.bind(trigger[0],this.functions.show).bind(trigger[1],this.functions.hide);}
else{element.bind(trigger[0],this.functions.switchShow);}
delete triggerTarget;delete hoverIntentOps;delete trigger;delete element;this._log("fin _applyTrigger");},_removeTrigger:function(){this._log("debut _removeTrigger");var self=this;triggerTarget=this.options.triggerTarget,hoverIntentOps=this.options.hoverIntentOps,trigger=this.options.trigger;element=this.element;if(triggerTarget!==null&&typeof triggerTarget==='object'){element=triggerTarget;}
if(trigger[0]==="hoverIntent"){hoverIntentOps=$.extend(this.options.hoverIntentOps,{over:function(){},out:function(){}});this.element.hoverIntent(hoverIntentOps);}else if(trigger[0]==="hover"){element.unbind('mouseover',this.functions.show);element.unbind('mouseout',this.functions.hide);}else if(trigger[0]==="now"){if(this.element.hasClass(this.css.active)){this.hide();}else{this.show();}}else if(trigger[0]==="none"){}
else if(trigger.length>1&&trigger[0]!==trigger[1]){element.unbind(trigger[0],this.functions.show).unbind(trigger[1],this.functions.hide);}
else{element.unbind(trigger[0],this.functions.switchShow);}
if(this.options.behaviorOptions.clickAnywhereToClose){$(document).click(null);}
delete triggerTarget;delete hoverIntentOps;delete trigger;delete element;this._log("fin _removeTrigger");},_buildTooltip:function(){this._log("debut _buildTooltip");textElem=$('<div></div>').addClass(this.css.content).append(this.content).css({padding:this.options.styleOptions.padding,position:'absolute',width:(this.options.behaviorOptions.shrinkToFit?'auto':this.options.width),zIndex:this.options.zIndexOptions.textzIndex,left:this.shadowShiftX,top:this.shadowShiftY});boxElem=$('<div></div>').attr("id",this.selectors.boxId).addClass(this.css.box).append(textElem).css({position:'absolute',width:this.options.width,zIndex:this.options.zIndexOptions.wrapperzIndex,visibility:'hidden'}).appendTo(this.offsetParent);if($.fn.bgiframe){textElem.bgiframe();boxElem.bgiframe();}
delete textElem;delete boxElem;this._log("fin _buildTooltip");},_buildCanvas:function(){this._log("debut _buildCanvas");textElem=$(this.selectors.text);boxElem=$(this.selectors.box);canvasWidth=(numb(textElem.btOuterWidth(true))+this.options.canvasOptions.strokeWidth*2+this.shadowMarginX);canvasHeight=(numb(textElem.outerHeight(true))+this.options.canvasOptions.strokeWidth*2+this.shadowMarginY);canvasElem=document.createElement('canvas');$(canvasElem).attr('width',canvasWidth).attr('height',canvasHeight).appendTo(boxElem).css({position:(this.options.behaviorOptions.shrinkToFit?'absolute':'relative'),zIndex:this.options.zIndexOptions.boxzIndex});if(typeof G_vmlCanvasManager!=='undefined'){canvasElem=G_vmlCanvasManager.initElement(canvasElem);}
delete canvasElem;delete textElem;delete boxElem;delete canvasWidth;delete canvasHeight;this._log("fin _buildCanvas");},getContent:function(){this._log("debut getContent");var content=false;if(this.options.contentText!==null){content=this.options.contentText;}
else if(this.options.contentSelector!==null){content=$.xtlvalidate.func(this.options.contentSelector)?this.options.contentSelector.apply(this):eval(this.options.contentSelector);if($.xtlvalidate.object(content)){content=$(content).clone(true).show();}}
else if(this.options.ajaxOptions.ajaxPath!==null){}
else{if(this.options.behaviorOptions.killTitle){content=this.back.title;}else{content=this.element.attr("title");}}
this._log("fin getContent");return content;},_updateState:function(){boxElem=$(this.selectors.box);if(boxElem.size()>0){this.hide();}
if(this.options.state==='disabled'){this._disableDynamicView();this.disabled=true;}else if(this.back.state!==null&&this.disabled===true){this._enableDynamicView();this.disabled=false;}},_applyState:function(){if(this.back.state!==null){this._callState(this.back.state,true);}
this._callState(this.options.state);},_generateUniqueId:function(){this._log("debut _generateUniqueId");generatedId=0;generatedId=parseInt(Math.random()*1000000);while($('#'+this.prefixId+generatedId).attr('id')!=undefined){generatedId=parseInt(Math.random()*10000);}
this.generatedId=generatedId;delete generatedId;this._log("fin _generateUniqueId");},_calculateCanvasPoints:function(){this._log("debut _calculateCanvasPoints");var points=new Array();textElem=$(this.selectors.text);boxElem=$(this.selectors.box);this.horiz=this.left+((this.width-this.textOutWidth)*.5);this.vert=this.top+((this.height-this.textOutHeight)*.5);switch(this.position){case'top':textElem.css('margin-bottom',this.options.canvasOptions.spikeLength+'px');boxElem.css({top:(this.top-textElem.outerHeight(true))+this.options.canvasOptions.overlap,left:this.horiz});textRightSpace=(this.winRight-this.options.canvasOptions.windowMargin)-(textElem.offset().left+textElem.btOuterWidth(true));xShift=this.shadowShiftX;if(textRightSpace<0){boxElem.css('left',(numb(boxElem.css('left'))+textRightSpace)+'px');xShift-=textRightSpace;}
textLeftSpace=(textElem.offset().left+numb(textElem.css('margin-left')))-(this.scrollLeft+this.options.canvasOptions.windowMargin);if(textLeftSpace<0){boxElem.css('left',(numb(boxElem.css('left'))-textLeftSpace)+'px');xShift+=textLeftSpace;}
textTop=textElem.position().top+numb(textElem.css('margin-top'));textLeft=textElem.position().left+numb(textElem.css('margin-left'));textRight=textLeft+textElem.btOuterWidth();textBottom=textTop+textElem.outerHeight();textCenter={x:textLeft+(textElem.btOuterWidth()*this.options.canvasOptions.centerPointX),y:textTop+(textElem.outerHeight()*this.options.canvasOptions.centerPointY)};points[points.length]=spikePoint={y:textBottom+this.options.canvasOptions.spikeLength,x:((textRight-textLeft)*.5)+xShift,type:'spike'};crossPoint=findIntersectX(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textBottom);crossPoint.x=crossPoint.x<textLeft+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius?textLeft+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius:crossPoint.x;crossPoint.x=crossPoint.x>(textRight-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius?(textRight-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius:crossPoint.x;points[points.length]={x:crossPoint.x-(this.options.canvasOptions.spikeGirth/2),y:textBottom,type:'join'};points[points.length]={x:textLeft,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:textTop,type:'corner'};points[points.length]={x:textRight,y:textTop,type:'corner'};points[points.length]={x:textRight,y:textBottom,type:'corner'};points[points.length]={x:crossPoint.x+(this.options.canvasOptions.spikeGirth/2),y:textBottom,type:'join'};points[points.length]=spikePoint;if(this.options.canvasOptions.shadow&&this.options.canvasOptions.shadowOverlap!==true){if(this.options.canvasOptions.shadowOffsetX+this.options.canvasOptions.shadowBlur-this.shadowOverlap>0){boxElem.css('top',(numb(boxElem.css('top'))-(this.options.canvasOptions.shadowOffsetX+this.options.canvasOptions.shadowBlur-this.shadowOverlap)));}}
break;case'left':textElem.css('margin-right',this.options.canvasOptions.spikeLength+'px');boxElem.css({top:this.vert+'px',left:((this.left-textElem.btOuterWidth(true))+this.options.canvasOptions.overlap)+'px'});textBottomSpace=(this.winBottom-this.options.canvasOptions.windowMargin)-(textElem.offset().top+textElem.outerHeight(true));yShift=this.shadowShiftY;if(textBottomSpace<0){boxElem.css('top',(numb(boxElem.css('top'))+textBottomSpace)+'px');yShift-=textBottomSpace;}
textTopSpace=(textElem.offset().top+numb(textElem.css('margin-top')))-(this.scrollTop+this.options.canvasOptions.windowMargin);if(textTopSpace<0){boxElem.css('top',(numb(boxElem.css('top'))-textTopSpace)+'px');yShift+=textTopSpace;}
textTop=textElem.position().top+numb(textElem.css('margin-top'));textLeft=textElem.position().left+numb(textElem.css('margin-left'));textRight=textLeft+textElem.btOuterWidth();textBottom=textTop+textElem.outerHeight();textCenter={x:textLeft+(textElem.btOuterWidth()*this.options.canvasOptions.centerPointX),y:textTop+(textElem.outerHeight()*this.options.canvasOptions.centerPointY)};points[points.length]=spikePoint={x:textRight+this.options.canvasOptions.spikeLength,y:((textBottom-textTop)*.5)+yShift,type:'spike'};crossPoint=findIntersectY(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textRight);crossPoint.y=crossPoint.y<textTop+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius?textTop+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius:crossPoint.y;crossPoint.y=crossPoint.y>(textBottom-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius?(textBottom-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius:crossPoint.y;points[points.length]={x:textRight,y:crossPoint.y+this.options.canvasOptions.spikeGirth/2,type:'join'};points[points.length]={x:textRight,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:textTop,type:'corner'};points[points.length]={x:textRight,y:textTop,type:'corner'};points[points.length]={x:textRight,y:crossPoint.y-this.options.canvasOptions.spikeGirth/2,type:'join'};points[points.length]=spikePoint;if(this.options.canvasOptions.shadow&&this.options.canvasOptions.shadowOverlap!==true){if(this.options.canvasOptions.shadowOffsetY+this.options.canvasOptions.shadowBlur-this.shadowOverlap>0){boxElem.css('left',(numb(boxElem.css('left'))-(this.options.canvasOptions.shadowOffsetY+this.options.canvasOptions.shadowBlur-this.shadowOverlap)));}}
delete textTopSpace,textBottomSpace;break;case'bottom':textElem.css('margin-top',this.options.canvasOptions.spikeLength+'px');boxElem.css({top:(this.top+this.height)-this.options.canvasOptions.overlap,left:this.horiz});textRightSpace=(this.winRight-this.options.canvasOptions.windowMargin)-(textElem.offset().left+textElem.btOuterWidth(true));xShift=this.shadowShiftX;if(textRightSpace<0){boxElem.css('left',(numb(boxElem.css('left'))+textRightSpace)+'px');xShift-=textRightSpace;}
textLeftSpace=(textElem.offset().left+numb(textElem.css('margin-left')))-(this.scrollLeft+this.options.canvasOptions.windowMargin);if(textLeftSpace<0){boxElem.css('left',(numb(boxElem.css('left'))-textLeftSpace)+'px');xShift+=textLeftSpace;}
textTop=textElem.position().top+numb(textElem.css('margin-top'));textLeft=textElem.position().left+numb(textElem.css('margin-left'));textRight=textLeft+textElem.btOuterWidth();textBottom=textTop+textElem.outerHeight();textCenter={x:textLeft+(textElem.btOuterWidth()*this.options.canvasOptions.centerPointX),y:textTop+(textElem.outerHeight()*this.options.canvasOptions.centerPointY)};points[points.length]=spikePoint={x:((textRight-textLeft)*.5)+xShift,y:this.shadowShiftY,type:'spike'};crossPoint=findIntersectX(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textTop);crossPoint.x=crossPoint.x<textLeft+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius?textLeft+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius:crossPoint.x;crossPoint.x=crossPoint.x>(textRight-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius?(textRight-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius:crossPoint.x;points[points.length]={x:crossPoint.x+this.options.canvasOptions.spikeGirth/2,y:textTop,type:'join'};points[points.length]={x:textRight,y:textTop,type:'corner'};points[points.length]={x:textRight,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:textTop,type:'corner'};points[points.length]={x:crossPoint.x-(this.options.canvasOptions.spikeGirth/2),y:textTop,type:'join'};points[points.length]=spikePoint;if(this.options.canvasOptions.shadow&&this.options.canvasOptions.shadowOverlap!==true){if(this.shadowShiftY-this.shadowOverlap>0){boxElem.css('top',(numb(boxElem.css('top'))+this.shadowShiftY-this.shadowOverlap));}}
break;case'right':textElem.css('margin-left',(this.options.canvasOptions.spikeLength+'px'));boxElem.css({top:this.vert+'px',left:((this.left+this.width)-this.options.canvasOptions.overlap)+'px'});textBottomSpace=(this.winBottom-this.options.canvasOptions.windowMargin)-(textElem.offset().top+textElem.outerHeight(true));yShift=this.shadowShiftY;if(textBottomSpace<0){boxElem.css('top',(numb(boxElem.css('top'))+textBottomSpace)+'px');yShift-=textBottomSpace;}
textTopSpace=(textElem.offset().top+numb(textElem.css('margin-top')))-(this.scrollTop+this.options.canvasOptions.windowMargin);if(textTopSpace<0){boxElem.css('top',(numb(boxElem.css('top'))-textTopSpace)+'px');yShift+=textTopSpace;}
textTop=textElem.position().top+numb(textElem.css('margin-top'));textLeft=textElem.position().left+numb(textElem.css('margin-left'));textRight=textLeft+textElem.btOuterWidth();textBottom=textTop+textElem.outerHeight();textCenter={x:textLeft+(textElem.btOuterWidth()*this.options.canvasOptions.centerPointX),y:textTop+(textElem.outerHeight()*this.options.canvasOptions.centerPointY)};points[points.length]=spikePoint={x:this.shadowShiftX,y:((textBottom-textTop)*.5)+yShift,type:'spike'};crossPoint=findIntersectY(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textLeft);crossPoint.y=crossPoint.y<textTop+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius?textTop+this.options.canvasOptions.spikeGirth/2+this.options.canvasOptions.cornerRadius:crossPoint.y;crossPoint.y=crossPoint.y>(textBottom-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius?(textBottom-this.options.canvasOptions.spikeGirth/2)-this.options.canvasOptions.cornerRadius:crossPoint.y;points[points.length]={x:textLeft,y:crossPoint.y-this.options.canvasOptions.spikeGirth/2,type:'join'};points[points.length]={x:textLeft,y:textTop,type:'corner'};points[points.length]={x:textRight,y:textTop,type:'corner'};points[points.length]={x:textRight,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:textBottom,type:'corner'};points[points.length]={x:textLeft,y:crossPoint.y+this.options.canvasOptions.spikeGirth/2,type:'join'};points[points.length]=spikePoint;if(this.options.canvasOptions.shadow&&this.options.canvasOptions.shadowOverlap!==true){if(this.shadowShiftX-this.shadowOverlap>0){boxElem.css('left',(numb(boxElem.css('left'))+this.shadowShiftX-this.shadowOverlap));}}
delete textTopSpace,textBottomSpace;break;}
if(this.options.canvasOptions.cornerRadius>0){var newPoints=new Array();var newPoint;for(var i=0;i<points.length;i++){if(points[i].type=='corner'){newPoint=betweenPoint(points[i],points[(i-1)%points.length],this.options.canvasOptions.cornerRadius);newPoint.type='arcStart';newPoints[newPoints.length]=newPoint;newPoints[newPoints.length]=points[i];newPoint=betweenPoint(points[i],points[(i+1)%points.length],this.options.canvasOptions.cornerRadius);newPoint.type='arcEnd';newPoints[newPoints.length]=newPoint;}
else{newPoints[newPoints.length]=points[i];}}
points=newPoints;}
delete textElem,boxElem,textTop,textLeft,textRight,textBottom,crossPoint,textCenter,spikePoint;this._log("fin _calculateCanvasPoints");return points;},_calculatePosition:function(){this._log("debut _calculatePosition");textElem=$(this.selectors.text);this.textOutHeight=numb(textElem.outerHeight());this.textOutWidth=numb(textElem.btOuterWidth());if(this.options.positions[0]=='most'){this.position='top';for(pig in this.space){this.position=this.space[pig]>this.space[this.position]?pig:this.position;}}else{for(positionIndex in this.options.positions){this.position=this.options.positions[positionIndex];if((this.position=='left'||this.position=='right')&&this.space[this.position]>this.textOutWidth+this.options.canvasOptions.spikeLength){break;}
else if((this.position=='top'||this.position=='bottom')&&this.space[this.position]>this.textOutHeight+this.options.canvasOptions.spikeLength){break;}}}
delete textElem;this._log("fin _calculatePosition");},_drawTooltip:function(points){this._log("debut _drawTooltip");canvasElem=$(this.selectors.canvas);var ctx=canvasElem.get(0).getContext("2d");drawTooltip.apply(ctx,[points],this.options.canvasOptions.strokeWidth);ctx.fillStyle=this.options.canvasOptions.fill;if(this.options.canvasOptions.shadow){ctx.shadowOffsetX=this.options.canvasOptions.shadowOffsetX;ctx.shadowOffsetY=this.options.canvasOptions.shadowOffsetY;ctx.shadowBlur=this.options.canvasOptions.shadowBlur;ctx.shadowColor=this.options.canvasOptions.shadowColor;}
ctx.closePath();ctx.fill();if(this.options.canvasOptions.strokeWidth>0){ctx.shadowColor='rgba(0, 0, 0, 0)';ctx.lineWidth=this.options.canvasOptions.strokeWidth;ctx.strokeStyle=this.options.canvasOptions.strokeStyle;ctx.beginPath();drawTooltip.apply(ctx,[points],this.options.canvasOptions.strokeWidth);ctx.closePath();ctx.stroke();}
delete canvasElem;this._log("fin _drawTooltip");},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_prepareVariables:function(){this._log("debut _prepareVariables");this.content=this.getContent();if(this.content===null||this.content===''){return;}
if(this.options.canvasOptions.shadow){if(this.options.canvasOptions.shadowBlur>Math.abs(this.options.canvasOptions.shadowOffsetX)){this.shadowMarginX=this.options.canvasOptions.shadowBlur*2;}else{this.shadowMarginX=this.options.canvasOptions.shadowBlur+Math.abs(this.options.canvasOptions.shadowOffsetX);}
this.shadowShiftX=(this.options.canvasOptions.shadowBlur-this.options.canvasOptions.shadowOffsetX)>0?this.options.canvasOptions.shadowBlur-this.options.canvasOptions.shadowOffsetX:0;if(this.options.canvasOptions.shadowBlur>Math.abs(this.options.canvasOptions.shadowOffsetY)){this.shadowMarginY=this.options.canvasOptions.shadowBlur*2;}else{this.shadowMarginY=this.options.canvasOptions.shadowBlur+Math.abs(this.options.canvasOptions.shadowOffsetY);}
this.shadowShiftY=(this.options.canvasOptions.shadowBlur-this.options.canvasOptions.shadowOffsetY)>0?this.options.canvasOptions.shadowBlur-this.options.canvasOptions.shadowOffsetY:0;if(this.options.canvasOptions.shadowOverlap!==true){this.shadowOverlap=numb(this.options.canvasOptions.shadowOverlap);}}
if(this.options.offsetParent&&$.xtlvalidate.object($(this.options.offsetParent))){this.offsetParent=$(this.options.offsetParent);offsetParentPos=this.offsetParent.offset();this.pos=this.element.offset();this.top=numb(this.pos.top)-numb(offsetParentPos.top)+numb(this.element.css('margin-top'))-this.shadowShiftY;this.left=numb(this.pos.left)-numb(offsetParentPos.left)+numb(this.element.css('margin-left'))-this.shadowShiftX;}else{this.offsetParent=(this.element.css('position')=='absolute')?this.element.parents().eq(0).offsetParent():this.element.offsetParent();this.pos=this.element.position();this.top=numb(this.pos.top)+numb(this.element.css('margin-top'))-this.shadowShiftY;this.left=numb(this.pos.left)+numb(this.element.css('margin-left'))-this.shadowShiftX;}
this.width=this.element.btOuterWidth();this.height=this.element.outerHeight();this.scrollTop=numb($(document).scrollTop());this.scrollLeft=numb($(document).scrollLeft());this.docWidth=numb($(window).width());this.docHeight=numb($(window).height());this.winRight=this.scrollLeft+this.docWidth;this.winBottom=this.scrollTop+this.docHeight;thisOffset=this.element.offset();this.space=new Object();this.space.top=thisOffset.top-this.scrollTop;this.space.bottom=this.docHeight-((thisOffset+this.height)-this.scrollTop);this.space.left=thisOffset.left-this.scrollLeft;this.space.right=this.docWidth-((thisOffset.left+this.width)-this.scrollLeft);delete offsetParentPos,thisOffset;this._log("fin _prepareVariables");},_prepareTooltip:function(){this._log("debut _prepareShow");boxElem=$(this.selectors.box);if(boxElem!==null){this.hide();delete boxElem;}
$.each($.tooltip.vars.closeWhenOpenStack,function(){this.hide();});this._prepareVariables();this._buildTooltip();this._applyState();this._calculatePosition();points=this._calculateCanvasPoints();this._buildCanvas();this._drawTooltip(points);delete points;this._log("fin _prepareShow");},_activeTooltip:function(){this._log("debut _activeTooltip");boxElem=$(this.selectors.box);this.element.addClass(this.css.active);boxElem.css({display:'none',visibility:'visible'});$.xtlview.prototype._showEffect.apply(this,[boxElem]);delete boxElem;this._log("fin _activeTooltip");},_cleanTooltip:function(){boxElem=$(this.selectors.box);if($.xtlvalidate.object(boxElem)){boxElem.remove();}
$.tooltip.vars.clickAnywhereStack=arrayRemove($.tooltip.vars.clickAnywhereStack,this);$.tooltip.vars.closeWhenOpenStack=arrayRemove($.tooltip.vars.closeWhenOpenStack,this);this.element.removeClass(this.css.active);},show:function(){this._log("debut show");this._prepareTooltip();this._activeTooltip();if(this.options.behaviorOptions.clickAnywhereToClose){$.tooltip.vars.clickAnywhereStack.push(this);$(document).bind('click',this.functions.closeOnClick);}
if(this.options.behaviorOptions.closeWhenOthersOpen){$.tooltip.vars.closeWhenOpenStack.push(this);}
if($.xtlvalidate.func(this.options.show)){this.options.show.apply(this,arguments);}
this._log("fin show");},hide:function(){this._log("debut hide");boxElem=$(this.selectors.box);if(boxElem!==null){$.xtlview.prototype._hideEffect.apply(this,[boxElem]);this._cleanTooltip();}
if($.xtlvalidate.func(this.options.hide)){this.options.hide.apply(this,arguments);}
this._log("fin hide");},_bindObservableEvent:function(){},_unbindObservableEvent:function(){}});$.extend($.xtl.viewTooltip,{version:"0.1",defaults:{shown:false,contentText:null,contentSelector:null,triggerTarget:null,trigger:'hover',positions:['most'],offsetParent:'#global',behaviorOptions:{shrinkToFit:true,clickAnywhereToClose:true,closeWhenOthersOpen:true,killTitle:true},ajaxOptions:{ajaxPath:null,ajaxError:'<strong>ERROR:</strong> <em>%error</em>',ajaxLoading:'<blink>Loading...</blink>',ajaxData:{},ajaxType:'GET',ajaxCache:true,ajaxOpts:{}},hoverIntentOptions:{interval:300,timeout:200},animationOptions:{animate:false,distance:15,easing:'swing',speed:200}},params:{customcss:'xtlview-tooltip'},dimensions:{height:'auto',width:200,maxHeight:false,maxWidth:false,minHeight:20,minWidth:200},styles:{statesStyle:{normal:'ui-state-active',error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'},stateStyleAction:[function(state){styleCss=this._getStateStyle(state);textElem=$(this.selectors.text);boxElem=$(this.selectors.box);element=boxElem.addClass(styleCss.classes);this.options.canvasOptions.fill=element.css("background-color");this.options.canvasOptions.strokeStyle=element.css("border-left-color");textElem.css("color",element.css("color"));boxElem.removeClass(styleCss.classes);delete element,styleCss,textElem,boxElem;},function(state){$(this).removeData('element-for-text');}],canvasOptions:{spikeGirth:10,spikeLength:15,overlap:0,fill:"rgb(255, 255, 102)",windowMargin:10,strokeWidth:1,strokeStyle:"#000",cornerRadius:3,centerPointX:.5,centerPointY:.5,shadow:false,shadowOffsetX:2,shadowOffsetY:2,shadowBlur:3,shadowColor:"#000",shadowOverlap:false,noShadowOpts:{strokeStyle:'#999'}},zIndexOptions:{textzIndex:9999,boxzIndex:9998,wrapperzIndex:9997},styleOptions:{padding:'10px'}}});function shadowSupport(){try{var userAgent=navigator.userAgent.toLowerCase();if(/webkit/.test(userAgent)){return true;}
else if(/gecko|mozilla/.test(userAgent)&&parseFloat(userAgent.match(/firefox\/(\d+(?:\.\d+)+)/)[1])>=3.1){return true;}}
catch(err){}
return false;}
function canvasSupport(){var canvas_compatible=false;try{canvas_compatible=!!(document.createElement('canvas').getContext('2d'));}catch(e){canvas_compatible=!!(document.createElement('canvas').getContext);}
return canvas_compatible;}
$.fn.btOuterWidth=function(margin){function num(elem,prop){return elem[0]&&parseInt($.curCSS(elem[0],prop,true),10)||0;};return this["innerWidth"]()
+num(this,"borderLeftWidth")
+num(this,"borderRightWidth")
+(margin?num(this,"marginLeft")
+num(this,"marginRight"):0);};$.tooltip={};$.tooltip.vars={clickAnywhereStack:[],closeWhenOpenStack:[]};})(jQuery);;(function($){$.xtlview("xtl.viewTabs",{_prepareOptions:function(){var self=this,errors=this.options.errors;},_build:function(){var iconError=this.options.iconError,errors=this.options.errors;this.element.data("view","viewTabs");if(iconError!==null){this.css.icon=iconError;}
$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){this.element.tabs(this.options.tabsOptions);},_destroyStaticView:function(){this.element.tabs('destroy');},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){this._checkMetadata();},setError:function(pIndex,pSwitchTab){var errors=this.options.errors,switchTab;if(pSwitchTab==undefined||pSwitchTab!==true){switchTab=false;}
else{switchTab=true;}
if(pIndex!=undefined){if(!this._isHide(pIndex)&&!this._isError(pIndex)){this._getTab(pIndex).addClass('ui-state-error');if(this.options.iconError&&!this._getSpan(pIndex).length){this._getA(pIndex).prepend("<span style=\"float:left;\"></span>");this._getSpan(pIndex).addClass("ui-icon");this._getSpan(pIndex).addClass(this.css.icon);}
if(($.inArray(pIndex,errors)===-1)&&(pIndex>=0)&&(pIndex<this.element.tabs('length'))){errors.push(pIndex);}
errors.sort();}
if(switchTab){this.selectTab(errors[0]);}}
else{this._log("geterrors",errors);return errors;}},selectTab:function(pIndex){if(pIndex!=undefined){this._log("select",pIndex);if(!this._isHide(pIndex)){this._log("select!!!!!!",pIndex);this.element.tabs('select',parseInt(pIndex));}}
else
{return this.element.tabs('option','selected');}},hideTab:function(pIndex){if(!this._isHide(pIndex)&&!this._isError(pIndex)){if(this._getNbHidden()<(this.element.tabs('length')-1)){this._getTab(pIndex).hide();this._setSelectFirst();}}},showTab:function(pIndex,pFocus){this._getTab(pIndex).show();this._log("test",pFocus);if(pFocus==='true'){this._getTab(pIndex).show();}
else{this._setSelectFirst();}},_getTab:function(pIndex){return $("#"+this.id+"  li:eq("+pIndex+") a");},_getA:function(pIndex)
{return $("#"+this.id+"  li:eq("+pIndex+")  a");},_getSpan:function(pIndex)
{return $("#"+this.id+"  li:eq("+pIndex+")  a  span");},_checkMetadata:function(){var tabLength=this.element.tabs('length');for(i=0;i<tabLength;i++){if(this._getTab(i).metadata().icon){this._getA(i).prepend("<span style=\"float:left;\"></span>");this._getSpan(i).addClass("ui-icon");this._getSpan(i).addClass(this._getTab(i).metadata().icon);}
if(this._getTab(i).metadata().error){this.setError(i);}}},_setSelectFirst:function()
{var ok=false,index=0,tabLength=this.element.tabs('length'),errors=this.options.errors;if(errors.length){this.selectTab(errors[0]);}
else{for(i=0;i<tabLength&&!ok;i++)
{if(!this._isHide(i)){ok=true;index=i;}}
this.selectTab(index);}},_getNbHidden:function()
{var tabLength=this.element.tabs('length'),nbHidden=0,i;for(i=0;i<tabLength;i++)
{if(this._isHide(i)){nbHidden++;}}
return nbHidden;},_isHide:function(pIndex)
{if(this._getTab(pIndex).css('display')==='none'){return true;}
else{return false;}},_isError:function(pIndex)
{var errors=this.options.errors;if($.inArray(pIndex,errors)===-1){return false;}
else{return true;}},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},clearErrors:function()
{var tabLength=this.element.tabs('length'),i,errors=this.options.errors;$("#"+this.id+" li").removeClass('ui-state-error');for(i=0;i<=tabLength;i++)
{if(this._isError(i)&&(!this._getTab(i).metadata().icon)){this._getSpan(i).remove();}}
this.options.errors=[];},clearError:function(pIndex,pSwitchTab)
{var indexDelete,errors=this.options.errors,switchTab;if(pSwitchTab==undefined||pSwitchTab!==true){switchTab=false;}
else{switchTab=true;}
if(this._isError(pIndex)){indexDelete=$.inArray(pIndex,errors);if(indexDelete!==-1){this._getTab(pIndex).removeClass('ui-state-error');if(!this._getTab(pIndex).metadata().icon){this._getSpan(pIndex).remove();}
errors.splice(indexDelete,1);if(switchTab){this.selectTab(errors[0]);}}}},_bindObservableEvent:function(){},_unbindObservableEvent:function(){}});$.extend($.xtl.viewTabs,{version:"0.1",defaults:{observers:[],readonly:false,shown:true,iconError:null,errors:[],tabsOptions:{}},params:{customcss:'xtlview-tabs'},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{states:{normal:true,error:false,highlight:false,disabled:false}}});})(jQuery);;(function($){$.xtlview("xtl.viewDialog",{_prepareOptions:function(){$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewDialog");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){this.element.dialog(this.options.dialogOptions);},_destroyStaticView:function(){this.element.dialog("destroy");$.xtlinput.prototype._destroyStaticView.apply(this,arguments);},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){$.xtlview.prototype._updateView.apply(this,arguments);},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},open:function(){this.element.dialog('open');},close:function(){this.element.dialog('close');},label:function(pLabel){if(pLabel===undefined){this.element.dialog('option','title');}
else{this.element.dialog('option','title',pLabel);}},isOpen:function(){this.element.dialog('isOpen');},_bindObservableEvent:function(){},_unbindObservableEvent:function(){}});$.extend($.xtl.viewDialog,{version:"0.1",defaults:{dialogOptions:{}},params:{customcss:'xtlview-dialog'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{normal:true,error:true,highlight:true,disabled:true}},styles:{statesStyle:{normal:null,error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'}}});})(jQuery);;(function($){$.xtlview("xtl.viewTable",{_prepareOptions:function(){var self=this,selectable=this.options.selectable,selectableOptions=this.options.selectableOptions,controller=this.options.controller;this.css.fixedColumn='fixed';this.css.unselectableRow="unselectable";this.prefix=this.id.split('list-')[0];this.selectors.headerRow='#'+this.id+' thead tr';this.selectors.footerRow='#'+this.id+' tfoot tr';this.selectors.rows='#'+this.id+' tbody tr';this.selectors.selectableRows=this.selectors.rows+':not(.'+this.css.unselectableRow+')';this.selectors.filterSelectableRows='> tbody > tr:not(.'+this.css.unselectableRow+')';this.selectors.headers=this.selectors.headerRow+':first th';this.selectors.notFixedHeaders=this.selectors.headers+':not(.'+this.css.fixedColumn+')';this.selectors.visibleHeaders=this.notFixedHeaders+':visible';this.cookieName=this.id+'_'+this.widgetName;this.cookieObj=null;this.selectedItems=null;this.selectedValues=null;this.selectable=false;if(typeof selectable==='string'){this.selectable=selectable;}
this.selectableOptions={};if(typeof selectableOptions==='object'){this.selectableOptions=selectableOptions;}
this.sortMap={};this.hiddenColumnsKey=[];this.controller=false;if(typeof controller==='string'){this.controller=controller;}
this.functions.mouseOver=function(event){var target=$(event.currentTarget),style=self._getStyle('hover');target.applyStyle('hover',style);};this.functions.mouseOut=function(event){var target=$(event.currentTarget);target.removeStyle('hover');};this.functions.applySelected=function(target,clean){if(clean){$(target).removeClass('ui-state-highlight').removeClass('ui-selected').removeData('already-selected');}else{$(target).addClass('ui-state-highlight').addClass('ui-selected').data('already-selected',true);}};this.functions.applySelecting=function(target,clean){if(clean){$(target).removeClass('ui-selecting').removeClass('ui-state-active');}else{$(target).addClass('ui-selecting');}};this.functions.selected=function(event,ui){if($(ui.selected).is('.ui-state-active')){$(ui.selected).removeClass('ui-state-active');}
if(self.selectable==='single'){$('#'+self.id+' .ui-selected').each(function(){self.functions.applySelected.apply(this,[$(this),true]);});$(ui.selected).addClass('ui-selected');$(ui.selected).data('already-selected',true);}
if(event.metaKey&&$(ui.selected).data('already-selected')===true){self.functions.applySelected.apply(this,[$(ui.selected),true]);}};this.functions.unselected=function(event,ui){self.functions.applySelected.apply(this,[$(ui.unselected),true]);};this.functions.selecting=function(event,ui){if(self.selectable==='single'){if($(ui.selecting).is('.ui-state-highlight')){$(ui.selecting).removeClass('ui-state-highlight');}
self.functions.applySelecting.apply(this,[$('.ui-selecting'),true]);$(ui.selecting).addClass('ui-selecting');}
self.functions.applySelecting.apply(this,[$(ui.selecting)]);};this.functions.unselecting=function(event,ui){self.functions.applySelecting.apply(this,[$(ui.unselecting),true]);};this.functions.selectionStop=function(event,ui){var rowId,id,rowValues,value,values=self.options.selectableValues,valuesIndex,valuesLength=values.length,valuesElem;self.selectedItems=[];self.selectedValues={};$("#"+self.id+" .ui-selected").each(function(){rowId=$(this).attr("id");id=rowId.substring((self.id+'_').length,rowId.length);self.selectedItems.push(id);rowValues={};for(key in values){valueId=key;value=$('#'+rowId+' td.'+values[key]).text();value=$.trim(value);if(value!==""){rowValues[valueId]=value;}}
if(rowValues!=={}){self.selectedValues[id]=rowValues;}});if(self.selectedItems.length===1){self.selectedValues=[self.selectedValues[self.selectedItems[0]]];}
self._log('selected items',self.selectedItems);if(self.controller!==false){$('#'+self.controller).callFrom('controller','execute',$.xtlobject.actionCall('selectValues',self.selectedValues));$('#'+self.controller).callFrom('controller','execute',$.xtlobject.actionCall('selectItems',self.selectedItems));}};$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewTable");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){this._loadColumnsState();$('#'+this.id+' table').show();var start=new Date();this._buildSelectable();var start=new Date();if(!$.browser.msie&&!$.browser.version.substr(0,1)<7){this._applyStyleCss();}},_destroyStaticView:function(){this._restoreColumnsState();if(this.selectable!==false){this.components.selectable.selectable("destroy");}
this.element.removeData('oldSort');delete this.cookieObj;},_enableDynamicView:function(){var rows=$(this.selectors.rows),sortMap=this.sortMap,functions=this.functions;if(this.selectable!==false){this.components.selectable.selectable("enable");}
for(key in this.sortMap){sortMap[key].removeClass('ui-state-default');sortMap[key].viewButton('state','normal');}
rows.bind('mouseover',functions.mouseOver).bind('mouseout',functions.mouseOut);},_disableDynamicView:function(){var rows=$(this.selectors.rows),sortMap=this.sortMap,functions=this.functions;if(this.selectable!==false){this.components.selectable.selectable("disable");}
for(key in this.sortMap){sortMap[key].viewButton('state','disabled');sortMap[key].removeClass('ui-state-disabled');sortMap[key].addClass('ui-state-default');}
rows.unbind('mouseover',functions.mouseOver).unbind('mouseout',functions.mouseOut);},_updateView:function(){this._updateSelectedItems();this._updateSortColumn();$.xtlview.prototype._updateView.apply(this,arguments);},_applyStyleCss:function(){var visibleLength=0,th=$('#'+this.id+' table > thead > tr > th'),tr=$('#'+this.id+' table > thead > tr'),td=$('#'+this.id+' table > tbody  td'),thFirst=th.filter(":visible:first"),thLast=th.filter(":visible:last"),thFirstId=thFirst.attr('id'),thLastId=thLast.attr('id'),tdFirst=$('#'+this.id+' .'+thFirstId),tdLast=$('#'+this.id+' .'+thLastId);th.css('borderWidth','1px');td.css('borderWidth','1px');th.css('borderTopWidth',0),thFirst.css('borderLeftWidth',0);thLast.css('borderRightWidth',0);tdFirst.css('borderLeftWidth',0);tdLast.css('borderRightWidth',0);$('#'+this.id+' table tbody tr:last td').css('borderBottomWidth',0);},_buildSelectable:function(){var selectableOptions;if(this.selectable!==false){selectableOptions=$.extend({},this.selectableOptions,{filter:this.selectors.filterSelectableRows,selected:this.functions.selected,unselected:this.functions.unselected,selecting:this.functions.selecting,unselecting:this.functions.unselecting,stop:this.functions.selectionStop});this._log("select options",selectableOptions);this.components.selectable=$('#'+this.id+' table').selectable(selectableOptions);}},_buildSortButton:function(headerId,sortKey){var headerElem=$('#'+this.id+' th#'+headerId),headerText=headerElem.text(),iconDefault=this.options.sortOptions.iconDefault,self=this;$(headerElem).data('originalText',headerText);headerElem.text('');this.sortMap[sortKey]=headerElem.viewButton({icon:iconDefault,label:headerText,actionArgs:'asc',action:function(actionArgs){var sort={column:sortKey,type:actionArgs};if(self.controller!==false){$('#'+self.controller).callFrom('controller','execute',$.xtlobject.actionCall('sortItems',sort));}},styles:{init:null,hover:self._getStyle('hover')}});},_loadColumnsState:function(){var headers=$(this.selectors.headers),headerElement,headersLength=headers.length,self=this,cookie=this.options.cookie,key,cookieKey,size,visibility,sortKey,metadata,metaWidth,metaSort,metaVisibility;for(var headersIndex=headersLength;headersIndex--;){headerElement=$(headers[headersIndex]);key=headerElement.attr('id');cookieKey=key.split(this.prefix)[1];metadata=headerElement.metadata(),metaWidth=metadata["width"];metaSort=metadata["sortkey"];metaVisibility=metadata["visible"];if(cookie){size=self._valueInTableObject(cookieKey,'s');visibility=self._valueInTableObject(cookieKey,'v');}
if(size===undefined){if(metaWidth!==undefined){size=metaWidth;}else{size=headerElement.width();}}
if(visibility===undefined){if(metaVisibility!==undefined){visibility=metaVisibility;}else{visibility=headerElement.is(':visible');}}
if(metaSort!==undefined){sortKey=metaSort;$(headerElement).data('sort',sortKey);self._buildSortButton(key,sortKey);}else{headerElement.addClass('ui-state-default');}
if(visibility=='false'||visibility==false){this.hiddenColumnsKey.push(key);}
self.visibilityColumn(key,visibility,true,undefined,false);self.sizeColumn(key,size,true);}
this._updateVisibilityOfColumns();if(headersLength>0){this._saveTableObjectInCookie();}},_restoreColumnsState:function(){var headers=$(this.selectors.headers),headersLength=headers.length,headersIndex,headerElement,self=this,key,sort,text,sortMap=this.sortMap;for(var headersIndex=headersLength;headersIndex--;){headerElement=$(headers[headersIndex]);sort=$(headerElement).data('sort');text=$(headerElement).data('originalText');$(headerElement).removeData('originalText');if(sort){sortMap[sort].viewButton('destroy');headerElement.text(text);$(headerElement).removeData('sort');}
headerElement.removeClass('ui-state-default');}},selectableMode:function(){return this.selectable;},headers:function(){return $(this.selectors.notFixedHeaders);},visibilityColumn:function(key,newVisibility,noCookie,applyCss,updateView){var currentVisibility,cookieKey=key.split(this.prefix)[1],value;if(newVisibility===undefined){value=this._valueInTableObject(cookieKey,'v');return(value==1)?true:false;}else{currentVisibility=this._valueInTableObject(cookieKey,'v');newVisibility=(newVisibility==true||newVisibility==1)?1:0;this._valueInTableObject(cookieKey,'v',newVisibility);this._triggerToObservers('xtl-observable-change','visibility',key);if(noCookie===undefined&&newVisibility!=currentVisibility){this._saveTableObjectInCookie();}
if(updateView===undefined){this._updateVisibilityOfColumn(key);}
if(applyCss!=undefined){this._applyStyleCss();}}},sizeColumn:function(key,newSize,noCookie){var currentSize,cookieKey=key.split(this.prefix)[1],value;if(newSize===undefined){value=this._valueInTableObject(cookieKey,'s');return(value==1)?true:false;}else{currentSize=this._valueInTableObject(cookieKey,'s');newSize=(newSize==true||newSize==1)?1:0;this._valueInTableObject(cookieKey,'s',newSize);if(noCookie===undefined&&newSize!=currentSize){this._saveTableObjectInCookie();}}},_prepareTableObject:function(columnKey){var tableCookie,cookie=this.options.cookie;if(!$.xtlvalidate.object(this.tableObj)&&cookie){tableCookie=$.cookie(this.cookieName);this._log('build of tableObj for '+columnKey);if(tableCookie!==undefined&&tableCookie!==null){this.tableObj=$.secureEvalJSON(tableCookie);}}
if(!$.xtlvalidate.object(this.tableObj)){this.tableObj={};}
if(this.tableObj[columnKey]===undefined){this.tableObj[columnKey]={};}},_saveTableObjectInCookie:function(){var tableCookie,cookie=this.options.cookie,cookieOptions=this.options.cookieOptions;if(cookie){tableCookie=$.toJSON(this.tableObj);$.cookie(this.cookieName,tableCookie,cookieOptions);}},_valueInTableObject:function(columnKey,attrKey,value){this._prepareTableObject(columnKey);if(value===undefined){return this.tableObj[columnKey][attrKey];}else{this.tableObj[columnKey][attrKey]=value;}},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_checkSelection:function(newSelection){return true;},_updateSelectedItems:function(){var observable,newSelection,self=this,currentItem,functions=this.functions,rows=$(this.selectors.rows),rowsLength=rows.length,rowsIndex,rowElement,selectionIndex,selectionLength,selectionElement;observable=this._observable('modelList');newSelection=$('#'+observable.id).callFrom(observable.type,'selectedItems');if(this._checkSelection(newSelection)){for(rowsIndex=rowsLength;rowsIndex--;){rowElement=$(rows[rowsIndex]);functions.applySelected.apply(self,[rowElement,true]);}
if($.xtlvalidate.array(newSelection)){selectionLength=newSelection.length;for(selectionIndex=selectionLength;selectionIndex--;){selectionElement=newSelection[selectionIndex];currentItem=$('#'+self.id+'_'+selectionElement);functions.applySelected.apply(self,[currentItem]);}}}},_updateSortColumn:function(){var observable,oldSort,newSort,sortOptions=this.options.sortOptions,iconDefault=sortOptions.iconDefault,iconAsc=sortOptions.iconAsc,iconDesc=sortOptions.iconDesc,sortMap=this.sortMap;observable=this._observable('modelList');newSort=$('#'+observable.id).callFrom(observable.type,'sort');oldSort=this.element.data('oldSort');if(oldSort===undefined||oldSort.column!==newSort.column||oldSort.type!==newSort.type){if(oldSort!==undefined&&sortMap[oldSort.column]!==undefined){sortMap[oldSort.column].callFrom('view','buttonIcon',iconDefault);sortMap[oldSort.column].callFrom('view','updateActionArgs','asc');}
if(typeof newSort==='object'&&sortMap[newSort.column]!==undefined){if(newSort.type==='asc'){sortMap[newSort.column].callFrom('view','buttonIcon',iconAsc);sortMap[newSort.column].callFrom('view','updateActionArgs','desc');}else{sortMap[newSort.column].callFrom('view','buttonIcon',iconDesc);sortMap[newSort.column].callFrom('view','updateActionArgs','asc');}
this.element.data('oldSort',newSort);}}},_updateVisibilityOfColumn:function(key){var headerColumn=$("div#"+this.id+" th#"+key),cellsColumn=$("div#"+this.id+" tbody td."+key);if(this.visibilityColumn(key)==true){if(!headerColumn.is(':visible')){headerColumn.show();}
if(!cellsColumn.eq(0).is(':visible')){cellsColumn.show();}}
else{if(headerColumn.is(':visible')){headerColumn.hide();}
if(cellsColumn.eq(0).is(':visible')){cellsColumn.hide();}}},_updateVisibilityOfColumns:function(){var cells=$("div#"+this.id+" tbody td"),headers=$("div#"+this.id+" thead th"),keyIndex,keyElem,keyLength=this.hiddenColumnsKey.length;for(keyIndex=keyLength;keyIndex--;){keyElem=this.hiddenColumnsKey[keyIndex];headers.filter('#'+keyElem).hide();cells.filter('.'+keyElem).hide();}},_updateSizeOfColumn:function(key){},_eventObservableChange:function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute;switch(observableName){case'modelList':if(observableAttribute==='selectedItems'){this._updateSelectedItems();}
else if(observableAttribute==='sort'){this._updateSortColumn();}
break;}}});$.extend($.xtl.viewTable,{version:"0.1",defaults:{controller:null,selectable:'multi',selectableOptions:{},selectableValues:{},cookie:true,cookieOptions:{expires:356,path:'/'},sort:true,sortOptions:{iconDefault:'ui-icon-triangle-2-n-s',iconAsc:'ui-icon-triangle-1-n',iconDesc:'ui-icon-triangle-1-s'}},params:{customcss:'xtlview-table',logDebug:false},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{states:{normal:true,error:false,highlight:false,disabled:true}},styles:{styles:{hover:$.xtlobject.style('ui-state-hover',{borderColor:$('<div></div').addClass('ui-state-default').css('borderColor')}),selected:$.xtlobject.style('ui-state-highlight')}}});})(jQuery);;(function($){$.xtlmodelview("xtl.modelviewAction",{_prepareOptions:function(){$.xtlmodelview.prototype._prepareOptions.apply(this);},_build:function(){this.element.data("modelview","modelviewAction");$.xtlmodelview.prototype._build.apply(this,arguments);this._log('Mes Observers',this.observers);}});$.extend($.xtl.modelviewAction,{version:"0.1",defaults:{itemChilds:{},items:{},isReloaded:false},params:{customcss:'xtlmodelview-action'},observe:{observers:[]}});})(jQuery);;(function($){$.xtlmanager("xtl.managerForm",{_prepareOptions:function(){var manager=this.options.manager;this.selectors.fields='div.xtlinput';this.errors=new Map();this.nbErrors=0;this.errorsClient=new Map();this.errorsServer=new Map();this.changedFields=new Map();this.isChanged=false;if($.xtlvalidate.string(manager)){this.options.observables=$.extend({},this.options.observables,{managerForm:$.xtlobject.observable('manager',manager)});}
$.xtlmanager.prototype._prepareOptions.apply(this);},_build:function(){$(this.element).data("manager","managerForm");$.xtlmanager.prototype._build.apply(this,arguments);},_ajaxData:function(){var ajaxData="";ajaxData=this.form().serialize();return ajaxData;},_ruleMethod:function(ruleKey){return this.options.ruleMethods[ruleKey];},_ruleMessage:function(ruleKey){return this.options.ruleMessages[ruleKey];},getErrors:function(){return this.errors;},getNbErrors:function(){return this.nbErrors;},getErrorsClient:function(){return this.errorsClient;},getErrorsServer:function(){return this.errorsServer;},fields:function(){return $(this.selectors.fields,this.element);},field:function(fieldName){var form=this.form(),input=null,fieldId;if($.xtlvalidate.string(fieldName)){input=$('#'+form+" [name='"+fieldName+"']");if(input.size()>1){input=input.eq(0);}}
if($.xtlvalidate.object(input)){fieldId=input.data("inputId");if($.xtlvalidate.string(fieldId)){return $('#'+fieldId);}}else{return undefined;}},form:function(){var form=this.options.form,manager=this.options.manager;if($.xtlvalidate.string(form)){return form;}else{if($.xtlvalidate.string(manager)){return $("#"+manager).callFrom('manager','form');}}
return undefined;},changedField:function(fieldKey,changedStatus){var manager=this._manager();if($.xtlvalidate.string(fieldKey)){if(changedStatus){this.changedFields.put(fieldKey,changedStatus);}else{this.changedFields.remove(fieldKey);}
if(this.changedFields.size()>0){this.isChanged=true;}else{this.isChanged=false;}
this._triggerToObservers('xtl-observable-change','changed',fieldKey);if($.xtlvalidate.objectId(manager)){$('#'+manager).callFrom('manager','changedField',[fieldKey,changedStatus]);}}},changed:function(){return this.isChanged;},addErrorClient:function(fieldKey,newError){var manager=this._manager(),callback=this.options.errorsClient;if($.xtlvalidate.string(fieldKey)&&$.xtlvalidate.string(newError)){this.errorsClient.put(fieldKey,newError);this._triggerToObservers('xtl-observable-change','errorsClient',fieldKey);this._addError(fieldKey,'client',newError);this._triggerToObservers('xtl-observable-change','errors',fieldKey);}
if($.xtlvalidate.objectId(manager)){$('#'+manager).callFrom('manager','addErrorClient',[fieldKey,newError]);}
if($.xtlvalidate.func(callback)){callback.apply(this);}},removeErrorClient:function(fieldKey){var manager=this._manager(),callback=this.options.errorsClient;if($.xtlvalidate.string(fieldKey)){this.errorsClient.remove(fieldKey);this._triggerToObservers('xtl-observable-change','errorsClient',fieldKey);this._removeError(fieldKey,'client');this._triggerToObservers('xtl-observable-change','errors',fieldKey);}
if($.xtlvalidate.objectId(manager)){$('#'+manager).callFrom('manager','removeErrorClient',fieldKey);}
if($.xtlvalidate.func(callback)){callback.apply(this);}},addErrorServer:function(fieldKey,newError){var manager=this._manager(),callback=this.options.errorsServer;if($.xtlvalidate.string(fieldKey)&&$.xtlvalidate.string(newError)){this.errorsServer.put(fieldKey,newError);this._triggerToObservers('xtl-observable-change','errorsServer',fieldKey);this._addError(fieldKey,'server',newError);this._triggerToObservers('xtl-observable-change','errors',fieldKey);}
if($.xtlvalidate.objectId(manager)){$('#'+manager).callFrom('manager','addErrorServer',[fieldKey,newError]);}
if($.xtlvalidate.func(callback)){callback.apply(this);}},removeErrorServer:function(fieldKey){var manager=this._manager(),callback=this.options.errorsServer;if($.xtlvalidate.string(fieldKey)){this.errorsServer.remove(fieldKey);this._triggerToObservers('xtl-observable-change','errorsServer',fieldKey);this._removeError(fieldKey,'server');this._triggerToObservers('xtl-observable-change','errors',fieldKey);}
if($.xtlvalidate.objectId(manager)){$('#'+manager).callFrom('manager','removeErrorServer',fieldKey);}
if($.xtlvalidate.func(callback)){callback.apply(this);}},cleanErrors:function(){var fields=this.fields();if(fields.size()>0){fields.each(function(){$(this).callFrom('input','cleanErrors');});}},resetChange:function(){var manager=this._manager();this.changedFields=new Map();this.isChanged=false;if($.xtlvalidate.objectId(manager)){$('#'+manager).callFrom('manager','resetChange');}},resetField:function(fieldName){var field=this.field(fieldName);if(field!==undefined){field.callFrom('input','reset');}},resetAllFields:function(){var fields=this.fields();if(fields.size()>0){fields.each(function(){$(this).callFrom('input','reset');});}
this.resetChange();},cleanField:function(fieldName){var field=this.field(fieldName);if(field!==undefined){if(field.callFrom('input','complex')){field.callFrom('input','defaultValue',fieldName);}
else{field.callFrom('input','defaultValue');}
field.callFrom('input','empty',false);}},cleanAllFields:function(){var fields=this.fields();if(fields.size()>0){fields.each(function(){$(this).callFrom('input','defaultValue');$(this).callFrom('input','empty',false);});}},reload:function(ajaxUrl,ajaxData,successBehavior){this._log("debut reload");var self=this,callback=this.options.reload,successTarget=this.options.successTarget,successBehaviorOpts=this.options.successBehavior,oldCookie;if(ajaxData===undefined){ajaxData=this._ajaxData();}else if(typeof ajaxData!=="string"){ajaxData=$.param(ajaxData);}
if(successBehavior===undefined){successBehavior=successBehaviorOpts;}
if(!$.xtlvalidate.object(successTarget)){successTarget=$.xtlobject.target('manager',this.id);}
if($.xtlvalidate.func(callback[0])){callback[0].apply(this,[ajaxUrl,ajaxData]);}
oldCookie=$.cookie('symfony');this._log("reload... ajaxUrl : ",ajaxUrl);this._triggerToObservers('xtl-model-before-reload');this._triggerToObservers('xtl-observable-change','reload-begin');$.xtl.ajax(oldCookie,{type:"POST",url:ajaxUrl,data:ajaxData,success:function(html){var tab=html.split('#XTLRESULT#');var success=$.trim(tab[0]);var content=tab[1];self.cleanErrors();self.resetChange();if(success==='1'){if($.xtlvalidate.func(successBehavior)){successBehavior.apply(self,[successTarget,content]);}
self._log('rafraichissement de la vue ciblée');}else{self.element.empty();self.element.html(content);self._log('retour au formulaire car des erreurs sont présentes');}}});if($.xtlvalidate.func(callback[1])){callback[1].apply(this,[ajaxUrl,ajaxData]);}
this._log("fin reload");},validate:function(fieldId){var field,fieldValue,rules,ruleKey,rule,ruleMethod,ruleMessage,ruleResult=true,ruleResultTemp=true,errorMessage='',self=this;if($.xtlvalidate.string(fieldId)){field=$('#'+fieldId);fieldValue=$(field).callFrom('input','value');rules=$(field).callFrom('input','validation');if($.xtlvalidate.object(rules)){for(ruleKey in rules){ruleMethod=this._ruleMethod(ruleKey);ruleMessage=this._ruleMessage(ruleKey);rule=rules[ruleKey];if($.xtlvalidate.string(rule[1])){errorMessage=rule[1];}else if($.xtlvalidate.string(ruleMessage)){errorMessage=ruleMessage;}
if($.xtlvalidate.func(ruleMethod)&&$.xtlvalidate.array(rule)){if($.xtlvalidate.array(fieldValue)){$.each(fieldValue,function(){ruleResultTemp=true;ruleResultTemp=self._validateValue(this,field,ruleMethod,rule[0],errorMessage);if(!ruleResultTemp){ruleResult=false;}});}else{ruleResult=self._validateValue(fieldValue,field,ruleMethod,rule[0],errorMessage);}}}}
if(ruleResult){field.callFrom('input','error',['client',null]);}}
return ruleResult;},_validateValue:function(fieldValue,field,validMethod,validParams,errorMessage){var ruleResult=true;ruleResult=validMethod.apply(this,[fieldValue,field,validParams]);if(!ruleResult){field.callFrom('input','error',['client',errorMessage]);}
return ruleResult;},_addError:function(fieldKey,errorName,error){var errorObj,callback=this.options.errors;if($.xtlvalidate.string(fieldKey)&&$.xtlvalidate.string(errorName)){errorObj=this.errors.get(fieldKey);if(!$.xtlvalidate.object(errorObj)){errorObj={};}
if(!$.xtlvalidate.string(errorObj[errorName])){errorObj[errorName]=error;this.errors.put(fieldKey,errorObj);this.nbErrors++;if($.xtlvalidate.func(callback)){callback.apply(this);}}}},_removeError:function(fieldKey,errorName){var errorObj,callback=this.options.errors;if($.xtlvalidate.string(fieldKey)&&$.xtlvalidate.string(errorName)){errorObj=this.errors.get(fieldKey);if($.xtlvalidate.object(errorObj)){if($.xtlvalidate.string(errorObj[errorName])){errorObj[errorName]=null;this.nbErrors--;if($.xtlvalidate.func(callback)){callback.apply(this);}}}}},_eventManagerChange:function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute;switch(observableName){case'managerForm':if(observableAttribute==='cleanErrors'){this.cleanErrors();}
break;}}});$.extend($.xtl.managerForm,{version:"0.1",defaults:{manager:null,form:null,successTarget:null,successBehavior:function(target,ajaxResult){if($.xtlvalidate.object(target)){$('#'+target.id).callFrom(target.type,'refresh',ajaxResult);}
this._triggerToObservers('xtl-model-after-reload');},errors:null,errorsClient:null,errorsServer:null,ruleMethods:{required:function(value,element,param){return(value!='');},minlength:function(value,element,param){return(value.length>param);},maxlength:function(value,element,param){return(value.length<param);},rangelength:function(value,element,param){return(value.length<param[1]&&value.length>param[0]);},min:function(value,element,param){return(value>=param);},max:function(value,element,param){return(value<=param);},range:function(value,element,param){return(value>=param[0]&&value<=param[1]);},email:function(value,element,param){return((value=='')||/^((([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(value));},url:function(value,element,param){return((value=='')||/^(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(value));},date:function(value,element,param){return((value=='')||!/Invalid|NaN/.test(new Date(value)));},dateISO:function(value,element,param){return((value=='')||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value));},number:function(value,element,param){return((value=='')||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value));},digits:function(value,element,param){return((value=='')||/^\d+$/.test(value));},fileTypes:function(value,element,param){if(!$.xtlvalidate.string(param)){param='png|jpeg|gif';}
return((value=='')||value.match(new RegExp(".("+param+")$","i")));}},ruleMessages:{required:null,minlength:null,maxlength:null,rangelength:null,min:null,max:null,range:null,email:null,url:null,date:null,dateISO:null,number:null,digits:null,fileTypes:null}},params:{customcss:'xtlmanager-form'},observe:{observables:{},observers:[]},actions:{actions:{}}});})(jQuery);;(function($){$.xtlcontroller("xtl.controllerCrud",{_build:function(){this.element.data("controller","controllerCrud");$.xtlcontroller.prototype._build.apply(this,arguments);}});$.extend($.xtl.controllerCrud,{version:"0.1",defaults:{controllers:{parent:null,list:null,form:null}},params:{customcss:'xtlcontroller-crud',debug:true,error:true},actions:{actions:{newItem:'form',editItem:'form',saveItem:'form',listItems:'list',deleteItems:'list'}}});})(jQuery);;(function($){$.xtlcontroller("xtl.controllerList",{_build:function(){this.element.data("controller","controllerList");$.xtlcontroller.prototype._build.apply(this,arguments);}});$.extend($.xtl.controllerList,{version:"0.1",defaults:{model:null,controllers:{parent:null}},params:{customcss:'xtlcontroller-list'},actions:{actions:{resetSelectedItems:function(action,args){if($.xtlvalidate.objectId(this.options.model)){$('#'+this.options.model).callFrom('model','selectedItems',null);}},selectItems:function(action,args){if($.xtlvalidate.objectId(this.options.model)){$('#'+this.options.model).callFrom('model','selectedItems',args);}},selectValues:function(action,args){if($.xtlvalidate.objectId(this.options.model)){$('#'+this.options.model).callFrom('model','selectedValues',args);}},sortItems:$.xtlobject.action(null,function(action,args){var ajaxData='';if($.xtlvalidate.object(args)&&$.xtlvalidate.string(args.column)&&$.xtlvalidate.string(args.type)){ajaxData+='sort=';ajaxData+=args.column;ajaxData+='&type=';ajaxData+=args.type;}
return ajaxData;}),setPage:$.xtlobject.action(null,'page'),listItems:$.xtlobject.action(null,null),deleteItems:$.xtlobject.action(null,null)},actionDefaultUrl:null}});})(jQuery);;(function($){$.xtlcontroller("xtl.controllerSearch",{_build:function(){this.element.data("controller","controllerSearch");$.xtlcontroller.prototype._build.apply(this,arguments);},_manager:function(){this._log("manager...get");return this._getData("manager");},_refresh:function(ajaxUrl,ajaxData){var manager=this._manager();if($.xtlvalidate.string(manager)){$("#"+manager).callFrom("manager","reload",[ajaxUrl,ajaxData]);}}});$.extend($.xtl.controllerSearch,{version:"0.1",defaults:{manager:null,controllers:{parent:null}},params:{customcss:'xtlcontroller-search'},actions:{actions:{deleteAllSearchCriterias:function(action,args){var manager=this._manager();if($.xtlvalidate.string(manager)){$('#'+manager).callFrom('manager','cleanAllFields');this.execute($.xtlobject.actionCall('searchItems'));}else{return;}},deleteSearchCriteria:function(action,args){var manager=this._manager();if($.xtlvalidate.string(manager)&&$.xtlvalidate.string(args)){$('#'+manager).callFrom('manager','cleanField',args);this.execute($.xtlobject.actionCall('searchItems'));}else{return;}},searchItems:$.xtlobject.action(null,function(action,args){var manager=this._manager(),form,ajaxData='';if($.xtlvalidate.string(manager)){form=$('#'+manager).callFrom('manager','form');if($.xtlvalidate.string(form)){ajaxData=$('#'+form).serialize();}}
return ajaxData;})},actionDefaultUrl:null}});})(jQuery);;(function($){$.xtlmodel("xtl.modelList",{_prepareOptions:function(){this.options.selectedItems=$.xtlprepare.array(this.options.selectedItems);$.xtlmodel.prototype._prepareOptions.apply(this);},_build:function(){this.element.data("model","modelList");$.xtlmodel.prototype._build.apply(this,arguments);},_ajaxData:function(){return'';},pagination:function(newPagination){var currentPagination=this._getData("pagination"),diffArray=false;if(newPagination===undefined){return currentPagination;}else{for(key in newPagination){if(newPagination[key]!==currentPagination[key]){diffArray=true;break;}}
if(diffArray){this._setData("pagination",newPagination);this._triggerToObservers('xtl-observable-change','pagination');}}},page:function(newPage){if(newPage===undefined){return this._getData("pagination").currentPage;}else{var pagination=this._getData("pagination");pagination.currentPage=newPage;}},nbResults:function(newNbResults){if(newNbResults===undefined){return this._getData("pagination").nbResults;}else{var pagination=this._getData("pagination");pagination.nbResults=newNbResults;this._triggerToObservers('xtl-observable-change','nbResults');}},lastPage:function(newLastPage){if(newLastPage===undefined){return this._getData("pagination").lastPage;}else{var pagination=this._getData("pagination");pagination.lastPage=newLastPage;}},sort:function(newSort){if(newSort===undefined){this._log("modelSort",this._getData("sort"));return this._getData("sort");}else{this._setData("sort",newSort);this._triggerToObservers('xtl-observable-change','sort');}},selectedItems:function(newSelectedItems){if(newSelectedItems===undefined){return this._getData("selectedItems");}else{newSelectedItems=$.xtlprepare.array(newSelectedItems);this._setData("selectedItems",newSelectedItems);this._triggerToObservers('xtl-observable-change','selectedItems');}},selectedValues:function(newSelectedValues){if(newSelectedValues===undefined){return this._getData("selectedValues");}else{this._setData("selectedValues",newSelectedValues);}}});$.extend($.xtl.modelList,{version:"0.1",defaults:{criterias:{},pagination:{currentPage:null,nbResults:null,lastPage:null,resultPerPage:null},sort:{column:null,type:"asc"},selectedItems:[],selectedValues:[]},params:{customcss:'xtlmodel-list'},observe:{observables:{},observers:[]}});})(jQuery);;(function($){$.xtlview("xtl.viewVisibility",{_prepareOptions:function(){this.components.buttons=new Array();this.components.buttons;this.components.buttonsDisabled;this.components.isBuild=false;this.css.iconVisible="ui-icon-check";this.css.iconHidden="ui-icon-cancel";$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewVisibility");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){this._setVisibility();},_destroyStaticView:function(){var self=this,observable=this._observable('viewTable'),headers=$('#'+observable.id).callFrom(observable.type,'headers');headers.each(function(){var id=$(this).attr('id'),button=self.components.buttons[id];button.callFrom("view","destroy");button.append($(this).text());});},_buildList:function(){var self=this,observable=this._observable('viewTable'),headers=$('#'+observable.id).callFrom(observable.type,'headers'),headersLength=headers.length,list,li,buttonWidth,ieFix=7;switch(headersLength){case'1':buttonWidth=this.element.width();break;case'2':buttonWidth=(this.element.width()/2);break;case'3':buttonWidth=(this.element.width()/3);break;default:buttonWidth=(this.element.width()/3);break;}
list=$("<ul></ul>").addClass('ui-helper-clearfix').addClass('ui-helper-reset');this.element.append(list);headers.each(function(){var id=$(this).attr('id'),label=$.trim($(this).text()),liId='li_visibility_'+id;li=$("<li id="+liId+"></li>");list.append(li);self.components.buttons[id]=li.viewButton({label:label.toString(),roundCorners:'none',width:(buttonWidth-ieFix),actionArgs:id,action:function(actionArgs){self._switchVisibility(actionArgs);},statesStyle:{normal:$.xtlobject.style('ui-state-default',{borderColor:'transparent',backgroundColor:'transparent',backgroundImage:'none'}),disabled:$.xtlobject.style('ui-state-disabled',{borderColor:'transparent',borderWidth:'1px',borderStyle:'solid',backgroundColor:'',backgroundImage:''})}});});this._updateButtons();this.components.isBuild=true;},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){$.xtlview.prototype._updateView.apply(this,arguments);},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_switchVisibility:function(id){var button=this.components.buttons[id],observable=this._observable('viewTable'),visibility;visibility=$('#'+observable.id).viewTable('visibilityColumn',id);visibility=!visibility;$('#'+observable.id).viewTable('visibilityColumn',id,visibility,undefined,true);this._checkLast();},_checkLast:function(){var observable=this._observable('viewTable'),headers=$('#'+observable.id).callFrom(observable.type,'headers'),headerVisible=headers.filter(":visible"),button;if(headerVisible.length===1){button=this.components.buttons[headerVisible.attr('id')];button.callFrom('view','state','disabled');this.components.buttonsDisabled=button;}
else if(this.components.buttonsDisabled!==undefined){this.components.buttonsDisabled.callFrom('view','state','normal');}},_updateButton:function(id){var observable=this._observable('viewTable'),self=this,button=this.components.buttons[id],visibility=$('#'+observable.id).viewTable('visibilityColumn',id);this._log("this.css.iconVisible",this.css.iconVisible);if(button!==undefined){if(visibility){button.viewButton('buttonIcon',this.css.iconVisible);button.addClass('visible');}
else{button.viewButton('buttonIcon',this.css.iconHidden);button.removeClass('visible');}}
this._checkLast();},_updateButtons:function(){var observable=this._observable('viewTable'),self=this,headers=$('#'+observable.id).callFrom(observable.type,'headers');headers.each(function(){var id=$(this).attr('id'),button=self.components.buttons[id];visibility=$('#'+observable.id).viewTable('visibilityColumn',id);if(visibility){button.callFrom("view","buttonIcon",self.css.iconVisible);button.addClass('visible');}
else{button.callFrom("view","buttonIcon",self.css.iconHidden);button.removeClass('visible');}});this._checkLast();},_setVisibility:function(){var observable=this._observable('modelList'),self=this,nbResults=$('#'+observable.id).callFrom(observable.type,'nbResults');if(nbResults>0){if(this.components.isBuild){this._updateButtons();this._updateShow();}
else{this._buildList();this._updateShow();}}
else{this.hide();}},_eventObservableChange:function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute,changeArgs=event.originalEvent.changeArgs;switch(observableName){case'viewTable':if(observableAttribute==='visibility'){this._updateButton(changeArgs);}
break;case'modelList':if(observableAttribute==='nbResults'){this._setVisibility();}
break;}}});$.extend($.xtl.viewVisibility,{version:"0.1",defaults:{},params:{customcss:'xtlview-visibility'},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{states:{normal:true,error:false,highlight:false,disabled:false}}});})(jQuery);;(function($){$.xtlview("xtl.viewSearchCriteria",{_prepareOptions:function(){this.components.buttons=[];$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewSearchCriteria");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){var criteriaListElem=$("<ul class=\"criteria-list\"></ul>");this.element.append(criteriaListElem);criteriaListElem.applyStyle('toolbar',$.xtlprepare.style(this.options.styles.toolbar));this.selectors.list=".criteria-list";},_destroyStaticView:function(){},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){this._updateCriterias();$.xtlview.prototype._updateView.apply(this,arguments);},_getInputDiv:function(name){var manager=this.options.manager,searchForm=$('#'+manager).callFrom('manager','form'),inputElem;inputElem=$('#'+searchForm+" [name='"+name+"']");return inputElem.data("inputId");},_getInputElem:function(name){var manager=this.options.manager,searchForm=$('#'+manager).callFrom('manager','form');inputElem=$('#'+searchForm+" [name='"+name+"']");return inputElem;},_updateButtons:function(pFields){var self=this,list=$(this.selectors.list,this.element),fields=pFields,arrayLength,needDeleteAll=false,inputDiv;for(i in this.components.buttons)
{this.components.buttons[i].viewButton("destroy");}
this.components.buttons=[];list.empty();fields.each(function(){var inputDiv=$(this),value,valueText,isDefault,isEmpty,label,name,inputId;self._log("a",inputDiv);value=inputDiv.callFrom("input","value");isDefault=inputDiv.callFrom("input","isDefaultValue");isEmpty=inputDiv.callFrom("input","empty");if(((value!=="")||(isEmpty===true))&&!isDefault){needDeleteAll=true;inputDivId=inputDiv.attr("id");valueText=inputDiv.callFrom("input","valueText");label=inputDiv.callFrom("input","label");name=inputDiv.callFrom("input","name");if($.isArray(name)&&isEmpty!=true){for(i=0;i<name.length;i++){inputId=self._getInputElem(name[i]).attr("id");if(value[i]!==""){self._createButtons(inputId,inputDivId,name[i],value[i],valueText,isEmpty,label);}}}
else if(isEmpty==true&&$.isArray(name)){inputId=self._getInputElem(name[0]).attr("id");self._createButtons(inputId,inputDivId,name[0],value,valueText,isEmpty,label);}
else{inputId=self._getInputElem(name).attr("id");self._createButtons(inputId,inputDivId,name,value,valueText,isEmpty,label);}}});if(needDeleteAll){this._createButtonDeleteAll();}
arrayLenght=0;for(i in this.components.buttons){arrayLenght++;}
if(arrayLenght<=1){this.hide();}
else{this.show();}},_createButtons:function(pInputId,pInputDivId,pName,pValue,pValueText,pIsEmpty,pLabel){var idButton=pInputId+"_button",idDelete=pInputId+"_delete",liButton,liDelete,tooltipText,value,list=$(this.selectors.list,this.element),label=pLabel,controller=this.options.controller;if(pValueText!==""){value=pValueText;}
else{value=pValue;}
if(pIsEmpty){value=this.options.isEmpty;}
else{if(pName.indexOf("[from]")!=-1){label+=": "+this.options.from;}
if(pName.indexOf("[to]")!=-1){label+=": "+this.options.to;}}
tooltipText="<strong>"+this.options.searchCriteria+"</strong>: <br/>"+this._createTooltipText(value);if(value.length>1&&$.isArray(value)){value=value.length+" "+this.options.searchItems;}
liButton=$("<li id=\""+idButton+"\" class=\"criteria-button xtlview-button\"></li>");liDelete=$("<li id=\""+idDelete+"\" class=\"criteria-delete xtlview-button\"></li>");liGroup=$("<li class=\"criteria-block\"> </li>");ulGroup=$("<ul></ul>");list.append(liGroup);liGroup.append(ulGroup);ulGroup.append(liButton);ulGroup.append(liDelete);ulGroup.applyStyle('grouped',$.xtlprepare.style(this.options.styles.grouped));if($.browser.msie&&$.browser.version=="6.0"){ulGroup.css('display','inline');}
liButton.viewButton({label:label+": "+value.toString(),tooltip:true,tooltipOptions:{contentText:tooltipText,positions:['right','most']},actionArgs:[pInputId],action:function(actionArgs){$("#"+controller).callFrom("view","show");$("#"+actionArgs[0]).focus();},styles:{init:$.xtlobject.style('ui-corner-left',{borderWidth:'0'})}});liDelete.viewButton({icon:'ui-icon-close',width:16,roundCorners:'right',tooltip:true,tooltipOptions:{contentText:"<strong>"+this.options.deleteSearch+"</strong>:<br/> "+"<ul class=\"criteria-elem-list\"><li>"+label+"</li></ul>",positions:['right','most']},actionArgs:[pInputId,pName],action:function(actionArgs){$('#'+controller).callFrom('controller','execute',$.xtlobject.actionCall('deleteSearchCriteria',pName));},styles:{init:$.xtlobject.style('ui-corner-right',{borderWidth:'0'})}});liButton.height(16);this.components.buttons.push(liButton);this.components.buttons.push(liDelete);},_createButtonDeleteAll:function(){var idDeleteAll=this.element.attr('id')+"_deleteAll",list=$(this.selectors.list,this.element),liDeleteAll,controller=this.options.controller;liDeleteAll=$("<li id=\""+idDeleteAll+"\" class=\"criteria-button-deleteAll\"></li>");list.append(liDeleteAll);liDeleteAll.viewButton({icon:'ui-icon-trash',tooltip:true,tooltipOptions:{contentText:this.options.deleteAllSearch,positions:['right','most']},action:function(actionArgs){$('#'+controller).callFrom('controller','execute',$.xtlobject.actionCall('deleteAllSearchCriterias'));}});this.components.buttons.push(liDeleteAll);},_createTooltipText:function(value){var text="<ul class=\"criteria-elem-list\">";if(value.length>1&&$.isArray(value)){for(val in value){text+="<li>"+value[val]+"</li>";}}
else{text+="<li>"+value+"</li>";}
text+="</ul>";return text;},_updateCriterias:function(){var manager=this.options.manager,fields;if($.xtlvalidate.string(manager)&&$('#'+manager).size()>0){fields=$('#'+manager).callFrom('manager','fields');this._updateButtons(fields);}},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_eventModelReloaded:function(event){this._updateCriterias();}});$.extend($.xtl.viewSearchCriteria,{version:"0.1",defaults:{controller:null,manager:null},params:{customcss:'xtlview-searchCriteria'},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},styles:{styles:{init:'ui-widget-content',toolbar:$.xtlobject.style('ui-helper-clearfix ui-helper-reset',{padding:'1px 5px'}),grouped:$.xtlobject.style('ui-corner-all ui-state-default ui-helper-reset ui-helper-clearfix',{margin:'1px'})}}});})(jQuery);;(function($){$.xtlview("xtl.viewPager",{_prepareOptions:function(){var controller=this.options.controller,options=this.options;this.navigationId=this.id+'-navigation';this.components["first"]={id:this.navigationId+"-first",icon:'ui-icon-seek-first',title:options.pageFirst,action:function(){$("#"+controller).callFrom("controller","execute",$.xtlobject.actionCall('setPage',1));},classes:''};this.components["prev"]={id:this.navigationId+"-prev",icon:'ui-icon-seek-prev',title:options.pagerBefore,action:function(actionArgs){$("#"+controller).callFrom("controller","execute",$.xtlobject.actionCall('setPage',actionArgs-1));},classes:''};this.components["next"]={id:this.navigationId+"-next",icon:'ui-icon-seek-next',title:options.pagerNext,action:function(actionArgs){$("#"+controller).callFrom("controller","execute",$.xtlobject.actionCall('setPage',actionArgs+1));},classes:''};this.components["end"]={id:this.navigationId+"-end",icon:'ui-icon-seek-end',title:options.pagerLast,action:function(actionArgs){$("#"+controller).callFrom("controller","execute",$.xtlobject.actionCall('setPage',actionArgs));},classes:''};this.components["page"]={id:this.navigationId+"-page",inputId:this.navigationId+"-page-input",classes:''};this.components["nbpages"]={id:this.navigationId+"-nbpages",classes:'ui-pager-nbpages'};this.components["currentpage"]={id:this.id+'-label',classes:'pager-message'};this.currentPage=1;this.lastPage=1;$.xtlview.prototype._prepareOptions.apply(this,arguments);},_build:function(){this.element.data("view","viewPager");$.xtlview.prototype._build.apply(this,arguments);},_buildStaticView:function(){var fragment=document.createDocumentFragment(),globalUl;globalUl=this._buildGlobalList();globalUl.appendChild(this._buildLabel('currentpage'));globalUl.appendChild(this._buildButtonsItem());fragment.appendChild(globalUl);this.element.append(fragment);this._buildButtons();},_buildGlobalList:function(){var htmlElem=document.createElement('ul');htmlElem.className='pager-list ui-helper-clearfix ui-helper-reset';return htmlElem;},_buildButtonsItem:function(globalUl){var htmlElem=document.createElement('li'),htmlButtonsList=document.createElement('ul');htmlElem.id=this.navigationId;htmlElem.className='pager-buttons';htmlButtonsList.className='pager-button-slot ui-helper-clearfix ui-helper-reset';this._buildItemsButtons(htmlButtonsList);htmlElem.appendChild(htmlButtonsList);return htmlElem;},_buildButtons:function(){this._buildButton('first');this._buildButton('prev');this._buildInput('page');this._buildButton('next');this._buildButton('end');},_buildItemsButtons:function(buttonsUl){buttonsUl.appendChild(this._buildItemButton('first'));buttonsUl.appendChild(this._buildItemButton('prev'));buttonsUl.appendChild(this._buildItemInput('page'));buttonsUl.appendChild(this._buildLabel('nbpages'));buttonsUl.appendChild(this._buildItemButton('next'));buttonsUl.appendChild(this._buildItemButton('end'));},_buildItemButton:function(key){var htmlElem=document.createElement('li'),component=this.components[key];htmlElem.id=component.id;return htmlElem;},_buildButton:function(key){var component=this.components[key],htmlElem=$('#'+component.id);htmlElem.viewButton({icon:component.icon,actionArgs:1,action:component.action,title:component.title});},_buildItemInput:function(key){var htmlElem=document.createElement('li'),inputElem=document.createElement('input'),component=this.components[key];htmlElem.id=component.id;htmlElem.className=component.classes;inputElem.id=component.inputId;inputElem.className='ui-state-default';inputElem.type='text';inputElem.size='3';htmlElem.appendChild(inputElem);return htmlElem;},_buildLabel:function(key){var htmlElem=document.createElement('li'),component=this.components[key];htmlElem.id=component.id;htmlElem.className=component.classes;return htmlElem;},_buildInput:function(key){var component=this.components[key],inputElem=$('#'+component.inputId),controller=this.options.controller,self=this;inputElem.keyfilter(/[\d]/).keyup(function(e){var nbDePages=self.lastPage,val=$(this).val(),strlen;if(e.which==13){$("#"+controller).callFrom("controller","execute",$.xtlobject.actionCall('setPage',val));}else{strlen=val.length;if(val>nbDePages){$(this).val(nbDePages);}
else if(val<1){$(this).val(1);}}}).focus(function(){this.select();}).blur(function(){$(this).val(self.currentPage);});},_destroyStaticView:function(){},_enableDynamicView:function(){},_disableDynamicView:function(){},_updateView:function(){this._updateFromModel();$.xtlview.prototype._updateView.apply(this,arguments);},_updateFromModel:function(){var observable=this._observable('modelList'),options=this.options,currentPage,lastPage,pagination;if($.xtlvalidate.objectId(observable.id)){pagination=$('#'+observable.id).callFrom(observable.type,'pagination');currentPage=pagination.currentPage;lastPage=pagination.lastPage;nbResults=pagination.nbResults;if(nbResults==0){this.hide();}
else{this.show();this.currentPage=currentPage;this.lastPage=lastPage;this._updateLabel('currentpage',this._prepareMessage(pagination));this._updateLabel('nbpages',"/"+lastPage);this._updateButton('first',null,(currentPage=='1'));this._updateButton('prev',currentPage,(currentPage=='1'));this._updateButton('next',currentPage,(currentPage==lastPage));this._updateButton('end',lastPage,(currentPage==lastPage));this._updateInput('page',currentPage);}}},_prepareMessage:function(pagination){var options=this.options,nbResults=pagination.nbResults,resultPerPage=pagination.resultPerPage,currentPage=pagination.currentPage,lastPage=pagination.lastPage,firstResult,lastResult,label;label='';firstResult=((currentPage*resultPerPage)-resultPerPage)+1;if(lastPage=='1'){label=nbResults+" "+options.pagerResults;}
else{if(currentPage===lastPage){lastResult=nbResults;}else{lastResult=(currentPage*resultPerPage);}
label=options.pagerResults+" "+firstResult+" "+options.pagerTo+" "+lastResult+" "+options.pagerOn+" "+nbResults;}
return label;},_updateLabel:function(key,message){var component=this.components[key];$('li#'+component.id).html(message);},_updateButton:function(key,arg,disableCondition){var component=this.components[key];if(disableCondition){$('li#'+component.id).viewButton('state','disabled');}
else{$('li#'+component.id).viewButton('state','normal');if(arg!==null){$('li#'+component.id).viewButton('updateActionArgs',arg);}}},_updateInput:function(key,value){var component=this.components[key];$('input#'+component.inputId).val(value);},_resizeWidth:function(newWidth){},_resizeHeight:function(newHeight){},_eventObservableChange:function(event){var observableName=event.originalEvent.observableName,observableAttribute=event.originalEvent.observableAttribute,changeArgs=event.originalEvent.changeArgs;switch(observableName){case'modelList':if(observableAttribute==='pagination'){start=new Date();this._updateFromModel();}
break;}}});$.extend($.xtl.viewPager,{version:"0.1",defaults:{pagination:{currentPage:1,lastPage:null,nbResults:null}},params:{customcss:'xtlview-pager'},observe:{observables:{},observers:[]},dimensions:{height:'auto',width:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150},states:{state:'normal',states:{normal:false,error:false,highlight:false,disabled:false}},styles:{statesStyle:{normal:null,error:'ui-state-error',highlight:'ui-state-highlight',disabled:'ui-state-disabled'}}});})(jQuery);;(function($){$.xtlcontroller("xtl.controllerForm",{_build:function(){this.element.data("controller","controllerForm");$.xtlcontroller.prototype._build.apply(this,arguments);},_manager:function(){this._log("manager...get");return this._getData("manager");},_refresh:function(ajaxUrl,ajaxData,successBehavior){var manager=this._manager();if($.xtlvalidate.string(manager)){$("#"+manager).callFrom("manager","reload",[ajaxUrl,ajaxData,successBehavior]);}}});$.extend($.xtl.controllerForm,{version:"0.1",defaults:{manager:null,controllers:{parent:null}},params:{customcss:'xtlcontroller-form'},actions:{actions:{editItem:$.xtlobject.action(null,'id'),newItem:$.xtlobject.action(null,'id'),saveItem:$.xtlobject.action(null,function(action,args){var manager=this._manager(),form,ajaxData='';if($.xtlvalidate.string(manager)){form=$('#'+manager).callFrom('manager','form');if($.xtlvalidate.string(form)){ajaxData=$('#'+form).serialize();}}
return ajaxData;}),saveAndQuitItem:$.xtlobject.action(null,function(){var manager=this._manager(),form,ajaxData='';if($.xtlvalidate.string(manager)){form=$('#'+manager).callFrom('manager','form');if($.xtlvalidate.string(form)){ajaxData=$('#'+form).serialize();}}
return ajaxData;},null)},actionDefaultUrl:null}});})(jQuery);