/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;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){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;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){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==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])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).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,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});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,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));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 this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];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.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/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: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));},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);},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);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};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(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")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 expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},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];}},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 value&&value.constructor==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 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){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;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}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&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}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){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';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=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");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.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?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(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});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,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)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;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&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)elem[name]=value;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||array.split||array.setInterval||array.call)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.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
while(elem=second[i++])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.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});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));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});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){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},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;},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;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===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 parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===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(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var 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 timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();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.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};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,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},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.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});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.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){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,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);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});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);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{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);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?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",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,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 remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=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();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();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){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){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.dataFilter);}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(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!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||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){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(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},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(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=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"){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;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},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;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;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:[],timerId:null,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.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&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;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.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(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";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)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)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,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};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;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;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";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
 jQuery.noConflict();
/*
 +--------------------------------------------------------------------+
 | CiviCRM version 2.2                                                |
 +--------------------------------------------------------------------+
 | Copyright CiviCRM LLC (c) 2004-2009                                |
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 | CiviCRM is free software; you can copy, modify, and distribute it  |
 | under the terms of the GNU Affero General Public License           |
 | Version 3, 19 November 2007.                                       |
 |                                                                    |
 | CiviCRM is distributed in the hope that it will be useful, but     |
 | WITHOUT ANY WARRANTY; without even the implied warranty of         |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
 | See the GNU Affero General Public License for more details.        |
 |                                                                    |
 | You should have received a copy of the GNU Affero General Public   |
 | License along with this program; if not, contact CiviCRM LLC       |
 | at info[AT]civicrm[DOT]org. If you have questions about the        |
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
*/

/**
 *
 * @package CRM
 * @copyright CiviCRM LLC (c) 2004-2009
 * $Id$
 *
 */

/** 
 *  This function can be used to clear default 'suggestive text' from an input field
 *  When the cursor is moved into the field.
 *  
 *  It is generally invoked by the input field's onFocus event. Use the reserved
 *  word 'this' to pass this object. EX: onFocus="clearFldVal(this);"
 * 
 * @access public
 * @param  fld The form field object whose value is to be cleared
 * @param  hideBlocks Array of element Id's to be hidden
 * @return none 
 */
function clearFldVal(fld) {
    if (fld.value == fld.defaultValue) {
        fld.value = "";
    }
}

/** 
 *  This function is called by default at the bottom of template files which have forms that have
 *  conditionally displayed/hidden sections and elements. The PHP is responsible for generating
 *  a list of 'blocks to show' and 'blocks to hide' and the template passes these parameters to
 *  this function.
 * 
 * @access public
 * @param  showBlocks Array of element Id's to be displayed
 * @param  hideBlocks Array of element Id's to be hidden
 * @param elementType Value to set display style to for showBlocks (e.g. 'block' or 'table-row' or ...)
 * @return none 
 */
function on_load_init_blocks(showBlocks, hideBlocks, elementType)
{   
    if ( elementType == null ) {
        var elementType = 'block';
    }
    
    /* This loop is used to display the blocks whose IDs are present within the showBlocks array */ 
    for ( var i = 0; i < showBlocks.length; i++ ) {
        var myElement = document.getElementById(showBlocks[i]);
        /* getElementById returns null if element id doesn't exist in the document */
        if (myElement != null) {
            myElement.style.display = elementType;
        } else {
	  alert('showBlocks array item not in .tpl = ' + showBlocks[i]);
        }
    }
    
    /* This loop is used to hide the blocks whose IDs are present within the hideBlocks array */ 
    for ( var i = 0; i < hideBlocks.length; i++ ) { 
        var myElement = document.getElementById(hideBlocks[i]);
        /* getElementById returns null if element id doesn't exist in the document */
        if (myElement != null) {
            myElement.style.display = 'none';
        } else {
	  alert('showBlocks array item not in .tpl = ' + hideBlocks[i]);
        }
    }
    
}

/** 
 *  This function is called when we need to show or hide a related form element (target_element)
 *  based on the value (trigger_value) of another form field (trigger_field).
 * 
 * @access public
 * @param  trigger_field_id     HTML id of field whose onchange is the trigger
 * @param  trigger_value        List of integers - option value(s) which trigger show-element action for target_field
 * @param  target_element_id    HTML id of element to be shown or hidden
 * @param  target_element_type  Type of element to be shown or hidden ('block' or 'table-row')
 * @param  field_type           Type of element radio/select
 * @param  invert               Boolean - if true, we HIDE target on value match; if false, we SHOW target on value match
 * @return none 
*/
function showHideByValue(trigger_field_id, trigger_value, target_element_id, target_element_type, field_type, invert ) {
    if ( target_element_type == null ) {
        var target_element_type = 'block';
    } else if ( target_element_type == 'table-row' ) {
	var target_element_type = '';
    }
    
    if (field_type == 'select') {
        var trigger = trigger_value.split("|");
        var selectedOptionValue = document.getElementById(trigger_field_id).options[document.getElementById(trigger_field_id).selectedIndex].value;	
        
        var target = target_element_id.split("|");
        for(var j = 0; j < target.length; j++) {
            if ( invert ) {  
                show(target[j], target_element_type);
            } else {
                hide(target[j],target_element_type);
            }
            for(var i = 0; i < trigger.length; i++) {
                if (selectedOptionValue == trigger[i]) {
                    if ( invert ) {  
                        hide(target[j],target_element_type);
                    } else {
                        show(target[j],target_element_type);
                    }	
                }
            }
        }
 
    } else if (field_type == 'radio') {

        var target = target_element_id.split("|");
        for(var j = 0; j < target.length; j++) {
	    if (document.getElementsByName(trigger_field_id)[0].checked) {
		if ( invert ) {  
		    hide(target[j], target_element_type);
		} else {
		    show(target[j], target_element_type);
		 }
	    } else {
		if ( invert ) {  
		    show(target[j], target_element_type);
		} else {
		    hide(target[j], target_element_type);
		}
	    }
	}
    }
}

/** 
 *  This function is called when we need to enable or disable a related form element (target_element)
 *  based on the value (trigger_value) of another form field (trigger_field).
 * 
 * @access public
 * @param  trigger_field_id     HTML id of field whose onchange is the trigger
 * @param  trigger_value        List of integers - option value(s) which trigger enable-element action for target_field
 * @param  target_element_id    HTML id of element to be enabled or disabled
 * @param  target_element_type  Type of element to be enabled or disabled ('block' or 'table-row')
 * @param  field_type           Type of element radio/select
 * @param  invert               Boolean - if true, we DISABLE target on value match; if false, we ENABLE target on value match
 * @return none 
*/
function enableDisableByValue(trigger_field_id, trigger_value, target_element_id, target_element_type, field_type, invert ) {
    if ( target_element_type == null ) {
        var target_element_type = 'block';
    } else if ( target_element_type == 'table-row' ) {
	var target_element_type = '';
    }
    
    if (field_type == 'select') {
        var trigger = trigger_value.split("|");
        var selectedOptionValue = document.getElementById(trigger_field_id).options[document.getElementById(trigger_field_id).selectedIndex].value;	
        
        var target = target_element_id.split("|");
        for(var j = 0; j < target.length; j++) {
  	    if (document.getElementById(target[j])) {
              if ( invert ) {  
                 document.getElementById(target[j]).disabled = false;
              } else {
                 document.getElementById(target[j]).disabled = true;
              }
	    }
            for(var i = 0; i < trigger.length; i++) {
                if (selectedOptionValue == trigger[i]) {
    	            if (document.getElementById(target[j])) {
                       if ( invert ) {  
			  document.getElementById(target[j]).disabled = true;
	               } else {
			  document.getElementById(target[j]).disabled = false;
	               }	
		    }
                }
            }
        }
 
    } else if (field_type == 'radio') {
        var target = target_element_id.split("|");
        for(var j = 0; j < target.length; j++) {
	    if (document.getElementsByName(trigger_field_id)[0].checked) {
	       if (document.getElementById(target[j])) {
		   if ( invert ) {  
			document.getElementById(target[j]).disabled = true;
		   } else {
			document.getElementById(target[j]).disabled = false;
		   }
		}
	    } else {
	       if (document.getElementById(target[j])) {
		   if ( invert ) {  
			document.getElementById(target[j]).disabled = false;
 		   } else {
			document.getElementById(target[j]).disabled = true;
	    	   }
		}
	    }
	}
    }
}

/** 
 *  This function is called when we need to Reset a related form element (target_element)
 *  based on the value (trigger_value) of another form field (trigger_field).
 * 
 * @access public
 * @param  trigger_field_id     HTML id of field whose onchange is the trigger
 * @param  trigger_value        List of integers - option value(s) which trigger reset action for target_field
 * @param  target_element_id    HTML id of element to be reset
 * @param  target_field_type    Field-Type of element to be reset ('radio' or 'text')
 * @param  field_type           Type of element radio/select
 * @param  invert               Boolean - if true, we RESET target on value-match; if false, we RESET target on No-value-match
 * @return none 
*/
function resetByValue(trigger_field_id, trigger_value, target_element_id, target_field_type, field_type, invert) {
    
    if (field_type == 'select') {
        var trigger = trigger_value.split("|");
        var selectedOptionValue = document.getElementById(trigger_field_id).options[document.getElementById(trigger_field_id).selectedIndex].value;	
        
        var target = target_element_id.split("|");
        for(var j = 0; j < target.length; j++) {
            for(var i = 0; i < trigger.length; i++) {
		if ( invert ) {
                  if (selectedOptionValue == trigger[i]) {
		       if (target_field_type == 'radio') {	
			   if (document.getElementsByName(target[j])) {
				for (var i=0; i<document.getElementsByName(target[j]).length; i++) {
				   if (document.getElementsByName(target[j])[i].checked) {
 				       document.getElementsByName(target[j])[i].checked = null;
				   }
				}
			   }
		       } else {	
	    	           if (document.getElementById(target[j])) {
			       document.getElementById(target[j]).value = "";
			   }
		       }
                  }
		} else {
		    if (selectedOptionValue != trigger[i]) {
		       if (target_field_type == 'radio') {	
			   if (document.getElementsByName(target[j])) {
				for (var i=0; i<document.getElementsByName(target[j]).length; i++) {
				   if (document.getElementsByName(target[j])[i].checked) {
 				       document.getElementsByName(target[j])[i].checked = null;
				   }
				}
			   }
		       } else {	
	    	           if (document.getElementById(target[j])) {
			       document.getElementById(target[j]).value = "";
			   }
		       }
		    }
		}
            }
        }

     } else if (field_type == 'radio') {
        var target = target_element_id.split("|");
        for(var j = 0; j < target.length; j++) {
	      if ( invert ) {
		   if (document.getElementsByName(trigger_field_id)[0].checked) {
		       if (target_field_type == 'radio') {	
			   if (document.getElementsByName(target[j])) {
				for (var i=0; i<document.getElementsByName(target[j]).length; i++) {
				   if (document.getElementsByName(target[j])[i].checked) {
 				       document.getElementsByName(target[j])[i].checked = null;
				   }
				}
			   }
		       } else {	
			       if (document.getElementById(target[j])) {
		  		   document.getElementById(target[j]).value = "";
			      }
		       }
		   }
	      } else {
		   if (!document.getElementsByName(trigger_field_id)[0].checked) {
		       if (target_field_type == 'radio') {	
			   if (document.getElementsByName(target[j])) {
				for (var i=0; i<document.getElementsByName(target[j]).length; i++) {
				   if (document.getElementsByName(target[j])[i].checked) {
 				       document.getElementsByName(target[j])[i].checked = null;
				   }
				}
			   }
		       } else {	
			       if (document.getElementById(target[j])) {
		  		   document.getElementById(target[j]).value = "";
			      }
		       }
		   }
	      }
	}
    }
}

/** 
 * This function is used to display a page element  (e.g. block or table row or...). 
 * 
 * This function is called by various links which handle requests to display the hidden blocks.
 * An example is the <code>[+] another phone</code> link which expands an additional phone block.
 * The parameter block_id must have the id of the block which has to be displayed.
 *
 * 
 * @access public
 * @param block_id Id value of the block (or row) to be displayed.
 * @param elementType Value to set display style to when showing the element (e.g. 'block' or 'table-row' or ...)
 * @return none
 */
function show(block_id,elementType)
{
    if ( elementType == null ) {
        var elementType = 'block';
    } else if ( elementType == "table-row" && navigator.appName == 'Microsoft Internet Explorer' ) {
 	var elementType = "block";
    }
    var myElement = document.getElementById(block_id);
    if (myElement != null) {
        myElement.style.display = elementType;
    } else {
        alert('Request to show() function failed. Element id undefined = '+ block_id);
    }
}


/** 
 * This function is used to hide a block. 
 * 
 * This function is called by various links which handle requests to hide the visible blocks.
 * An example is the <code>[-] hide phone</code> link which hides the phone block.
 * The parameter block_id must have the id of the block which has to be hidden.
 *
 * @access public
 * @param block_id Id value of the block to be hidden.
 * @return none
 */
function hide(block_id) 
{
    var myElement = document.getElementById(block_id);
    if (myElement != null) {
        myElement.style.display = 'none';
    } else {
        alert('Request to hide() function failed. Element id undefined = ' + block_id);
    }
    
    //    document.getElementById(block_id).style.display = 'none';
}

/**
 *
 * Function for checking ALL or unchecking ALL check boxes in a resultset page.
 *
 * @access public
 * @param fldPrefix - common string which precedes unique checkbox ID and identifies field as
 *                    belonging to the resultset's checkbox collection
 * @param action - 'select' = set all to checked; 'deselect' = set all to unchecked
 * @param form - name of form that checkboxes are part of
 * Sample usage: onClick="javascript:changeCheckboxValues('chk_', 'select', myForm );"
 *
 * @return
 */
function toggleCheckboxVals(fldPrefix,form) {
    for( i=0; i < form.elements.length; i++) {
        fpLen = fldPrefix.length;
        if (form.elements[i].type == 'checkbox' && form.elements[i].name.slice(0,fpLen) == fldPrefix ) {
            element = form.elements[i];
            if (form.toggleSelect.checked == false ) {
                element.checked = false; 
            } else {
                element.checked = true;
            }
        }
    }
    /* function called to change the color of selected rows */
    on_load_init_checkboxes(form.name); 
}

function countSelectedCheckboxes(fldPrefix, form) {
    fieldCount = 0;
    for( i=0; i < form.elements.length; i++) {
        fpLen = fldPrefix.length;
        if (form.elements[i].type == 'checkbox' && form.elements[i].name.slice(0,fpLen) == fldPrefix && form.elements[i].checked == true) {
            fieldCount++;
        }
    }
    return fieldCount;
}

/**
 * Function to enable task action select
 */
function toggleTaskAction( status ) {
    var radio_ts = document.getElementsByName('radio_ts');
    if ( radio_ts[0].checked || radio_ts[1].checked ) {
	status = true;
    }

    var formElements = ['task', 'Go', 'Print'];
    for(var i=0; i<formElements.length; i++ ) {
	var element = document.getElementById( formElements[i] );
	if ( element ) {
	    if ( status ) {
		element.disabled = false;
	    } else {
		element.disabled = true;
	    }
	}
    }
}

/**
 * This function is used to check if any actio is selected and also to check if any contacts are checked.
 *
 * @access public
 * @param fldPrefix - common string which precedes unique checkbox ID and identifies field as
 *                    belonging to the resultset's checkbox collection
 * @param form - name of form that checkboxes are part of
 * Sample usage: onClick="javascript:checkPerformAction('chk_', myForm );"
 *
 */
function checkPerformAction (fldPrefix, form, taskButton) {
    var cnt;
    var gotTask = 0;
    
    // taskButton TRUE means we don't need to check the 'task' field - it's a button-driven task
    if (taskButton == 1) {
        gotTask = 1;
    } else if (document.forms[form].task.selectedIndex) {
	//force user to select all search contacts, CRM-3711
	if ( document.forms[form].task.value == 13 || document.forms[form].task.value == 14 || document.forms[form].task.value == 20 ) {
	    var toggleSelect = document.getElementsByName('toggleSelect');
	    if ( toggleSelect[0].checked || document.forms[form].radio_ts[0].checked ) {
		return true;
	    } else {
		alert( "Please select all contacts for this action.\n\nTo use the entire set of search results, click the 'all records' radio button." );
		return false;
	    }
	}
	gotTask = 1; 
    }
    
    if (gotTask == 1) {
        // If user wants to perform action on ALL records and we have a task, return (no need to check further)
        if (document.forms[form].radio_ts[0].checked) {
            return true;
        }
	
        cnt = countSelectedCheckboxes(fldPrefix, document.forms[form]);
        if (!cnt) {
            alert ("Please select one or more contacts for this action.\n\nTo use the entire set of search results, click the 'all records' radio button.");
            return false;
        }
    } else {
        alert ("Please select an action from the drop-down menu.");
        return false;
    }
}

/**
 * This function changes the style for a checkbox block when it is selected.
 *
 * @access public
 * @param chkName - it is name of the checkbox
 * @param form - name of form that checkboxes are part of
 * @return null
 */
function checkSelectedBox (chkName, form) 
{
    var ss = document.forms[form].elements[chkName].name.substring(7,document.forms[form].elements[chkName].name.length);
    
    var row = 'rowid' + ss;
  
    if (document.forms[form].elements[chkName].checked == true) {
        // change 'all records' radio to 'selected' if any row is checked
        document.forms[form].radio_ts[1].checked = true;
        
        if (document.getElementById(row).className == 'even-row') {
            document.getElementById(row).className = 'selected even-row';
        } else {
            document.getElementById(row).className = 'selected odd-row';
        }
	
    } else {
        if (document.getElementById(row).className == 'selected even-row') {
            document.getElementById(row).className = 'even-row';
        } else if (document.getElementById(row).className == 'selected odd-row') {
            document.getElementById(row).className = 'odd-row';
        }
    }
}


/**
 * This function is to show the row with  selected checkbox in different color
 * @param form - name of form that checkboxes are part of
 *
 * @access public
 * @return null
 */

function on_load_init_checkboxes(form) 
{
    var formName = form;
    var fldPrefix = 'mark_x';
    for( i=0; i < document.forms[formName].elements.length; i++) {
	fpLen = fldPrefix.length;
	if (document.forms[formName].elements[i].type == 'checkbox' && document.forms[formName].elements[i].name.slice(0,fpLen) == fldPrefix ) {
	    checkSelectedBox (document.forms[formName].elements[i].name, formName); 
	}
    }
    
}

/**
 * Function to change the color of the class
 * 
 * @param form - name of the form
 * @param rowid - id of the <tr>, <div> you want to change
 *
 * @access public
 * @return null
 */

function changeRowColor (rowid, form) {

    switch (document.getElementById(rowid).className) 	{
    case 'even-row'          : 	document.getElementById(rowid).className = 'selected even-row';
	break;
    case 'odd-row'           : 	document.getElementById(rowid).className = 'selected odd-row';
	break;
    case 'selected even-row' : 	document.getElementById(rowid).className = 'even-row';
	break;
    case 'selected odd-row'  : 	document.getElementById(rowid).className = 'odd-row';
	break;
    case 'form-item'         : 	document.getElementById(rowid).className = 'selected';
	break;
    case 'selected'          : 	document.getElementById(rowid).className = 'form-item';
	
    }
}

/**
 * This function is to show the row with  selected checkbox in different color
 * @param form - name of form that checkboxes are part of
 *
 * @access public
 * @return null
 */

function on_load_init_check(form) 
{
    for( i=0; i < document.forms[form].elements.length; i++) {
	
      if (
          ( document.forms[form].elements[i].type == 'checkbox' && document.forms[form].elements[i].checked == true )
           ||
          ( document.forms[form].elements[i].type == 'hidden' && document.forms[form].elements[i].value == 1 )
         ) {
              var ss = document.forms[form].elements[i].id;
		      var row = 'rowid' + ss;
		      changeRowColor(row, form);
           }
    }
}


/** 
 * This function is used to hide the table row 
 * also checks whether we have reached the 11th row
 * 
 * @param rowid get the id of tablerow
 * @param index current row index
 * @param type type of form to hide the row
 * @access public
 * @return null
 *
 */
function hiderow(rowid, type)
{
    hide(rowid);
    if(document.getElementById(type+'Link').style.display == 'none') {
	document.getElementById(type+'Link').style.display = '';
	if (type == 'optionField') {
	    document.getElementById('additionalOption').style.display = 'none';
	}
    }
    rowcounter++;
}

/** 
 * This function is used to show the table row 
 * also checks whether we have reached the 11th or 6th row, according to who called it
 * 
 * @param type eg.discount/optionField
 * @param maxValue number of rows
 * @access public
 * @return null
 *
 */

function showrow(type,maxValue)
{
    var rowid ;
    if( rowcounter == 0 ) {
	for ( var i = 2; i <= maxValue; i++ ) {
            rowid = type+"_"+i;
	    
	    if ( i == maxValue ) {
		document.getElementById(type+'Link').style.display = 'none';
		if (type == 'optionField') {
		    document.getElementById('additionalOption').style.display = '';
		}
            }

	    if(document.getElementById(rowid).style.display == 'none') {
                document.getElementById(rowid).style.display = '';
		if(type == 'discount' ) {
		    //set start date of next discount set, 
		    //according to end date of previouse discount set
		    var j = i -1;
		    var month = document.getElementById("discount_end_date["+j+"][M]").value;
		    var day   = document.getElementById("discount_end_date["+j+"][d]").value;
		    var year  = document.getElementById("discount_end_date["+j+"][Y]").value;
		    
		    var discount_date=new Date( year, month-1, day );
		    discount_date.setDate( discount_date.getDate() + 1 );
		    if ( month && day && year ) {       
			document.getElementById("discount_start_date["+i+"][M]").value = discount_date.getMonth( )+1;
			document.getElementById("discount_start_date["+i+"][d]").value = discount_date.getDate( );
			document.getElementById("discount_start_date["+i+"][Y]").value = discount_date.getFullYear( );
		    }
		} else if (i < maxValue && type == 'optionField' ) {
		    document.getElementById('additionalOption').style.display = 'none';
		}
		break;
	    }
	}
    } else {
        rowcounter--;
	
	for (var i = 2; i <= maxValue; i++ ) {
            rowid = type+'_'+i;
	    if (i == maxValue) {
		document.getElementById(type+'Link').style.display = 'none';
		if ( type == 'optionField') {
		    document.getElementById('additionalOption').style.display = '';
		}
            }	
	    
	    if(document.getElementById(rowid).style.display == 'none') {
                document.getElementById(rowid).style.display = '';
		if (i <= maxValue && type == 'discount') {
		    
		    if(rowcounter == 0) {
		   	document.getElementById(type+'Link').style.display = 'none';
		    }
		    //set start date of next discount set, 
		    //according to end date of previouse discount set
		    var j = i -1;
		    var month = document.getElementById("discount_end_date["+j+"][M]").value;
		    var day   = document.getElementById("discount_end_date["+j+"][d]").value;
		    var year  = document.getElementById("discount_end_date["+j+"][Y]").value;
		    
		    var discount_date = new Date( year, month-1, day );
		    discount_date.setDate( discount_date.getDate() + 1 );
		    
		    if ( month && day && year ) {			       
			document.getElementById("discount_start_date["+i+"][M]").value = discount_date.getMonth( )+1;
			document.getElementById("discount_start_date["+i+"][d]").value = discount_date.getDate( );
			document.getElementById("discount_start_date["+i+"][Y]").value = discount_date.getFullYear( );
		    }
		    
		    break;
		} else if (i < maxValue && type == 'optionField') {
		    document.getElementById('additionalOption').style.display = 'none';
		    if(rowcounter == 0) {
		   	document.getElementById('optionFieldLink').style.display = 'none';
			document.getElementById('additionalOption').style.display = '';
		    }
		    break;
		}
            }
        }
    }
}

/**
 * reset all the radio buttons with a given name
 *
 * @param string fieldName
 * @param object form
 * @return null
 */
function unselectRadio(fieldName, form)
{
  for( i=0; i < document.forms[form].elements.length; i++) {
    if (document.forms[form].elements[i].name == fieldName) {
      document.forms[form].elements[i].checked = false;
    }
  }
  return;
}

/**
 * Function to change button text and disable one it is clicked
 *
 * @param obj object - the button clicked
 * @param formID string - the id of the form being submitted
 * @param string procText - button text after user clicks it
 * @return null
 */
var submitcount=0;
/* Changes button label on submit, and disables button after submit for newer browsers.
Puts up alert for older browsers. */
function submitOnce(obj,formId,procText) {
    // if named button clicked, change text
    if (obj.value != null) {
        obj.value = procText + " ...";
    }
    if (document.getElementById) { // disable submit button for newer browsers
        obj.disabled = true;
        document.getElementById(formId).submit();
        return true;
    }
    else { // for older browsers
        if (submitcount == 0) {
            submitcount++;
            return true;
        } else {
            alert("Your request is currently being processed ... Please wait.");
            return false;
        }
    }
}

/**
 * Function submits referenced form on click of wizard nav link.
 * Populates targetPage hidden field prior to POST.
 *
 * @param formID string - the id of the form being submitted
 * @param targetPage - identifier of wizard section target
 * @return null
 */
function submitCurrentForm(formId,targetPage) {
    alert(formId + ' ' + targetPage);
    document.getElementById(formId).targetPage.value = targetPage;
    document.getElementById(formId).submit();
}

/**
 * Function counts and controls maximum word count for textareas.
 *
 * @param essay_id string - the id of the essay (textarea) field
 * @param wc - int - number of words allowed
 * @return null
 */
function countit(essay_id,wc){
    var text_area       = document.getElementById("essay_" + essay_id);
    var count_element   = document.getElementById("word_count_" + essay_id);
    var count           = 0;
    var text_area_value = text_area.value;
    var regex           = /\n/g; 
    var essay           = text_area_value.replace(regex," ");
    var words           = essay.split(' ');
    
    for (z=0; z<words.length; z++){
        if (words[z].length>0){
            count++;
        }
    }
    
    count_element.value     = count;
    if (count>=wc) {
        /*text_area.value     = essay;*/

        var dataString = '';
        for (z=0; z<wc; z++){
	  if (words[z].length>0) {
	    dataString = dataString + words[z] + ' '; 
	  }
	}

	text_area.value = dataString; 
        text_area.blur();
	count = wc;
        count_element.value = count;
        alert("You have reached the "+ wc +" word limit.");
    }
}

function popUp(URL) {
  day = new Date();
  id  = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=420,left = 202,top = 184');");
}

/**
 * Function to execute javascript that is assigned to element using innerHTML property
 *
 * @param elementName element name, that whose innerHTML is set
 */
function executeInnerHTML ( elementName ) 
{
    var element   = document.getElementById( elementName );
    var content   = element.getElementsByTagName('script');
    var tagLength = content.length;
    
    for (var x=0; x<tagLength; x++ ) {
	var newScript = document.createElement('script');
	newScript.type = "text/javascript";
	newScript.text = content[x].text;
	//execute script
	element.appendChild(newScript);
    }
    
    for ( var y=0; y<tagLength-1; y++ ) {
	element.removeChild(element.getElementsByTagName('script')[y]);
    }
}

function imagePopUp ( path ) 
{      window.open(path,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,screenX=150,screenY=150,top=150,left=150');
}/*
	Copyright (c) 2004-2008, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/

/*
	This is a compiled version of Dojo, built for deployment and not for
	development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.
*/

(function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var _2="",_3="",_4="",_5={},_6={};_1=_1||djConfig.scopeMap;for(var i=0;i<_1.length;i++){var _8=_1[i];_2+="var "+_8[0]+" = {}; "+_8[1]+" = "+_8[0]+";"+_8[1]+"._scopeName = '"+_8[1]+"';";_3+=(i==0?"":",")+_8[0];_4+=(i==0?"":",")+_8[1];_5[_8[0]]=_8[1];_6[_8[1]]=_8[0];}eval(_2+"dojo._scopeArgs = ["+_4+"];");dojo._scopePrefixArgs=_3;dojo._scopePrefix="(function("+_3+"){";dojo._scopeSuffix="})("+_4+")";dojo._scopeMap=_5;dojo._scopeMapRev=_6;}(function(){if(!this["console"]){this.console={log:function(){}};}var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var _c=tn+"";console[_c]=function(){var a=Array.apply({},arguments);a.unshift(_c+":");console.log(a.join(" "));};})();}}if(typeof dojo=="undefined"){this.dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){this.dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){this.dojox={_scopeName:"dojox"};}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox];}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};if(typeof djConfig!="undefined"){for(var _f in djConfig){d.config[_f]=djConfig[_f];}}var _10=["Browser","Rhino","Spidermonkey","Mobile"];var t;while((t=_10.shift())){d["is"+t]=false;}dojo.locale=d.config.locale;var rev="$Rev: 13231 $".match(/\d+/);dojo.version={major:0,minor:0,patch:0,flag:"dev",revision:rev?+rev[0]:999999,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")";}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());}dojo._mixin=function(obj,_14){var _15={};for(var x in _14){if(_15[x]===undefined||_15[x]!=_14[x]){obj[x]=_14[x];}}if(d["isIE"]&&_14){var p=_14.toString;if(typeof p=="function"&&p!=obj.toString&&p!=_15.toString&&p!="\nfunction toString() {\n    [native code]\n}\n"){obj.toString=_14.toString;}}return obj;};dojo.mixin=function(obj,_19){for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i]);}return obj;};dojo._getProp=function(_1c,_1d,_1e){var obj=_1e||d.global;for(var i=0,p;obj&&(p=_1c[i]);i++){if(i==0&&this._scopeMap[p]){p=this._scopeMap[p];}obj=(p in obj?obj[p]:(_1d?obj[p]={}:undefined));}return obj;};dojo.setObject=function(_22,_23,_24){var _25=_22.split("."),p=_25.pop(),obj=d._getProp(_25,true,_24);return obj&&p?(obj[p]=_23):undefined;};dojo.getObject=function(_28,_29,_2a){return d._getProp(_28.split("."),_29,_2a);};dojo.exists=function(_2b,obj){return !!d.getObject(_2b,false,obj);};dojo["eval"]=function(_2d){return d.global.eval?d.global.eval(_2d):eval(_2d);};d.deprecated=d.experimental=function(){};})();(function(){var d=dojo;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(_2f){var mp=this._modulePrefixes;return !!(mp[_2f]&&mp[_2f].value);},_getModulePrefix:function(_31){var mp=this._modulePrefixes;if(this._moduleHasPrefix(_31)){return mp[_31].value;}return _31;},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(_33,_34,cb){var uri=((_33.charAt(0)=="/"||_33.match(/^\w+:/))?"":this.baseUrl)+_33;try{return !_34?this._loadUri(uri,cb):this._loadUriAndCheck(uri,_34,cb);}catch(e){console.error(e);return false;}};dojo._loadUri=function(uri,cb){if(this._loadedUrls[uri]){return true;}var _39=this._getText(uri,true);if(!_39){return false;}this._loadedUrls[uri]=true;this._loadedUrls.push(uri);if(cb){_39="("+_39+")";}else{_39=this._scopePrefix+_39+this._scopeSuffix;}if(d.isMoz){_39+="\r\n//@ sourceURL="+uri;}var _3a=d["eval"](_39);if(cb){cb(_3a);}return true;};dojo._loadUriAndCheck=function(uri,_3c,cb){var ok=false;try{ok=this._loadUri(uri,cb);}catch(e){console.error("failed loading "+uri+" with error: "+e);}return !!(ok&&this._loadedModules[_3c]);};dojo.loaded=function(){this._loadNotifying=true;this._postLoad=true;var mll=d._loaders;this._loaders=[];for(var x=0;x<mll.length;x++){try{mll[x]();}catch(e){throw e;console.error("dojo.addOnLoad callback failed: "+e,e);}}this._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded();}};dojo.unloaded=function(){var mll=this._unloaders;while(mll.length){(mll.pop())();}};var _42=function(arr,obj,fn){if(!fn){arr.push(obj);}else{if(fn){var _46=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){_46.call(obj);});}}};dojo.addOnLoad=function(obj,_48){_42(d._loaders,obj,_48);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded();}};dojo.addOnUnload=function(obj,_4a){_42(d._unloaders,obj,_4a);};dojo._modulesLoaded=function(){if(d._postLoad){return;}if(d._inFlightCount>0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(dojo.config.useXDomain&&d.isOpera)){if(dojo.isAIR){setTimeout(function(){dojo.loaded();},0);}else{setTimeout(dojo._scopeName+".loaded();",0);}}else{d.loaded();}};dojo._getModuleSymbols=function(_4b){var _4c=_4b.split(".");for(var i=_4c.length;i>0;i--){var _4e=_4c.slice(0,i).join(".");if((i==1)&&!this._moduleHasPrefix(_4e)){_4c[0]="../"+_4c[0];}else{var _4f=this._getModulePrefix(_4e);if(_4f!=_4e){_4c.splice(0,i,_4f);break;}}}return _4c;};dojo._global_omit_module_check=false;dojo._loadModule=dojo.require=function(_50,_51){_51=this._global_omit_module_check||_51;var _52=this._loadedModules[_50];if(_52){return _52;}var _53=this._getModuleSymbols(_50).join("/")+".js";var _54=(!_51)?_50:null;var ok=this._loadPath(_53,_54);if(!ok&&!_51){throw new Error("Could not load '"+_50+"'; last tried '"+_53+"'");}if(!_51&&!this._isXDomain){_52=this._loadedModules[_50];if(!_52){throw new Error("symbol '"+_50+"' is not defined after loading '"+_53+"'");}}return _52;};dojo.provide=function(_56){_56=_56+"";return (d._loadedModules[_56]=d.getObject(_56,true));};dojo.platformRequire=function(_57){var _58=_57.common||[];var _59=_58.concat(_57[d._name]||_57["default"]||[]);for(var x=0;x<_59.length;x++){var _5b=_59[x];if(_5b.constructor==Array){d._loadModule.apply(d,_5b);}else{d._loadModule(_5b);}}};dojo.requireIf=function(_5c,_5d){if(_5c===true){var _5e=[];for(var i=1;i<arguments.length;i++){_5e.push(arguments[i]);}d.require.apply(d,_5e);}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(_60,_61){d._modulePrefixes[_60]={name:_60,value:_61};};dojo.requireLocalization=function(_62,_63,_64,_65){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments);};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$");var ire=new RegExp("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");dojo._Url=function(){var n=null;var _a=arguments;var uri=[_a[0]];for(var i=1;i<_a.length;i++){if(!_a[i]){continue;}var _6c=new d._Url(_a[i]+"");var _6d=new d._Url(uri[0]+"");if(_6c.path==""&&!_6c.scheme&&!_6c.authority&&!_6c.query){if(_6c.fragment!=n){_6d.fragment=_6c.fragment;}_6c=_6d;}else{if(!_6c.scheme){_6c.scheme=_6d.scheme;if(!_6c.authority){_6c.authority=_6d.authority;if(_6c.path.charAt(0)!="/"){var _6e=_6d.path.substring(0,_6d.path.lastIndexOf("/")+1)+_6c.path;var _6f=_6e.split("/");for(var j=0;j<_6f.length;j++){if(_6f[j]=="."){if(j==_6f.length-1){_6f[j]="";}else{_6f.splice(j,1);j--;}}else{if(j>0&&!(j==1&&_6f[0]=="")&&_6f[j]==".."&&_6f[j-1]!=".."){if(j==(_6f.length-1)){_6f.splice(j,1);_6f[j-1]="";}else{_6f.splice(j-1,2);j-=2;}}}}_6c.path=_6f.join("/");}}}}uri=[];if(_6c.scheme){uri.push(_6c.scheme,":");}if(_6c.authority){uri.push("//",_6c.authority);}uri.push(_6c.path);if(_6c.query){uri.push("?",_6c.query);}if(_6c.fragment){uri.push("#",_6c.fragment);}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[5];this.port=r[7]||n;}};dojo._Url.prototype.toString=function(){return this.uri;};dojo.moduleUrl=function(_72,url){var loc=d._getModuleSymbols(_72).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _75=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_75==-1||_75>loc.indexOf("/"))){loc=d.baseUrl+loc;}return new d._Url(loc,url);};})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var _77=document.getElementsByTagName("script");var _78=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_77.length;i++){var src=_77[i].getAttribute("src");if(!src){continue;}var m=src.match(_78);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=_77[i].getAttribute("djConfig");if(cfg){var _7d=eval("({ "+cfg+" })");for(var x in _7d){dojo.config[x]=_7d[x];}}break;}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent;var dav=n.appVersion;var tv=parseFloat(dav);d.isOpera=(dua.indexOf("Opera")>=0)?tv:0;var idx=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(idx){d.isSafari=parseFloat(dav.split("Version/")[1])||((parseFloat(dav.substr(idx+7))>=419.3)?3:2)||2;}d.isAIR=(dua.indexOf("AdobeAIR")>=0)?1:0;d.isKhtml=(dav.indexOf("Konqueror")>=0||d.isSafari)?tv:0;d.isMozilla=d.isMoz=(dua.indexOf("Gecko")>=0&&!d.isKhtml)?tv:0;d.isFF=d.isIE=0;if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1])||0;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||0;}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}var cm=document.compatMode;d.isQuirks=cm=="BackCompat"||cm=="QuirksMode"||d.isIE<6;d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var _85=null;var _86=null;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_85=new XMLHttpRequest();}catch(e){}}if(!_85){for(var i=0;i<3;++i){var _88=d._XMLHTTP_PROGIDS[i];try{_85=new ActiveXObject(_88);}catch(e){_86=e;}if(_85){d._XMLHTTP_PROGIDS=[_88];break;}}}if(!_85){throw new Error("XMLHTTP not available: "+_86);}return _85;};d._isDocumentOk=function(_89){var _8a=_89.status||0;return (_8a>=200&&_8a<300)||_8a==304||_8a==1223||(!_8a&&(location.protocol=="file:"||location.protocol=="chrome:"));};var _8b=window.location+"";var _8c=document.getElementsByTagName("base");var _8d=(_8c&&_8c.length>0);d._getText=function(uri,_8f){var _90=this._xhrObj();if(!_8d&&dojo._Url){uri=(new dojo._Url(_8b,uri)).toString();}if(d.config.cacheBust){uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_90.open("GET",uri,false);try{_90.send(null);if(!d._isDocumentOk(_90)){var err=Error("Unable to load "+uri+" status:"+_90.status);err.status=_90.status;err.responseText=_90.responseText;throw err;}}catch(e){if(_8f){return null;}throw e;}return _90.responseText;};})();dojo._initFired=false;dojo._loadInit=function(e){dojo._initFired=true;var _93=(e&&e.type)?e.type.toLowerCase():"load";if(arguments.callee.initialized||(_93!="domcontentloaded"&&_93!="load")){return;}arguments.callee.initialized=true;if("_khtmlTimer" in dojo){clearInterval(dojo._khtmlTimer);delete dojo._khtmlTimer;}if(dojo._inFlightCount==0){dojo._modulesLoaded();}};dojo._fakeLoadInit=function(){dojo._loadInit({type:"load"});};if(dojo.config.afterOnLoad){window.setTimeout(dojo._fakeLoadInit,1000);}else{if(document.addEventListener){if(dojo.isOpera||dojo.isFF>=3||(dojo.isMoz&&dojo.config.enableMozDomContentLoaded===true)){document.addEventListener("DOMContentLoaded",dojo._loadInit,null);}window.addEventListener("load",dojo._loadInit,null);}if(dojo.isAIR){window.addEventListener("load",dojo._loadInit,null);}else{if(/(WebKit|khtml)/i.test(navigator.userAgent)){dojo._khtmlTimer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){dojo._loadInit();}},10);}}}(function(){var _w=window;var _95=function(_96,fp){var _98=_w[_96]||function(){};_w[_96]=function(){fp.apply(_w,arguments);_98.apply(_w,arguments);};};if(dojo.isIE){if(!dojo.config.afterOnLoad){document.write("<scr"+"ipt defer src=\"//:\" "+"onreadystatechange=\"if(this.readyState=='complete'){"+dojo._scopeName+"._loadInit();}\">"+"</scr"+"ipt>");}var _99=true;_95("onbeforeunload",function(){_w.setTimeout(function(){_99=false;},0);});_95("onunload",function(){if(_99){dojo.unloaded();}});try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)");}catch(e){}}else{_95("onbeforeunload",function(){dojo.unloaded();});}})();}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _9b in mp){dojo.registerModulePath(_9b,mp[_9b]);}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug");}if(dojo.config.debugAtAllCosts){dojo.config.useXDomain=true;dojo.require("dojo._base._loader.loader_xd");dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");dojo.isString=function(it){return !!arguments.length&&it!=null&&(typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=(function(){var _9e=function(it){return it&&(typeof it=="function"||it instanceof Function);};return dojo.isSafari?function(it){if(typeof it=="function"&&it=="[object NodeList]"){return false;}return _9e(it);}:_9e;})();dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||dojo.isArray(it)||dojo.isFunction(it));};dojo.isArrayLike=function(it){var d=dojo;return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));};dojo.isAlien=function(it){return it&&!dojo.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_a5,_a6){for(var i=1,l=arguments.length;i<l;i++){dojo._mixin(_a5.prototype,arguments[i]);}return _a5;};dojo._hitchArgs=function(_a9,_aa){var pre=dojo._toArray(arguments,2);var _ac=dojo.isString(_aa);return function(){var _ad=dojo._toArray(arguments);var f=_ac?(_a9||dojo.global)[_aa]:_aa;return f&&f.apply(_a9||this,pre.concat(_ad));};};dojo.hitch=function(_af,_b0){if(arguments.length>2){return dojo._hitchArgs.apply(dojo,arguments);}if(!_b0){_b0=_af;_af=null;}if(dojo.isString(_b0)){_af=_af||dojo.global;if(!_af[_b0]){throw (["dojo.hitch: scope[\"",_b0,"\"] is null (scope=\"",_af,"\")"].join(""));}return function(){return _af[_b0].apply(_af,arguments||[]);};}return !_af?_b0:function(){return _b0.apply(_af,arguments||[]);};};dojo.delegate=dojo._delegate=function(obj,_b2){function TMP(){};TMP.prototype=obj;var tmp=new TMP();if(_b2){dojo.mixin(tmp,_b2);}return tmp;};dojo.partial=function(_b4){var arr=[null];return dojo.hitch.apply(dojo,arr.concat(dojo._toArray(arguments)));};dojo._toArray=function(obj,_b7,_b8){var arr=_b8||[];for(var x=_b7||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};dojo.clone=function(o){if(!o){return o;}if(dojo.isArray(o)){var r=[];for(var i=0;i<o.length;++i){r.push(dojo.clone(o[i]));}return r;}if(!dojo.isObject(o)){return o;}if(o.nodeType&&o.cloneNode){return o.cloneNode(true);}if(o instanceof Date){return new Date(o.getTime());}var r=new o.constructor();for(var i in o){if(!(i in r)||r[i]!=o[i]){r[i]=dojo.clone(o[i]);}}return r;};dojo.trim=function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");dojo.declare=function(_bf,_c0,_c1){var dd=arguments.callee,_c3;if(dojo.isArray(_c0)){_c3=_c0;_c0=_c3.shift();}if(_c3){dojo.forEach(_c3,function(m){if(!m){throw (_bf+": mixin #"+i+" is null");}_c0=dd._delegate(_c0,m);});}var _c5=(_c1||0).constructor,_c6=dd._delegate(_c0),fn;for(var i in _c1){if(dojo.isFunction(fn=_c1[i])&&!0[i]){fn.nom=i;}}dojo.extend(_c6,{declaredClass:_bf,_constructor:_c5,preamble:null},_c1||0);_c6.prototype.constructor=_c6;return dojo.setObject(_bf,_c6);};dojo.mixin(dojo.declare,{_delegate:function(_c9,_ca){var bp=(_c9||0).prototype,mp=(_ca||0).prototype;var _cd=dojo.declare._makeCtor();dojo.mixin(_cd,{superclass:bp,mixin:mp,extend:dojo.declare._extend});if(_c9){_cd.prototype=dojo._delegate(bp);}dojo.extend(_cd,dojo.declare._core,mp||0,{_constructor:null,preamble:null});_cd.prototype.constructor=_cd;_cd.prototype.declaredClass=(bp||0).declaredClass+"_"+(mp||0).declaredClass;return _cd;},_extend:function(_ce){for(var i in _ce){if(dojo.isFunction(fn=_ce[i])&&!0[i]){fn.nom=i;}}dojo.extend(this,_ce);},_makeCtor:function(){return function(){this._construct(arguments);};},_core:{_construct:function(_d0){var c=_d0.callee,s=c.superclass,ct=s&&s.constructor,m=c.mixin,mct=m&&m.constructor,a=_d0,ii,fn;if(a[0]){if(((fn=a[0].preamble))){a=fn.apply(this,a)||a;}}if((fn=c.prototype.preamble)){a=fn.apply(this,a)||a;}if(ct&&ct.apply){ct.apply(this,a);}if(mct&&mct.apply){mct.apply(this,a);}if((ii=c.prototype._constructor)){ii.apply(this,_d0);}if(this.constructor.prototype==c.prototype&&(ct=this.postscript)){ct.apply(this,_d0);}},_findMixin:function(_d9){var c=this.constructor,p,m;while(c){p=c.superclass;m=c.mixin;if(m==_d9||(m instanceof _d9.constructor)){return p;}if(m&&(m=m._findMixin(_d9))){return m;}c=p&&p.constructor;}},_findMethod:function(_dd,_de,_df,has){var p=_df,c,m,f;do{c=p.constructor;m=c.mixin;if(m&&(m=this._findMethod(_dd,_de,m,has))){return m;}if((f=p[_dd])&&(has==(f==_de))){return p;}p=c.superclass;}while(p);return !has&&(p=this._findMixin(_df))&&this._findMethod(_dd,_de,p,has);},inherited:function(_e5,_e6,_e7){var a=arguments;if(!dojo.isString(a[0])){_e7=_e6;_e6=_e5;_e5=_e6.callee.nom;}a=_e7||_e6;var c=_e6.callee,p=this.constructor.prototype,fn,mp;if(this[_e5]!=c||p[_e5]==c){mp=this._findMethod(_e5,c,p,true);if(!mp){throw (this.declaredClass+": inherited method \""+_e5+"\" mismatch");}p=this._findMethod(_e5,c,mp,false);}fn=p&&p[_e5];if(!fn){throw (mp.declaredClass+": inherited method \""+_e5+"\" not found");}return fn.apply(this,a);}}});}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);for(var i in ls){if(!(i in ap)){ls[i].apply(this,arguments);}}return r;};},add:function(_f3,_f4,_f5){_f3=_f3||dojo.global;var f=_f3[_f4];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=_f3[_f4]=d;}return f._listeners.push(_f5);},remove:function(_f8,_f9,_fa){var f=(_f8||dojo.global)[_f9];if(f&&f._listeners&&_fa--){delete f._listeners[_fa];}}};dojo.connect=function(obj,_fd,_fe,_ff,_100){var a=arguments,args=[],i=0;args.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];args.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){args.push(a[i]);}return dojo._connect.apply(this,args);};dojo._connect=function(obj,_106,_107,_108){var l=dojo._listener,h=l.add(obj,_106,dojo.hitch(_107,_108));return [obj,_106,h,l];};dojo.disconnect=function(_10b){if(_10b&&_10b[0]!==undefined){dojo._disconnect.apply(this,_10b);delete _10b[0];}};dojo._disconnect=function(obj,_10d,_10e,_10f){_10f.remove(obj,_10d,_10e);};dojo._topics={};dojo.subscribe=function(_110,_111,_112){return [_110,dojo._listener.add(dojo._topics,_110,dojo.hitch(_111,_112))];};dojo.unsubscribe=function(_113){if(_113){dojo._listener.remove(dojo._topics,_113[0],_113[1]);}};dojo.publish=function(_114,args){var f=dojo._topics[_114];if(f){f.apply(this,args||[]);}};dojo.connectPublisher=function(_117,obj,_119){var pf=function(){dojo.publish(_117,arguments);};return (_119)?dojo.connect(obj,_119,pf):dojo.connect(obj,pf);};}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");dojo.Deferred=function(_11b){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=_11b;this.silentlyCancelled=false;};dojo.extend(dojo.Deferred,{_nextId:(function(){var n=1;return function(){return n++;};})(),cancel:function(){var err;if(this.fired==-1){if(this.canceller){err=this.canceller(this);}else{this.silentlyCancelled=true;}if(this.fired==-1){if(!(err instanceof Error)){var res=err;err=new Error("Deferred Cancelled");err.dojoType="cancel";err.cancelResult=res;}this.errback(err);}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel();}}},_resback:function(res){this.fired=((res instanceof Error)?1:0);this.results[this.fired]=res;this._fire();},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){throw new Error("already called!");}this.silentlyCancelled=false;return;}},callback:function(res){this._check();this._resback(res);},errback:function(res){this._check();if(!(res instanceof Error)){res=new Error(res);}this._resback(res);},addBoth:function(cb,cbfn){var _124=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(_124,_124);},addCallback:function(cb,cbfn){return this.addCallbacks(dojo.hitch.apply(dojo,arguments));},addErrback:function(cb,cbfn){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));},addCallbacks:function(cb,eb){this.chain.push([cb,eb]);if(this.fired>=0){this._fire();}return this;},_fire:function(){var _12b=this.chain;var _12c=this.fired;var res=this.results[_12c];var self=this;var cb=null;while((_12b.length>0)&&(this.paused==0)){var f=_12b.shift()[_12c];if(!f){continue;}try{res=f(res);_12c=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){self._resback(res);self.paused--;if((self.paused==0)&&(self.fired>=0)){self._fire();}};this.paused++;}}catch(err){console.debug(err);_12c=1;res=err;}}this.fired=_12c;this.results[_12c]=res;if((cb)&&(this.paused)){res.addBoth(cb);}}});}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(json){return eval("("+json+")");};dojo._escapeString=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_135,_136){if(it===undefined){return "undefined";}var _137=typeof it;if(_137=="number"||_137=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}if(it.nodeType&&it.cloneNode){return "";}var _138=arguments.callee;var _139;_136=_136||"";var _13a=_135?_136+dojo.toJsonIndentStr:"";if(typeof it.__json__=="function"){_139=it.__json__();if(it!==_139){return _138(_139,_135,_13a);}}if(typeof it.json=="function"){_139=it.json();if(it!==_139){return _138(_139,_135,_13a);}}var sep=_135?" ":"";var _13c=_135?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_138(obj,_135,_13a);if(typeof val!="string"){val="undefined";}return _13c+_13a+val;});return "["+res.join(","+sep)+_13c+_136+"]";}if(_137=="function"){return null;}var _140=[];for(var key in it){var _142;if(typeof key=="number"){_142="\""+key+"\"";}else{if(typeof key=="string"){_142=dojo._escapeString(key);}else{continue;}}val=_138(it[key],_135,_13a);if(typeof val!="string"){continue;}_140.push(_13c+_13a+_142+":"+sep+val);}return "{"+_140.join(","+sep)+_13c+_136+"}";};}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _143=function(arr,obj,cb){return [dojo.isString(arr)?arr.split(""):arr,obj||dojo.global,dojo.isString(cb)?new Function("item","index","array",cb):cb];};dojo.mixin(dojo,{indexOf:function(_147,_148,_149,_14a){var step=1,end=_147.length||0,i=0;if(_14a){i=end-1;step=end=-1;}if(_149!=undefined){i=_149;}if((_14a&&i>end)||i<end){for(;i!=end;i+=step){if(_147[i]==_148){return i;}}}return -1;},lastIndexOf:function(_14d,_14e,_14f){return dojo.indexOf(_14d,_14e,_14f,true);},forEach:function(arr,_151,_152){if(!arr||!arr.length){return;}var _p=_143(arr,_152,_151);arr=_p[0];for(var i=0,l=_p[0].length;i<l;i++){_p[2].call(_p[1],arr[i],i,arr);}},_everyOrSome:function(_156,arr,_158,_159){var _p=_143(arr,_159,_158);arr=_p[0];for(var i=0,l=arr.length;i<l;i++){var _15d=!!_p[2].call(_p[1],arr[i],i,arr);if(_156^_15d){return _15d;}}return _156;},every:function(arr,_15f,_160){return this._everyOrSome(true,arr,_15f,_160);},some:function(arr,_162,_163){return this._everyOrSome(false,arr,_162,_163);},map:function(arr,_165,_166){var _p=_143(arr,_166,_165);arr=_p[0];var _168=(arguments[3]?(new arguments[3]()):[]);for(var i=0;i<arr.length;++i){_168.push(_p[2].call(_p[1],arr[i],i,arr));}return _168;},filter:function(arr,_16b,_16c){var _p=_143(arr,_16c,_16b);arr=_p[0];var _16e=[];for(var i=0;i<arr.length;i++){if(_p[2].call(_p[1],arr[i],i,arr)){_16e.push(arr[i]);}}return _16e;}});})();}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");dojo.Color=function(_170){if(_170){this.setColor(_170);}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_176){var d=dojo;if(d.isString(_176)){d.colorFromString(_176,this);}else{if(d.isArray(_176)){d.colorFromArray(_176,this);}else{this._set(_176.r,_176.g,_176.b,_176.a);if(!(_176 instanceof d.Color)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=dojo.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_17d){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_17d?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});dojo.blendColors=function(_180,end,_182,obj){var d=dojo,t=obj||new dojo.Color();d.forEach(["r","g","b","a"],function(x){t[x]=_180[x]+(end[x]-_180[x])*_182;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};dojo.colorFromRgb=function(_187,obj){var m=_187.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj);};dojo.colorFromHex=function(_18a,obj){var d=dojo,t=obj||new d.Color(),bits=(_18a.length==4)?4:8,mask=(1<<bits)-1;_18a=Number("0x"+_18a.substr(1));if(isNaN(_18a)){return null;}d.forEach(["b","g","r"],function(x){var c=_18a&mask;_18a>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};dojo.colorFromArray=function(a,obj){var t=obj||new dojo.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};dojo.colorFromString=function(str,obj){var a=dojo.Color.named[str];return a&&dojo.colorFromArray(a,obj)||dojo.colorFromRgb(str,obj)||dojo.colorFromHex(str,obj);};}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base");}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo._gearsObject=function(){var _198;var _199;var _19a=dojo.getObject("google.gears");if(_19a){return _19a;}if(typeof GearsFactory!="undefined"){_198=new GearsFactory();}else{if(dojo.isIE){try{_198=new ActiveXObject("Gears.Factory");}catch(e){}}else{if(navigator.mimeTypes["application/x-googlegears"]){_198=document.createElement("object");_198.setAttribute("type","application/x-googlegears");_198.setAttribute("width",0);_198.setAttribute("height",0);_198.style.display="none";document.documentElement.appendChild(_198);}}}if(!_198){return null;}dojo.setObject("google.gears.factory",_198);return dojo.getObject("google.gears");};dojo.isGears=(!!dojo._gearsObject())||0;dojo.doc=window["document"]||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.setContext=function(_19b,_19c){dojo.global=_19b;dojo.doc=_19c;};dojo._fireCallback=function(_19d,_19e,_19f){if(_19e&&dojo.isString(_19d)){_19d=_19e[_19d];}return _19d.apply(_19e,_19f||[]);};dojo.withGlobal=function(_1a0,_1a1,_1a2,_1a3){var rval;var _1a5=dojo.global;var _1a6=dojo.doc;try{dojo.setContext(_1a0,_1a0.document);rval=dojo._fireCallback(_1a1,_1a2,_1a3);}finally{dojo.setContext(_1a5,_1a6);}return rval;};dojo.withDoc=function(_1a7,_1a8,_1a9,_1aa){var rval;var _1ac=dojo.doc;try{dojo.doc=_1a7;rval=dojo._fireCallback(_1a8,_1a9,_1aa);}finally{dojo.doc=_1ac;}return rval;};}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return;}name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);var _1b1=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_1b5,_1b6){if(node){node.removeEventListener(del._normalizeEventName(_1b5),_1b6,false);}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name;},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this));};},_fixEvent:function(evt,_1bc){switch(evt.type){case "keypress":del._setKeyChar(evt);break;}return evt;},_setKeyChar:function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";}});dojo.fixEvent=function(evt,_1bf){return del._fixEvent(evt,_1bf);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _1c1=dojo._listener;dojo._connect=function(obj,_1c3,_1c4,_1c5,_1c6){var _1c7=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=!_1c7?0:(!_1c6?1:2),l=[dojo._listener,del,_1c1][lid];var h=l.add(obj,_1c3,dojo.hitch(_1c4,_1c5));return [obj,_1c3,h,lid];};dojo._disconnect=function(obj,_1cc,_1cd,_1ce){([dojo._listener,del,_1c1][_1ce]).remove(obj,_1cc,_1cd);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145};if(dojo.isIE){var _1cf=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;if(!dojo.config._allow_leaks){_1c1=iel=dojo._ie_listener={handlers:[],add:function(_1d3,_1d4,_1d5){_1d3=_1d3||dojo.global;var f=_1d3[_1d4];if(!f||!f._listeners){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d._listeners=[];f=_1d3[_1d4]=d;}return f._listeners.push(ieh.push(_1d5)-1);},remove:function(_1d9,_1da,_1db){var f=(_1d9||dojo.global)[_1da],l=f&&f._listeners;if(f&&l&&_1db--){delete ieh[l[_1db]];delete l[_1db];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_1df,fp){if(!node){return;}_1df=del._normalizeEventName(_1df);if(_1df=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd._listeners||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1;}else{kd._stealthKeydownRefs++;}}return iel.add(node,_1df,del._fixCallback(fp));},remove:function(node,_1e4,_1e5){_1e4=del._normalizeEventName(_1e4);iel.remove(node,_1e4,_1e5);if(_1e4=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_1e7){return _1e7.slice(0,2)!="on"?"on"+_1e7:_1e7;},_nop:function(){},_fixEvent:function(evt,_1e9){if(!evt){var w=_1e9&&(_1e9.ownerDocument||_1e9.document||_1e9).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_1e9||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _1ed=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _1ee=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_1ed.scrollLeft||0)-_1ee.x;evt.pageY=evt.clientY+(_1ed.scrollTop||0)-_1ee.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;return del._fixKeys(evt);},_fixKeys:function(evt){switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;del._setKeyChar(evt);break;}return evt;},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp._listeners){return;}var k=evt.keyCode;var _1f4=(k!=13)&&(k!=32)&&(k!=27)&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_1f4||evt.ctrlKey){var c=_1f4?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);evt.cancelBubble=faux.cancelBubble;evt.returnValue=faux.returnValue;_1cf(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_1cf(this,0);}this.returnValue=false;}});dojo.stopEvent=function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt);};}del._synthesizeEvent=function(evt,_1f9){var faux=dojo.mixin({},evt,_1f9);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_1fc){switch(evt.type){case "keypress":var c=evt.which;if(c==3){c=99;}c=((c<41)&&(!evt.shiftKey)?0:c);if((evt.ctrlKey)&&(!evt.shiftKey)&&(c>=65)&&(c<=90)){c+=32;}return del._synthesizeEvent(evt,{charCode:c});}return evt;}});}if(dojo.isSafari){dojo.mixin(del,{_fixEvent:function(evt,_1ff){switch(evt.type){case "keypress":var c=evt.charCode,s=evt.shiftKey,k=evt.keyCode;k=k||_203[evt.keyIdentifier]||0;if(evt.keyIdentifier=="Enter"){c=0;}else{if((evt.ctrlKey)&&(c>0)&&(c<27)){c+=96;}else{if(c==dojo.keys.SHIFT_TAB){c=dojo.keys.TAB;s=true;}else{c=(c>=32&&c<63232?c:0);}}}return del._synthesizeEvent(evt,{charCode:c,shiftKey:s,keyCode:k});}return evt;}});dojo.mixin(dojo.keys,{SHIFT_TAB:25,UP_ARROW:63232,DOWN_ARROW:63233,LEFT_ARROW:63234,RIGHT_ARROW:63235,F1:63236,F2:63237,F3:63238,F4:63239,F5:63240,F6:63241,F7:63242,F8:63243,F9:63244,F10:63245,F11:63246,F12:63247,PAUSE:63250,DELETE:63272,HOME:63273,END:63275,PAGE_UP:63276,PAGE_DOWN:63277,INSERT:63302,PRINT_SCREEN:63248,SCROLL_LOCK:63249,NUM_LOCK:63289});var dk=dojo.keys,_203={"Up":dk.UP_ARROW,"Down":dk.DOWN_ARROW,"Left":dk.LEFT_ARROW,"Right":dk.RIGHT_ARROW,"PageUp":dk.PAGE_UP,"PageDown":dk.PAGE_DOWN};}})();if(dojo.isIE){dojo._ieDispatcher=function(args,_206){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c._listeners,t=h[c.target];var r=t&&t.apply(_206,args);for(var i in ls){if(!(i in ap)){h[ls[i]].apply(_206,args);}}return r;};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this));};};}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}if(dojo.isIE||dojo.isOpera){dojo.byId=function(id,doc){if(dojo.isString(id)){var _d=doc||dojo.doc;var te=_d.getElementById(id);if(te&&te.attributes.id.value==id){return te;}else{var eles=_d.all[id];if(!eles||!eles.length){return eles;}var i=0;while((te=eles[i++])){if(te.attributes.id.value==id){return te;}}}}else{return id;}};}else{dojo.byId=function(id,doc){return dojo.isString(id)?(doc||dojo.doc).getElementById(id):id;};}(function(){var d=dojo;var _21a=null;dojo.addOnUnload(function(){_21a=null;});dojo._destroyElement=function(node){node=d.byId(node);try{if(!_21a){_21a=document.createElement("div");}_21a.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_21a.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_21d){try{node=d.byId(node);_21d=d.byId(_21d);while(node){if(node===_21d){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_21f){node=d.byId(node);if(d.isMozilla){node.style.MozUserSelect=_21f?"":"none";}else{if(d.isKhtml){node.style.KhtmlUserSelect=_21f?"auto":"none";}else{if(d.isIE){node.unselectable=_21f?"":"on";d.query("*",node).forEach(function(_220){_220.unselectable=_21f?"":"on";});}}}};var _221=function(node,ref){ref.parentNode.insertBefore(node,ref);return true;};var _224=function(node,ref){var pn=ref.parentNode;if(ref==pn.lastChild){pn.appendChild(node);}else{return _221(node,ref.nextSibling);}return true;};dojo.place=function(node,_229,_22a){if(!node||!_229||_22a===undefined){return false;}node=d.byId(node);_229=d.byId(_229);if(typeof _22a=="number"){var cn=_229.childNodes;if((_22a==0&&cn.length==0)||cn.length==_22a){_229.appendChild(node);return true;}if(_22a==0){return _221(node,_229.firstChild);}return _224(node,cn[_22a-1]);}switch(_22a.toLowerCase()){case "before":return _221(node,_229);case "after":return _224(node,_229);case "first":if(_229.firstChild){return _221(node,_229.firstChild);}default:_229.appendChild(node);return true;}};dojo.boxModel="content-box";if(d.isIE){var _dcm=document.compatMode;d.boxModel=_dcm=="BackCompat"||_dcm=="QuirksMode"||d.isIE<6?"border-box":"content-box";}var gcs,dv=document.defaultView;if(d.isSafari){gcs=function(node){var s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}return s||{};};}else{if(d.isIE){gcs=function(node){return node.currentStyle;};}else{gcs=function(node){return dv.getComputedStyle(node,null);};}}dojo.getComputedStyle=gcs;if(!d.isIE){dojo._toPixelValue=function(_233,_234){return parseFloat(_234)||0;};}else{dojo._toPixelValue=function(_235,_236){if(!_236){return 0;}if(_236=="medium"){return 4;}if(_236.slice&&(_236.slice(-2)=="px")){return parseFloat(_236);}with(_235){var _237=style.left;var _238=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_236;_236=style.pixelLeft;}catch(e){_236=0;}style.left=_237;runtimeStyle.left=_238;}return _236;};}var px=d._toPixelValue;dojo._getOpacity=d.isIE?function(node){try{return node.filters.alpha.opacity/100;}catch(e){return 1;}}:function(node){return gcs(node).opacity;};dojo._setOpacity=d.isIE?function(node,_23d){if(_23d==1){var _23e=/FILTER:[^;]*;?/i;node.style.cssText=node.style.cssText.replace(_23e,"");if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){i.style.cssText=i.style.cssText.replace(_23e,"");});}}else{var o="Alpha(Opacity="+_23d*100+")";node.style.filter=o;}if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){i.style.filter=o;});}return _23d;}:function(node,_243){return node.style.opacity=_243;};var _244={left:true,top:true};var _245=/margin|padding|width|height|max|min|offset/;var _246=function(node,type,_249){type=type.toLowerCase();if(d.isIE&&_249=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(!(type in _244)){_244[type]=_245.test(type);}return _244[type]?px(node,_249):_249;};var _24a=d.isIE?"styleFloat":"cssFloat";var _24b={"cssFloat":_24a,"styleFloat":_24a,"float":_24a};dojo.style=function(node,_24d,_24e){var n=d.byId(node),args=arguments.length,op=(_24d=="opacity");_24d=_24b[_24d]||_24d;if(args==3){return op?d._setOpacity(n,_24e):n.style[_24d]=_24e;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&!d.isString(_24d)){for(var x in _24d){d.style(node,x,_24d[x]);}return s;}return (args==1)?s:_246(n,_24d,s[_24d]);};dojo._getPadExtents=function(n,_255){var s=_255||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};};dojo._getBorderExtents=function(n,_25a){var ne="none",s=_25a||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};};dojo._getPadBorderExtents=function(n,_260){var s=_260||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};};dojo._getMarginExtents=function(n,_265){var s=_265||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isSafari&&(s.position!="absolute")){r=l;}return {l:l,t:t,w:l+r,h:t+b};};dojo._getMarginBox=function(node,_26c){var s=_26c||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{var p=node.parentNode;if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else{if(d.isOpera){var p=node.parentNode;if(p){var be=d._getBorderExtents(p);l-=be.l,t-=be.t;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getContentBox=function(node,_277){var s=_277||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight;}else{h=node.clientHeight,be.w=be.h=0;}if(d.isOpera){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};dojo._getBorderBox=function(node,_27e){var s=_27e||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||n=="BUTTON";};dojo._setContentSize=function(node,_28c,_28d,_28e){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_28e);if(_28c>=0){_28c+=pb.w;}if(_28d>=0){_28d+=pb.h;}}d._setBox(node,NaN,NaN,_28c,_28d);};dojo._setMarginBox=function(node,_291,_292,_293,_294,_295){var s=_295||gcs(node);var bb=d._usesBorderBox(node),pb=bb?_299:d._getPadBorderExtents(node,s),mb=d._getMarginExtents(node,s);if(_293>=0){_293=Math.max(_293-pb.w-mb.w,0);}if(_294>=0){_294=Math.max(_294-pb.h-mb.h,0);}d._setBox(node,_291,_292,_293,_294);};var _299={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=d.byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);};dojo.contentBox=function(node,box){var n=dojo.byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _2a5=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_2a9=0,_b=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_2a9+=val-0;if(node==_b){break;}}node=node.parentNode;}return _2a9;};dojo._docScroll=function(){var _b=d.body(),_w=d.global,de=d.doc.documentElement;return {y:(_w.pageYOffset||de.scrollTop||_b.scrollTop||0),x:(_w.pageXOffset||d._fixIeBiDiScrollLeft(de.scrollLeft)||_b.scrollLeft||0)};};dojo._isBodyLtr=function(){return !("_bodyLtr" in d)?d._bodyLtr=gcs(d.body()).direction=="ltr":d._bodyLtr;};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;return (d.isIE>=7)?{x:de.getBoundingClientRect().left,y:de.getBoundingClientRect().top}:{x:d._isBodyLtr()||window.parent==window?de.clientLeft:de.offsetWidth-de.clientWidth-de.clientLeft,y:de.clientTop};};dojo._fixIeBiDiScrollLeft=function(_2af){var dd=d.doc;if(d.isIE&&!dojo._isBodyLtr()){var de=dd.compatMode=="BackCompat"?dd.body:dd.documentElement;return _2af+de.clientWidth-de.scrollWidth;}return _2af;};dojo._abs=function(node,_2b3){var _2b4=node.ownerDocument;var ret={x:0,y:0};var db=d.body();if(d.isIE||(d.isFF>=3)){var _2b7=node.getBoundingClientRect();var _2b8=(d.isIE)?d._getIeDocumentElementOffset():{x:0,y:0};ret.x=_2b7.left-_2b8.x;ret.y=_2b7.top-_2b8.y;}else{if(_2b4["getBoxObjectFor"]){var bo=_2b4.getBoxObjectFor(node),b=d._getBorderExtents(node);ret.x=bo.x-b.l-_2a5(node,"scrollLeft");ret.y=bo.y-b.t-_2a5(node,"scrollTop");}else{if(node["offsetParent"]){var _2bb;if(d.isSafari&&(gcs(node).position=="absolute")&&(node.parentNode==db)){_2bb=db;}else{_2bb=db.parentNode;}if(node.parentNode!=db){var nd=node;if(d.isOpera){nd=db;}ret.x-=_2a5(nd,"scrollLeft");ret.y-=_2a5(nd,"scrollTop");}var _2bd=node;do{var n=_2bd.offsetLeft;if(!d.isOpera||n>0){ret.x+=isNaN(n)?0:n;}var t=_2bd.offsetTop;ret.y+=isNaN(t)?0:t;if(d.isSafari&&_2bd!=node){var cs=gcs(_2bd);ret.x+=px(_2bd,cs.borderLeftWidth);ret.y+=px(_2bd,cs.borderTopWidth);}_2bd=_2bd.offsetParent;}while((_2bd!=_2bb)&&_2bd);}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}}}if(_2b3){var _2c1=d._docScroll();ret.y+=_2c1.y;ret.x+=_2c1.x;}return ret;};dojo.coords=function(node,_2c3){var n=d.byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d._abs(n,_2c3);mb.x=abs.x;mb.y=abs.y;return mb;};var _2c8=function(name){switch(name.toLowerCase()){case "tabindex":return (d.isIE&&d.isIE<8)?"tabIndex":"tabindex";default:return name;}};var _2ca={colspan:"colSpan",enctype:"enctype",frameborder:"frameborder",method:"method",rowspan:"rowSpan",scrolling:"scrolling",shape:"shape",span:"span",type:"type",valuetype:"valueType"};dojo.hasAttr=function(node,name){var attr=d.byId(node).getAttributeNode(_2c8(name));return attr?attr.specified:false;};var _2ce={};var _ctr=0;var _2d0=dojo._scopeName+"attrid";dojo.attr=function(node,name,_2d3){var args=arguments.length;if(args==2&&!d.isString(name)){for(var x in name){d.attr(node,x,name[x]);}return;}node=d.byId(node);name=_2c8(name);if(args==3){if(d.isFunction(_2d3)){var _2d6=d.attr(node,_2d0);if(!_2d6){_2d6=_ctr++;d.attr(node,_2d0,_2d6);}if(!_2ce[_2d6]){_2ce[_2d6]={};}var h=_2ce[_2d6][name];if(h){d.disconnect(h);}else{try{delete node[name];}catch(e){}}_2ce[_2d6][name]=d.connect(node,name,_2d3);}else{if(typeof _2d3=="boolean"){node[name]=_2d3;}else{node.setAttribute(name,_2d3);}}return;}else{var prop=_2ca[name.toLowerCase()];if(prop){return node[prop];}else{var _2d3=node[name];return (typeof _2d3=="boolean"||typeof _2d3=="function")?_2d3:(d.hasAttr(node,name)?node.getAttribute(name):null);}}};dojo.removeAttr=function(node,name){d.byId(node).removeAttribute(_2c8(name));};})();dojo.hasClass=function(node,_2dc){return ((" "+dojo.byId(node).className+" ").indexOf(" "+_2dc+" ")>=0);};dojo.addClass=function(node,_2de){node=dojo.byId(node);var cls=node.className;if((" "+cls+" ").indexOf(" "+_2de+" ")<0){node.className=cls+(cls?" ":"")+_2de;}};dojo.removeClass=function(node,_2e1){node=dojo.byId(node);var t=dojo.trim((" "+node.className+" ").replace(" "+_2e1+" "," "));if(node.className!=t){node.className=t;}};dojo.toggleClass=function(node,_2e4,_2e5){if(_2e5===undefined){_2e5=!dojo.hasClass(node,_2e4);}dojo[_2e5?"addClass":"removeClass"](node,_2e4);};}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var tnl=function(arr){arr.constructor=dojo.NodeList;dojo._mixin(arr,dojo.NodeList.prototype);return arr;};var _2e9=function(func,_2eb){return function(){var _a=arguments;var aa=d._toArray(_a,0,[null]);var s=this.map(function(i){aa[0]=i;return d[func].apply(d,aa);});return (_2eb||((_a.length>1)||!d.isString(_a[0])))?this:s;};};dojo.NodeList=function(){return tnl(Array.apply(null,arguments));};dojo.NodeList._wrap=tnl;dojo.extend(dojo.NodeList,{slice:function(){var a=dojo._toArray(arguments);return tnl(a.slice.apply(this,a));},splice:function(){var a=dojo._toArray(arguments);return tnl(a.splice.apply(this,a));},concat:function(){var a=dojo._toArray(arguments,0,[this]);return tnl(a.concat.apply([],a));},indexOf:function(_2f3,_2f4){return d.indexOf(this,_2f3,_2f4);},lastIndexOf:function(){return d.lastIndexOf.apply(d,d._toArray(arguments,0,[this]));},every:function(_2f5,_2f6){return d.every(this,_2f5,_2f6);},some:function(_2f7,_2f8){return d.some(this,_2f7,_2f8);},map:function(func,obj){return d.map(this,func,obj,d.NodeList);},forEach:function(_2fb,_2fc){d.forEach(this,_2fb,_2fc);return this;},coords:function(){return d.map(this,d.coords);},attr:_2e9("attr"),style:_2e9("style"),addClass:_2e9("addClass",true),removeClass:_2e9("removeClass",true),toggleClass:_2e9("toggleClass",true),connect:_2e9("connect",true),place:function(_2fd,_2fe){var item=d.query(_2fd)[0];return this.forEach(function(i){d.place(i,item,(_2fe||"last"));});},orphan:function(_301){var _302=_301?d._filterQueryResult(this,_301):this;_302.forEach(function(item){if(item.parentNode){item.parentNode.removeChild(item);}});return _302;},adopt:function(_304,_305){var item=this[0];return d.query(_304).forEach(function(ai){d.place(ai,item,_305||"last");});},query:function(_308){if(!_308){return this;}var ret=d.NodeList();this.forEach(function(item){d.query(_308,item).forEach(function(_30b){if(_30b!==undefined){ret.push(_30b);}});});return ret;},filter:function(_30c){var _30d=this;var _a=arguments;var r=d.NodeList();var rp=function(t){if(t!==undefined){r.push(t);}};if(d.isString(_30c)){_30d=d._filterQueryResult(this,_a[0]);if(_a.length==1){return _30d;}_a.shift();}d.forEach(d.filter(_30d,_a[0],_a[1]),rp);return r;},addContent:function(_312,_313){var ta=d.doc.createElement("span");if(d.isString(_312)){ta.innerHTML=_312;}else{ta.appendChild(_312);}if(_313===undefined){_313="last";}var ct=(_313=="first"||_313=="after")?"lastChild":"firstChild";this.forEach(function(item){var tn=ta.cloneNode(true);while(tn[ct]){d.place(tn[ct],item,_313);}});return this;},empty:function(){return this.forEach("item.innerHTML='';");},instantiate:function(_318,_319){var c=d.isFunction(_318)?_318:d.getObject(_318);return this.forEach(function(i){new c(_319||{},i);});}});d.forEach(["blur","focus","click","keydown","keypress","keyup","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup"],function(evt){var _oe="on"+evt;dojo.NodeList.prototype[_oe]=function(a,b){return this.connect(_oe,a,b);};});})();}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;dojo.provide("dojo._base.query");(function(){var d=dojo;var _321=dojo.isIE?"children":"childNodes";var _322=false;var _323=function(_324){if(">~+".indexOf(_324.charAt(_324.length-1))>=0){_324+=" *";}_324+=" ";var ts=function(s,e){return d.trim(_324.slice(s,e));};var _328=[];var _329=-1;var _32a=-1;var _32b=-1;var _32c=-1;var _32d=-1;var inId=-1;var _32f=-1;var lc="";var cc="";var _332;var x=0;var ql=_324.length;var _335=null;var _cp=null;var _337=function(){if(_32f>=0){var tv=(_32f==x)?null:ts(_32f,x).toLowerCase();_335[(">~+".indexOf(tv)<0)?"tag":"oper"]=tv;_32f=-1;}};var _339=function(){if(inId>=0){_335.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _33a=function(){if(_32d>=0){_335.classes.push(ts(_32d+1,x).replace(/\\/g,""));_32d=-1;}};var _33b=function(){_339();_337();_33a();};for(;lc=cc,cc=_324.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_335){_332=x;_335={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null};_32f=x;}if(_329>=0){if(cc=="]"){if(!_cp.attr){_cp.attr=ts(_329+1,x);}else{_cp.matchFor=ts((_32b||_329+1),x);}var cmf=_cp.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_cp.matchFor=cmf.substring(1,cmf.length-1);}}_335.attrs.push(_cp);_cp=null;_329=_32b=-1;}else{if(cc=="="){var _33d=("|~^$*".indexOf(lc)>=0)?lc:"";_cp.type=_33d+cc;_cp.attr=ts(_329+1,x-_33d.length);_32b=x+1;}}}else{if(_32a>=0){if(cc==")"){if(_32c>=0){_cp.value=ts(_32a+1,x);}_32c=_32a=-1;}}else{if(cc=="#"){_33b();inId=x+1;}else{if(cc=="."){_33b();_32d=x;}else{if(cc==":"){_33b();_32c=x;}else{if(cc=="["){_33b();_329=x;_cp={};}else{if(cc=="("){if(_32c>=0){_cp={name:ts(_32c+1,x),value:null};_335.pseudos.push(_cp);}_32a=x;}else{if(cc==" "&&lc!=cc){_33b();if(_32c>=0){_335.pseudos.push({name:ts(_32c+1,x)});}_335.hasLoops=(_335.pseudos.length||_335.attrs.length||_335.classes.length);_335.query=ts(_332,x);_335.tag=(_335["oper"])?null:(_335.tag||"*");_328.push(_335);_335=null;}}}}}}}}}return _328;};var _33e={"*=":function(attr,_340){return "[contains(@"+attr+", '"+_340+"')]";},"^=":function(attr,_342){return "[starts-with(@"+attr+", '"+_342+"')]";},"$=":function(attr,_344){return "[substring(@"+attr+", string-length(@"+attr+")-"+(_344.length-1)+")='"+_344+"']";},"~=":function(attr,_346){return "[contains(concat(' ',@"+attr+",' '), ' "+_346+" ')]";},"|=":function(attr,_348){return "[contains(concat(' ',@"+attr+",' '), ' "+_348+"-')]";},"=":function(attr,_34a){return "[@"+attr+"='"+_34a+"']";}};var _34b=function(_34c,_34d,_34e,_34f){d.forEach(_34d.attrs,function(attr){var _351;if(attr.type&&_34c[attr.type]){_351=_34c[attr.type](attr.attr,attr.matchFor);}else{if(attr.attr.length){_351=_34e(attr.attr);}}if(_351){_34f(_351);}});};var _352=function(_353){var _354=".";var _355=_323(d.trim(_353));while(_355.length){var tqp=_355.shift();var _357;var _358="";if(tqp.oper==">"){_357="/";tqp=_355.shift();}else{if(tqp.oper=="~"){_357="/following-sibling::";tqp=_355.shift();}else{if(tqp.oper=="+"){_357="/following-sibling::";_358="[position()=1]";tqp=_355.shift();}else{_357="//";}}}_354+=_357+tqp.tag+_358;if(tqp.id){_354+="[@id='"+tqp.id+"'][1]";}d.forEach(tqp.classes,function(cn){var cnl=cn.length;var _35b=" ";if(cn.charAt(cnl-1)=="*"){_35b="";cn=cn.substr(0,cnl-1);}_354+="[contains(concat(' ',@class,' '), ' "+cn+_35b+"')]";});_34b(_33e,tqp,function(_35c){return "[@"+_35c+"]";},function(_35d){_354+=_35d;});}return _354;};var _35e={};var _35f=function(path){if(_35e[path]){return _35e[path];}var doc=d.doc;var _362=_352(path);var tf=function(_364){var ret=[];var _366;try{_366=doc.evaluate(_362,_364,null,XPathResult.ANY_TYPE,null);}catch(e){console.debug("failure in exprssion:",_362,"under:",_364);console.debug(e);}var _367=_366.iterateNext();while(_367){ret.push(_367);_367=_366.iterateNext();}return ret;};return _35e[path]=tf;};var _368={};var _369={};var _36a=function(_36b,_36c){if(!_36b){return _36c;}if(!_36c){return _36b;}return function(){return _36b.apply(window,arguments)&&_36c.apply(window,arguments);};};var _36d=function(root){var ret=[];var te,x=0,tret=root[_321];while(te=tret[x++]){if(te.nodeType==1){ret.push(te);}}return ret;};var _373=function(root,_375){var ret=[];var te=root;while(te=te.nextSibling){if(te.nodeType==1){ret.push(te);if(_375){break;}}}return ret;};var _378=function(_379,_37a,_37b,idx){var nidx=idx+1;var _37e=(_37a.length==nidx);var tqp=_37a[idx];if(tqp.oper){var ecn=(tqp.oper==">")?_36d(_379):_373(_379,(tqp.oper=="+"));if(!ecn||!ecn.length){return;}nidx++;_37e=(_37a.length==nidx);var tf=_382(_37a[idx+1]);for(var x=0,ecnl=ecn.length,te;x<ecnl,te=ecn[x];x++){if(tf(te)){if(_37e){_37b.push(te);}else{_378(te,_37a,_37b,nidx);}}}}var _386=_387(tqp)(_379);if(_37e){while(_386.length){_37b.push(_386.shift());}}else{while(_386.length){_378(_386.shift(),_37a,_37b,nidx);}}};var _388=function(_389,_38a){var ret=[];var x=_389.length-1,te;while(te=_389[x--]){_378(te,_38a,ret,0);}return ret;};var _382=function(q){if(_368[q.query]){return _368[q.query];}var ff=null;if(q.tag){if(q.tag=="*"){ff=_36a(ff,function(elem){return (elem.nodeType==1);});}else{ff=_36a(ff,function(elem){return ((elem.nodeType==1)&&(q.tag==elem.tagName.toLowerCase()));});}}if(q.id){ff=_36a(ff,function(elem){return ((elem.nodeType==1)&&(elem.id==q.id));});}if(q.hasLoops){ff=_36a(ff,_393(q));}return _368[q.query]=ff;};var _394=function(node){var pn=node.parentNode;var pnc=pn.childNodes;var nidx=-1;var _399=pn.firstChild;if(!_399){return nidx;}var ci=node["__cachedIndex"];var cl=pn["__cachedLength"];if(((typeof cl=="number")&&(cl!=pnc.length))||(typeof ci!="number")){pn["__cachedLength"]=pnc.length;var idx=1;do{if(_399===node){nidx=idx;}if(_399.nodeType==1){_399["__cachedIndex"]=idx;idx++;}_399=_399.nextSibling;}while(_399);}else{nidx=ci;}return nidx;};var _39d=0;var _39e="";var _39f=function(elem,attr){if(attr=="class"){return elem.className||_39e;}if(attr=="for"){return elem.htmlFor||_39e;}return elem.getAttribute(attr,2)||_39e;};var _3a2={"*=":function(attr,_3a4){return function(elem){return (_39f(elem,attr).indexOf(_3a4)>=0);};},"^=":function(attr,_3a7){return function(elem){return (_39f(elem,attr).indexOf(_3a7)==0);};},"$=":function(attr,_3aa){var tval=" "+_3aa;return function(elem){var ea=" "+_39f(elem,attr);return (ea.lastIndexOf(_3aa)==(ea.length-_3aa.length));};},"~=":function(attr,_3af){var tval=" "+_3af+" ";return function(elem){var ea=" "+_39f(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_3b4){var _3b5=" "+_3b4+"-";return function(elem){var ea=" "+(elem.getAttribute(attr,2)||"");return ((ea==_3b4)||(ea.indexOf(_3b5)==0));};},"=":function(attr,_3b9){return function(elem){return (_39f(elem,attr)==_3b9);};}};var _3bb={"first-child":function(name,_3bd){return function(elem){if(elem.nodeType!=1){return false;}var fc=elem.previousSibling;while(fc&&(fc.nodeType!=1)){fc=fc.previousSibling;}return (!fc);};},"last-child":function(name,_3c1){return function(elem){if(elem.nodeType!=1){return false;}var nc=elem.nextSibling;while(nc&&(nc.nodeType!=1)){nc=nc.nextSibling;}return (!nc);};},"empty":function(name,_3c5){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt==1)||(nt==3)){return false;}}return true;};},"contains":function(name,_3cc){return function(elem){return (elem.innerHTML.indexOf(_3cc)>=0);};},"not":function(name,_3cf){var ntf=_382(_323(_3cf)[0]);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_3d3){var pi=parseInt;if(_3d3=="odd"){return function(elem){return (((_394(elem))%2)==1);};}else{if((_3d3=="2n")||(_3d3=="even")){return function(elem){return ((_394(elem)%2)==0);};}else{if(_3d3.indexOf("0n+")==0){var _3d7=pi(_3d3.substr(3));return function(elem){return (elem.parentNode[_321][_3d7-1]===elem);};}else{if((_3d3.indexOf("n+")>0)&&(_3d3.length>3)){var _3d9=_3d3.split("n+",2);var pred=pi(_3d9[0]);var idx=pi(_3d9[1]);return function(elem){return ((_394(elem)%pred)==idx);};}else{if(_3d3.indexOf("n")==-1){var _3d7=pi(_3d3);return function(elem){return (_394(elem)==_3d7);};}}}}}}};var _3de=(d.isIE)?function(cond){var clc=cond.toLowerCase();return function(elem){return elem[cond]||elem[clc];};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _393=function(_3e4){var _3e5=(_369[_3e4.query]||_368[_3e4.query]);if(_3e5){return _3e5;}var ff=null;if(_3e4.id){if(_3e4.tag!="*"){ff=_36a(ff,function(elem){return (elem.tagName.toLowerCase()==_3e4.tag);});}}d.forEach(_3e4.classes,function(_3e8,idx,arr){var _3eb=_3e8.charAt(_3e8.length-1)=="*";if(_3eb){_3e8=_3e8.substr(0,_3e8.length-1);}var re=new RegExp("(?:^|\\s)"+_3e8+(_3eb?".*":"")+"(?:\\s|$)");ff=_36a(ff,function(elem){return re.test(elem.className);});ff.count=idx;});d.forEach(_3e4.pseudos,function(_3ee){if(_3bb[_3ee.name]){ff=_36a(ff,_3bb[_3ee.name](_3ee.name,_3ee.value));}});_34b(_3a2,_3e4,_3de,function(_3ef){ff=_36a(ff,_3ef);});if(!ff){ff=function(){return true;};}return _369[_3e4.query]=ff;};var _3f0={};var _387=function(_3f1,root){var fHit=_3f0[_3f1.query];if(fHit){return fHit;}if(_3f1.id&&!_3f1.hasLoops&&!_3f1.tag){return _3f0[_3f1.query]=function(root){return [d.byId(_3f1.id)];};}var _3f5=_393(_3f1);var _3f6;if(_3f1.tag&&_3f1.id&&!_3f1.hasLoops){_3f6=function(root){var te=d.byId(_3f1.id);if(_3f5(te)){return [te];}};}else{var tret;if(!_3f1.hasLoops){_3f6=function(root){var ret=[];var te,x=0,tret=root.getElementsByTagName(_3f1.tag);while(te=tret[x++]){ret.push(te);}return ret;};}else{_3f6=function(root){var ret=[];var te,x=0,tret=root.getElementsByTagName(_3f1.tag);while(te=tret[x++]){if(_3f5(te)){ret.push(te);}}return ret;};}}return _3f0[_3f1.query]=_3f6;};var _402={};var _403={"*":d.isIE?function(root){return root.all;}:function(root){return root.getElementsByTagName("*");},"~":_373,"+":function(root){return _373(root,true);},">":_36d};var _407=function(_408){var _409=_323(d.trim(_408));if(_409.length==1){var tt=_387(_409[0]);tt.nozip=true;return tt;}var sqf=function(root){var _40d=_409.slice(0);var _40e;if(_40d[0].oper==">"){_40e=[root];}else{_40e=_387(_40d.shift())(root);}return _388(_40e,_40d);};return sqf;};var _40f=((document["evaluate"]&&!d.isSafari)?function(_410){var _411=_410.split(" ");if((document["evaluate"])&&(_410.indexOf(":")==-1)&&(_410.indexOf("+")==-1)){if(((_411.length>2)&&(_410.indexOf(">")==-1))||(_411.length>3)||(_410.indexOf("[")>=0)||((1==_411.length)&&(0<=_410.indexOf(".")))){return _35f(_410);}}return _407(_410);}:_407);var _412=function(_413){var qcz=_413.charAt(0);if(d.doc["querySelectorAll"]&&((!d.isSafari)||(d.isSafari>3.1))&&(">+~".indexOf(qcz)==-1)){return function(root){var r=root.querySelectorAll(_413);r.nozip=true;return r;};}if(_403[_413]){return _403[_413];}if(0>_413.indexOf(",")){return _403[_413]=_40f(_413);}else{var _417=_413.split(/\s*,\s*/);var tf=function(root){var _41a=0;var ret=[];var tp;while(tp=_417[_41a++]){ret=ret.concat(_40f(tp,tp.indexOf(" "))(root));}return ret;};return _403[_413]=tf;}};var _41d=0;var _zip=function(arr){if(arr&&arr.nozip){return d.NodeList._wrap(arr);}var ret=new d.NodeList();if(!arr){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_41d++;arr[0]["_zipIdx"]=_41d;for(var x=1,te;te=arr[x];x++){if(arr[x]["_zipIdx"]!=_41d){ret.push(te);}te["_zipIdx"]=_41d;}return ret;};d.query=function(_423,root){if(_423.constructor==d.NodeList){return _423;}if(!d.isString(_423)){return new d.NodeList(_423);}if(d.isString(root)){root=d.byId(root);}return _zip(_412(_423)(root||d.doc));};d.query.pseudos=_3bb;d._filterQueryResult=function(_425,_426){var tnl=new d.NodeList();var ff=(_426)?_382(_323(_426)[0]):function(){return true;};for(var x=0,te;te=_425[x];x++){if(ff(te)){tnl.push(te);}}return tnl;};})();}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _d=dojo;function setValue(obj,name,_42e){var val=obj[name];if(_d.isString(val)){obj[name]=[val,_42e];}else{if(_d.isArray(val)){val.push(_42e);}else{obj[name]=_42e;}}};dojo.formToObject=function(_430){var ret={};var iq="input:not([type=file]):not([type=submit]):not([type=image]):not([type=reset]):not([type=button]), select, textarea";_d.query(iq,_430).filter(function(node){return !node.disabled&&node.name;}).forEach(function(item){var _in=item.name;var type=(item.type||"").toLowerCase();if(type=="radio"||type=="checkbox"){if(item.checked){setValue(ret,_in,item.value);}}else{if(item.multiple){ret[_in]=[];_d.query("option",item).forEach(function(opt){if(opt.selected){setValue(ret,_in,opt.value);}});}else{setValue(ret,_in,item.value);if(type=="image"){ret[_in+".x"]=ret[_in+".y"]=ret[_in].x=ret[_in].y=0;}}}});return ret;};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var _43a=[];var _43b={};for(var name in map){var _43d=map[name];if(_43d!=_43b[name]){var _43e=enc(name)+"=";if(_d.isArray(_43d)){for(var i=0;i<_43d.length;i++){_43a.push(_43e+enc(_43d[i]));}}else{_43a.push(_43e+enc(_43d));}}}return _43a.join("&");};dojo.formToQuery=function(_440){return _d.objectToQuery(_d.formToObject(_440));};dojo.formToJson=function(_441,_442){return _d.toJson(_d.formToObject(_441),_442);};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_d.forEach(qp,function(item){if(item.length){var _448=item.split("=");var name=dec(_448.shift());var val=dec(_448.join("="));if(_d.isString(ret[name])){ret[name]=[ret[name]];}if(_d.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}});return ret;};dojo._blockAsync=false;dojo._contentHandlers={"text":function(xhr){return xhr.responseText;},"json":function(xhr){if(!dojo.config.usePlainJson){console.warn("Consider using mimetype:text/json-comment-filtered"+" to avoid potential security issues with JSON endpoints"+" (use djConfig.usePlainJson=true to turn off this message)");}return _d.fromJson(xhr.responseText);},"json-comment-filtered":function(xhr){var _44e=xhr.responseText;var _44f=_44e.indexOf("/*");var _450=_44e.lastIndexOf("*/");if(_44f==-1||_450==-1){throw new Error("JSON was not comment filtered");}return _d.fromJson(_44e.substring(_44f+2,_450));},"javascript":function(xhr){return _d.eval(xhr.responseText);},"xml":function(xhr){var _453=xhr.responseXML;if(_d.isIE&&(!_453||window.location.protocol=="file:")){_d.forEach(["MSXML2","Microsoft","MSXML","MSXML3"],function(_454){try{var dom=new ActiveXObject(_454+".XMLDOM");dom.async=false;dom.loadXML(xhr.responseText);_453=dom;}catch(e){}});}return _453;}};dojo._contentHandlers["json-comment-optional"]=function(xhr){var _457=_d._contentHandlers;try{return _457["json-comment-filtered"](xhr);}catch(e){return _457["json"](xhr);}};dojo._ioSetArgs=function(args,_459,_45a,_45b){var _45c={args:args,url:args.url};var _45d=null;if(args.form){var form=_d.byId(args.form);var _45f=form.getAttributeNode("action");_45c.url=_45c.url||(_45f?_45f.value:null);_45d=_d.formToObject(form);}var _460=[{}];if(_45d){_460.push(_45d);}if(args.content){_460.push(args.content);}if(args.preventCache){_460.push({"dojo.preventCache":new Date().valueOf()});}_45c.query=_d.objectToQuery(_d.mixin.apply(null,_460));_45c.handleAs=args.handleAs||"text";var d=new _d.Deferred(_459);d.addCallbacks(_45a,function(_462){return _45b(_462,d);});var ld=args.load;if(ld&&_d.isFunction(ld)){d.addCallback(function(_464){return ld.call(args,_464,_45c);});}var err=args.error;if(err&&_d.isFunction(err)){d.addErrback(function(_466){return err.call(args,_466,_45c);});}var _467=args.handle;if(_467&&_d.isFunction(_467)){d.addBoth(function(_468){return _467.call(args,_468,_45c);});}d.ioArgs=_45c;return d;};var _469=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _at=typeof xhr.abort;if(_at=="function"||_at=="unknown"){xhr.abort();}var err=new Error("xhr cancelled");err.dojoType="cancel";return err;};var _46e=function(dfd){return _d._contentHandlers[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);};var _470=function(_471,dfd){console.debug(_471);return _471;};var _473=function(args){var dfd=_d._ioSetArgs(args,_469,_46e,_470);dfd.ioArgs.xhr=_d._xhrObj(dfd.ioArgs.args);return dfd;};var _476=null;var _477=[];var _478=function(){var now=(new Date()).getTime();if(!_d._blockAsync){for(var i=0,tif;i<_477.length&&(tif=_477[i]);i++){var dfd=tif.dfd;try{if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_477.splice(i--,1);}else{if(tif.ioCheck(dfd)){_477.splice(i--,1);tif.resHandle(dfd);}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_477.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel();}}}}}catch(e){console.debug(e);dfd.errback(new Error("_watchInFlightError!"));}}}if(!_477.length){clearInterval(_476);_476=null;return;}};dojo._ioCancelAll=function(){try{_d.forEach(_477,function(i){i.dfd.cancel();});}catch(e){}};if(_d.isIE){_d.addOnUnload(_d._ioCancelAll);}_d._ioWatch=function(dfd,_480,_481,_482){if(dfd.ioArgs.args.timeout){dfd.startTime=(new Date()).getTime();}_477.push({dfd:dfd,validCheck:_480,ioCheck:_481,resHandle:_482});if(!_476){_476=setInterval(_478,50);}_478();};var _483="application/x-www-form-urlencoded";var _484=function(dfd){return dfd.ioArgs.xhr.readyState;};var _486=function(dfd){return 4==dfd.ioArgs.xhr.readyState;};var _488=function(dfd){var xhr=dfd.ioArgs.xhr;if(_d._isDocumentOk(xhr)){dfd.callback(dfd);}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err);}};var _48c=function(type,dfd){var _48f=dfd.ioArgs;var args=_48f.args;var xhr=_48f.xhr;xhr.open(type,_48f.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr];}else{xhr.setRequestHeader(hdr,args.headers[hdr]);}}}xhr.setRequestHeader("Content-Type",args.contentType||_483);if(!args.headers||!args.headers["X-Requested-With"]){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}try{xhr.send(_48f.query);}catch(e){dfd.cancel();}_d._ioWatch(dfd,_484,_486,_488);xhr=null;return dfd;};dojo._ioAddQueryToUrl=function(_493){if(_493.query.length){_493.url+=(_493.url.indexOf("?")==-1?"?":"&")+_493.query;_493.query=null;}};dojo.xhr=function(_494,args,_496){var dfd=_473(args);if(!_496){_d._ioAddQueryToUrl(dfd.ioArgs);}return _48c(_494,dfd);};dojo.xhrGet=function(args){return _d.xhr("GET",args);};dojo.xhrPost=function(args){return _d.xhr("POST",args,true);};dojo.rawXhrPost=function(args){var dfd=_473(args);dfd.ioArgs.query=args.postData;return _48c("POST",dfd);};dojo.xhrPut=function(args){return _d.xhr("PUT",args,true);};dojo.rawXhrPut=function(args){var dfd=_473(args);var _49f=dfd.ioArgs;if(args.putData){_49f.query=args.putData;args.putData=null;}return _48c("PUT",dfd);};dojo.xhrDelete=function(args){return _d.xhr("DELETE",args);};})();}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;dojo._Line=function(_4a2,end){this.start=_4a2;this.end=end;this.getValue=function(n){return ((this.end-this.start)*n)+this.start;};};d.declare("dojo._Animation",null,{constructor:function(args){d.mixin(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1]);}},duration:350,repeat:0,rate:10,_percent:0,_startRepeatCount:0,_fire:function(evt,args){try{if(this[evt]){this[evt].apply(this,args||[]);}}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}return this;},play:function(_4a8,_4a9){var _t=this;if(_4a9){_t._stopTimer();_t._active=_t._paused=false;_t._percent=0;}else{if(_t._active&&!_t._paused){return _t;}}_t._fire("beforeBegin");var de=_4a8||_t.delay;var _p=dojo.hitch(_t,"_play",_4a9);if(de>0){setTimeout(_p,de);return _t;}_p();return _t;},_play:function(_4ad){var _t=this;_t._startTime=new Date().valueOf();if(_t._paused){_t._startTime-=_t.duration*_t._percent;}_t._endTime=_t._startTime+_t.duration;_t._active=true;_t._paused=false;var _4af=_t.curve.getValue(_t._percent);if(!_t._percent){if(!_t._startRepeatCount){_t._startRepeatCount=_t.repeat;}_t._fire("onBegin",[_4af]);}_t._fire("onPlay",[_4af]);_t._cycle();return _t;},pause:function(){this._stopTimer();if(!this._active){return this;}this._paused=true;this._fire("onPause",[this.curve.getValue(this._percent)]);return this;},gotoPercent:function(_4b0,_4b1){this._stopTimer();this._active=this._paused=true;this._percent=_4b0;if(_4b1){this.play();}return this;},stop:function(_4b2){if(!this._timer){return this;}this._stopTimer();if(_4b2){this._percent=1;}this._fire("onStop",[this.curve.getValue(this._percent)]);this._active=this._paused=false;return this;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _t=this;if(_t._active){var curr=new Date().valueOf();var step=(curr-_t._startTime)/(_t._endTime-_t._startTime);if(step>=1){step=1;}_t._percent=step;if(_t.easing){step=_t.easing(step);}_t._fire("onAnimate",[_t.curve.getValue(step)]);if(_t._percent<1){_t._startTimer();}else{_t._active=false;if(_t.repeat>0){_t.repeat--;_t.play(null,true);}else{if(_t.repeat==-1){_t.play(null,true);}else{if(_t._startRepeatCount){_t.repeat=_t._startRepeatCount;_t._startRepeatCount=0;}}}_t._percent=0;_t._fire("onEnd");_t._stopTimer();}}return _t;}});var ctr=0;var _4b7=[];var _4b8={run:function(){}};var _4b9=null;dojo._Animation.prototype._startTimer=function(){if(!this._timer){this._timer=d.connect(_4b8,"run",this,"_cycle");ctr++;}if(!_4b9){_4b9=setInterval(d.hitch(_4b8,"run"),this.rate);}};dojo._Animation.prototype._stopTimer=function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_4b9);_4b9=null;ctr=0;}};var _4ba=(d.isIE)?function(node){var ns=node.style;if(!ns.zoom.length&&d.style(node,"zoom")=="normal"){ns.zoom="1";}if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto";}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var _4be=d.mixin({properties:{}},args);var _4bf=(_4be.properties.opacity={});_4bf.start=!("start" in _4be)?function(){return Number(d.style(_4be.node,"opacity"));}:_4be.start;_4bf.end=_4be.end;var anim=d.animateProperty(_4be);d.connect(anim,"beforeBegin",d.partial(_4ba,_4be.node));return anim;};dojo.fadeIn=function(args){return d._fade(d.mixin({end:1},args));};dojo.fadeOut=function(args){return d._fade(d.mixin({end:0},args));};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _4c4=function(_4c5){this._properties=_4c5;for(var p in _4c5){var prop=_4c5[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color();}}this.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p];var _4cc=prop.start;if(_4cc instanceof d.Color){ret[p]=d.blendColors(_4cc,prop.end,r,prop.tempColor).toCss();}else{if(!d.isArray(_4cc)){ret[p]=((prop.end-_4cc)*r)+_4cc+(p!="opacity"?prop.units||"px":"");}}}return ret;};};dojo.animateProperty=function(args){args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing;}var anim=new d._Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];prop=pm[p]=d.mixin({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start();}if(d.isFunction(prop.end)){prop.end=prop.end();}var _4d2=(p.toLowerCase().indexOf("color")>=0);function getStyle(node,p){var v=({height:node.offsetHeight,width:node.offsetWidth})[p];if(v!==undefined){return v;}v=d.style(node,p);return (p=="opacity")?Number(v):(_4d2?v:parseFloat(v));};if(!("end" in prop)){prop.end=getStyle(this.node,p);}else{if(!("start" in prop)){prop.start=getStyle(this.node,p);}}if(_4d2){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end);}else{prop.start=(p=="opacity")?Number(prop.start):parseFloat(prop.start);}}this.curve=new _4c4(pm);});d.connect(anim,"onAnimate",anim,function(_4d6){for(var s in _4d6){d.style(this.node,s,_4d6[s]);}});return anim;};dojo.anim=function(node,_4d9,_4da,_4db,_4dc,_4dd){return d.animateProperty({node:node,duration:_4da||d._Animation.prototype.duration,properties:_4d9,easing:_4db,onEnd:_4dc}).play(_4dd||0);};})();}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");if(dojo.config.require){dojo.forEach(dojo.config.require,"dojo['require'](item);");}}})();
/*
	Copyright (c) 2004-2008, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/

/*
	This is a compiled version of Dojo, built for deployment and not for
	development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.
*/

if(!dojo._hasResource["dojo.dnd.common"]){dojo._hasResource["dojo.dnd.common"]=true;dojo.provide("dojo.dnd.common");dojo.dnd._copyKey=navigator.appVersion.indexOf("Macintosh")<0?"ctrlKey":"metaKey";dojo.dnd.getCopyKeyState=function(e){return e[dojo.dnd._copyKey];};dojo.dnd._uniqueId=0;dojo.dnd.getUniqueId=function(){var id;do{id=dojo._scopeName+"Unique"+(++dojo.dnd._uniqueId);}while(dojo.byId(id));return id;};dojo.dnd._empty={};dojo.dnd.isFormElement=function(e){var t=e.target;if(t.nodeType==3){t=t.parentNode;}return " button textarea input select option ".indexOf(" "+t.tagName.toLowerCase()+" ")>=0;};}if(!dojo._hasResource["dojo.dnd.autoscroll"]){dojo._hasResource["dojo.dnd.autoscroll"]=true;dojo.provide("dojo.dnd.autoscroll");dojo.dnd.getViewport=function(){var d=dojo.doc,dd=d.documentElement,w=window,b=dojo.body();if(dojo.isMozilla){return {w:dd.clientWidth,h:w.innerHeight};}else{if(!dojo.isOpera&&w.innerWidth){return {w:w.innerWidth,h:w.innerHeight};}else{if(!dojo.isOpera&&dd&&dd.clientWidth){return {w:dd.clientWidth,h:dd.clientHeight};}else{if(b.clientWidth){return {w:b.clientWidth,h:b.clientHeight};}}}}return null;};dojo.dnd.V_TRIGGER_AUTOSCROLL=32;dojo.dnd.H_TRIGGER_AUTOSCROLL=32;dojo.dnd.V_AUTOSCROLL_VALUE=16;dojo.dnd.H_AUTOSCROLL_VALUE=16;dojo.dnd.autoScroll=function(e){var v=dojo.dnd.getViewport(),dx=0,dy=0;if(e.clientX<dojo.dnd.H_TRIGGER_AUTOSCROLL){dx=-dojo.dnd.H_AUTOSCROLL_VALUE;}else{if(e.clientX>v.w-dojo.dnd.H_TRIGGER_AUTOSCROLL){dx=dojo.dnd.H_AUTOSCROLL_VALUE;}}if(e.clientY<dojo.dnd.V_TRIGGER_AUTOSCROLL){dy=-dojo.dnd.V_AUTOSCROLL_VALUE;}else{if(e.clientY>v.h-dojo.dnd.V_TRIGGER_AUTOSCROLL){dy=dojo.dnd.V_AUTOSCROLL_VALUE;}}window.scrollBy(dx,dy);};dojo.dnd._validNodes={"div":1,"p":1,"td":1};dojo.dnd._validOverflow={"auto":1,"scroll":1};dojo.dnd.autoScrollNodes=function(e){for(var n=e.target;n;){if(n.nodeType==1&&(n.tagName.toLowerCase() in dojo.dnd._validNodes)){var s=dojo.getComputedStyle(n);if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){var b=dojo._getContentBox(n,s),t=dojo._abs(n,true);b.l+=t.x+n.scrollLeft;b.t+=t.y+n.scrollTop;var w=Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL,b.w/2),h=Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL,b.h/2),rx=e.pageX-b.l,ry=e.pageY-b.t,dx=0,dy=0;if(rx>0&&rx<b.w){if(rx<w){dx=-dojo.dnd.H_AUTOSCROLL_VALUE;}else{if(rx>b.w-w){dx=dojo.dnd.H_AUTOSCROLL_VALUE;}}}if(ry>0&&ry<b.h){if(ry<h){dy=-dojo.dnd.V_AUTOSCROLL_VALUE;}else{if(ry>b.h-h){dy=dojo.dnd.V_AUTOSCROLL_VALUE;}}}var _18=n.scrollLeft,_19=n.scrollTop;n.scrollLeft=n.scrollLeft+dx;n.scrollTop=n.scrollTop+dy;if(_18!=n.scrollLeft||_19!=n.scrollTop){return;}}}try{n=n.parentNode;}catch(x){n=null;}}dojo.dnd.autoScroll(e);};}if(!dojo._hasResource["dojo.dnd.Mover"]){dojo._hasResource["dojo.dnd.Mover"]=true;dojo.provide("dojo.dnd.Mover");dojo.declare("dojo.dnd.Mover",null,{constructor:function(_1a,e,_1c){this.node=dojo.byId(_1a);this.marginBox={l:e.pageX,t:e.pageY};this.mouseButton=e.button;var h=this.host=_1c,d=_1a.ownerDocument,_1f=dojo.connect(d,"onmousemove",this,"onFirstMove");this.events=[dojo.connect(d,"onmousemove",this,"onMouseMove"),dojo.connect(d,"onmouseup",this,"onMouseUp"),dojo.connect(d,"ondragstart",dojo,"stopEvent"),dojo.connect(d,"onselectstart",dojo,"stopEvent"),_1f];if(h&&h.onMoveStart){h.onMoveStart(this);}},onMouseMove:function(e){dojo.dnd.autoScroll(e);var m=this.marginBox;this.host.onMove(this,{l:m.l+e.pageX,t:m.t+e.pageY});},onMouseUp:function(e){if(this.mouseButton==e.button){this.destroy();}},onFirstMove:function(){var s=this.node.style,l,t;switch(s.position){case "relative":case "absolute":l=Math.round(parseFloat(s.left));t=Math.round(parseFloat(s.top));break;default:s.position="absolute";var m=dojo.marginBox(this.node);l=m.l;t=m.t;break;}this.marginBox.l=l-this.marginBox.l;this.marginBox.t=t-this.marginBox.t;this.host.onFirstMove(this);dojo.disconnect(this.events.pop());},destroy:function(){dojo.forEach(this.events,dojo.disconnect);var h=this.host;if(h&&h.onMoveStop){h.onMoveStop(this);}this.events=this.node=null;}});}if(!dojo._hasResource["dojo.dnd.Moveable"]){dojo._hasResource["dojo.dnd.Moveable"]=true;dojo.provide("dojo.dnd.Moveable");dojo.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(_28,_29){this.node=dojo.byId(_28);if(!_29){_29={};}this.handle=_29.handle?dojo.byId(_29.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_29.delay>0?_29.delay:0;this.skip=_29.skip;this.mover=_29.mover?_29.mover:dojo.dnd.Mover;this.events=[dojo.connect(this.handle,"onmousedown",this,"onMouseDown"),dojo.connect(this.handle,"ondragstart",this,"onSelectStart"),dojo.connect(this.handle,"onselectstart",this,"onSelectStart")];},markupFactory:function(_2a,_2b){return new dojo.dnd.Moveable(_2b,_2a);},destroy:function(){dojo.forEach(this.events,dojo.disconnect);this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&dojo.dnd.isFormElement(e)){return;}if(this.delay){this.events.push(dojo.connect(this.handle,"onmousemove",this,"onMouseMove"));this.events.push(dojo.connect(this.handle,"onmouseup",this,"onMouseUp"));this._lastX=e.pageX;this._lastY=e.pageY;}else{new this.mover(this.node,e,this);}dojo.stopEvent(e);},onMouseMove:function(e){if(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay){this.onMouseUp(e);new this.mover(this.node,e,this);}dojo.stopEvent(e);},onMouseUp:function(e){dojo.disconnect(this.events.pop());dojo.disconnect(this.events.pop());},onSelectStart:function(e){if(!this.skip||!dojo.dnd.isFormElement(e)){dojo.stopEvent(e);}},onMoveStart:function(_30){dojo.publish("/dnd/move/start",[_30]);dojo.addClass(dojo.body(),"dojoMove");dojo.addClass(this.node,"dojoMoveItem");},onMoveStop:function(_31){dojo.publish("/dnd/move/stop",[_31]);dojo.removeClass(dojo.body(),"dojoMove");dojo.removeClass(this.node,"dojoMoveItem");},onFirstMove:function(_32){},onMove:function(_33,_34){this.onMoving(_33,_34);var s=_33.node.style;s.left=_34.l+"px";s.top=_34.t+"px";this.onMoved(_33,_34);},onMoving:function(_36,_37){},onMoved:function(_38,_39){}});}if(!dojo._hasResource["dojo.dnd.TimedMoveable"]){dojo._hasResource["dojo.dnd.TimedMoveable"]=true;dojo.provide("dojo.dnd.TimedMoveable");(function(){var _3a=dojo.dnd.Moveable.prototype.onMove;dojo.declare("dojo.dnd.TimedMoveable",dojo.dnd.Moveable,{timeout:40,constructor:function(_3b,_3c){if(!_3c){_3c={};}if(_3c.timeout&&typeof _3c.timeout=="number"&&_3c.timeout>=0){this.timeout=_3c.timeout;}},markupFactory:function(_3d,_3e){return new dojo.dnd.TimedMoveable(_3e,_3d);},onMoveStop:function(_3f){if(_3f._timer){clearTimeout(_3f._timer);_3a.call(this,_3f,_3f._leftTop);}dojo.dnd.Moveable.prototype.onMoveStop.apply(this,arguments);},onMove:function(_40,_41){_40._leftTop=_41;if(!_40._timer){var _t=this;_40._timer=setTimeout(function(){_40._timer=null;_3a.call(_t,_40,_40._leftTop);},this.timeout);}}});})();}if(!dojo._hasResource["dojo.fx"]){dojo._hasResource["dojo.fx"]=true;dojo.provide("dojo.fx");dojo.provide("dojo.fx.Toggler");(function(){var _43={_fire:function(evt,_45){if(this[evt]){this[evt].apply(this,_45||[]);}return this;}};var _46=function(_47){this._index=-1;this._animations=_47||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;dojo.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};dojo.extend(_46,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){dojo.disconnect(this._onAnimateCtx);dojo.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=dojo.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=dojo.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_49,_4a){if(!this._current){this._current=this._animations[this._index=0];}if(!_4a&&this._current.status()=="playing"){return this;}var _4b=dojo.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_4c=dojo.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_4e=dojo.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);dojo.disconnect(_4b);dojo.disconnect(_4c);dojo.disconnect(_4e);});if(this._onAnimateCtx){dojo.disconnect(this._onAnimateCtx);}this._onAnimateCtx=dojo.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){dojo.disconnect(this._onEndCtx);}this._onEndCtx=dojo.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=dojo.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);dojo.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_52,_53){this.pause();var _54=this.duration*_52;this._current=null;dojo.some(this._animations,function(a){if(a.duration<=_54){this._current=a;return true;}_54-=a.duration;return false;});if(this._current){this._current.gotoPercent(_54/_current.duration,_53);}return this;},stop:function(_56){if(this._current){if(_56){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=dojo.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);dojo.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){dojo.disconnect(this._onAnimateCtx);}if(this._onEndCtx){dojo.disconnect(this._onEndCtx);}}});dojo.extend(_46,_43);dojo.fx.chain=function(_59){return new _46(_59);};var _5a=function(_5b){this._animations=_5b||[];this._connects=[];this._finished=0;this.duration=0;dojo.forEach(_5b,function(a){var _5d=a.duration;if(a.delay){_5d+=a.delay;}if(this.duration<_5d){this.duration=_5d;}this._connects.push(dojo.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new dojo._Animation({curve:[0,1],duration:this.duration});dojo.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop"],function(evt){this._connects.push(dojo.connect(this._pseudoAnimation,evt,dojo.hitch(this,"_fire",evt)));},this);};dojo.extend(_5a,{_doAction:function(_5f,_60){dojo.forEach(this._animations,function(a){a[_5f].apply(a,_60);});return this;},_onEnd:function(){if(++this._finished==this._animations.length){this._fire("onEnd");}},_call:function(_62,_63){var t=this._pseudoAnimation;t[_62].apply(t,_63);},play:function(_65,_66){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_67,_68){var ms=this.duration*_67;dojo.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_68);});this._call("gotoProcent",arguments);return this;},stop:function(_6b){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){dojo.forEach(this._connects,dojo.disconnect);}});dojo.extend(_5a,_43);dojo.fx.combine=function(_6c){return new _5a(_6c);};})();dojo.declare("dojo.fx.Toggler",null,{constructor:function(_6d){var _t=this;dojo.mixin(_t,_6d);_t.node=_6d.node;_t._showArgs=dojo.mixin({},_6d);_t._showArgs.node=_t.node;_t._showArgs.duration=_t.showDuration;_t.showAnim=_t.showFunc(_t._showArgs);_t._hideArgs=dojo.mixin({},_6d);_t._hideArgs.node=_t.node;_t._hideArgs.duration=_t.hideDuration;_t.hideAnim=_t.hideFunc(_t._hideArgs);dojo.connect(_t.showAnim,"beforeBegin",dojo.hitch(_t.hideAnim,"stop",true));dojo.connect(_t.hideAnim,"beforeBegin",dojo.hitch(_t.showAnim,"stop",true));},node:null,showFunc:dojo.fadeIn,hideFunc:dojo.fadeOut,showDuration:200,hideDuration:200,show:function(_6f){return this.showAnim.play(_6f||0);},hide:function(_70){return this.hideAnim.play(_70||0);}});dojo.fx.wipeIn=function(_71){_71.node=dojo.byId(_71.node);var _72=_71.node,s=_72.style;var _74=dojo.animateProperty(dojo.mixin({properties:{height:{start:function(){s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _75=dojo.style(_72,"height");return Math.max(_75,1);}},end:function(){return _72.scrollHeight;}}}},_71));dojo.connect(_74,"onEnd",function(){s.height="auto";});return _74;};dojo.fx.wipeOut=function(_76){var _77=_76.node=dojo.byId(_76.node);var s=_77.style;var _79=dojo.animateProperty(dojo.mixin({properties:{height:{end:1}}},_76));dojo.connect(_79,"beforeBegin",function(){s.overflow="hidden";s.display="";});dojo.connect(_79,"onEnd",function(){s.height="auto";s.display="none";});return _79;};dojo.fx.slideTo=function(_7a){var _7b=(_7a.node=dojo.byId(_7a.node));var top=null;var _7d=null;var _7e=(function(n){return function(){var cs=dojo.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);_7d=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=dojo.coords(n,true);top=ret.y;_7d=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=_7d+"px";}};})(_7b);_7e();var _83=dojo.animateProperty(dojo.mixin({properties:{top:{end:_7a.top||0},left:{end:_7a.left||0}}},_7a));dojo.connect(_83,"beforeBegin",_83,_7e);return _83;};}if(!dojo._hasResource["dijit._base.focus"]){dojo._hasResource["dijit._base.focus"]=true;dojo.provide("dijit._base.focus");dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){var _84=dojo.global;var _85=dojo.doc;if(_85.selection){return !_85.selection.createRange().text;}else{var _86=_84.getSelection();if(dojo.isString(_86)){return !_86;}else{return _86.isCollapsed||!_86.toString();}}},getBookmark:function(){var _87,_88=dojo.doc.selection;if(_88){var _89=_88.createRange();if(_88.type.toUpperCase()=="CONTROL"){if(_89.length){_87=[];var i=0,len=_89.length;while(i<len){_87.push(_89.item(i++));}}else{_87=null;}}else{_87=_89.getBookmark();}}else{if(window.getSelection){_88=dojo.global.getSelection();if(_88){_89=_88.getRangeAt(0);_87=_89.cloneRange();}}else{console.warn("No idea how to store the current selection for this browser!");}}return _87;},moveToBookmark:function(_8c){var _8d=dojo.doc;if(_8d.selection){var _8e;if(dojo.isArray(_8c)){_8e=_8d.body.createControlRange();dojo.forEach(_8c,"range.addElement(item)");}else{_8e=_8d.selection.createRange();_8e.moveToBookmark(_8c);}_8e.select();}else{var _8f=dojo.global.getSelection&&dojo.global.getSelection();if(_8f&&_8f.removeAllRanges){_8f.removeAllRanges();_8f.addRange(_8c);}else{console.warn("No idea how to restore selection for this browser!");}}},getFocus:function(_90,_91){return {node:_90&&dojo.isDescendant(dijit._curFocus,_90.domNode)?dijit._prevFocus:dijit._curFocus,bookmark:!dojo.withGlobal(_91||dojo.global,dijit.isCollapsed)?dojo.withGlobal(_91||dojo.global,dijit.getBookmark):null,openedForWindow:_91};},focus:function(_92){if(!_92){return;}var _93="node" in _92?_92.node:_92,_94=_92.bookmark,_95=_92.openedForWindow;if(_93){var _96=(_93.tagName.toLowerCase()=="iframe")?_93.contentWindow:_93;if(_96&&_96.focus){try{_96.focus();}catch(e){}}dijit._onFocusNode(_93);}if(_94&&dojo.withGlobal(_95||dojo.global,dijit.isCollapsed)){if(_95){_95.focus();}try{dojo.withGlobal(_95||dojo.global,dijit.moveToBookmark,null,[_94]);}catch(e){}}},_activeStack:[],registerWin:function(_97){if(!_97){_97=window;}dojo.connect(_97.document,"onmousedown",function(evt){dijit._justMouseDowned=true;setTimeout(function(){dijit._justMouseDowned=false;},0);dijit._onTouchNode(evt.target||evt.srcElement);});var _99=_97.document.body||_97.document.getElementsByTagName("body")[0];if(_99){if(dojo.isIE){_99.attachEvent("onactivate",function(evt){if(evt.srcElement.tagName.toLowerCase()!="body"){dijit._onFocusNode(evt.srcElement);}});_99.attachEvent("ondeactivate",function(evt){dijit._onBlurNode(evt.srcElement);});}else{_99.addEventListener("focus",function(evt){dijit._onFocusNode(evt.target);},true);_99.addEventListener("blur",function(evt){dijit._onBlurNode(evt.target);},true);}}_99=null;},_onBlurNode:function(_9e){dijit._prevFocus=dijit._curFocus;dijit._curFocus=null;if(dijit._justMouseDowned){return;}if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);}dijit._clearActiveWidgetsTimer=setTimeout(function(){delete dijit._clearActiveWidgetsTimer;dijit._setStack([]);dijit._prevFocus=null;},100);},_onTouchNode:function(_9f){if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);delete dijit._clearActiveWidgetsTimer;}var _a0=[];try{while(_9f){if(_9f.dijitPopupParent){_9f=dijit.byId(_9f.dijitPopupParent).domNode;}else{if(_9f.tagName&&_9f.tagName.toLowerCase()=="body"){if(_9f===dojo.body()){break;}_9f=dijit.getDocumentWindow(_9f.ownerDocument).frameElement;}else{var id=_9f.getAttribute&&_9f.getAttribute("widgetId");if(id){_a0.unshift(id);}_9f=_9f.parentNode;}}}}catch(e){}dijit._setStack(_a0);},_onFocusNode:function(_a2){if(_a2&&_a2.tagName&&_a2.tagName.toLowerCase()=="body"){return;}dijit._onTouchNode(_a2);if(_a2==dijit._curFocus){return;}if(dijit._curFocus){dijit._prevFocus=dijit._curFocus;}dijit._curFocus=_a2;dojo.publish("focusNode",[_a2]);},_setStack:function(_a3){var _a4=dijit._activeStack;dijit._activeStack=_a3;for(var _a5=0;_a5<Math.min(_a4.length,_a3.length);_a5++){if(_a4[_a5]!=_a3[_a5]){break;}}for(var i=_a4.length-1;i>=_a5;i--){var _a7=dijit.byId(_a4[i]);if(_a7){_a7._focused=false;_a7._hasBeenBlurred=true;if(_a7._onBlur){_a7._onBlur();}if(_a7._setStateClass){_a7._setStateClass();}dojo.publish("widgetBlur",[_a7]);}}for(i=_a5;i<_a3.length;i++){_a7=dijit.byId(_a3[i]);if(_a7){_a7._focused=true;if(_a7._onFocus){_a7._onFocus();}if(_a7._setStateClass){_a7._setStateClass();}dojo.publish("widgetFocus",[_a7]);}}}});dojo.addOnLoad(dijit.registerWin);}if(!dojo._hasResource["dijit._base.manager"]){dojo._hasResource["dijit._base.manager"]=true;dojo.provide("dijit._base.manager");dojo.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};},add:function(_a8){if(this._hash[_a8.id]){throw new Error("Tried to register widget with id=="+_a8.id+" but that id is already registered");}this._hash[_a8.id]=_a8;},remove:function(id){delete this._hash[id];},forEach:function(_aa){for(var id in this._hash){_aa(this._hash[id]);}},filter:function(_ac){var res=new dijit.WidgetSet();this.forEach(function(_ae){if(_ac(_ae)){res.add(_ae);}});return res;},byId:function(id){return this._hash[id];},byClass:function(cls){return this.filter(function(_b1){return _b1.declaredClass==cls;});}});dijit.registry=new dijit.WidgetSet();dijit._widgetTypeCtr={};dijit.getUniqueId=function(_b2){var id;do{id=_b2+"_"+(_b2 in dijit._widgetTypeCtr?++dijit._widgetTypeCtr[_b2]:dijit._widgetTypeCtr[_b2]=0);}while(dijit.byId(id));return id;};if(dojo.isIE){dojo.addOnUnload(function(){dijit.registry.forEach(function(_b4){_b4.destroy();});});}dijit.byId=function(id){return (dojo.isString(id))?dijit.registry.byId(id):id;};dijit.byNode=function(_b6){return dijit.registry.byId(_b6.getAttribute("widgetId"));};dijit.getEnclosingWidget=function(_b7){while(_b7){if(_b7.getAttribute&&_b7.getAttribute("widgetId")){return dijit.registry.byId(_b7.getAttribute("widgetId"));}_b7=_b7.parentNode;}return null;};dijit._tabElements={area:true,button:true,input:true,object:true,select:true,textarea:true};dijit._isElementShown=function(_b8){var _b9=dojo.style(_b8);return (_b9.visibility!="hidden")&&(_b9.visibility!="collapsed")&&(_b9.display!="none");};dijit.isTabNavigable=function(_ba){if(dojo.hasAttr(_ba,"disabled")){return false;}var _bb=dojo.hasAttr(_ba,"tabindex");var _bc=dojo.attr(_ba,"tabindex");if(_bb&&_bc>=0){return true;}var _bd=_ba.nodeName.toLowerCase();if(((_bd=="a"&&dojo.hasAttr(_ba,"href"))||dijit._tabElements[_bd])&&(!_bb||_bc>=0)){return true;}return false;};dijit._getTabNavigable=function(_be){var _bf,_c0,_c1,_c2,_c3,_c4;var _c5=function(_c6){dojo.query("> *",_c6).forEach(function(_c7){var _c8=dijit._isElementShown(_c7);if(_c8&&dijit.isTabNavigable(_c7)){var _c9=dojo.attr(_c7,"tabindex");if(!dojo.hasAttr(_c7,"tabindex")||_c9==0){if(!_bf){_bf=_c7;}_c0=_c7;}else{if(_c9>0){if(!_c1||_c9<_c2){_c2=_c9;_c1=_c7;}if(!_c3||_c9>=_c4){_c4=_c9;_c3=_c7;}}}}if(_c8){_c5(_c7);}});};if(dijit._isElementShown(_be)){_c5(_be);}return {first:_bf,last:_c0,lowest:_c1,highest:_c3};};dijit.getFirstInTabbingOrder=function(_ca){var _cb=dijit._getTabNavigable(dojo.byId(_ca));return _cb.lowest?_cb.lowest:_cb.first;};dijit.getLastInTabbingOrder=function(_cc){var _cd=dijit._getTabNavigable(dojo.byId(_cc));return _cd.last?_cd.last:_cd.highest;};}if(!dojo._hasResource["dijit._base.place"]){dojo._hasResource["dijit._base.place"]=true;dojo.provide("dijit._base.place");dijit.getViewport=function(){var _ce=dojo.global;var _cf=dojo.doc;var w=0,h=0;var de=_cf.documentElement;var dew=de.clientWidth,deh=de.clientHeight;if(dojo.isMozilla){var _d5,_d6,_d7,_d8;var dbw=_cf.body.clientWidth;if(dbw>dew){_d5=dew;_d7=dbw;}else{_d7=dew;_d5=dbw;}var dbh=_cf.body.clientHeight;if(dbh>deh){_d6=deh;_d8=dbh;}else{_d8=deh;_d6=dbh;}w=(_d7>_ce.innerWidth)?_d5:_d7;h=(_d8>_ce.innerHeight)?_d6:_d8;}else{if(!dojo.isOpera&&_ce.innerWidth){w=_ce.innerWidth;h=_ce.innerHeight;}else{if(dojo.isIE&&de&&deh){w=dew;h=deh;}else{if(dojo.body().clientWidth){w=dojo.body().clientWidth;h=dojo.body().clientHeight;}}}}var _db=dojo._docScroll();return {w:w,h:h,l:_db.x,t:_db.y};};dijit.placeOnScreen=function(_dc,pos,_de,_df){var _e0=dojo.map(_de,function(_e1){return {corner:_e1,pos:pos};});return dijit._place(_dc,_e0);};dijit._place=function(_e2,_e3,_e4){var _e5=dijit.getViewport();if(!_e2.parentNode||String(_e2.parentNode.tagName).toLowerCase()!="body"){dojo.body().appendChild(_e2);}var _e6=null;dojo.some(_e3,function(_e7){var _e8=_e7.corner;var pos=_e7.pos;if(_e4){_e4(_e2,_e7.aroundCorner,_e8);}var _ea=_e2.style;var _eb=_ea.display;var _ec=_ea.visibility;_ea.visibility="hidden";_ea.display="";var mb=dojo.marginBox(_e2);_ea.display=_eb;_ea.visibility=_ec;var _ee=(_e8.charAt(1)=="L"?pos.x:Math.max(_e5.l,pos.x-mb.w)),_ef=(_e8.charAt(0)=="T"?pos.y:Math.max(_e5.t,pos.y-mb.h)),_f0=(_e8.charAt(1)=="L"?Math.min(_e5.l+_e5.w,_ee+mb.w):pos.x),_f1=(_e8.charAt(0)=="T"?Math.min(_e5.t+_e5.h,_ef+mb.h):pos.y),_f2=_f0-_ee,_f3=_f1-_ef,_f4=(mb.w-_f2)+(mb.h-_f3);if(_e6==null||_f4<_e6.overflow){_e6={corner:_e8,aroundCorner:_e7.aroundCorner,x:_ee,y:_ef,w:_f2,h:_f3,overflow:_f4};}return !_f4;});_e2.style.left=_e6.x+"px";_e2.style.top=_e6.y+"px";if(_e6.overflow&&_e4){_e4(_e2,_e6.aroundCorner,_e6.corner);}return _e6;};dijit.placeOnScreenAroundElement=function(_f5,_f6,_f7,_f8){_f6=dojo.byId(_f6);var _f9=_f6.style.display;_f6.style.display="";var _fa=_f6.offsetWidth;var _fb=_f6.offsetHeight;var _fc=dojo.coords(_f6,true);_f6.style.display=_f9;var _fd=[];for(var _fe in _f7){_fd.push({aroundCorner:_fe,corner:_f7[_fe],pos:{x:_fc.x+(_fe.charAt(1)=="L"?0:_fa),y:_fc.y+(_fe.charAt(0)=="T"?0:_fb)}});}return dijit._place(_f5,_fd,_f8);};}if(!dojo._hasResource["dijit._base.window"]){dojo._hasResource["dijit._base.window"]=true;dojo.provide("dijit._base.window");dijit.getDocumentWindow=function(doc){if(dojo.isSafari&&!doc._parentWindow){var fix=function(win){win.document._parentWindow=win;for(var i=0;i<win.frames.length;i++){fix(win.frames[i]);}};fix(window.top);}if(dojo.isIE&&window!==document.parentWindow&&!doc._parentWindow){doc.parentWindow.execScript("document._parentWindow = window;","Javascript");var win=doc._parentWindow;doc._parentWindow=null;return win;}return doc._parentWindow||doc.parentWindow||doc.defaultView;};}if(!dojo._hasResource["dijit._base.popup"]){dojo._hasResource["dijit._base.popup"]=true;dojo.provide("dijit._base.popup");dijit.popup=new function(){var _104=[],_105=1000,_106=1;this.prepare=function(node){dojo.body().appendChild(node);var s=node.style;if(s.display=="none"){s.display="";}s.visibility="hidden";s.position="absolute";s.top="-9999px";};this.open=function(args){var _10a=args.popup,_10b=args.orient||{"BL":"TL","TL":"BL"},_10c=args.around,id=(args.around&&args.around.id)?(args.around.id+"_dropdown"):("popup_"+_106++);var _10e=dojo.doc.createElement("div");dijit.setWaiRole(_10e,"presentation");_10e.id=id;_10e.className="dijitPopup";_10e.style.zIndex=_105+_104.length;_10e.style.visibility="hidden";if(args.parent){_10e.dijitPopupParent=args.parent.id;}dojo.body().appendChild(_10e);var s=_10a.domNode.style;s.display="";s.visibility="";s.position="";_10e.appendChild(_10a.domNode);var _110=new dijit.BackgroundIframe(_10e);var best=_10c?dijit.placeOnScreenAroundElement(_10e,_10c,_10b,_10a.orient?dojo.hitch(_10a,"orient"):null):dijit.placeOnScreen(_10e,args,_10b=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"]);_10e.style.visibility="visible";var _112=[];var _113=function(){for(var pi=_104.length-1;pi>0&&_104[pi].parent===_104[pi-1].widget;pi--){}return _104[pi];};_112.push(dojo.connect(_10e,"onkeypress",this,function(evt){if(evt.keyCode==dojo.keys.ESCAPE&&args.onCancel){dojo.stopEvent(evt);args.onCancel();}else{if(evt.keyCode==dojo.keys.TAB){dojo.stopEvent(evt);var _116=_113();if(_116&&_116.onCancel){_116.onCancel();}}}}));if(_10a.onCancel){_112.push(dojo.connect(_10a,"onCancel",null,args.onCancel));}_112.push(dojo.connect(_10a,_10a.onExecute?"onExecute":"onChange",null,function(){var _117=_113();if(_117&&_117.onExecute){_117.onExecute();}}));_104.push({wrapper:_10e,iframe:_110,widget:_10a,parent:args.parent,onExecute:args.onExecute,onCancel:args.onCancel,onClose:args.onClose,handlers:_112});if(_10a.onOpen){_10a.onOpen(best);}return best;};this.close=function(_118){while(dojo.some(_104,function(elem){return elem.widget==_118;})){var top=_104.pop(),_11b=top.wrapper,_11c=top.iframe,_11d=top.widget,_11e=top.onClose;if(_11d.onClose){_11d.onClose();}dojo.forEach(top.handlers,dojo.disconnect);if(!_11d||!_11d.domNode){return;}this.prepare(_11d.domNode);_11c.destroy();dojo._destroyElement(_11b);if(_11e){_11e();}}};}();dijit._frames=new function(){var _11f=[];this.pop=function(){var _120;if(_11f.length){_120=_11f.pop();_120.style.display="";}else{if(dojo.isIE){var html="<iframe src='javascript:\"\"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_120=dojo.doc.createElement(html);}else{_120=dojo.doc.createElement("iframe");_120.src="javascript:\"\"";_120.className="dijitBackgroundIframe";}_120.tabIndex=-1;dojo.body().appendChild(_120);}return _120;};this.push=function(_122){_122.style.display="";if(dojo.isIE){_122.style.removeExpression("width");_122.style.removeExpression("height");}_11f.push(_122);};}();if(dojo.isIE&&dojo.isIE<7){dojo.addOnLoad(function(){var f=dijit._frames;dojo.forEach([f.pop()],f.push);});}dijit.BackgroundIframe=function(node){if(!node.id){throw new Error("no id");}if((dojo.isIE&&dojo.isIE<7)||(dojo.isFF&&dojo.isFF<3&&dojo.hasClass(dojo.body(),"dijit_a11y"))){var _125=dijit._frames.pop();node.appendChild(_125);if(dojo.isIE){_125.style.setExpression("width",dojo._scopeName+".doc.getElementById('"+node.id+"').offsetWidth");_125.style.setExpression("height",dojo._scopeName+".doc.getElementById('"+node.id+"').offsetHeight");}this.iframe=_125;}};dojo.extend(dijit.BackgroundIframe,{destroy:function(){if(this.iframe){dijit._frames.push(this.iframe);delete this.iframe;}}});}if(!dojo._hasResource["dijit._base.scroll"]){dojo._hasResource["dijit._base.scroll"]=true;dojo.provide("dijit._base.scroll");dijit.scrollIntoView=function(node){if(dojo.isMozilla){node.scrollIntoView(false);}else{var _127=node.parentNode;var _128=_127.scrollTop+dojo.marginBox(_127).h;var _129=node.offsetTop+dojo.marginBox(node).h;if(_128<_129){_127.scrollTop+=(_129-_128);}else{if(_127.scrollTop>node.offsetTop){_127.scrollTop-=(_127.scrollTop-node.offsetTop);}}}};}if(!dojo._hasResource["dijit._base.sniff"]){dojo._hasResource["dijit._base.sniff"]=true;dojo.provide("dijit._base.sniff");(function(){var d=dojo;var ie=d.isIE;var _12c=d.isOpera;var maj=Math.floor;var ff=d.isFF;var _12f={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_iequirks:ie&&d.isQuirks,dj_opera:_12c,dj_opera8:maj(_12c)==8,dj_opera9:maj(_12c)==9,dj_khtml:d.isKhtml,dj_safari:d.isSafari,dj_gecko:d.isMozilla,dj_ff2:maj(ff)==2};for(var p in _12f){if(_12f[p]){var html=dojo.doc.documentElement;if(html.className){html.className+=" "+p;}else{html.className=p;}}}})();}if(!dojo._hasResource["dijit._base.bidi"]){dojo._hasResource["dijit._base.bidi"]=true;dojo.provide("dijit._base.bidi");dojo.addOnLoad(function(){if(!dojo._isBodyLtr()){dojo.addClass(dojo.body(),"dijitRtl");}});}if(!dojo._hasResource["dijit._base.typematic"]){dojo._hasResource["dijit._base.typematic"]=true;dojo.provide("dijit._base.typematic");dijit.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=(this._currentTimeout<0)?this._initialDelay:((this._subsequentDelay>1)?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay));this._timer=setTimeout(dojo.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_133,node,_135,obj,_137,_138){if(obj!=this._obj){this.stop();this._initialDelay=_138||500;this._subsequentDelay=_137||0.9;this._obj=obj;this._evt=evt;this._node=node;this._currentTimeout=-1;this._count=-1;this._callback=dojo.hitch(_133,_135);this._fireEventAndReload();}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(node,_13a,_13b,_13c,_13d,_13e){return [dojo.connect(node,"onkeypress",this,function(evt){if(evt.keyCode==_13a.keyCode&&(!_13a.charCode||_13a.charCode==evt.charCode)&&(_13a.ctrlKey===undefined||_13a.ctrlKey==evt.ctrlKey)&&(_13a.altKey===undefined||_13a.altKey==evt.ctrlKey)&&(_13a.shiftKey===undefined||_13a.shiftKey==evt.ctrlKey)){dojo.stopEvent(evt);dijit.typematic.trigger(_13a,_13b,node,_13c,_13a,_13d,_13e);}else{if(dijit.typematic._obj==_13a){dijit.typematic.stop();}}}),dojo.connect(node,"onkeyup",this,function(evt){if(dijit.typematic._obj==_13a){dijit.typematic.stop();}})];},addMouseListener:function(node,_142,_143,_144,_145){var dc=dojo.connect;return [dc(node,"mousedown",this,function(evt){dojo.stopEvent(evt);dijit.typematic.trigger(evt,_142,node,_143,node,_144,_145);}),dc(node,"mouseup",this,function(evt){dojo.stopEvent(evt);dijit.typematic.stop();}),dc(node,"mouseout",this,function(evt){dojo.stopEvent(evt);dijit.typematic.stop();}),dc(node,"mousemove",this,function(evt){dojo.stopEvent(evt);}),dc(node,"dblclick",this,function(evt){dojo.stopEvent(evt);if(dojo.isIE){dijit.typematic.trigger(evt,_142,node,_143,node,_144,_145);setTimeout(dojo.hitch(this,dijit.typematic.stop),50);}})];},addListener:function(_14c,_14d,_14e,_14f,_150,_151,_152){return this.addKeyListener(_14d,_14e,_14f,_150,_151,_152).concat(this.addMouseListener(_14c,_14f,_150,_151,_152));}};}if(!dojo._hasResource["dijit._base.wai"]){dojo._hasResource["dijit._base.wai"]=true;dojo.provide("dijit._base.wai");dijit.wai={onload:function(){var div=dojo.doc.createElement("div");div.id="a11yTestNode";div.style.cssText="border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+dojo.moduleUrl("dojo","resources/blank.gif")+"\");";dojo.body().appendChild(div);var cs=dojo.getComputedStyle(div);if(cs){var _155=cs.backgroundImage;var _156=(cs.borderTopColor==cs.borderRightColor)||(_155!=null&&(_155=="none"||_155=="url(invalid-url:)"));dojo[_156?"addClass":"removeClass"](dojo.body(),"dijit_a11y");dojo.body().removeChild(div);}}};if(dojo.isIE||dojo.isMoz){dojo._loaders.unshift(dijit.wai.onload);}dojo.mixin(dijit,{hasWaiRole:function(elem){return elem.hasAttribute?elem.hasAttribute("role"):!!elem.getAttribute("role");},getWaiRole:function(elem){var _159=elem.getAttribute("role");if(_159){var _15a=_159.indexOf(":");return _15a==-1?_159:_159.substring(_15a+1);}else{return "";}},setWaiRole:function(elem,role){elem.setAttribute("role",(dojo.isFF&&dojo.isFF<3)?"wairole:"+role:role);},removeWaiRole:function(elem){elem.removeAttribute("role");},hasWaiState:function(elem,_15f){if(dojo.isFF&&dojo.isFF<3){return elem.hasAttributeNS("http://www.w3.org/2005/07/aaa",_15f);}else{return elem.hasAttribute?elem.hasAttribute("aria-"+_15f):!!elem.getAttribute("aria-"+_15f);}},getWaiState:function(elem,_161){if(dojo.isFF&&dojo.isFF<3){return elem.getAttributeNS("http://www.w3.org/2005/07/aaa",_161);}else{var _162=elem.getAttribute("aria-"+_161);return _162?_162:"";}},setWaiState:function(elem,_164,_165){if(dojo.isFF&&dojo.isFF<3){elem.setAttributeNS("http://www.w3.org/2005/07/aaa","aaa:"+_164,_165);}else{elem.setAttribute("aria-"+_164,_165);}},removeWaiState:function(elem,_167){if(dojo.isFF&&dojo.isFF<3){elem.removeAttributeNS("http://www.w3.org/2005/07/aaa",_167);}else{elem.removeAttribute("aria-"+_167);}}});}if(!dojo._hasResource["dijit._base"]){dojo._hasResource["dijit._base"]=true;dojo.provide("dijit._base");if(dojo.isSafari){dojo.connect(window,"load",function(){window.resizeBy(1,0);setTimeout(function(){window.resizeBy(-1,0);},10);});}}if(!dojo._hasResource["dijit._Widget"]){dojo._hasResource["dijit._Widget"]=true;dojo.provide("dijit._Widget");dojo.require("dijit._base");dojo.declare("dijit._Widget",null,{id:"",lang:"",dir:"","class":"",style:"",title:"",srcNodeRef:null,domNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},postscript:function(_168,_169){this.create(_168,_169);},create:function(_16a,_16b){this.srcNodeRef=dojo.byId(_16b);this._connects=[];this._attaches=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_16a){this.params=_16a;dojo.mixin(this,_16a);}this.postMixInProperties();if(!this.id){this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));}dijit.registry.add(this);this.buildRendering();if(this.domNode){for(var attr in this.attributeMap){var _16d=this[attr];if(typeof _16d!="object"&&((_16d!==""&&_16d!==false)||(_16a&&_16a[attr]))){this.setAttribute(attr,_16d);}}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}},postMixInProperties:function(){},buildRendering:function(){this.domNode=this.srcNodeRef||dojo.doc.createElement("div");},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_16e){this.destroyDescendants();this.destroy();},destroy:function(_16f){this.uninitialize();dojo.forEach(this._connects,function(_170){dojo.forEach(_170,dojo.disconnect);});dojo.forEach(this._supportingWidgets||[],function(w){w.destroy();});this.destroyRendering(_16f);dijit.registry.remove(this.id);},destroyRendering:function(_172){if(this.bgIframe){this.bgIframe.destroy();delete this.bgIframe;}if(this.domNode){dojo._destroyElement(this.domNode);delete this.domNode;}if(this.srcNodeRef){dojo._destroyElement(this.srcNodeRef);delete this.srcNodeRef;}},destroyDescendants:function(){dojo.forEach(this.getDescendants(),function(_173){_173.destroy();});},uninitialize:function(){return false;},onFocus:function(){},onBlur:function(){},_onFocus:function(e){this.onFocus();},_onBlur:function(){this.onBlur();},setAttribute:function(attr,_176){var _177=this[this.attributeMap[attr]||"domNode"];this[attr]=_176;switch(attr){case "class":dojo.addClass(_177,_176);break;case "style":if(_177.style.cssText){_177.style.cssText+="; "+_176;}else{_177.style.cssText=_176;}break;default:if(/^on[A-Z]/.test(attr)){attr=attr.toLowerCase();}if(typeof _176=="function"){_176=dojo.hitch(this,_176);}dojo.attr(_177,attr,_176);}},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){if(this.containerNode){var list=dojo.query("[widgetId]",this.containerNode);return list.map(dijit.byNode);}else{return [];}},nodesWithKeyClick:["input","button"],connect:function(obj,_17a,_17b){var _17c=[];if(_17a=="ondijitclick"){if(!this.nodesWithKeyClick[obj.nodeName]){_17c.push(dojo.connect(obj,"onkeydown",this,function(e){if(e.keyCode==dojo.keys.ENTER){return (dojo.isString(_17b))?this[_17b](e):_17b.call(this,e);}else{if(e.keyCode==dojo.keys.SPACE){dojo.stopEvent(e);}}}));_17c.push(dojo.connect(obj,"onkeyup",this,function(e){if(e.keyCode==dojo.keys.SPACE){return dojo.isString(_17b)?this[_17b](e):_17b.call(this,e);}}));}_17a="onclick";}_17c.push(dojo.connect(obj,_17a,this,_17b));this._connects.push(_17c);return _17c;},disconnect:function(_17f){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_17f){dojo.forEach(_17f,dojo.disconnect);this._connects.splice(i,1);return;}}},isLeftToRight:function(){if(!("_ltr" in this)){this._ltr=dojo.getComputedStyle(this.domNode).direction!="rtl";}return this._ltr;},isFocusable:function(){return this.focus&&(dojo.style(this.domNode,"display")!="none");}});}if(!dojo._hasResource["dojo.string"]){dojo._hasResource["dojo.string"]=true;dojo.provide("dojo.string");dojo.string.pad=function(text,size,ch,end){var out=String(text);if(!ch){ch="0";}while(out.length<size){if(end){out+=ch;}else{out=ch+out;}}return out;};dojo.string.substitute=function(_186,map,_188,_189){return _186.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_18a,key,_18c){var _18d=dojo.getObject(key,false,map);if(_18c){_18d=dojo.getObject(_18c,false,_189)(_18d);}if(_188){_18d=_188(_18d,key);}return _18d.toString();});};dojo.string.trim=function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!dojo._hasResource["dojo.date.stamp"]){dojo._hasResource["dojo.date.stamp"]=true;dojo.provide("dojo.date.stamp");dojo.date.stamp.fromISOString=function(_190,_191){if(!dojo.date.stamp._isoRegExp){dojo.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _192=dojo.date.stamp._isoRegExp.exec(_190);var _193=null;if(_192){_192.shift();if(_192[1]){_192[1]--;}if(_192[6]){_192[6]*=1000;}if(_191){_191=new Date(_191);dojo.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(prop){return _191["get"+prop]();}).forEach(function(_195,_196){if(_192[_196]===undefined){_192[_196]=_195;}});}_193=new Date(_192[0]||1970,_192[1]||0,_192[2]||1,_192[3]||0,_192[4]||0,_192[5]||0,_192[6]||0);var _197=0;var _198=_192[7]&&_192[7].charAt(0);if(_198!="Z"){_197=((_192[8]||0)*60)+(Number(_192[9])||0);if(_198!="-"){_197*=-1;}}if(_198){_197-=_193.getTimezoneOffset();}if(_197){_193.setTime(_193.getTime()+_197*60000);}}return _193;};dojo.date.stamp.toISOString=function(_199,_19a){var _=function(n){return (n<10)?"0"+n:n;};_19a=_19a||{};var _19d=[];var _19e=_19a.zulu?"getUTC":"get";var date="";if(_19a.selector!="time"){var year=_199[_19e+"FullYear"]();date=["0000".substr((year+"").length)+year,_(_199[_19e+"Month"]()+1),_(_199[_19e+"Date"]())].join("-");}_19d.push(date);if(_19a.selector!="date"){var time=[_(_199[_19e+"Hours"]()),_(_199[_19e+"Minutes"]()),_(_199[_19e+"Seconds"]())].join(":");var _1a2=_199[_19e+"Milliseconds"]();if(_19a.milliseconds){time+="."+(_1a2<100?"0":"")+_(_1a2);}if(_19a.zulu){time+="Z";}else{if(_19a.selector!="time"){var _1a3=_199.getTimezoneOffset();var _1a4=Math.abs(_1a3);time+=(_1a3>0?"-":"+")+_(Math.floor(_1a4/60))+":"+_(_1a4%60);}}_19d.push(time);}return _19d.join("T");};}if(!dojo._hasResource["dojo.parser"]){dojo._hasResource["dojo.parser"]=true;dojo.provide("dojo.parser");dojo.parser=new function(){var d=dojo;var _1a6=d._scopeName+"Type";var qry="["+_1a6+"]";function val2type(_1a8){if(d.isString(_1a8)){return "string";}if(typeof _1a8=="number"){return "number";}if(typeof _1a8=="boolean"){return "boolean";}if(d.isFunction(_1a8)){return "function";}if(d.isArray(_1a8)){return "array";}if(_1a8 instanceof Date){return "date";}if(_1a8 instanceof d._Url){return "url";}return "object";};function str2obj(_1a9,type){switch(type){case "string":return _1a9;case "number":return _1a9.length?Number(_1a9):NaN;case "boolean":return typeof _1a9=="boolean"?_1a9:!(_1a9.toLowerCase()=="false");case "function":if(d.isFunction(_1a9)){_1a9=_1a9.toString();_1a9=d.trim(_1a9.substring(_1a9.indexOf("{")+1,_1a9.length-1));}try{if(_1a9.search(/[^\w\.]+/i)!=-1){_1a9=d.parser._nameAnonFunc(new Function(_1a9),this);}return d.getObject(_1a9,false);}catch(e){return new Function();}case "array":return _1a9.split(/\s*,\s*/);case "date":switch(_1a9){case "":return new Date("");case "now":return new Date();default:return d.date.stamp.fromISOString(_1a9);}case "url":return d.baseUrl+_1a9;default:return d.fromJson(_1a9);}};var _1ab={};function getClassInfo(_1ac){if(!_1ab[_1ac]){var cls=d.getObject(_1ac);if(!d.isFunction(cls)){throw new Error("Could not load class '"+_1ac+"'. Did you spell the name correctly and use a full path, like 'dijit.form.Button'?");}var _1ae=cls.prototype;var _1af={};for(var name in _1ae){if(name.charAt(0)=="_"){continue;}var _1b1=_1ae[name];_1af[name]=val2type(_1b1);}_1ab[_1ac]={cls:cls,params:_1af};}return _1ab[_1ac];};this._functionFromScript=function(_1b2){var _1b3="";var _1b4="";var _1b5=_1b2.getAttribute("args");if(_1b5){d.forEach(_1b5.split(/\s*,\s*/),function(part,idx){_1b3+="var "+part+" = arguments["+idx+"]; ";});}var _1b8=_1b2.getAttribute("with");if(_1b8&&_1b8.length){d.forEach(_1b8.split(/\s*,\s*/),function(part){_1b3+="with("+part+"){";_1b4+="}";});}return new Function(_1b3+_1b2.innerHTML+_1b4);};this.instantiate=function(_1ba){var _1bb=[];d.forEach(_1ba,function(node){if(!node){return;}var type=node.getAttribute(_1a6);if((!type)||(!type.length)){return;}var _1be=getClassInfo(type);var _1bf=_1be.cls;var ps=_1bf._noScript||_1bf.prototype._noScript;var _1c1={};var _1c2=node.attributes;for(var name in _1be.params){var item=_1c2.getNamedItem(name);if(!item||(!item.specified&&(!dojo.isIE||name.toLowerCase()!="value"))){continue;}var _1c5=item.value;switch(name){case "class":_1c5=node.className;break;case "style":_1c5=node.style&&node.style.cssText;}var _1c6=_1be.params[name];_1c1[name]=str2obj(_1c5,_1c6);}if(!ps){var _1c7=[],_1c8=[];d.query("> script[type^='dojo/']",node).orphan().forEach(function(_1c9){var _1ca=_1c9.getAttribute("event"),type=_1c9.getAttribute("type"),nf=d.parser._functionFromScript(_1c9);if(_1ca){if(type=="dojo/connect"){_1c7.push({event:_1ca,func:nf});}else{_1c1[_1ca]=nf;}}else{_1c8.push(nf);}});}var _1cc=_1bf["markupFactory"];if(!_1cc&&_1bf["prototype"]){_1cc=_1bf.prototype["markupFactory"];}var _1cd=_1cc?_1cc(_1c1,node,_1bf):new _1bf(_1c1,node);_1bb.push(_1cd);var _1ce=node.getAttribute("jsId");if(_1ce){d.setObject(_1ce,_1cd);}if(!ps){d.forEach(_1c7,function(_1cf){d.connect(_1cd,_1cf.event,null,_1cf.func);});d.forEach(_1c8,function(func){func.call(_1cd);});}});d.forEach(_1bb,function(_1d1){if(_1d1&&_1d1.startup&&!_1d1._started&&(!_1d1.getParent||!_1d1.getParent())){_1d1.startup();}});return _1bb;};this.parse=function(_1d2){var list=d.query(qry,_1d2);var _1d4=this.instantiate(list);return _1d4;};}();(function(){var _1d5=function(){if(dojo.config["parseOnLoad"]==true){dojo.parser.parse();}};if(dojo.exists("dijit.wai.onload")&&(dijit.wai.onload===dojo._loaders[0])){dojo._loaders.splice(1,0,_1d5);}else{dojo._loaders.unshift(_1d5);}})();dojo.parser._anonCtr=0;dojo.parser._anon={};dojo.parser._nameAnonFunc=function(_1d6,_1d7){var jpn="$joinpoint";var nso=(_1d7||dojo.parser._anon);if(dojo.isIE){var cn=_1d6["__dojoNameCache"];if(cn&&nso[cn]===_1d6){return _1d6["__dojoNameCache"];}}var ret="__"+dojo.parser._anonCtr++;while(typeof nso[ret]!="undefined"){ret="__"+dojo.parser._anonCtr++;}nso[ret]=_1d6;return ret;};}if(!dojo._hasResource["dijit._Templated"]){dojo._hasResource["dijit._Templated"]=true;dojo.provide("dijit._Templated");dojo.declare("dijit._Templated",null,{templateNode:null,templateString:null,templatePath:null,widgetsInTemplate:false,containerNode:null,_skipNodeCache:false,_stringRepl:function(tmpl){var _1dd=this.declaredClass,_1de=this;return dojo.string.substitute(tmpl,this,function(_1df,key){if(key.charAt(0)=="!"){_1df=_1de[key.substr(1)];}if(typeof _1df=="undefined"){throw new Error(_1dd+" template:"+key);}if(!_1df){return "";}return key.charAt(0)=="!"?_1df:_1df.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){var _1e1=dijit._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);var node;if(dojo.isString(_1e1)){node=dijit._Templated._createNodesFromText(this._stringRepl(_1e1))[0];}else{node=_1e1.cloneNode(true);}this._attachTemplateNodes(node);var _1e3=this.srcNodeRef;if(_1e3&&_1e3.parentNode){_1e3.parentNode.replaceChild(node,_1e3);}this.domNode=node;if(this.widgetsInTemplate){var cw=this._supportingWidgets=dojo.parser.parse(node);this._attachTemplateNodes(cw,function(n,p){return n[p];});}this._fillContent(_1e3);},_fillContent:function(_1e7){var dest=this.containerNode;if(_1e7&&dest){while(_1e7.hasChildNodes()){dest.appendChild(_1e7.firstChild);}}},_attachTemplateNodes:function(_1e9,_1ea){_1ea=_1ea||function(n,p){return n.getAttribute(p);};var _1ed=dojo.isArray(_1e9)?_1e9:(_1e9.all||_1e9.getElementsByTagName("*"));var x=dojo.isArray(_1e9)?0:-1;for(;x<_1ed.length;x++){var _1ef=(x==-1)?_1e9:_1ed[x];if(this.widgetsInTemplate&&_1ea(_1ef,"dojoType")){continue;}var _1f0=_1ea(_1ef,"dojoAttachPoint");if(_1f0){var _1f1,_1f2=_1f0.split(/\s*,\s*/);while((_1f1=_1f2.shift())){if(dojo.isArray(this[_1f1])){this[_1f1].push(_1ef);}else{this[_1f1]=_1ef;}}}var _1f3=_1ea(_1ef,"dojoAttachEvent");if(_1f3){var _1f4,_1f5=_1f3.split(/\s*,\s*/);var trim=dojo.trim;while((_1f4=_1f5.shift())){if(_1f4){var _1f7=null;if(_1f4.indexOf(":")!=-1){var _1f8=_1f4.split(":");_1f4=trim(_1f8[0]);_1f7=trim(_1f8[1]);}else{_1f4=trim(_1f4);}if(!_1f7){_1f7=_1f4;}this.connect(_1ef,_1f4,_1f7);}}}var role=_1ea(_1ef,"waiRole");if(role){dijit.setWaiRole(_1ef,role);}var _1fa=_1ea(_1ef,"waiState");if(_1fa){dojo.forEach(_1fa.split(/\s*,\s*/),function(_1fb){if(_1fb.indexOf("-")!=-1){var pair=_1fb.split("-");dijit.setWaiState(_1ef,pair[0],pair[1]);}});}}}});dijit._Templated._templateCache={};dijit._Templated.getCachedTemplate=function(_1fd,_1fe,_1ff){var _200=dijit._Templated._templateCache;var key=_1fe||_1fd;var _202=_200[key];if(_202){return _202;}if(!_1fe){_1fe=dijit._Templated._sanitizeTemplateString(dojo._getText(_1fd));}_1fe=dojo.string.trim(_1fe);if(_1ff||_1fe.match(/\$\{([^\}]+)\}/g)){return (_200[key]=_1fe);}else{return (_200[key]=dijit._Templated._createNodesFromText(_1fe)[0]);}};dijit._Templated._sanitizeTemplateString=function(_203){if(_203){_203=_203.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var _204=_203.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_204){_203=_204[1];}}else{_203="";}return _203;};if(dojo.isIE){dojo.addOnUnload(function(){var _205=dijit._Templated._templateCache;for(var key in _205){var _207=_205[key];if(!isNaN(_207.nodeType)){dojo._destroyElement(_207);}delete _205[key];}});}(function(){var _208={cell:{re:/^<t[dh][\s\r\n>]/i,pre:"<table><tbody><tr>",post:"</tr></tbody></table>"},row:{re:/^<tr[\s\r\n>]/i,pre:"<table><tbody>",post:"</tbody></table>"},section:{re:/^<(thead|tbody|tfoot)[\s\r\n>]/i,pre:"<table>",post:"</table>"}};var tn;dijit._Templated._createNodesFromText=function(text){if(!tn){tn=dojo.doc.createElement("div");tn.style.display="none";dojo.body().appendChild(tn);}var _20b="none";var _20c=text.replace(/^\s+/,"");for(var type in _208){var map=_208[type];if(map.re.test(_20c)){_20b=type;text=map.pre+text+map.post;break;}}tn.innerHTML=text;if(tn.normalize){tn.normalize();}var tag={cell:"tr",row:"tbody",section:"table"}[_20b];var _210=(typeof tag!="undefined")?tn.getElementsByTagName(tag)[0]:tn;var _211=[];while(_210.firstChild){_211.push(_210.removeChild(_210.firstChild));}tn.innerHTML="";return _211;};})();dojo.extend(dijit._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});}if(!dojo._hasResource["dijit._Container"]){dojo._hasResource["dijit._Container"]=true;dojo.provide("dijit._Container");dojo.declare("dijit._Contained",null,{getParent:function(){for(var p=this.domNode.parentNode;p;p=p.parentNode){var id=p.getAttribute&&p.getAttribute("widgetId");if(id){var _214=dijit.byId(id);return _214.isContainer?_214:null;}}return null;},_getSibling:function(_215){var node=this.domNode;do{node=node[_215+"Sibling"];}while(node&&node.nodeType!=1);if(!node){return null;}var id=node.getAttribute("widgetId");return dijit.byId(id);},getPreviousSibling:function(){return this._getSibling("previous");},getNextSibling:function(){return this._getSibling("next");}});dojo.declare("dijit._Container",null,{isContainer:true,addChild:function(_218,_219){if(_219===undefined){_219="last";}var _21a=this.containerNode||this.domNode;if(_219&&typeof _219=="number"){var _21b=dojo.query("> [widgetid]",_21a);if(_21b&&_21b.length>=_219){_21a=_21b[_219-1];_219="after";}}dojo.place(_218.domNode,_21a,_219);if(this._started&&!_218._started){_218.startup();}},removeChild:function(_21c){var node=_21c.domNode;node.parentNode.removeChild(node);},_nextElement:function(node){do{node=node.nextSibling;}while(node&&node.nodeType!=1);return node;},_firstElement:function(node){node=node.firstChild;if(node&&node.nodeType!=1){node=this._nextElement(node);}return node;},getChildren:function(){return dojo.query("> [widgetId]",this.containerNode||this.domNode).map(dijit.byNode);},hasChildren:function(){var cn=this.containerNode||this.domNode;return !!this._firstElement(cn);},_getSiblingOfChild:function(_221,dir){var node=_221.domNode;var _224=(dir>0?"nextSibling":"previousSibling");do{node=node[_224];}while(node&&(node.nodeType!=1||!dijit.byNode(node)));return node?dijit.byNode(node):null;}});dojo.declare("dijit._KeyNavContainer",[dijit._Container],{_keyNavCodes:{},connectKeyNavHandlers:function(_225,_226){var _227=this._keyNavCodes={};var prev=dojo.hitch(this,this.focusPrev);var next=dojo.hitch(this,this.focusNext);dojo.forEach(_225,function(code){_227[code]=prev;});dojo.forEach(_226,function(code){_227[code]=next;});this.connect(this.domNode,"onkeypress","_onContainerKeypress");this.connect(this.domNode,"onfocus","_onContainerFocus");},startupKeyNavChildren:function(){dojo.forEach(this.getChildren(),dojo.hitch(this,"_startupChild"));},addChild:function(_22c,_22d){dijit._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(_22c);},focus:function(){this.focusFirstChild();},focusFirstChild:function(){this.focusChild(this._getFirstFocusableChild());},focusNext:function(){if(this.focusedChild&&this.focusedChild.hasNextFocalNode&&this.focusedChild.hasNextFocalNode()){this.focusedChild.focusNext();return;}var _22e=this._getNextFocusableChild(this.focusedChild,1);if(_22e.getFocalNodes){this.focusChild(_22e,_22e.getFocalNodes()[0]);}else{this.focusChild(_22e);}},focusPrev:function(){if(this.focusedChild&&this.focusedChild.hasPrevFocalNode&&this.focusedChild.hasPrevFocalNode()){this.focusedChild.focusPrev();return;}var _22f=this._getNextFocusableChild(this.focusedChild,-1);if(_22f.getFocalNodes){var _230=_22f.getFocalNodes();this.focusChild(_22f,_230[_230.length-1]);}else{this.focusChild(_22f);}},focusChild:function(_231,node){if(_231){if(this.focusedChild&&_231!==this.focusedChild){this._onChildBlur(this.focusedChild);}this.focusedChild=_231;if(node&&_231.focusFocalNode){_231.focusFocalNode(node);}else{_231.focus();}}},_startupChild:function(_233){if(_233.getFocalNodes){dojo.forEach(_233.getFocalNodes(),function(node){dojo.attr(node,"tabindex",-1);this._connectNode(node);},this);}else{var node=_233.focusNode||_233.domNode;if(_233.isFocusable()){dojo.attr(node,"tabindex",-1);}this._connectNode(node);}},_connectNode:function(node){this.connect(node,"onfocus","_onNodeFocus");this.connect(node,"onblur","_onNodeBlur");},_onContainerFocus:function(evt){if(evt.target===this.domNode){this.focusFirstChild();}},_onContainerKeypress:function(evt){if(evt.ctrlKey||evt.altKey){return;}var func=this._keyNavCodes[evt.keyCode];if(func){func();dojo.stopEvent(evt);}},_onNodeFocus:function(evt){dojo.attr(this.domNode,"tabindex",-1);var _23b=dijit.getEnclosingWidget(evt.target);if(_23b&&_23b.isFocusable()){this.focusedChild=_23b;}dojo.stopEvent(evt);},_onNodeBlur:function(evt){if(this.tabIndex){dojo.attr(this.domNode,"tabindex",this.tabIndex);}dojo.stopEvent(evt);},_onChildBlur:function(_23d){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1);},_getNextFocusableChild:function(_23e,dir){if(_23e){_23e=this._getSiblingOfChild(_23e,dir);}var _240=this.getChildren();for(var i=0;i<_240.length;i++){if(!_23e){_23e=_240[(dir>0)?0:(_240.length-1)];}if(_23e.isFocusable()){return _23e;}_23e=this._getSiblingOfChild(_23e,dir);}return null;}});}if(!dojo._hasResource["dijit.layout._LayoutWidget"]){dojo._hasResource["dijit.layout._LayoutWidget"]=true;dojo.provide("dijit.layout._LayoutWidget");dojo.declare("dijit.layout._LayoutWidget",[dijit._Widget,dijit._Container,dijit._Contained],{isLayoutContainer:true,postCreate:function(){dojo.addClass(this.domNode,"dijitContainer");},startup:function(){if(this._started){return;}dojo.forEach(this.getChildren(),function(_242){_242.startup();});if(!this.getParent||!this.getParent()){this.resize();this.connect(window,"onresize",function(){this.resize();});}this.inherited(arguments);},resize:function(args){var node=this.domNode;if(args){dojo.marginBox(node,args);if(args.t){node.style.top=args.t+"px";}if(args.l){node.style.left=args.l+"px";}}var mb=dojo.mixin(dojo.marginBox(node),args||{});this._contentBox=dijit.layout.marginBox2contentBox(node,mb);this.layout();},layout:function(){}});dijit.layout.marginBox2contentBox=function(node,mb){var cs=dojo.getComputedStyle(node);var me=dojo._getMarginExtents(node,cs);var pb=dojo._getPadBorderExtents(node,cs);return {l:dojo._toPixelValue(node,cs.paddingLeft),t:dojo._toPixelValue(node,cs.paddingTop),w:mb.w-(me.w+pb.w),h:mb.h-(me.h+pb.h)};};(function(){var _24b=function(word){return word.substring(0,1).toUpperCase()+word.substring(1);};var size=function(_24e,dim){_24e.resize?_24e.resize(dim):dojo.marginBox(_24e.domNode,dim);dojo.mixin(_24e,dojo.marginBox(_24e.domNode));dojo.mixin(_24e,dim);};dijit.layout.layoutChildren=function(_250,dim,_252){dim=dojo.mixin({},dim);dojo.addClass(_250,"dijitLayoutContainer");_252=dojo.filter(_252,function(item){return item.layoutAlign!="client";}).concat(dojo.filter(_252,function(item){return item.layoutAlign=="client";}));dojo.forEach(_252,function(_255){var elm=_255.domNode,pos=_255.layoutAlign;var _258=elm.style;_258.left=dim.l+"px";_258.top=dim.t+"px";_258.bottom=_258.right="auto";dojo.addClass(elm,"dijitAlign"+_24b(pos));if(pos=="top"||pos=="bottom"){size(_255,{w:dim.w});dim.h-=_255.h;if(pos=="top"){dim.t+=_255.h;}else{_258.top=dim.t+dim.h+"px";}}else{if(pos=="left"||pos=="right"){size(_255,{h:dim.h});dim.w-=_255.w;if(pos=="left"){dim.l+=_255.w;}else{_258.left=dim.l+dim.w+"px";}}else{if(pos=="client"){size(_255,dim);}}}});};})();}if(!dojo._hasResource["dojo.i18n"]){dojo._hasResource["dojo.i18n"]=true;dojo.provide("dojo.i18n");dojo.i18n.getLocalization=function(_259,_25a,_25b){_25b=dojo.i18n.normalizeLocale(_25b);var _25c=_25b.split("-");var _25d=[_259,"nls",_25a].join(".");var _25e=dojo._loadedModules[_25d];if(_25e){var _25f;for(var i=_25c.length;i>0;i--){var loc=_25c.slice(0,i).join("_");if(_25e[loc]){_25f=_25e[loc];break;}}if(!_25f){_25f=_25e.ROOT;}if(_25f){var _262=function(){};_262.prototype=_25f;return new _262();}}throw new Error("Bundle not found: "+_25a+" in "+_259+" , locale="+_25b);};dojo.i18n.normalizeLocale=function(_263){var _264=_263?_263.toLowerCase():dojo.locale;if(_264=="root"){_264="ROOT";}return _264;};dojo.i18n._requireLocalization=function(_265,_266,_267,_268){var _269=dojo.i18n.normalizeLocale(_267);var _26a=[_265,"nls",_266].join(".");var _26b="";if(_268){var _26c=_268.split(",");for(var i=0;i<_26c.length;i++){if(_269.indexOf(_26c[i])==0){if(_26c[i].length>_26b.length){_26b=_26c[i];}}}if(!_26b){_26b="ROOT";}}var _26e=_268?_26b:_269;var _26f=dojo._loadedModules[_26a];var _270=null;if(_26f){if(dojo.config.localizationComplete&&_26f._built){return;}var _271=_26e.replace(/-/g,"_");var _272=_26a+"."+_271;_270=dojo._loadedModules[_272];}if(!_270){_26f=dojo["provide"](_26a);var syms=dojo._getModuleSymbols(_265);var _274=syms.concat("nls").join("/");var _275;dojo.i18n._searchLocalePath(_26e,_268,function(loc){var _277=loc.replace(/-/g,"_");var _278=_26a+"."+_277;var _279=false;if(!dojo._loadedModules[_278]){dojo["provide"](_278);var _27a=[_274];if(loc!="ROOT"){_27a.push(loc);}_27a.push(_266);var _27b=_27a.join("/")+".js";_279=dojo._loadPath(_27b,null,function(hash){var _27d=function(){};_27d.prototype=_275;_26f[_277]=new _27d();for(var j in hash){_26f[_277][j]=hash[j];}});}else{_279=true;}if(_279&&_26f[_277]){_275=_26f[_277];}else{_26f[_277]=_275;}if(_268){return true;}});}if(_268&&_269!=_26b){_26f[_269.replace(/-/g,"_")]=_26f[_26b.replace(/-/g,"_")];}};(function(){var _27f=dojo.config.extraLocale;if(_27f){if(!_27f instanceof Array){_27f=[_27f];}var req=dojo.i18n._requireLocalization;dojo.i18n._requireLocalization=function(m,b,_283,_284){req(m,b,_283,_284);if(_283){return;}for(var i=0;i<_27f.length;i++){req(m,b,_27f[i],_284);}};}})();dojo.i18n._searchLocalePath=function(_286,down,_288){_286=dojo.i18n.normalizeLocale(_286);var _289=_286.split("-");var _28a=[];for(var i=_289.length;i>0;i--){_28a.push(_289.slice(0,i).join("-"));}_28a.push(false);if(down){_28a.reverse();}for(var j=_28a.length-1;j>=0;j--){var loc=_28a[j]||"ROOT";var stop=_288(loc);if(stop){break;}}};dojo.i18n._preloadLocalizations=function(_28f,_290){function preload(_291){_291=dojo.i18n.normalizeLocale(_291);dojo.i18n._searchLocalePath(_291,true,function(loc){for(var i=0;i<_290.length;i++){if(_290[i]==loc){dojo["require"](_28f+"_"+loc);return true;}}return false;});};preload();var _294=dojo.config.extraLocale||[];for(var i=0;i<_294.length;i++){preload(_294[i]);}};}if(!dojo._hasResource["dijit.layout.ContentPane"]){dojo._hasResource["dijit.layout.ContentPane"]=true;dojo.provide("dijit.layout.ContentPane");dojo.declare("dijit.layout.ContentPane",dijit._Widget,{href:"",extractContent:false,parseOnLoad:true,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",isLoaded:false,"class":"dijitContentPane",doLayout:"auto",postCreate:function(){this.domNode.title="";if(!this.containerNode){this.containerNode=this.domNode;}if(this.preload){this._loadCheck();}var _296=dojo.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=dojo.string.substitute(this.loadingMessage,_296);this.errorMessage=dojo.string.substitute(this.errorMessage,_296);var _297=dijit.getWaiRole(this.domNode);if(!_297){dijit.setWaiRole(this.domNode,"group");}dojo.addClass(this.domNode,this["class"]);},startup:function(){if(this._started){return;}if(this.doLayout!="false"&&this.doLayout!==false){this._checkIfSingleChild();if(this._singleChild){this._singleChild.startup();}}this._loadCheck();this.inherited(arguments);},_checkIfSingleChild:function(){var _298=dojo.query(">",this.containerNode||this.domNode),_299=_298.filter("[widgetId]");if(_298.length==1&&_299.length==1){this.isContainer=true;this._singleChild=dijit.byNode(_299[0]);}else{delete this.isContainer;delete this._singleChild;}},refresh:function(){return this._prepareLoad(true);},setHref:function(href){this.href=href;return this._prepareLoad();},setContent:function(data){if(!this._isDownloaded){this.href="";this._onUnloadHandler();}this._setContent(data||"");this._isDownloaded=false;if(this.parseOnLoad){this._createSubWidgets();}if(this.doLayout!="false"&&this.doLayout!==false){this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){this._singleChild.startup();this._singleChild.resize(this._contentBox||dojo.contentBox(this.containerNode||this.domNode));}}this._onLoadHandler();},cancel:function(){if(this._xhrDfd&&(this._xhrDfd.fired==-1)){this._xhrDfd.cancel();}delete this._xhrDfd;},destroy:function(){if(this._beingDestroyed){return;}this._onUnloadHandler();this._beingDestroyed=true;this.inherited("destroy",arguments);},resize:function(size){dojo.marginBox(this.domNode,size);var node=this.containerNode||this.domNode,mb=dojo.mixin(dojo.marginBox(node),size||{});this._contentBox=dijit.layout.marginBox2contentBox(node,mb);if(this._singleChild&&this._singleChild.resize){this._singleChild.resize(this._contentBox);}},_prepareLoad:function(_29f){this.cancel();this.isLoaded=false;this._loadCheck(_29f);},_isShown:function(){if("open" in this){return this.open;}else{var node=this.domNode;return (node.style.display!="none")&&(node.style.visibility!="hidden");}},_loadCheck:function(_2a1){var _2a2=this._isShown();if(this.href&&(_2a1||(this.preload&&!this._xhrDfd)||(this.refreshOnShow&&_2a2&&!this._xhrDfd)||(!this.isLoaded&&_2a2&&!this._xhrDfd))){this._downloadExternalContent();}},_downloadExternalContent:function(){this._onUnloadHandler();this._setContent(this.onDownloadStart.call(this));var self=this;var _2a4={preventCache:(this.preventCache||this.refreshOnShow),url:this.href,handleAs:"text"};if(dojo.isObject(this.ioArgs)){dojo.mixin(_2a4,this.ioArgs);}var hand=this._xhrDfd=(this.ioMethod||dojo.xhrGet)(_2a4);hand.addCallback(function(html){try{self.onDownloadEnd.call(self);self._isDownloaded=true;self.setContent.call(self,html);}catch(err){self._onError.call(self,"Content",err);}delete self._xhrDfd;return html;});hand.addErrback(function(err){if(!hand.cancelled){self._onError.call(self,"Download",err);}delete self._xhrDfd;return err;});},_onLoadHandler:function(){this.isLoaded=true;try{this.onLoad.call(this);}catch(e){console.error("Error "+this.widgetId+" running custom onLoad code");}},_onUnloadHandler:function(){this.isLoaded=false;this.cancel();try{this.onUnload.call(this);}catch(e){console.error("Error "+this.widgetId+" running custom onUnload code");}},_setContent:function(cont){this.destroyDescendants();try{var node=this.containerNode||this.domNode;while(node.firstChild){dojo._destroyElement(node.firstChild);}if(typeof cont=="string"){if(this.extractContent){match=cont.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(match){cont=match[1];}}node.innerHTML=cont;}else{if(cont.nodeType){node.appendChild(cont);}else{dojo.forEach(cont,function(n){node.appendChild(n.cloneNode(true));});}}}catch(e){var _2ab=this.onContentError(e);try{node.innerHTML=_2ab;}catch(e){console.error("Fatal "+this.id+" could not change content due to "+e.message,e);}}},_onError:function(type,err,_2ae){var _2af=this["on"+type+"Error"].call(this,err);if(_2ae){console.error(_2ae,err);}else{if(_2af){this._setContent.call(this,_2af);}}},_createSubWidgets:function(){var _2b0=this.containerNode||this.domNode;try{dojo.parser.parse(_2b0,true);}catch(e){this._onError("Content",e,"Couldn't create widgets in "+this.id+(this.href?" from "+this.href:""));}},onLoad:function(e){},onUnload:function(e){},onDownloadStart:function(){return this.loadingMessage;},onContentError:function(_2b3){},onDownloadError:function(_2b4){return this.errorMessage;},onDownloadEnd:function(){}});}if(!dojo._hasResource["dijit.form.Form"]){dojo._hasResource["dijit.form.Form"]=true;dojo.provide("dijit.form.Form");dojo.declare("dijit.form._FormMixin",null,{reset:function(){dojo.forEach(this.getDescendants(),function(_2b5){if(_2b5.reset){_2b5.reset();}});},validate:function(){var _2b6=false;return dojo.every(dojo.map(this.getDescendants(),function(_2b7){_2b7._hasBeenBlurred=true;var _2b8=!_2b7.validate||_2b7.validate();if(!_2b8&&!_2b6){dijit.scrollIntoView(_2b7.containerNode||_2b7.domNode);_2b7.focus();_2b6=true;}return _2b8;}),"return item;");},setValues:function(obj){var map={};dojo.forEach(this.getDescendants(),function(_2bb){if(!_2bb.name){return;}var _2bc=map[_2bb.name]||(map[_2bb.name]=[]);_2bc.push(_2bb);});for(var name in map){var _2be=map[name],_2bf=dojo.getObject(name,false,obj);if(!dojo.isArray(_2bf)){_2bf=[_2bf];}if(typeof _2be[0].checked=="boolean"){dojo.forEach(_2be,function(w,i){w.setValue(dojo.indexOf(_2bf,w.value)!=-1);});}else{if(_2be[0]._multiValue){_2be[0].setValue(_2bf);}else{dojo.forEach(_2be,function(w,i){w.setValue(_2bf[i]);});}}}},getValues:function(){var obj={};dojo.forEach(this.getDescendants(),function(_2c5){var name=_2c5.name;if(!name){return;}var _2c7=(_2c5.getValue&&!_2c5._getValueDeprecated)?_2c5.getValue():_2c5.value;if(typeof _2c5.checked=="boolean"){if(/Radio/.test(_2c5.declaredClass)){if(_2c7!==false){dojo.setObject(name,_2c7,obj);}}else{var ary=dojo.getObject(name,false,obj);if(!ary){ary=[];dojo.setObject(name,ary,obj);}if(_2c7!==false){ary.push(_2c7);}}}else{dojo.setObject(name,_2c7,obj);}});return obj;},isValid:function(){return dojo.every(this.getDescendants(),function(_2c9){return !_2c9.isValid||_2c9.isValid();});}});dojo.declare("dijit.form.Form",[dijit._Widget,dijit._Templated,dijit.form._FormMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' name='${name}'></form>",attributeMap:dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap),{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),execute:function(_2ca){},onExecute:function(){},setAttribute:function(attr,_2cc){this.inherited(arguments);switch(attr){case "encType":if(dojo.isIE){this.domNode.encoding=_2cc;}}},postCreate:function(){if(dojo.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){var item=this.srcNodeRef.attributes.getNamedItem("encType");if(item&&!item.specified&&(typeof item.value=="string")){this.setAttribute("encType",item.value);}}this.inherited(arguments);},onReset:function(e){return true;},_onReset:function(e){var faux={returnValue:true,preventDefault:function(){this.returnValue=false;},stopPropagation:function(){},currentTarget:e.currentTarget,target:e.target};if(!(this.onReset(faux)===false)&&faux.returnValue){this.reset();}dojo.stopEvent(e);return false;},_onSubmit:function(e){var fp=dijit.form.Form.prototype;if(this.execute!=fp.execute||this.onExecute!=fp.onExecute){dojo.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues());}if(this.onSubmit(e)===false){dojo.stopEvent(e);}},onSubmit:function(e){return this.isValid();},submit:function(){if(!(this.onSubmit()===false)){this.containerNode.submit();}}});}if(!dojo._hasResource["dijit.Dialog"]){dojo._hasResource["dijit.Dialog"]=true;dojo.provide("dijit.Dialog");dojo.declare("dijit.DialogUnderlay",[dijit._Widget,dijit._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper' id='${id}_wrapper'><div class='dijitDialogUnderlay ${class}' id='${id}' dojoAttachPoint='node'></div></div>",attributeMap:{},postCreate:function(){dojo.body().appendChild(this.domNode);this.bgIframe=new dijit.BackgroundIframe(this.domNode);},layout:function(){var _2d4=dijit.getViewport();var is=this.node.style,os=this.domNode.style;os.top=_2d4.t+"px";os.left=_2d4.l+"px";is.width=_2d4.w+"px";is.height=_2d4.h+"px";var _2d7=dijit.getViewport();if(_2d4.w!=_2d7.w){is.width=_2d7.w+"px";}if(_2d4.h!=_2d7.h){is.height=_2d7.h+"px";}},show:function(){this.domNode.style.display="block";this.layout();if(this.bgIframe.iframe){this.bgIframe.iframe.style.display="block";}this._resizeHandler=this.connect(window,"onresize","layout");},hide:function(){this.domNode.style.display="none";if(this.bgIframe.iframe){this.bgIframe.iframe.style.display="none";}this.disconnect(this._resizeHandler);},uninitialize:function(){if(this.bgIframe){this.bgIframe.destroy();}}});dojo.declare("dijit._DialogMixin",null,{attributeMap:dijit._Widget.prototype.attributeMap,execute:function(_2d8){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.getValues());},_getFocusItems:function(_2d9){var _2da=dijit.getFirstInTabbingOrder(_2d9);this._firstFocusItem=_2da?_2da:_2d9;_2da=dijit.getLastInTabbingOrder(_2d9);this._lastFocusItem=_2da?_2da:this._firstFocusItem;if(dojo.isMoz&&this._firstFocusItem.tagName.toLowerCase()=="input"&&dojo.attr(this._firstFocusItem,"type").toLowerCase()=="file"){dojo.attr(_2d9,"tabindex","0");this._firstFocusItem=_2d9;}}});dojo.declare("dijit.Dialog",[dijit.layout.ContentPane,dijit._Templated,dijit.form._FormMixin,dijit._DialogMixin],{templateString:null,templateString:"<div class=\"dijitDialog\" tabindex=\"-1\" waiRole=\"dialog\" waiState=\"labelledby-${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\">${title}</span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n",open:false,duration:400,refocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,attributeMap:dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap),{title:"titleBar"}),postCreate:function(){dojo.body().appendChild(this.domNode);this.inherited(arguments);var _2db=dojo.i18n.getLocalization("dijit","common");if(this.closeButtonNode){this.closeButtonNode.setAttribute("title",_2db.buttonCancel);}if(this.closeText){this.closeText.setAttribute("title",_2db.buttonCancel);}var s=this.domNode.style;s.visibility="hidden";s.position="absolute";s.display="";s.top="-9999px";this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[];},onLoad:function(){this._position();this.inherited(arguments);},_setup:function(){if(this.titleBar){this._moveable=new dojo.dnd.TimedMoveable(this.domNode,{handle:this.titleBar,timeout:0});}this._underlay=new dijit.DialogUnderlay({id:this.id+"_underlay","class":dojo.map(this["class"].split(/\s/),function(s){return s+"_underlay";}).join(" ")});var node=this.domNode;this._fadeIn=dojo.fx.combine([dojo.fadeIn({node:node,duration:this.duration}),dojo.fadeIn({node:this._underlay.domNode,duration:this.duration,onBegin:dojo.hitch(this._underlay,"show")})]);this._fadeOut=dojo.fx.combine([dojo.fadeOut({node:node,duration:this.duration,onEnd:function(){node.style.visibility="hidden";node.style.top="-9999px";}}),dojo.fadeOut({node:this._underlay.domNode,duration:this.duration,onEnd:dojo.hitch(this._underlay,"hide")})]);},uninitialize:function(){if(this._fadeIn&&this._fadeIn.status()=="playing"){this._fadeIn.stop();}if(this._fadeOut&&this._fadeOut.status()=="playing"){this._fadeOut.stop();}if(this._underlay){this._underlay.destroy();}},_position:function(){if(dojo.hasClass(dojo.body(),"dojoMove")){return;}var _2df=dijit.getViewport();var mb=dojo.marginBox(this.domNode);var _2e1=this.domNode.style;_2e1.left=Math.floor((_2df.l+(_2df.w-mb.w)/2))+"px";_2e1.top=Math.floor((_2df.t+(_2df.h-mb.h)/2))+"px";},_onKey:function(evt){if(evt.keyCode){var node=evt.target;if(evt.keyCode==dojo.keys.TAB){this._getFocusItems(this.domNode);}var _2e4=(this._firstFocusItem==this._lastFocusItem);if(node==this._firstFocusItem&&evt.shiftKey&&evt.keyCode==dojo.keys.TAB){if(!_2e4){dijit.focus(this._lastFocusItem);}dojo.stopEvent(evt);}else{if(node==this._lastFocusItem&&evt.keyCode==dojo.keys.TAB&&!evt.shiftKey){if(!_2e4){dijit.focus(this._firstFocusItem);}dojo.stopEvent(evt);}else{while(node){if(node==this.domNode){if(evt.keyCode==dojo.keys.ESCAPE){this.hide();}else{return;}}node=node.parentNode;}if(evt.keyCode!=dojo.keys.TAB){dojo.stopEvent(evt);}else{if(!dojo.isOpera){try{this._firstFocusItem.focus();}catch(e){}}}}}}},show:function(){if(this.open){return;}if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true;}if(this._fadeOut.status()=="playing"){this._fadeOut.stop();}this._modalconnects.push(dojo.connect(window,"onscroll",this,"layout"));this._modalconnects.push(dojo.connect(dojo.doc.documentElement,"onkeypress",this,"_onKey"));dojo.style(this.domNode,"opacity",0);this.domNode.style.visibility="";this.open=true;this._loadCheck();this._position();this._fadeIn.play();this._savedFocus=dijit.getFocus(this);this._getFocusItems(this.domNode);setTimeout(dojo.hitch(this,function(){dijit.focus(this._firstFocusItem);}),50);},hide:function(){if(!this._alreadyInitialized){return;}if(this._fadeIn.status()=="playing"){this._fadeIn.stop();}this._fadeOut.play();if(this._scrollConnected){this._scrollConnected=false;}dojo.forEach(this._modalconnects,dojo.disconnect);this._modalconnects=[];if(this.refocus){this.connect(this._fadeOut,"onEnd",dojo.hitch(dijit,"focus",this._savedFocus));}this.open=false;},layout:function(){if(this.domNode.style.visibility!="hidden"){this._underlay.layout();this._position();}},destroy:function(){dojo.forEach(this._modalconnects,dojo.disconnect);if(this.refocus&&this.open){var fo=this._savedFocus;setTimeout(dojo.hitch(dijit,"focus",fo),25);}this.inherited(arguments);}});dojo.declare("dijit.TooltipDialog",[dijit.layout.ContentPane,dijit._Templated,dijit.form._FormMixin,dijit._DialogMixin],{title:"",doLayout:false,_firstFocusItem:null,_lastFocusItem:null,templateString:null,templateString:"<div class=\"dijitTooltipDialog\" waiRole=\"presentation\">\n\t<div class=\"dijitTooltipContainer\" waiRole=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" tabindex=\"-1\" waiRole=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" waiRole=\"presenation\"></div>\n</div>\n",postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey");this.containerNode.title=this.title;},orient:function(node,_2e7,_2e8){this.domNode.className="dijitTooltipDialog "+" dijitTooltipAB"+(_2e8.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(_2e8.charAt(0)=="T"?"Below":"Above");},onOpen:function(pos){this._getFocusItems(this.containerNode);this.orient(this.domNode,pos.aroundCorner,pos.corner);this._loadCheck();dijit.focus(this._firstFocusItem);},_onKey:function(evt){var node=evt.target;if(evt.keyCode==dojo.keys.TAB){this._getFocusItems(this.containerNode);}var _2ec=(this._firstFocusItem==this._lastFocusItem);if(evt.keyCode==dojo.keys.ESCAPE){this.onCancel();}else{if(node==this._firstFocusItem&&evt.shiftKey&&evt.keyCode==dojo.keys.TAB){if(!_2ec){dijit.focus(this._lastFocusItem);}dojo.stopEvent(evt);}else{if(node==this._lastFocusItem&&evt.keyCode==dojo.keys.TAB&&!evt.shiftKey){if(!_2ec){dijit.focus(this._firstFocusItem);}dojo.stopEvent(evt);}else{if(evt.keyCode==dojo.keys.TAB){evt.stopPropagation();}}}}}});}if(!dojo._hasResource["dijit._editor.selection"]){dojo._hasResource["dijit._editor.selection"]=true;dojo.provide("dijit._editor.selection");dojo.mixin(dijit._editor.selection,{getType:function(){if(dojo.doc.selection){return dojo.doc.selection.type.toLowerCase();}else{var _2ed="text";var oSel;try{oSel=dojo.global.getSelection();}catch(e){}if(oSel&&oSel.rangeCount==1){var _2ef=oSel.getRangeAt(0);if((_2ef.startContainer==_2ef.endContainer)&&((_2ef.endOffset-_2ef.startOffset)==1)&&(_2ef.startContainer.nodeType!=3)){_2ed="control";}}return _2ed;}},getSelectedText:function(){if(dojo.doc.selection){if(dijit._editor.selection.getType()=="control"){return null;}return dojo.doc.selection.createRange().text;}else{var _2f0=dojo.global.getSelection();if(_2f0){return _2f0.toString();}}return "";},getSelectedHtml:function(){if(dojo.doc.selection){if(dijit._editor.selection.getType()=="control"){return null;}return dojo.doc.selection.createRange().htmlText;}else{var _2f1=dojo.global.getSelection();if(_2f1&&_2f1.rangeCount){var frag=_2f1.getRangeAt(0).cloneContents();var div=dojo.doc.createElement("div");div.appendChild(frag);return div.innerHTML;}return null;}},getSelectedElement:function(){if(this.getType()=="control"){if(dojo.doc.selection){var _2f4=dojo.doc.selection.createRange();if(_2f4&&_2f4.item){return dojo.doc.selection.createRange().item(0);}}else{var _2f5=dojo.global.getSelection();return _2f5.anchorNode.childNodes[_2f5.anchorOffset];}}return null;},getParentElement:function(){if(this.getType()=="control"){var p=this.getSelectedElement();if(p){return p.parentNode;}}else{if(dojo.doc.selection){return dojo.doc.selection.createRange().parentElement();}else{var _2f7=dojo.global.getSelection();if(_2f7){var node=_2f7.anchorNode;while(node&&(node.nodeType!=1)){node=node.parentNode;}return node;}}}return null;},hasAncestorElement:function(_2f9){return this.getAncestorElement.apply(this,arguments)!=null;},getAncestorElement:function(_2fa){var node=this.getSelectedElement()||this.getParentElement();return this.getParentOfType(node,arguments);},isTag:function(node,tags){if(node&&node.tagName){var _nlc=node.tagName.toLowerCase();for(var i=0;i<tags.length;i++){var _tlc=String(tags[i]).toLowerCase();if(_nlc==_tlc){return _tlc;}}}return "";},getParentOfType:function(node,tags){while(node){if(this.isTag(node,tags).length){return node;}node=node.parentNode;}return null;},collapse:function(_303){if(window["getSelection"]){var _304=dojo.global.getSelection();if(_304.removeAllRanges){if(_303){_304.collapseToStart();}else{_304.collapseToEnd();}}else{_304.collapse(_303);}}else{if(dojo.doc.selection){var _305=dojo.doc.selection.createRange();_305.collapse(_303);_305.select();}}},remove:function(){var _s=dojo.doc.selection;if(_s){if(_s.type.toLowerCase()!="none"){_s.clear();}return _s;}else{_s=dojo.global.getSelection();_s.deleteFromDocument();return _s;}},selectElementChildren:function(_307,_308){var _309=dojo.global;var _30a=dojo.doc;_307=dojo.byId(_307);if(_30a.selection&&dojo.body().createTextRange){var _30b=_307.ownerDocument.body.createTextRange();_30b.moveToElementText(_307);if(!_308){try{_30b.select();}catch(e){}}}else{if(_309.getSelection){var _30c=_309.getSelection();if(_30c.setBaseAndExtent){_30c.setBaseAndExtent(_307,0,_307,_307.innerText.length-1);}else{if(_30c.selectAllChildren){_30c.selectAllChildren(_307);}}}}},selectElement:function(_30d,_30e){var _30f,_310=dojo.doc;_30d=dojo.byId(_30d);if(_310.selection&&dojo.body().createTextRange){try{_30f=dojo.body().createControlRange();_30f.addElement(_30d);if(!_30e){_30f.select();}}catch(e){this.selectElementChildren(_30d,_30e);}}else{if(dojo.global.getSelection){var _311=dojo.global.getSelection();if(_311.removeAllRanges){_30f=_310.createRange();_30f.selectNode(_30d);_311.removeAllRanges();_311.addRange(_30f);}}}}});}if(!dojo._hasResource["dijit._editor.html"]){dojo._hasResource["dijit._editor.html"]=true;dojo.provide("dijit._editor.html");dijit._editor.escapeXml=function(str,_313){str=str.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;");if(!_313){str=str.replace(/'/gm,"&#39;");}return str;};dijit._editor.getNodeHtml=function(node){var _315;switch(node.nodeType){case 1:_315="<"+node.nodeName.toLowerCase();var _316=[];if(dojo.isIE&&node.outerHTML){var s=node.outerHTML;s=s.substr(0,s.indexOf(">"));s=s.replace(/(['"])[^"']*\1/g,"");var reg=/([^\s=]+)=/g;var m,key;while((m=reg.exec(s))){key=m[1];if(key.substr(0,3)!="_dj"){if(key=="src"||key=="href"){if(node.getAttribute("_djrealurl")){_316.push([key,node.getAttribute("_djrealurl")]);continue;}}if(key=="style"){_316.push([key,node.style.cssText.toLowerCase()]);}else{_316.push([key,key=="class"?node.className:node.getAttribute(key)]);}}}}else{var attr,i=0,_31d=node.attributes;while((attr=_31d[i++])){var n=attr.name;if(n.substr(0,3)!="_dj"){var v=attr.value;if(n=="src"||n=="href"){if(node.getAttribute("_djrealurl")){v=node.getAttribute("_djrealurl");}}_316.push([n,v]);}}}_316.sort(function(a,b){return a[0]<b[0]?-1:(a[0]==b[0]?0:1);});i=0;while((attr=_316[i++])){_315+=" "+attr[0]+"=\""+dijit._editor.escapeXml(attr[1],true)+"\"";}if(node.childNodes.length){_315+=">"+dijit._editor.getChildrenHtml(node)+"</"+node.nodeName.toLowerCase()+">";}else{_315+=" />";}break;case 3:_315=dijit._editor.escapeXml(node.nodeValue,true);break;case 8:_315="<!--"+dijit._editor.escapeXml(node.nodeValue,true)+"-->";break;default:_315="Element not recognized - Type: "+node.nodeType+" Name: "+node.nodeName;}return _315;};dijit._editor.getChildrenHtml=function(dom){var out="";if(!dom){return out;}var _324=dom["childNodes"]||dom;var i=0;var node;while((node=_324[i++])){out+=dijit._editor.getNodeHtml(node);}return out;};}if(!dojo._hasResource["dijit._editor.RichText"]){dojo._hasResource["dijit._editor.RichText"]=true;dojo.provide("dijit._editor.RichText");if(!dojo.config["useXDomain"]||dojo.config["allowXdRichTextSave"]){if(dojo._postLoad){(function(){var _327=dojo.doc.createElement("textarea");_327.id=dijit._scopeName+"._editor.RichText.savedContent";var s=_327.style;s.display="none";s.position="absolute";s.top="-100px";s.left="-100px";s.height="3px";s.width="3px";dojo.body().appendChild(_327);})();}else{try{dojo.doc.write("<textarea id=\""+dijit._scopeName+"._editor.RichText.savedContent\" "+"style=\"display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;\"></textarea>");}catch(e){}}}dojo.declare("dijit._editor.RichText",dijit._Widget,{constructor:function(){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this._keyHandlers={};this.contentPreFilters.push(dojo.hitch(this,"_preFixUrlAttributes"));if(dojo.isMoz){this.contentPreFilters.push(this._fixContentForMoz);this.contentPostFilters.push(this._removeMozBogus);}else{if(dojo.isSafari){this.contentPostFilters.push(this._removeSafariBogus);}}this.onLoadDeferred=new dojo.Deferred();},inheritWidth:false,focusOnLoad:false,name:"",styleSheets:"",_content:"",height:"300px",minHeight:"1em",isClosed:true,isLoaded:false,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",onLoadDeferred:null,postCreate:function(){dojo.publish(dijit._scopeName+"._editor.RichText::init",[this]);this.open();this.setupDefaultShortcuts();},setupDefaultShortcuts:function(){var exec=function(cmd,arg){return arguments.length==1?function(){this.execCommand(cmd);}:function(){this.execCommand(cmd,arg);};};var _32c={b:exec("bold"),i:exec("italic"),u:exec("underline"),a:exec("selectall"),s:function(){this.save(true);},"1":exec("formatblock","h1"),"2":exec("formatblock","h2"),"3":exec("formatblock","h3"),"4":exec("formatblock","h4"),"\\":exec("insertunorderedlist")};if(!dojo.isIE){_32c.Z=exec("redo");}for(var key in _32c){this.addKeyHandler(key,this.KEY_CTRL,_32c[key]);}},events:["onKeyPress","onKeyDown","onKeyUp","onClick"],captureEvents:[],_editorCommandsLocalized:false,_localizeEditorCommands:function(){if(this._editorCommandsLocalized){return;}this._editorCommandsLocalized=true;var _32e=["p","pre","address","h1","h2","h3","h4","h5","h6","ol","div","ul"];var _32f="",_330,i=0;while((_330=_32e[i++])){if(_330.charAt(1)!="l"){_32f+="<"+_330+"><span>content</span></"+_330+">";}else{_32f+="<"+_330+"><li>content</li></"+_330+">";}}var div=dojo.doc.createElement("div");div.style.position="absolute";div.style.left="-2000px";div.style.top="-2000px";dojo.doc.body.appendChild(div);div.innerHTML=_32f;var node=div.firstChild;while(node){dijit._editor.selection.selectElement(node.firstChild);dojo.withGlobal(this.window,"selectElement",dijit._editor.selection,[node.firstChild]);var _334=node.tagName.toLowerCase();this._local2NativeFormatNames[_334]=dojo.doc.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[_334]]=_334;node=node.nextSibling;}dojo.doc.body.removeChild(div);},open:function(_335){if((!this.onLoadDeferred)||(this.onLoadDeferred.fired>=0)){this.onLoadDeferred=new dojo.Deferred();}if(!this.isClosed){this.close();}dojo.publish(dijit._scopeName+"._editor.RichText::open",[this]);this._content="";if((arguments.length==1)&&(_335["nodeName"])){this.domNode=_335;}var html;if((this.domNode["nodeName"])&&(this.domNode.nodeName.toLowerCase()=="textarea")){this.textarea=this.domNode;this.name=this.textarea.name;html=this._preFilterContent(this.textarea.value);this.domNode=dojo.doc.createElement("div");this.domNode.setAttribute("widgetId",this.id);this.textarea.removeAttribute("widgetId");this.domNode.cssText=this.textarea.cssText;this.domNode.className+=" "+this.textarea.className;dojo.place(this.domNode,this.textarea,"before");var _337=dojo.hitch(this,function(){dojo.attr(this.textarea,"tabIndex","-1");with(this.textarea.style){display="block";position="absolute";left=top="-1000px";if(dojo.isIE){this.__overflow=overflow;overflow="hidden";}}});if(dojo.isIE){setTimeout(_337,10);}else{_337();}}else{html=this._preFilterContent(dijit._editor.getChildrenHtml(this.domNode));this.domNode.innerHTML="";}if(html==""){html="&nbsp;";}var _338=dojo.contentBox(this.domNode);this._oldHeight=_338.h;this._oldWidth=_338.w;if((this.domNode["nodeName"])&&(this.domNode.nodeName=="LI")){this.domNode.innerHTML=" <br>";}this.editingArea=dojo.doc.createElement("div");this.domNode.appendChild(this.editingArea);if(this.name!=""&&(!dojo.config["useXDomain"]||dojo.config["allowXdRichTextSave"])){var _339=dojo.byId(dijit._scopeName+"._editor.RichText.savedContent");if(_339.value!=""){var _33a=_339.value.split(this._SEPARATOR),i=0,dat;while((dat=_33a[i++])){var data=dat.split(":");if(data[0]==this.name){html=data[1];_33a.splice(i,1);break;}}}this.connect(window,"onbeforeunload","_saveContent");}this.isClosed=false;if(dojo.isIE||dojo.isSafari||dojo.isOpera){var burl=dojo.moduleUrl("dojo","resources/blank.html")+"";var ifr=this.editorObject=this.iframe=dojo.doc.createElement("iframe");ifr.id=this.id+"_iframe";ifr.src=burl;ifr.style.border="none";ifr.style.width="100%";ifr.frameBorder=0;this.editingArea.appendChild(ifr);var h=null;var _341=dojo.hitch(this,function(){if(h){dojo.disconnect(h);h=null;}this.window=ifr.contentWindow;var d=this.document=this.window.document;d.open();d.write(this._getIframeDocTxt(html));d.close();if(dojo.isIE>=7){if(this.height){ifr.style.height=this.height;}if(this.minHeight){ifr.style.minHeight=this.minHeight;}}else{ifr.style.height=this.height?this.height:this.minHeight;}if(dojo.isIE){this._localizeEditorCommands();}this.onLoad();this.savedContent=this.getValue(true);});if(dojo.isIE&&dojo.isIE<7){var t=setInterval(function(){if(ifr.contentWindow.isLoaded){clearInterval(t);_341();}},100);}else{h=dojo.connect(((dojo.isIE)?ifr.contentWindow:ifr),"onload",_341);}}else{this._drawIframe(html);this.savedContent=this.getValue(true);}if(this.domNode.nodeName=="LI"){this.domNode.lastChild.style.marginTop="-1.2em";}this.domNode.className+=" RichTextEditable";},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_localizedIframeTitles:null,_getIframeDocTxt:function(html){var _cs=dojo.getComputedStyle(this.domNode);if(dojo.isIE||(!this.height&&!dojo.isMoz)){html="<div>"+html+"</div>";}var font=[_cs.fontWeight,_cs.fontSize,_cs.fontFamily].join(" ");var _347=_cs.lineHeight;if(_347.indexOf("px")>=0){_347=parseFloat(_347)/parseFloat(_cs.fontSize);}else{if(_347.indexOf("em")>=0){_347=parseFloat(_347);}else{_347="1.0";}}return [this.isLeftToRight()?"<html><head>":"<html dir='rtl'><head>",(dojo.isMoz?"<title>"+this._localizedIframeTitles.iframeEditTitle+"</title>":""),"<style>","body,html {","\tbackground:transparent;","\tfont:",font,";","\tpadding: 1em 0 0 0;","\tmargin: -1em 0 0 0;","\theight: 100%;","}","body{","\ttop:0px; left:0px; right:0px;",((this.height||dojo.isOpera)?"":"position: fixed;"),"\tmin-height:",this.minHeight,";","\tline-height:",_347,"}","p{ margin: 1em 0 !important; }",(this.height?"":"body,html{height:auto;overflow-y:hidden;/*for IE*/} body > div {overflow-x:auto;/*for FF to show vertical scrollbar*/}"),"li > ul:-moz-first-node, li > ol:-moz-first-node{ padding-top: 1.2em; } ","li{ min-height:1.2em; }","</style>",this._applyEditingAreaStyleSheets(),"</head><body>"+html+"</body></html>"].join("");},_drawIframe:function(html){if(!this.iframe){var ifr=this.iframe=dojo.doc.createElement("iframe");ifr.id=this.id;var ifrs=ifr.style;ifrs.border="none";ifrs.lineHeight="0";ifrs.verticalAlign="bottom";this.editorObject=this.iframe;this._localizedIframeTitles=dojo.i18n.getLocalization("dijit","Textarea");var _34b=dojo.query("label[for=\""+this.id+"\"]");if(_34b.length){this._localizedIframeTitles.iframeEditTitle=_34b[0].innerHTML+" "+this._localizedIframeTitles.iframeEditTitle;}}this.iframe.style.width=this.inheritWidth?this._oldWidth:"100%";if(this.height){this.iframe.style.height=this.height;}else{this.iframe.height=this._oldHeight;}var _34c;if(this.textarea){_34c=this.srcNodeRef;}else{_34c=dojo.doc.createElement("div");_34c.style.display="none";_34c.innerHTML=html;this.editingArea.appendChild(_34c);}this.editingArea.appendChild(this.iframe);var _34d=false;var _34e=this.iframe.contentDocument;_34e.open();if(dojo.isAIR){_34e.body.innerHTML=html;}else{_34e.write(this._getIframeDocTxt(html));}_34e.close();var _34f=dojo.hitch(this,function(){if(!_34d){_34d=true;}else{return;}if(!this.editNode){try{if(this.iframe.contentWindow){this.window=this.iframe.contentWindow;this.document=this.iframe.contentWindow.document;}else{if(this.iframe.contentDocument){this.window=this.iframe.contentDocument.window;this.document=this.iframe.contentDocument;}}if(!this.document.body){throw "Error";}}catch(e){setTimeout(_34f,500);_34d=false;return;}dojo._destroyElement(_34c);this.onLoad();}else{dojo._destroyElement(_34c);this.editNode.innerHTML=html;this.onDisplayChanged();}this._preDomFilterContent(this.editNode);});_34f();},_applyEditingAreaStyleSheets:function(){var _350=[];if(this.styleSheets){_350=this.styleSheets.split(";");this.styleSheets="";}_350=_350.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];var text="",i=0,url;while((url=_350[i++])){var _354=(new dojo._Url(dojo.global.location,url)).toString();this.editingAreaStyleSheets.push(_354);text+="<link rel=\"stylesheet\" type=\"text/css\" href=\""+_354+"\"/>";}return text;},addStyleSheet:function(uri){var url=uri.toString();if(url.charAt(0)=="."||(url.charAt(0)!="/"&&!uri.host)){url=(new dojo._Url(dojo.global.location,url)).toString();}if(dojo.indexOf(this.editingAreaStyleSheets,url)>-1){return;}this.editingAreaStyleSheets.push(url);if(this.document.createStyleSheet){this.document.createStyleSheet(url);}else{var head=this.document.getElementsByTagName("head")[0];var _358=this.document.createElement("link");with(_358){rel="stylesheet";type="text/css";href=url;}head.appendChild(_358);}},removeStyleSheet:function(uri){var url=uri.toString();if(url.charAt(0)=="."||(url.charAt(0)!="/"&&!uri.host)){url=(new dojo._Url(dojo.global.location,url)).toString();}var _35b=dojo.indexOf(this.editingAreaStyleSheets,url);if(_35b==-1){return;}delete this.editingAreaStyleSheets[_35b];dojo.withGlobal(this.window,"query",dojo,["link:[href=\""+url+"\"]"]).orphan();},disabled:true,_mozSettingProps:["styleWithCSS","insertBrOnReturn"],setDisabled:function(_35c){if(dojo.isIE||dojo.isSafari||dojo.isOpera){if(dojo.isIE){this.editNode.unselectable="on";}this.editNode.contentEditable=!_35c;if(dojo.isIE){var _35d=this;setTimeout(function(){_35d.editNode.unselectable="off";},0);}}else{if(_35c){this._mozSettings=[false,this.blockNodeForEnter==="BR"];}this.document.designMode=(_35c?"off":"on");if(!_35c&&this._mozSettings){dojo.forEach(this._mozSettingProps,function(s,i){this.document.execCommand(s,false,this._mozSettings[i]);},this);}}this.disabled=_35c;},_isResized:function(){return false;},onLoad:function(e){this.isLoaded=true;if(!this.window.__registeredWindow){this.window.__registeredWindow=true;dijit.registerWin(this.window);}if(!dojo.isIE&&(this.height||dojo.isMoz)){this.editNode=this.document.body;}else{this.editNode=this.document.body.firstChild;var _361=this;if(dojo.isIE){var _362=this.tabStop=dojo.doc.createElement("<div tabIndex=-1>");this.editingArea.appendChild(_362);this.iframe.onfocus=function(){_361.editNode.setActive();};}}try{this.setDisabled(false);}catch(e){var _363=dojo.connect(this,"onClick",this,function(){this.setDisabled(false);dojo.disconnect(_363);});}this._preDomFilterContent(this.editNode);var _364=this.events.concat(this.captureEvents),i=0,et;while((et=_364[i++])){this.connect(this.document,et.toLowerCase(),et);}if(!dojo.isIE){try{this.document.execCommand("styleWithCSS",false,false);}catch(e2){}}else{this.connect(this.document,"onmousedown","_onMouseDown");this.editNode.style.zoom=1;}if(this.focusOnLoad){setTimeout(dojo.hitch(this,"focus"),0);}this.onDisplayChanged(e);if(this.onLoadDeferred){this.onLoadDeferred.callback(true);}},onKeyDown:function(e){if(dojo.isIE){if(e.keyCode==dojo.keys.TAB&&e.shiftKey&&!e.ctrlKey&&!e.altKey){this.iframe.focus();}else{if(e.keyCode==dojo.keys.TAB&&!e.shiftKey&&!e.ctrlKey&&!e.altKey){this.tabStop.focus();}else{if(e.keyCode===dojo.keys.BACKSPACE&&this.document.selection.type==="Control"){dojo.stopEvent(e);this.execCommand("delete");}else{if((65<=e.keyCode&&e.keyCode<=90)||(e.keyCode>=37&&e.keyCode<=40)){e.charCode=e.keyCode;this.onKeyPress(e);}}}}}else{if(dojo.isMoz){if(e.keyCode==dojo.keys.TAB&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&this.iframe){this.iframe.contentDocument.title=this._localizedIframeTitles.iframeFocusTitle;this.iframe.focus();dojo.stopEvent(e);}else{if(e.keyCode==dojo.keys.TAB&&e.shiftKey){if(this.toolbar){this.toolbar.focus();}dojo.stopEvent(e);}}}}},onKeyUp:function(e){return;},KEY_CTRL:1,KEY_SHIFT:2,onKeyPress:function(e){var _36a=(e.ctrlKey&&!e.altKey)?this.KEY_CTRL:0|e.shiftKey?this.KEY_SHIFT:0;var key=e.keyChar||e.keyCode;if(this._keyHandlers[key]){var _36c=this._keyHandlers[key],i=0,h;while((h=_36c[i++])){if(_36a==h.modifiers){if(!h.handler.apply(this,arguments)){e.preventDefault();}break;}}}setTimeout(dojo.hitch(this,function(){this.onKeyPressed(e);}),1);},addKeyHandler:function(key,_370,_371){if(!dojo.isArray(this._keyHandlers[key])){this._keyHandlers[key]=[];}this._keyHandlers[key].push({modifiers:_370||0,handler:_371});},onKeyPressed:function(e){this.onDisplayChanged();},onClick:function(e){this.onDisplayChanged(e);},_onMouseDown:function(e){if(!this._focused&&!this.disabled){this.focus();}},_onBlur:function(e){this.inherited(arguments);var _c=this.getValue(true);if(_c!=this.savedContent){this.onChange(_c);this.savedContent=_c;}if(dojo.isMoz&&this.iframe){this.iframe.contentDocument.title=this._localizedIframeTitles.iframeEditTitle;}},_initialFocus:true,_onFocus:function(e){this.inherited(arguments);if(dojo.isMoz&&this._initialFocus){this._initialFocus=false;if(this.editNode.innerHTML.replace(/^\s+|\s+$/g,"")=="&nbsp;"){this.placeCursorAtStart();}}},blur:function(){if(!dojo.isIE&&this.window.document.documentElement&&this.window.document.documentElement.focus){this.window.document.documentElement.focus();}else{if(dojo.doc.body.focus){dojo.doc.body.focus();}}},focus:function(){if(!dojo.isIE){dijit.focus(this.iframe);}else{if(this.editNode&&this.editNode.focus){this.iframe.fireEvent("onfocus",document.createEventObject());}}},updateInterval:200,_updateTimer:null,onDisplayChanged:function(e){if(!this._updateTimer){if(this._updateTimer){clearTimeout(this._updateTimer);}this._updateTimer=setTimeout(dojo.hitch(this,this.onNormalizedDisplayChanged),this.updateInterval);}},onNormalizedDisplayChanged:function(){this._updateTimer=null;},onChange:function(_379){},_normalizeCommand:function(cmd){var _37b=cmd.toLowerCase();if(_37b=="hilitecolor"&&!dojo.isMoz){_37b="backcolor";}return _37b;},queryCommandAvailable:function(_37c){var ie=1;var _37e=1<<1;var _37f=1<<2;var _380=1<<3;var _381=1<<4;var _382=dojo.isSafari;function isSupportedBy(_383){return {ie:Boolean(_383&ie),mozilla:Boolean(_383&_37e),safari:Boolean(_383&_37f),safari420:Boolean(_383&_381),opera:Boolean(_383&_380)};};var _384=null;switch(_37c.toLowerCase()){case "bold":case "italic":case "underline":case "subscript":case "superscript":case "fontname":case "fontsize":case "forecolor":case "hilitecolor":case "justifycenter":case "justifyfull":case "justifyleft":case "justifyright":case "delete":case "selectall":case "toggledir":_384=isSupportedBy(_37e|ie|_37f|_380);break;case "createlink":case "unlink":case "removeformat":case "inserthorizontalrule":case "insertimage":case "insertorderedlist":case "insertunorderedlist":case "indent":case "outdent":case "formatblock":case "inserthtml":case "undo":case "redo":case "strikethrough":_384=isSupportedBy(_37e|ie|_380|_381);break;case "blockdirltr":case "blockdirrtl":case "dirltr":case "dirrtl":case "inlinedirltr":case "inlinedirrtl":_384=isSupportedBy(ie);break;case "cut":case "copy":case "paste":_384=isSupportedBy(ie|_37e|_381);break;case "inserttable":_384=isSupportedBy(_37e|ie);break;case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":_384=isSupportedBy(ie|_37e);break;default:return false;}return (dojo.isIE&&_384.ie)||(dojo.isMoz&&_384.mozilla)||(dojo.isSafari&&_384.safari)||(_382&&_384.safari420)||(dojo.isOpera&&_384.opera);},execCommand:function(_385,_386){var _387;this.focus();_385=this._normalizeCommand(_385);if(_386!=undefined){if(_385=="heading"){throw new Error("unimplemented");}else{if((_385=="formatblock")&&dojo.isIE){_386="<"+_386+">";}}}if(_385=="inserthtml"){_386=this._preFilterContent(_386);if(dojo.isIE){var _388=this.document.selection.createRange();if(this.document.selection.type.toUpperCase()=="CONTROL"){var n=_388.item(0);while(_388.length){_388.remove(_388.item(0));}n.outerHTML=_386;}else{_388.pasteHTML(_386);}_388.select();_387=true;}else{if(dojo.isMoz&&!_386.length){dojo.withGlobal(this.window,"remove",dijit._editor.selection);_387=true;}else{_387=this.document.execCommand(_385,false,_386);}}}else{if((_385=="unlink")&&(this.queryCommandEnabled("unlink"))&&(dojo.isMoz||dojo.isSafari)){var _38a=this.window.getSelection();var a=dojo.withGlobal(this.window,"getAncestorElement",dijit._editor.selection,["a"]);dojo.withGlobal(this.window,"selectElement",dijit._editor.selection,[a]);_387=this.document.execCommand("unlink",false,null);}else{if((_385=="hilitecolor")&&(dojo.isMoz)){this.document.execCommand("styleWithCSS",false,true);_387=this.document.execCommand(_385,false,_386);this.document.execCommand("styleWithCSS",false,false);}else{if((dojo.isIE)&&((_385=="backcolor")||(_385=="forecolor"))){_386=arguments.length>1?_386:null;_387=this.document.execCommand(_385,false,_386);}else{_386=arguments.length>1?_386:null;if(_386||_385!="createlink"){_387=this.document.execCommand(_385,false,_386);}}}}}this.onDisplayChanged();return _387;},queryCommandEnabled:function(_38c){if(this.disabled){return false;}_38c=this._normalizeCommand(_38c);if(dojo.isMoz||dojo.isSafari){if(_38c=="unlink"){return dojo.withGlobal(this.window,"hasAncestorElement",dijit._editor.selection,["a"]);}else{if(_38c=="inserttable"){return true;}}}if(dojo.isSafari){if(_38c=="copy"){_38c="cut";}else{if(_38c=="paste"){return true;}}}var elem=dojo.isIE?this.document.selection.createRange():this.document;return elem.queryCommandEnabled(_38c);},queryCommandState:function(_38e){if(this.disabled){return false;}_38e=this._normalizeCommand(_38e);return this.document.queryCommandState(_38e);},queryCommandValue:function(_38f){if(this.disabled){return false;}_38f=this._normalizeCommand(_38f);if(dojo.isIE&&_38f=="formatblock"){return this._local2NativeFormatNames[this.document.queryCommandValue(_38f)];}return this.document.queryCommandValue(_38f);},placeCursorAtStart:function(){this.focus();var _390=false;if(dojo.isMoz){var _391=this.editNode.firstChild;while(_391){if(_391.nodeType==3){if(_391.nodeValue.replace(/^\s+|\s+$/g,"").length>0){_390=true;dojo.withGlobal(this.window,"selectElement",dijit._editor.selection,[_391]);break;}}else{if(_391.nodeType==1){_390=true;dojo.withGlobal(this.window,"selectElementChildren",dijit._editor.selection,[_391]);break;}}_391=_391.nextSibling;}}else{_390=true;dojo.withGlobal(this.window,"selectElementChildren",dijit._editor.selection,[this.editNode]);}if(_390){dojo.withGlobal(this.window,"collapse",dijit._editor.selection,[true]);}},placeCursorAtEnd:function(){this.focus();var _392=false;if(dojo.isMoz){var last=this.editNode.lastChild;while(last){if(last.nodeType==3){if(last.nodeValue.replace(/^\s+|\s+$/g,"").length>0){_392=true;dojo.withGlobal(this.window,"selectElement",dijit._editor.selection,[last]);break;}}else{if(last.nodeType==1){_392=true;if(last.lastChild){dojo.withGlobal(this.window,"selectElement",dijit._editor.selection,[last.lastChild]);}else{dojo.withGlobal(this.window,"selectElement",dijit._editor.selection,[last]);}break;}}last=last.previousSibling;}}else{_392=true;dojo.withGlobal(this.window,"selectElementChildren",dijit._editor.selection,[this.editNode]);}if(_392){dojo.withGlobal(this.window,"collapse",dijit._editor.selection,[false]);}},getValue:function(_394){if(this.textarea){if(this.isClosed||!this.isLoaded){return this.textarea.value;}}return this._postFilterContent(null,_394);},setValue:function(html){if(this.textarea&&(this.isClosed||!this.isLoaded)){this.textarea.value=html;}else{html=this._preFilterContent(html);var node=this.isClosed?this.domNode:this.editNode;node.innerHTML=html;this._preDomFilterContent(node);}this.onDisplayChanged();},replaceValue:function(html){if(this.isClosed){this.setValue(html);}else{if(this.window&&this.window.getSelection&&!dojo.isMoz){this.setValue(html);}else{if(this.window&&this.window.getSelection){html=this._preFilterContent(html);this.execCommand("selectall");if(dojo.isMoz&&!html){html="&nbsp;";}this.execCommand("inserthtml",html);this._preDomFilterContent(this.editNode);}else{if(this.document&&this.document.selection){this.setValue(html);}}}}},_preFilterContent:function(html){var ec=html;dojo.forEach(this.contentPreFilters,function(ef){if(ef){ec=ef(ec);}});return ec;},_preDomFilterContent:function(dom){dom=dom||this.editNode;dojo.forEach(this.contentDomPreFilters,function(ef){if(ef&&dojo.isFunction(ef)){ef(dom);}},this);},_postFilterContent:function(dom,_39e){var ec;if(!dojo.isString(dom)){dom=dom||this.editNode;if(this.contentDomPostFilters.length){if(_39e&&dom["cloneNode"]){dom=dom.cloneNode(true);}dojo.forEach(this.contentDomPostFilters,function(ef){dom=ef(dom);});}ec=dijit._editor.getChildrenHtml(dom);}else{ec=dom;}if(!ec.replace(/^(?:\s|\xA0)+/g,"").replace(/(?:\s|\xA0)+$/g,"").length){ec="";}dojo.forEach(this.contentPostFilters,function(ef){ec=ef(ec);});return ec;},_saveContent:function(e){var _3a3=dojo.byId(dijit._scopeName+"._editor.RichText.savedContent");_3a3.value+=this._SEPARATOR+this.name+":"+this.getValue();},escapeXml:function(str,_3a5){dojo.deprecated("dijit.Editor::escapeXml is deprecated","use dijit._editor.escapeXml instead",2);return dijit._editor.escapeXml(str,_3a5);},getNodeHtml:function(node){dojo.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit._editor.getNodeHtml instead",2);return dijit._editor.getNodeHtml(node);},getNodeChildrenHtml:function(dom){dojo.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit._editor.getChildrenHtml instead",2);return dijit._editor.getChildrenHtml(dom);},close:function(save,_3a9){if(this.isClosed){return false;}if(!arguments.length){save=true;}this._content=this.getValue();var _3aa=(this.savedContent!=this._content);if(this.interval){clearInterval(this.interval);}if(this.textarea){with(this.textarea.style){position="";left=top="";if(dojo.isIE){overflow=this.__overflow;this.__overflow=null;}}this.textarea.value=save?this._content:this.savedContent;dojo._destroyElement(this.domNode);this.domNode=this.textarea;}else{this.domNode.innerHTML=save?this._content:this.savedContent;}dojo.removeClass(this.domNode,"RichTextEditable");this.isClosed=true;this.isLoaded=false;delete this.editNode;if(this.window&&this.window._frameElement){this.window._frameElement=null;}this.window=null;this.document=null;this.editingArea=null;this.editorObject=null;return _3aa;},destroyRendering:function(){},destroy:function(){this.destroyRendering();if(!this.isClosed){this.close(false);}this.inherited("destroy",arguments);},_removeMozBogus:function(html){return html.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"");},_removeSafariBogus:function(html){return html.replace(/\sclass="webkit-block-placeholder"/gi,"");},_fixContentForMoz:function(html){return html.replace(/<(\/)?strong([ \>])/gi,"<$1b$2").replace(/<(\/)?em([ \>])/gi,"<$1i$2");},_srcInImgRegex:/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,_hrefInARegex:/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,_preFixUrlAttributes:function(html){return html.replace(this._hrefInARegex,"$1$4$2$3$5$2 _djrealurl=$2$3$5$2").replace(this._srcInImgRegex,"$1$4$2$3$5$2 _djrealurl=$2$3$5$2");}});}if(!dojo._hasResource["dijit.Toolbar"]){dojo._hasResource["dijit.Toolbar"]=true;dojo.provide("dijit.Toolbar");dojo.declare("dijit.Toolbar",[dijit._Widget,dijit._Templated,dijit._KeyNavContainer],{templateString:"<div class=\"dijit dijitToolbar\" waiRole=\"toolbar\" tabIndex=\"${tabIndex}\" dojoAttachPoint=\"containerNode\">"+"</div>",tabIndex:"0",postCreate:function(){this.connectKeyNavHandlers(this.isLeftToRight()?[dojo.keys.LEFT_ARROW]:[dojo.keys.RIGHT_ARROW],this.isLeftToRight()?[dojo.keys.RIGHT_ARROW]:[dojo.keys.LEFT_ARROW]);},startup:function(){if(this._started){return;}this.startupKeyNavChildren();this.inherited(arguments);}});dojo.declare("dijit.ToolbarSeparator",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"dijitToolbarSeparator dijitInline\"></div>",postCreate:function(){dojo.setSelectable(this.domNode,false);},isFocusable:function(){return false;}});}if(!dojo._hasResource["dijit.form._FormWidget"]){dojo._hasResource["dijit.form._FormWidget"]=true;dojo.provide("dijit.form._FormWidget");dojo.declare("dijit.form._FormWidget",[dijit._Widget,dijit._Templated],{baseClass:"",name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,readOnly:false,intermediateChanges:false,attributeMap:dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap),{value:"focusNode",disabled:"focusNode",readOnly:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode"}),setAttribute:function(attr,_3b0){this.inherited(arguments);switch(attr){case "disabled":var _3b1=this[this.attributeMap["tabIndex"]||"domNode"];if(_3b0){this._hovering=false;this._active=false;_3b1.removeAttribute("tabIndex");}else{_3b1.setAttribute("tabIndex",this.tabIndex);}dijit.setWaiState(this[this.attributeMap["disabled"]||"domNode"],"disabled",_3b0);this._setStateClass();}},setDisabled:function(_3b2){dojo.deprecated("setDisabled("+_3b2+") is deprecated. Use setAttribute('disabled',"+_3b2+") instead.","","2.0");this.setAttribute("disabled",_3b2);},_onMouse:function(_3b3){var _3b4=_3b3.currentTarget;if(_3b4&&_3b4.getAttribute){this.stateModifier=_3b4.getAttribute("stateModifier")||"";}if(!this.disabled){switch(_3b3.type){case "mouseenter":case "mouseover":this._hovering=true;this._active=this._mouseDown;break;case "mouseout":case "mouseleave":this._hovering=false;this._active=false;break;case "mousedown":this._active=true;this._mouseDown=true;var _3b5=this.connect(dojo.body(),"onmouseup",function(){this._active=false;this._mouseDown=false;this._setStateClass();this.disconnect(_3b5);});if(this.isFocusable()){this.focus();}break;}this._setStateClass();}},isFocusable:function(){return !this.disabled&&!this.readOnly&&this.focusNode&&(dojo.style(this.domNode,"display")!="none");},focus:function(){setTimeout(dojo.hitch(this,dijit.focus,this.focusNode),0);},_setStateClass:function(){if(!("staticClass" in this)){this.staticClass=(this.stateNode||this.domNode).className;}var _3b6=[this.baseClass];function multiply(_3b7){_3b6=_3b6.concat(dojo.map(_3b6,function(c){return c+_3b7;}),"dijit"+_3b7);};if(this.checked){multiply("Checked");}if(this.state){multiply(this.state);}if(this.selected){multiply("Selected");}if(this.disabled){multiply("Disabled");}else{if(this.readOnly){multiply("ReadOnly");}else{if(this._active){multiply(this.stateModifier+"Active");}else{if(this._focused){multiply("Focused");}if(this._hovering){multiply(this.stateModifier+"Hover");}}}}(this.stateNode||this.domNode).className=this.staticClass+" "+_3b6.join(" ");},onChange:function(_3b9){},_onChangeMonitor:"value",_onChangeActive:false,_handleOnChange:function(_3ba,_3bb){this._lastValue=_3ba;if(this._lastValueReported==undefined&&(_3bb===null||!this._onChangeActive)){this._resetValue=this._lastValueReported=_3ba;}if((this.intermediateChanges||_3bb||_3bb===undefined)&&((_3ba&&_3ba.toString)?_3ba.toString():_3ba)!==((this._lastValueReported&&this._lastValueReported.toString)?this._lastValueReported.toString():this._lastValueReported)){this._lastValueReported=_3ba;if(this._onChangeActive){this.onChange(_3ba);}}},reset:function(){this._hasBeenBlurred=false;if(this.setValue&&!this._getValueDeprecated){this.setValue(this._resetValue,true);}else{if(this._onChangeMonitor){this.setAttribute(this._onChangeMonitor,(this._resetValue!==undefined&&this._resetValue!==null)?this._resetValue:"");}}},create:function(){this.inherited(arguments);this._onChangeActive=true;this._setStateClass();},destroy:function(){if(this._layoutHackHandle){clearTimeout(this._layoutHackHandle);}this.inherited(arguments);},setValue:function(_3bc){dojo.deprecated("dijit.form._FormWidget:setValue("+_3bc+") is deprecated.  Use setAttribute('value',"+_3bc+") instead.","","2.0");this.setAttribute("value",_3bc);},_getValueDeprecated:true,getValue:function(){dojo.deprecated("dijit.form._FormWidget:getValue() is deprecated.  Use widget.value instead.","","2.0");return this.value;},_layoutHack:function(){if(dojo.isFF==2){var node=this.domNode;var old=node.style.opacity;node.style.opacity="0.999";this._layoutHackHandle=setTimeout(dojo.hitch(this,function(){this._layoutHackHandle=null;node.style.opacity=old;}),0);}}});dojo.declare("dijit.form._FormValueWidget",dijit.form._FormWidget,{attributeMap:dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap),{value:""}),postCreate:function(){this.setValue(this.value,null);},setValue:function(_3bf,_3c0){this.value=_3bf;this._handleOnChange(_3bf,_3c0);},_getValueDeprecated:false,getValue:function(){return this._lastValue;},undo:function(){this.setValue(this._lastValueReported,false);},_valueChanged:function(){var v=this.getValue();var lv=this._lastValueReported;return ((v!==null&&(v!==undefined)&&v.toString)?v.toString():"")!==((lv!==null&&(lv!==undefined)&&lv.toString)?lv.toString():"");},_onKeyPress:function(e){if(e.keyCode==dojo.keys.ESCAPE&&!e.shiftKey&&!e.ctrlKey&&!e.altKey){if(this._valueChanged()){this.undo();dojo.stopEvent(e);return false;}}return true;}});}if(!dojo._hasResource["dijit.form.Button"]){dojo._hasResource["dijit.form.Button"]=true;dojo.provide("dijit.form.Button");dojo.declare("dijit.form.Button",dijit.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:"<div class=\"dijit dijitReset dijitLeft dijitInline\"\n\tdojoAttachEvent=\"onclick:_onButtonClick,onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\"\n\twaiRole=\"presentation\"\n\t><button class=\"dijitReset dijitStretch dijitButtonNode dijitButtonContents\" dojoAttachPoint=\"focusNode,titleNode\"\n\t\ttype=\"${type}\" waiRole=\"button\" waiState=\"labelledby-${id}_label\"\n\t\t><span class=\"dijitReset dijitInline ${iconClass}\" dojoAttachPoint=\"iconNode\" \n \t\t\t><span class=\"dijitReset dijitToggleButtonIconChar\">&#10003;</span \n\t\t></span\n\t\t><div class=\"dijitReset dijitInline\"><center class=\"dijitReset dijitButtonText\" id=\"${id}_label\" dojoAttachPoint=\"containerNode\">${label}</center></div\n\t></button\n></div>\n",_onChangeMonitor:"",_onClick:function(e){if(this.disabled||this.readOnly){dojo.stopEvent(e);return false;}this._clicked();return this.onClick(e);},_onButtonClick:function(e){if(this._onClick(e)===false){dojo.stopEvent(e);}else{if(this.type=="submit"&&!this.focusNode.form){for(var node=this.domNode;node.parentNode;node=node.parentNode){var _3c7=dijit.byNode(node);if(_3c7&&typeof _3c7._onSubmit=="function"){_3c7._onSubmit(e);break;}}}}},postCreate:function(){if(this.showLabel==false){var _3c8="";this.label=this.containerNode.innerHTML;_3c8=dojo.trim(this.containerNode.innerText||this.containerNode.textContent||"");this.titleNode.title=_3c8;dojo.addClass(this.containerNode,"dijitDisplayNone");}dojo.setSelectable(this.focusNode,false);this.inherited(arguments);},onClick:function(e){return true;},_clicked:function(e){},setLabel:function(_3cb){this.containerNode.innerHTML=this.label=_3cb;this._layoutHack();if(this.showLabel==false){this.titleNode.title=dojo.trim(this.containerNode.innerText||this.containerNode.textContent||"");}}});dojo.declare("dijit.form.DropDownButton",[dijit.form.Button,dijit._Container],{baseClass:"dijitDropDownButton",templateString:"<div class=\"dijit dijitReset dijitLeft dijitInline\"\n\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse,onclick:_onDropDownClick,onkeydown:_onDropDownKeydown,onblur:_onDropDownBlur,onkeypress:_onKey\"\n\twaiRole=\"presentation\"\n\t><div class='dijitReset dijitRight' waiRole=\"presentation\"\n\t><button class=\"dijitReset dijitStretch dijitButtonNode dijitButtonContents\" type=\"${type}\"\n\t\tdojoAttachPoint=\"focusNode,titleNode\" waiRole=\"button\" waiState=\"haspopup-true,labelledby-${id}_label\"\n\t\t><div class=\"dijitReset dijitInline ${iconClass}\" dojoAttachPoint=\"iconNode\" waiRole=\"presentation\"></div\n\t\t><div class=\"dijitReset dijitInline dijitButtonText\"  dojoAttachPoint=\"containerNode,popupStateNode\" waiRole=\"presentation\"\n\t\t\tid=\"${id}_label\">${label}</div\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonInner\" waiRole=\"presentation\">&thinsp;</div\n\t\t><div class=\"dijitReset dijitInline dijitArrowButtonChar\" waiRole=\"presentation\">&#9660;</div\n\t></button\n></div></div>\n",_fillContent:function(){if(this.srcNodeRef){var _3cc=dojo.query("*",this.srcNodeRef);dijit.form.DropDownButton.superclass._fillContent.call(this,_3cc[0]);this.dropDownContainer=this.srcNodeRef;}},startup:function(){if(this._started){return;}if(!this.dropDown){var _3cd=dojo.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=dijit.byNode(_3cd);delete this.dropDownContainer;}dijit.popup.prepare(this.dropDown.domNode);this.inherited(arguments);},destroyDescendants:function(){if(this.dropDown){this.dropDown.destroyRecursive();delete this.dropDown;}this.inherited(arguments);},_onArrowClick:function(e){if(this.disabled||this.readOnly){return;}this._toggleDropDown();},_onDropDownClick:function(e){var _3d0=dojo.isFF&&dojo.isFF<3&&navigator.appVersion.indexOf("Macintosh")!=-1;if(!_3d0||e.detail!=0||this._seenKeydown){this._onArrowClick(e);}this._seenKeydown=false;},_onDropDownKeydown:function(e){this._seenKeydown=true;},_onDropDownBlur:function(e){this._seenKeydown=false;},_onKey:function(e){if(this.disabled||this.readOnly){return;}if(e.keyCode==dojo.keys.DOWN_ARROW){if(!this.dropDown||this.dropDown.domNode.style.visibility=="hidden"){dojo.stopEvent(e);this._toggleDropDown();}}},_onBlur:function(){this._closeDropDown();this.inherited(arguments);},_toggleDropDown:function(){if(this.disabled||this.readOnly){return;}dijit.focus(this.popupStateNode);var _3d4=this.dropDown;if(!_3d4){return;}if(!this._opened){if(_3d4.href&&!_3d4.isLoaded){var self=this;var _3d6=dojo.connect(_3d4,"onLoad",function(){dojo.disconnect(_3d6);self._openDropDown();});_3d4._loadCheck(true);return;}else{this._openDropDown();}}else{this._closeDropDown();}},_openDropDown:function(){var _3d7=this.dropDown;var _3d8=_3d7.domNode.style.width;var self=this;dijit.popup.open({parent:this,popup:_3d7,around:this.domNode,orient:this.isLeftToRight()?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"},onExecute:function(){self._closeDropDown(true);},onCancel:function(){self._closeDropDown(true);},onClose:function(){_3d7.domNode.style.width=_3d8;self.popupStateNode.removeAttribute("popupActive");this._opened=false;}});if(this.domNode.offsetWidth>_3d7.domNode.offsetWidth){var _3da=null;if(!this.isLeftToRight()){_3da=_3d7.domNode.parentNode;var _3db=_3da.offsetLeft+_3da.offsetWidth;}dojo.marginBox(_3d7.domNode,{w:this.domNode.offsetWidth});if(_3da){_3da.style.left=_3db-this.domNode.offsetWidth+"px";}}this.popupStateNode.setAttribute("popupActive","true");this._opened=true;if(_3d7.focus){_3d7.focus();}},_closeDropDown:function(_3dc){if(this._opened){dijit.popup.close(this.dropDown);if(_3dc){this.focus();}this._opened=false;}}});dojo.declare("dijit.form.ComboButton",dijit.form.DropDownButton,{templateString:"<table class='dijit dijitReset dijitInline dijitLeft'\n\tcellspacing='0' cellpadding='0' waiRole=\"presentation\"\n\t><tbody waiRole=\"presentation\"><tr waiRole=\"presentation\"\n\t\t><td\tclass=\"dijitReset dijitStretch dijitButtonContents dijitButtonNode\"\n\t\t\ttabIndex=\"${tabIndex}\"\n\t\t\tdojoAttachEvent=\"ondijitclick:_onButtonClick,onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\"  dojoAttachPoint=\"titleNode\"\n\t\t\twaiRole=\"button\" waiState=\"labelledby-${id}_label\"\n\t\t\t><div class=\"dijitReset dijitInline ${iconClass}\" dojoAttachPoint=\"iconNode\" waiRole=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitInline dijitButtonText\" id=\"${id}_label\" dojoAttachPoint=\"containerNode\" waiRole=\"presentation\">${label}</div\n\t\t></td\n\t\t><td class='dijitReset dijitStretch dijitButtonNode dijitArrowButton dijitDownArrowButton'\n\t\t\tdojoAttachPoint=\"popupStateNode,focusNode\"\n\t\t\tdojoAttachEvent=\"ondijitclick:_onArrowClick, onkeypress:_onKey,onmouseenter:_onMouse,onmouseleave:_onMouse\"\n\t\t\tstateModifier=\"DownArrow\"\n\t\t\ttitle=\"${optionsTitle}\" name=\"${name}\"\n\t\t\twaiRole=\"button\" waiState=\"haspopup-true\"\n\t\t\t><div class=\"dijitReset dijitArrowButtonInner\" waiRole=\"presentation\">&thinsp;</div\n\t\t\t><div class=\"dijitReset dijitArrowButtonChar\" waiRole=\"presentation\">&#9660;</div\n\t\t></td\n\t></tr></tbody\n></table>\n",attributeMap:dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap),{id:"",name:""}),optionsTitle:"",baseClass:"dijitComboButton",_focusedNode:null,postCreate:function(){this.inherited(arguments);this._focalNodes=[this.titleNode,this.popupStateNode];dojo.forEach(this._focalNodes,dojo.hitch(this,function(node){if(dojo.isIE){this.connect(node,"onactivate",this._onNodeFocus);this.connect(node,"ondeactivate",this._onNodeBlur);}else{this.connect(node,"onfocus",this._onNodeFocus);this.connect(node,"onblur",this._onNodeBlur);}}));},focusFocalNode:function(node){this._focusedNode=node;dijit.focus(node);},hasNextFocalNode:function(){return this._focusedNode!==this.getFocalNodes()[1];},focusNext:function(){this._focusedNode=this.getFocalNodes()[this._focusedNode?1:0];dijit.focus(this._focusedNode);},hasPrevFocalNode:function(){return this._focusedNode!==this.getFocalNodes()[0];},focusPrev:function(){this._focusedNode=this.getFocalNodes()[this._focusedNode?0:1];dijit.focus(this._focusedNode);},getFocalNodes:function(){return this._focalNodes;},_onNodeFocus:function(evt){this._focusedNode=evt.currentTarget;var fnc=this._focusedNode==this.focusNode?"dijitDownArrowButtonFocused":"dijitButtonContentsFocused";dojo.addClass(this._focusedNode,fnc);},_onNodeBlur:function(evt){var fnc=evt.currentTarget==this.focusNode?"dijitDownArrowButtonFocused":"dijitButtonContentsFocused";dojo.removeClass(evt.currentTarget,fnc);},_onBlur:function(){this.inherited(arguments);this._focusedNode=null;}});dojo.declare("dijit.form.ToggleButton",dijit.form.Button,{baseClass:"dijitToggleButton",checked:false,_onChangeMonitor:"checked",attributeMap:dojo.mixin(dojo.clone(dijit.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(evt){this.setAttribute("checked",!this.checked);},setAttribute:function(attr,_3e5){this.inherited(arguments);switch(attr){case "checked":dijit.setWaiState(this.focusNode||this.domNode,"pressed",this.checked);this._setStateClass();this._handleOnChange(this.checked,true);}},setChecked:function(_3e6){dojo.deprecated("setChecked("+_3e6+") is deprecated. Use setAttribute('checked',"+_3e6+") instead.","","2.0");this.setAttribute("checked",_3e6);},postCreate:function(){this.inherited(arguments);this.setAttribute("checked",this.checked);}});}if(!dojo._hasResource["dijit._editor._Plugin"]){dojo._hasResource["dijit._editor._Plugin"]=true;dojo.provide("dijit._editor._Plugin");dojo.declare("dijit._editor._Plugin",null,{constructor:function(args,node){if(args){dojo.mixin(this,args);}this._connects=[];},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,queryCommand:null,command:"",commandArg:null,useDefaultCommand:true,buttonClass:dijit.form.Button,getLabel:function(key){return this.editor.commands[key];},_initButton:function(_3ea){if(this.command.length){var _3eb=this.getLabel(this.command);var _3ec=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);if(!this.button){_3ea=dojo.mixin({label:_3eb,showLabel:false,iconClass:_3ec,dropDown:this.dropDown,tabIndex:"-1"},_3ea||{});this.button=new this.buttonClass(_3ea);}}},destroy:function(f){dojo.forEach(this._connects,dojo.disconnect);},connect:function(o,f,tf){this._connects.push(dojo.connect(o,f,this,tf));},updateState:function(){var _e=this.editor;var _c=this.command;if(!_e){return;}if(!_e.isLoaded){return;}if(!_c.length){return;}if(this.button){try{var _3f3=_e.queryCommandEnabled(_c);this.button.setAttribute("disabled",!_3f3);if(typeof this.button.checked=="boolean"){this.button.setAttribute("checked",_e.queryCommandState(_c));}}catch(e){console.debug(e);}}},setEditor:function(_3f4){this.editor=_3f4;this._initButton();if(this.command.length&&!this.editor.queryCommandAvailable(this.command)){if(this.button){this.button.domNode.style.display="none";}}if(this.button&&this.useDefaultCommand){this.connect(this.button,"onClick",dojo.hitch(this.editor,"execCommand",this.command,this.commandArg));}this.connect(this.editor,"onNormalizedDisplayChanged","updateState");},setToolbar:function(_3f5){if(this.button){_3f5.addChild(this.button);}}});}if(!dojo._hasResource["dijit.Editor"]){dojo._hasResource["dijit.Editor"]=true;dojo.provide("dijit.Editor");dojo.declare("dijit.Editor",dijit._editor.RichText,{plugins:null,extraPlugins:null,constructor:function(){if(!dojo.isArray(this.plugins)){this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|","insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull"];}this._plugins=[];this._editInterval=this.editActionInterval*1000;},postCreate:function(){if(this.customUndo){dojo["require"]("dijit._editor.range");this._steps=this._steps.slice(0);this._undoedSteps=this._undoedSteps.slice(0);}if(dojo.isArray(this.extraPlugins)){this.plugins=this.plugins.concat(this.extraPlugins);}this.inherited(arguments);this.commands=dojo.i18n.getLocalization("dijit._editor","commands",this.lang);if(!this.toolbar){this.toolbar=new dijit.Toolbar({});dojo.place(this.toolbar.domNode,this.editingArea,"before");}dojo.forEach(this.plugins,this.addPlugin,this);this.onNormalizedDisplayChanged();},destroy:function(){dojo.forEach(this._plugins,function(p){if(p&&p.destroy){p.destroy();}});this._plugins=[];this.toolbar.destroy();delete this.toolbar;this.inherited(arguments);},addPlugin:function(_3f7,_3f8){var args=dojo.isString(_3f7)?{name:_3f7}:_3f7;if(!args.setEditor){var o={"args":args,"plugin":null,"editor":this};dojo.publish(dijit._scopeName+".Editor.getPlugin",[o]);if(!o.plugin){var pc=dojo.getObject(args.name);if(pc){o.plugin=new pc(args);}}if(!o.plugin){console.warn("Cannot find plugin",_3f7);return;}_3f7=o.plugin;}if(arguments.length>1){this._plugins[_3f8]=_3f7;}else{this._plugins.push(_3f7);}_3f7.setEditor(this);if(dojo.isFunction(_3f7.setToolbar)){_3f7.setToolbar(this.toolbar);}},customUndo:dojo.isIE,editActionInterval:3,beginEditing:function(cmd){if(!this._inEditing){this._inEditing=true;this._beginEditing(cmd);}if(this.editActionInterval>0){if(this._editTimer){clearTimeout(this._editTimer);}this._editTimer=setTimeout(dojo.hitch(this,this.endEditing),this._editInterval);}},_steps:[],_undoedSteps:[],execCommand:function(cmd){if(this.customUndo&&(cmd=="undo"||cmd=="redo")){return this[cmd]();}else{try{if(this.customUndo){this.endEditing();this._beginEditing();}var r=this.inherited("execCommand",arguments);if(this.customUndo){this._endEditing();}return r;}catch(e){if(dojo.isMoz&&/copy|cut|paste/.test(cmd)){var sub=dojo.string.substitute,_400={cut:"X",copy:"C",paste:"V"},_401=navigator.userAgent.indexOf("Macintosh")!=-1;alert(sub(this.commands.systemShortcutFF,[this.commands[cmd],sub(this.commands[_401?"appleKey":"ctrlKey"],[_400[cmd]])]));}return false;}}},queryCommandEnabled:function(cmd){if(this.customUndo&&(cmd=="undo"||cmd=="redo")){return cmd=="undo"?(this._steps.length>1):(this._undoedSteps.length>0);}else{return this.inherited("queryCommandEnabled",arguments);}},_moveToBookmark:function(b){var _404=b;if(dojo.isIE){if(dojo.isArray(b)){_404=[];dojo.forEach(b,function(n){_404.push(dijit.range.getNode(n,this.editNode));},this);}}else{var r=dijit.range.create();r.setStart(dijit.range.getNode(b.startContainer,this.editNode),b.startOffset);r.setEnd(dijit.range.getNode(b.endContainer,this.editNode),b.endOffset);_404=r;}dojo.withGlobal(this.window,"moveToBookmark",dijit,[_404]);},_changeToStep:function(from,to){this.setValue(to.text);var b=to.bookmark;if(!b){return;}this._moveToBookmark(b);},undo:function(){this.endEditing(true);var s=this._steps.pop();if(this._steps.length>0){this.focus();this._changeToStep(s,this._steps[this._steps.length-1]);this._undoedSteps.push(s);this.onDisplayChanged();return true;}return false;},redo:function(){this.endEditing(true);var s=this._undoedSteps.pop();if(s&&this._steps.length>0){this.focus();this._changeToStep(this._steps[this._steps.length-1],s);this._steps.push(s);this.onDisplayChanged();return true;}return false;},endEditing:function(_40c){if(this._editTimer){clearTimeout(this._editTimer);}if(this._inEditing){this._endEditing(_40c);this._inEditing=false;}},_getBookmark:function(){var b=dojo.withGlobal(this.window,dijit.getBookmark);var tmp=[];if(dojo.isIE){if(dojo.isArray(b)){dojo.forEach(b,function(n){tmp.push(dijit.range.getIndex(n,this.editNode).o);},this);b=tmp;}}else{tmp=dijit.range.getIndex(b.startContainer,this.editNode).o;b={startContainer:tmp,startOffset:b.startOffset,endContainer:b.endContainer===b.startContainer?tmp:dijit.range.getIndex(b.endContainer,this.editNode).o,endOffset:b.endOffset};}return b;},_beginEditing:function(cmd){if(this._steps.length===0){this._steps.push({"text":this.savedContent,"bookmark":this._getBookmark()});}},_endEditing:function(_411){var v=this.getValue(true);this._undoedSteps=[];this._steps.push({text:v,bookmark:this._getBookmark()});},onKeyDown:function(e){if(!this.customUndo){this.inherited("onKeyDown",arguments);return;}var k=e.keyCode,ks=dojo.keys;if(e.ctrlKey&&!e.altKey){if(k==90||k==122){dojo.stopEvent(e);this.undo();return;}else{if(k==89||k==121){dojo.stopEvent(e);this.redo();return;}}}this.inherited("onKeyDown",arguments);switch(k){case ks.ENTER:case ks.BACKSPACE:case ks.DELETE:this.beginEditing();break;case 88:case 86:if(e.ctrlKey&&!e.altKey&&!e.metaKey){this.endEditing();if(e.keyCode==88){this.beginEditing("cut");setTimeout(dojo.hitch(this,this.endEditing),1);}else{this.beginEditing("paste");setTimeout(dojo.hitch(this,this.endEditing),1);}break;}default:if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&(e.keyCode<dojo.keys.F1||e.keyCode>dojo.keys.F15)){this.beginEditing();break;}case ks.ALT:this.endEditing();break;case ks.UP_ARROW:case ks.DOWN_ARROW:case ks.LEFT_ARROW:case ks.RIGHT_ARROW:case ks.HOME:case ks.END:case ks.PAGE_UP:case ks.PAGE_DOWN:this.endEditing(true);break;case ks.CTRL:case ks.SHIFT:case ks.TAB:break;}},_onBlur:function(){this.inherited("_onBlur",arguments);this.endEditing(true);},onClick:function(){this.endEditing(true);this.inherited("onClick",arguments);}});dojo.subscribe(dijit._scopeName+".Editor.getPlugin",null,function(o){if(o.plugin){return;}var args=o.args,p;var _p=dijit._editor._Plugin;var name=args.name;switch(name){case "undo":case "redo":case "cut":case "copy":case "paste":case "insertOrderedList":case "insertUnorderedList":case "indent":case "outdent":case "justifyCenter":case "justifyFull":case "justifyLeft":case "justifyRight":case "delete":case "selectAll":case "removeFormat":case "insertHorizontalRule":p=new _p({command:name});break;case "bold":case "italic":case "underline":case "strikethrough":case "subscript":case "superscript":p=new _p({buttonClass:dijit.form.ToggleButton,command:name});break;case "|":p=new _p({button:new dijit.ToolbarSeparator()});}o.plugin=p;});}if(!dojo._hasResource["dojo.regexp"]){dojo._hasResource["dojo.regexp"]=true;dojo.provide("dojo.regexp");dojo.regexp.escapeString=function(str,_41c){return str.replace(/([\.$?*!=:|{}\(\)\[\]\\\/^])/g,function(ch){if(_41c&&_41c.indexOf(ch)!=-1){return ch;}return "\\"+ch;});};dojo.regexp.buildGroupRE=function(arr,re,_420){if(!(arr instanceof Array)){return re(arr);}var b=[];for(var i=0;i<arr.length;i++){b.push(re(arr[i]));}return dojo.regexp.group(b.join("|"),_420);};dojo.regexp.group=function(_423,_424){return "("+(_424?"?:":"")+_423+")";};}if(!dojo._hasResource["dojo.number"]){dojo._hasResource["dojo.number"]=true;dojo.provide("dojo.number");dojo.number.format=function(_425,_426){_426=dojo.mixin({},_426||{});var _427=dojo.i18n.normalizeLocale(_426.locale);var _428=dojo.i18n.getLocalization("dojo.cldr","number",_427);_426.customs=_428;var _429=_426.pattern||_428[(_426.type||"decimal")+"Format"];if(isNaN(_425)){return null;}return dojo.number._applyPattern(_425,_429,_426);};dojo.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;dojo.number._applyPattern=function(_42a,_42b,_42c){_42c=_42c||{};var _42d=_42c.customs.group;var _42e=_42c.customs.decimal;var _42f=_42b.split(";");var _430=_42f[0];_42b=_42f[(_42a<0)?1:0]||("-"+_430);if(_42b.indexOf("%")!=-1){_42a*=100;}else{if(_42b.indexOf("‰")!=-1){_42a*=1000;}else{if(_42b.indexOf("¤")!=-1){_42d=_42c.customs.currencyGroup||_42d;_42e=_42c.customs.currencyDecimal||_42e;_42b=_42b.replace(/\u00a4{1,3}/,function(_431){var prop=["symbol","currency","displayName"][_431.length-1];return _42c[prop]||_42c.currency||"";});}else{if(_42b.indexOf("E")!=-1){throw new Error("exponential notation not supported");}}}}var _433=dojo.number._numberPatternRE;var _434=_430.match(_433);if(!_434){throw new Error("unable to find a number expression in pattern: "+_42b);}return _42b.replace(_433,dojo.number._formatAbsolute(_42a,_434[0],{decimal:_42e,group:_42d,places:_42c.places}));};dojo.number.round=function(_435,_436,_437){var _438=String(_435).split(".");var _439=(_438[1]&&_438[1].length)||0;if(_439>_436){var _43a=Math.pow(10,_436);if(_437>0){_43a*=10/_437;_436++;}_435=Math.round(_435*_43a)/_43a;_438=String(_435).split(".");_439=(_438[1]&&_438[1].length)||0;if(_439>_436){_438[1]=_438[1].substr(0,_436);_435=Number(_438.join("."));}}return _435;};dojo.number._formatAbsolute=function(_43b,_43c,_43d){_43d=_43d||{};if(_43d.places===true){_43d.places=0;}if(_43d.places===Infinity){_43d.places=6;}var _43e=_43c.split(".");var _43f=(_43d.places>=0)?_43d.places:(_43e[1]&&_43e[1].length)||0;if(!(_43d.round<0)){_43b=dojo.number.round(_43b,_43f,_43d.round);}var _440=String(Math.abs(_43b)).split(".");var _441=_440[1]||"";if(_43d.places){_440[1]=dojo.string.pad(_441.substr(0,_43d.places),_43d.places,"0",true);}else{if(_43e[1]&&_43d.places!==0){var pad=_43e[1].lastIndexOf("0")+1;if(pad>_441.length){_440[1]=dojo.string.pad(_441,pad,"0",true);}var _443=_43e[1].length;if(_443<_441.length){_440[1]=_441.substr(0,_443);}}else{if(_440[1]){_440.pop();}}}var _444=_43e[0].replace(",","");pad=_444.indexOf("0");if(pad!=-1){pad=_444.length-pad;if(pad>_440[0].length){_440[0]=dojo.string.pad(_440[0],pad);}if(_444.indexOf("#")==-1){_440[0]=_440[0].substr(_440[0].length-pad);}}var _445=_43e[0].lastIndexOf(",");var _446,_447;if(_445!=-1){_446=_43e[0].length-_445-1;var _448=_43e[0].substr(0,_445);_445=_448.lastIndexOf(",");if(_445!=-1){_447=_448.length-_445-1;}}var _449=[];for(var _44a=_440[0];_44a;){var off=_44a.length-_446;_449.push((off>0)?_44a.substr(off):_44a);_44a=(off>0)?_44a.slice(0,off):"";if(_447){_446=_447;delete _447;}}_440[0]=_449.reverse().join(_43d.group||",");return _440.join(_43d.decimal||".");};dojo.number.regexp=function(_44c){return dojo.number._parseInfo(_44c).regexp;};dojo.number._parseInfo=function(_44d){_44d=_44d||{};var _44e=dojo.i18n.normalizeLocale(_44d.locale);var _44f=dojo.i18n.getLocalization("dojo.cldr","number",_44e);var _450=_44d.pattern||_44f[(_44d.type||"decimal")+"Format"];var _451=_44f.group;var _452=_44f.decimal;var _453=1;if(_450.indexOf("%")!=-1){_453/=100;}else{if(_450.indexOf("‰")!=-1){_453/=1000;}else{var _454=_450.indexOf("¤")!=-1;if(_454){_451=_44f.currencyGroup||_451;_452=_44f.currencyDecimal||_452;}}}var _455=_450.split(";");if(_455.length==1){_455.push("-"+_455[0]);}var re=dojo.regexp.buildGroupRE(_455,function(_457){_457="(?:"+dojo.regexp.escapeString(_457,".")+")";return _457.replace(dojo.number._numberPatternRE,function(_458){var _459={signed:false,separator:_44d.strict?_451:[_451,""],fractional:_44d.fractional,decimal:_452,exponent:false};var _45a=_458.split(".");var _45b=_44d.places;if(_45a.length==1||_45b===0){_459.fractional=false;}else{if(_45b===undefined){_45b=_45a[1].lastIndexOf("0")+1;}if(_45b&&_44d.fractional==undefined){_459.fractional=true;}if(!_44d.places&&(_45b<_45a[1].length)){_45b+=","+_45a[1].length;}_459.places=_45b;}var _45c=_45a[0].split(",");if(_45c.length>1){_459.groupSize=_45c.pop().length;if(_45c.length>1){_459.groupSize2=_45c.pop().length;}}return "("+dojo.number._realNumberRegexp(_459)+")";});},true);if(_454){re=re.replace(/(\s*)(\u00a4{1,3})(\s*)/g,function(_45d,_45e,_45f,_460){var prop=["symbol","currency","displayName"][_45f.length-1];var _462=dojo.regexp.escapeString(_44d[prop]||_44d.currency||"");_45e=_45e?"\\s":"";_460=_460?"\\s":"";if(!_44d.strict){if(_45e){_45e+="*";}if(_460){_460+="*";}return "(?:"+_45e+_462+_460+")?";}return _45e+_462+_460;});}return {regexp:re.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:_451,decimal:_452,factor:_453};};dojo.number.parse=function(_463,_464){var info=dojo.number._parseInfo(_464);var _466=(new RegExp("^"+info.regexp+"$")).exec(_463);if(!_466){return NaN;}var _467=_466[1];if(!_466[1]){if(!_466[2]){return NaN;}_467=_466[2];info.factor*=-1;}_467=_467.replace(new RegExp("["+info.group+"\\s\\xa0"+"]","g"),"").replace(info.decimal,".");return Number(_467)*info.factor;};dojo.number._realNumberRegexp=function(_468){_468=_468||{};if(!("places" in _468)){_468.places=Infinity;}if(typeof _468.decimal!="string"){_468.decimal=".";}if(!("fractional" in _468)||/^0/.test(_468.places)){_468.fractional=[true,false];}if(!("exponent" in _468)){_468.exponent=[true,false];}if(!("eSigned" in _468)){_468.eSigned=[true,false];}var _469=dojo.number._integerRegexp(_468);var _46a=dojo.regexp.buildGroupRE(_468.fractional,function(q){var re="";if(q&&(_468.places!==0)){re="\\"+_468.decimal;if(_468.places==Infinity){re="(?:"+re+"\\d+)?";}else{re+="\\d{"+_468.places+"}";}}return re;},true);var _46d=dojo.regexp.buildGroupRE(_468.exponent,function(q){if(q){return "([eE]"+dojo.number._integerRegexp({signed:_468.eSigned})+")";}return "";});var _46f=_469+_46a;if(_46a){_46f="(?:(?:"+_46f+")|(?:"+_46a+"))";}return _46f+_46d;};dojo.number._integerRegexp=function(_470){_470=_470||{};if(!("signed" in _470)){_470.signed=[true,false];}if(!("separator" in _470)){_470.separator="";}else{if(!("groupSize" in _470)){_470.groupSize=3;}}var _471=dojo.regexp.buildGroupRE(_470.signed,function(q){return q?"[-+]":"";},true);var _473=dojo.regexp.buildGroupRE(_470.separator,function(sep){if(!sep){return "(?:0|[1-9]\\d*)";}sep=dojo.regexp.escapeString(sep);if(sep==" "){sep="\\s";}else{if(sep==" "){sep="\\s\\xa0";}}var grp=_470.groupSize,grp2=_470.groupSize2;if(grp2){var _477="(?:0|[1-9]\\d{0,"+(grp2-1)+"}(?:["+sep+"]\\d{"+grp2+"})*["+sep+"]\\d{"+grp+"})";return ((grp-grp2)>0)?"(?:"+_477+"|(?:0|[1-9]\\d{0,"+(grp-1)+"}))":_477;}return "(?:0|[1-9]\\d{0,"+(grp-1)+"}(?:["+sep+"]\\d{"+grp+"})*)";},true);return _471+_473;};}if(!dojo._hasResource["dijit.ProgressBar"]){dojo._hasResource["dijit.ProgressBar"]=true;dojo.provide("dijit.ProgressBar");dojo.declare("dijit.ProgressBar",[dijit._Widget,dijit._Templated],{progress:"0",maximum:100,places:0,indeterminate:false,templateString:"<div class=\"dijitProgressBar dijitProgressBarEmpty\"\n\t><div waiRole=\"progressbar\" tabindex=\"0\" dojoAttachPoint=\"internalProgress\" class=\"dijitProgressBarFull\"\n\t\t><div class=\"dijitProgressBarTile\"></div\n\t\t><span style=\"visibility:hidden\">&nbsp;</span\n\t></div\n\t><div dojoAttachPoint=\"label\" class=\"dijitProgressBarLabel\" id=\"${id}_label\">&nbsp;</div\n\t><img dojoAttachPoint=\"inteterminateHighContrastImage\" class=\"dijitProgressBarIndeterminateHighContrastImage\"\n\t></img\n></div>\n",_indeterminateHighContrastImagePath:dojo.moduleUrl("dijit","themes/a11y/indeterminate_progress.gif"),postCreate:function(){this.inherited("postCreate",arguments);this.inteterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath);this.update();},update:function(_478){dojo.mixin(this,_478||{});var _479=1,_47a;if(this.indeterminate){_47a="addClass";dijit.removeWaiState(this.internalProgress,"valuenow");dijit.removeWaiState(this.internalProgress,"valuemin");dijit.removeWaiState(this.internalProgress,"valuemax");}else{_47a="removeClass";if(String(this.progress).indexOf("%")!=-1){_479=Math.min(parseFloat(this.progress)/100,1);this.progress=_479*this.maximum;}else{this.progress=Math.min(this.progress,this.maximum);_479=this.progress/this.maximum;}var text=this.report(_479);this.label.firstChild.nodeValue=text;dijit.setWaiState(this.internalProgress,"describedby",this.label.id);dijit.setWaiState(this.internalProgress,"valuenow",this.progress);dijit.setWaiState(this.internalProgress,"valuemin",0);dijit.setWaiState(this.internalProgress,"valuemax",this.maximum);}dojo[_47a](this.domNode,"dijitProgressBarIndeterminate");this.internalProgress.style.width=(_479*100)+"%";this.onChange();},report:function(_47c){return dojo.number.format(_47c,{type:"percent",places:this.places,locale:this.lang});},onChange:function(){}});}if(!dojo._hasResource["dijit.TitlePane"]){dojo._hasResource["dijit.TitlePane"]=true;dojo.provide("dijit.TitlePane");dojo.declare("dijit.TitlePane",[dijit.layout.ContentPane,dijit._Templated],{title:"",open:true,duration:250,baseClass:"dijitTitlePane",templateString:"<div class=\"${baseClass}\">\n\t<div dojoAttachEvent=\"onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus\" tabindex=\"0\"\n\t\t\twaiRole=\"button\" class=\"dijitTitlePaneTitle\" dojoAttachPoint=\"titleBarNode,focusNode\">\n\t\t<div dojoAttachPoint=\"arrowNode\" class=\"dijitInline dijitArrowNode\"><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span></div>\n\t\t<div dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" waiRole=\"region\" tabindex=\"-1\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc.  Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n",postCreate:function(){this.setTitle(this.title);if(!this.open){this.hideNode.style.display=this.wipeNode.style.display="none";}this._setCss();dojo.setSelectable(this.titleNode,false);this.inherited(arguments);dijit.setWaiState(this.containerNode,"labelledby",this.titleNode.id);dijit.setWaiState(this.focusNode,"haspopup","true");var _47d=this.hideNode,_47e=this.wipeNode;this._wipeIn=dojo.fx.wipeIn({node:this.wipeNode,duration:this.duration,beforeBegin:function(){_47d.style.display="";}});this._wipeOut=dojo.fx.wipeOut({node:this.wipeNode,duration:this.duration,onEnd:function(){_47d.style.display="none";}});},setContent:function(_47f){if(!this.open||this._wipeOut.status()=="playing"){this.inherited(arguments);}else{if(this._wipeIn.status()=="playing"){this._wipeIn.stop();}dojo.marginBox(this.wipeNode,{h:dojo.marginBox(this.wipeNode).h});this.inherited(arguments);this._wipeIn.play();}},toggle:function(){dojo.forEach([this._wipeIn,this._wipeOut],function(_480){if(_480.status()=="playing"){_480.stop();}});this[this.open?"_wipeOut":"_wipeIn"].play();this.open=!this.open;this._loadCheck();this._setCss();},_setCss:function(){var _481=["dijitClosed","dijitOpen"];var _482=this.open;var node=this.titleBarNode||this.focusNode;dojo.removeClass(node,_481[!_482+0]);node.className+=" "+_481[_482+0];this.arrowNodeInner.innerHTML=this.open?"-":"+";},_onTitleKey:function(e){if(e.keyCode==dojo.keys.ENTER||e.charCode==dojo.keys.SPACE){this.toggle();}else{if(e.keyCode==dojo.keys.DOWN_ARROW&&this.open){this.containerNode.focus();e.preventDefault();}}},_handleFocus:function(e){dojo[(e.type=="focus"?"addClass":"removeClass")](this.focusNode,this.baseClass+"Focused");},setTitle:function(_486){this.titleNode.innerHTML=_486;}});}if(!dojo._hasResource["dijit.layout.LinkPane"]){dojo._hasResource["dijit.layout.LinkPane"]=true;dojo.provide("dijit.layout.LinkPane");dojo.declare("dijit.layout.LinkPane",[dijit.layout.ContentPane,dijit._Templated],{templateString:"<div class=\"dijitLinkPane\"></div>",postCreate:function(){if(this.srcNodeRef){this.title+=this.srcNodeRef.innerHTML;}this.inherited("postCreate",arguments);}});}if(!dojo._hasResource["dijit.Menu"]){dojo._hasResource["dijit.Menu"]=true;dojo.provide("dijit.Menu");dojo.declare("dijit.Menu",[dijit._Widget,dijit._Templated,dijit._KeyNavContainer],{constructor:function(){this._bindings=[];},templateString:"<table class=\"dijit dijitMenu dijitReset dijitMenuTable\" waiRole=\"menu\" dojoAttachEvent=\"onkeypress:_onKeyPress\">"+"<tbody class=\"dijitReset\" dojoAttachPoint=\"containerNode\"></tbody>"+"</table>",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,parentMenu:null,popupDelay:500,_contextMenuWithMouse:false,postCreate:function(){if(this.contextMenuForWindow){this.bindDomNode(dojo.body());}else{dojo.forEach(this.targetNodeIds,this.bindDomNode,this);}this.connectKeyNavHandlers([dojo.keys.UP_ARROW],[dojo.keys.DOWN_ARROW]);},startup:function(){if(this._started){return;}dojo.forEach(this.getChildren(),function(_487){_487.startup();});this.startupKeyNavChildren();this.inherited(arguments);},onExecute:function(){},onCancel:function(_488){},_moveToPopup:function(evt){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled){this.focusedChild._onClick(evt);}},_onKeyPress:function(evt){if(evt.ctrlKey||evt.altKey){return;}switch(evt.keyCode){case dojo.keys.RIGHT_ARROW:this._moveToPopup(evt);dojo.stopEvent(evt);break;case dojo.keys.LEFT_ARROW:if(this.parentMenu){this.onCancel(false);}else{dojo.stopEvent(evt);}break;}},onItemHover:function(item){this.focusChild(item);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer){this.hover_timer=setTimeout(dojo.hitch(this,"_openPopup"),this.popupDelay);}},_onChildBlur:function(item){dijit.popup.close(item.popup);item._blur();this._stopPopupTimer();},onItemUnhover:function(item){},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null;}},_getTopMenu:function(){for(var top=this;top.parentMenu;top=top.parentMenu){}return top;},onItemClick:function(item,evt){if(item.disabled){return false;}if(item.popup){if(!this.is_open){this._openPopup();}}else{this.onExecute();item.onClick(evt);}},_iframeContentWindow:function(_491){var win=dijit.getDocumentWindow(dijit.Menu._iframeContentDocument(_491))||dijit.Menu._iframeContentDocument(_491)["__parent__"]||(_491.name&&dojo.doc.frames[_491.name])||null;return win;},_iframeContentDocument:function(_493){var doc=_493.contentDocument||(_493.contentWindow&&_493.contentWindow.document)||(_493.name&&dojo.doc.frames[_493.name]&&dojo.doc.frames[_493.name].document)||null;return doc;},bindDomNode:function(node){node=dojo.byId(node);var win=dijit.getDocumentWindow(node.ownerDocument);if(node.tagName.toLowerCase()=="iframe"){win=this._iframeContentWindow(node);node=dojo.withGlobal(win,dojo.body);}var cn=(node==dojo.body()?dojo.doc:node);node[this.id]=this._bindings.push([dojo.connect(cn,(this.leftClickToOpen)?"onclick":"oncontextmenu",this,"_openMyself"),dojo.connect(cn,"onkeydown",this,"_contextKey"),dojo.connect(cn,"onmousedown",this,"_contextMouse")]);},unBindDomNode:function(_498){var node=dojo.byId(_498);if(node){var bid=node[this.id]-1,b=this._bindings[bid];dojo.forEach(b,dojo.disconnect);delete this._bindings[bid];}},_contextKey:function(e){this._contextMenuWithMouse=false;if(e.keyCode==dojo.keys.F10){dojo.stopEvent(e);if(e.shiftKey&&e.type=="keydown"){var _e={target:e.target,pageX:e.pageX,pageY:e.pageY};_e.preventDefault=_e.stopPropagation=function(){};window.setTimeout(dojo.hitch(this,function(){this._openMyself(_e);}),1);}}},_contextMouse:function(e){this._contextMenuWithMouse=true;},_openMyself:function(e){if(this.leftClickToOpen&&e.button>0){return;}dojo.stopEvent(e);var x,y;if(dojo.isSafari||this._contextMenuWithMouse){x=e.pageX;y=e.pageY;}else{var _4a2=dojo.coords(e.target,true);x=_4a2.x+10;y=_4a2.y+10;}var self=this;var _4a4=dijit.getFocus(this);function closeAndRestoreFocus(){dijit.focus(_4a4);dijit.popup.close(self);};dijit.popup.open({popup:this,x:x,y:y,onExecute:closeAndRestoreFocus,onCancel:closeAndRestoreFocus,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=function(){this.inherited("_onBlur",arguments);dijit.popup.close(this);};},onOpen:function(e){this.isShowingNow=true;},onClose:function(){this._stopPopupTimer();this.parentMenu=null;this.isShowingNow=false;this.currentPopup=null;if(this.focusedChild){this._onChildBlur(this.focusedChild);this.focusedChild=null;}},_openPopup:function(){this._stopPopupTimer();var _4a6=this.focusedChild;var _4a7=_4a6.popup;if(_4a7.isShowingNow){return;}_4a7.parentMenu=this;var self=this;dijit.popup.open({parent:this,popup:_4a7,around:_4a6.arrowCell,orient:this.isLeftToRight()?{"TR":"TL","TL":"TR"}:{"TL":"TR","TR":"TL"},onCancel:function(){dijit.popup.close(_4a7);_4a6.focus();self.currentPopup=null;}});this.currentPopup=_4a7;if(_4a7.focus){_4a7.focus();}},uninitialize:function(){dojo.forEach(this.targetNodeIds,this.unBindDomNode,this);this.inherited(arguments);}});dojo.declare("dijit.MenuItem",[dijit._Widget,dijit._Templated,dijit._Contained],{templateString:"<tr class=\"dijitReset dijitMenuItem\" "+"dojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">"+"<td class=\"dijitReset\"><div class=\"dijitMenuItemIcon ${iconClass}\" dojoAttachPoint=\"iconNode\"></div></td>"+"<td tabIndex=\"-1\" class=\"dijitReset dijitMenuItemLabel\" dojoAttachPoint=\"containerNode,focusNode\" waiRole=\"menuitem\"></td>"+"<td class=\"dijitReset\" dojoAttachPoint=\"arrowCell\">"+"<div class=\"dijitMenuExpand\" dojoAttachPoint=\"expand\" style=\"display:none\">"+"<span class=\"dijitInline dijitArrowNode dijitMenuExpandInner\">+</span>"+"</div>"+"</td>"+"</tr>",label:"",iconClass:"",disabled:false,postCreate:function(){dojo.setSelectable(this.domNode,false);this.setDisabled(this.disabled);if(this.label){this.setLabel(this.label);}},_onHover:function(){this.getParent().onItemHover(this);},_onUnhover:function(){this.getParent().onItemUnhover(this);},_onClick:function(evt){this.getParent().onItemClick(this,evt);dojo.stopEvent(evt);},onClick:function(evt){},focus:function(){dojo.addClass(this.domNode,"dijitMenuItemHover");try{dijit.focus(this.containerNode);}catch(e){}},_blur:function(){dojo.removeClass(this.domNode,"dijitMenuItemHover");},setLabel:function(_4ab){this.containerNode.innerHTML=this.label=_4ab;},setDisabled:function(_4ac){this.disabled=_4ac;dojo[_4ac?"addClass":"removeClass"](this.domNode,"dijitMenuItemDisabled");dijit.setWaiState(this.containerNode,"disabled",_4ac?"true":"false");}});dojo.declare("dijit.PopupMenuItem",dijit.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var _4ad=dojo.query("*",this.srcNodeRef);dijit.PopupMenuItem.superclass._fillContent.call(this,_4ad[0]);this.dropDownContainer=this.srcNodeRef;}},startup:function(){if(this._started){return;}this.inherited(arguments);if(!this.popup){var node=dojo.query("[widgetId]",this.dropDownContainer)[0];this.popup=dijit.byNode(node);}dojo.body().appendChild(this.popup.domNode);this.popup.domNode.style.display="none";dojo.addClass(this.expand,"dijitMenuExpandEnabled");dojo.style(this.expand,"display","");dijit.setWaiState(this.containerNode,"haspopup","true");},destroyDescendants:function(){if(this.popup){this.popup.destroyRecursive();delete this.popup;}this.inherited(arguments);}});dojo.declare("dijit.MenuSeparator",[dijit._Widget,dijit._Templated,dijit._Contained],{templateString:"<tr class=\"dijitMenuSeparator\"><td colspan=3>"+"<div class=\"dijitMenuSeparatorTop\"></div>"+"<div class=\"dijitMenuSeparatorBottom\"></div>"+"</td></tr>",postCreate:function(){dojo.setSelectable(this.domNode,false);},isFocusable:function(){return false;}});}if(!dojo._hasResource["dijit.layout.StackContainer"]){dojo._hasResource["dijit.layout.StackContainer"]=true;dojo.provide("dijit.layout.StackContainer");dojo.declare("dijit.layout.StackContainer",dijit.layout._LayoutWidget,{doLayout:true,_started:false,postCreate:function(){dijit.setWaiRole((this.containerNode||this.domNode),"tabpanel");this.connect(this.domNode,"onkeypress",this._onKeyPress);},startup:function(){if(this._started){return;}var _4af=this.getChildren();dojo.forEach(_4af,this._setupChild,this);dojo.some(_4af,function(_4b0){if(_4b0.selected){this.selectedChildWidget=_4b0;}return _4b0.selected;},this);var _4b1=this.selectedChildWidget;if(!_4b1&&_4af[0]){_4b1=this.selectedChildWidget=_4af[0];_4b1.selected=true;}if(_4b1){this._showChild(_4b1);}dojo.publish(this.id+"-startup",[{children:_4af,selected:_4b1}]);this.inherited(arguments);},_setupChild:function(page){page.domNode.style.display="none";page.domNode.style.position="relative";return page;},addChild:function(_4b3,_4b4){dijit._Container.prototype.addChild.apply(this,arguments);_4b3=this._setupChild(_4b3);if(this._started){this.layout();dojo.publish(this.id+"-addChild",[_4b3,_4b4]);if(!this.selectedChildWidget){this.selectChild(_4b3);}}},removeChild:function(page){dijit._Container.prototype.removeChild.apply(this,arguments);if(this._beingDestroyed){return;}if(this._started){dojo.publish(this.id+"-removeChild",[page]);this.layout();}if(this.selectedChildWidget===page){this.selectedChildWidget=undefined;if(this._started){var _4b6=this.getChildren();if(_4b6.length){this.selectChild(_4b6[0]);}}}},selectChild:function(page){page=dijit.byId(page);if(this.selectedChildWidget!=page){this._transition(page,this.selectedChildWidget);this.selectedChildWidget=page;dojo.publish(this.id+"-selectChild",[page]);}},_transition:function(_4b8,_4b9){if(_4b9){this._hideChild(_4b9);}this._showChild(_4b8);if(this.doLayout&&_4b8.resize){_4b8.resize(this._containerContentBox||this._contentBox);}},_adjacent:function(_4ba){var _4bb=this.getChildren();var _4bc=dojo.indexOf(_4bb,this.selectedChildWidget);_4bc+=_4ba?1:_4bb.length-1;return _4bb[_4bc%_4bb.length];},forward:function(){this.selectChild(this._adjacent(true));},back:function(){this.selectChild(this._adjacent(false));},_onKeyPress:function(e){dojo.publish(this.id+"-containerKeyPress",[{e:e,page:this}]);},layout:function(){if(this.doLayout&&this.selectedChildWidget&&this.selectedChildWidget.resize){this.selectedChildWidget.resize(this._contentBox);}},_showChild:function(page){var _4bf=this.getChildren();page.isFirstChild=(page==_4bf[0]);page.isLastChild=(page==_4bf[_4bf.length-1]);page.selected=true;page.domNode.style.display="";if(page._loadCheck){page._loadCheck();}if(page.onShow){page.onShow();}},_hideChild:function(page){page.selected=false;page.domNode.style.display="none";if(page.onHide){page.onHide();}},closeChild:function(page){var _4c2=page.onClose(this,page);if(_4c2){this.removeChild(page);page.destroyRecursive();}},destroy:function(){this._beingDestroyed=true;this.inherited(arguments);}});dojo.declare("dijit.layout.StackController",[dijit._Widget,dijit._Templated,dijit._Container],{templateString:"<span wairole='tablist' dojoAttachEvent='onkeypress' class='dijitStackController'></span>",containerId:"",buttonWidget:"dijit.layout._StackButton",postCreate:function(){dijit.setWaiRole(this.domNode,"tablist");this.pane2button={};this.pane2menu={};this._subscriptions=[dojo.subscribe(this.containerId+"-startup",this,"onStartup"),dojo.subscribe(this.containerId+"-addChild",this,"onAddChild"),dojo.subscribe(this.containerId+"-removeChild",this,"onRemoveChild"),dojo.subscribe(this.containerId+"-selectChild",this,"onSelectChild"),dojo.subscribe(this.containerId+"-containerKeyPress",this,"onContainerKeyPress")];},onStartup:function(info){dojo.forEach(info.children,this.onAddChild,this);this.onSelectChild(info.selected);},destroy:function(){for(var pane in this.pane2button){this.onRemoveChild(pane);}dojo.forEach(this._subscriptions,dojo.unsubscribe);this.inherited(arguments);},onAddChild:function(page,_4c6){var _4c7=dojo.doc.createElement("span");this.domNode.appendChild(_4c7);var cls=dojo.getObject(this.buttonWidget);var _4c9=new cls({label:page.title,closeButton:page.closable},_4c7);this.addChild(_4c9,_4c6);this.pane2button[page]=_4c9;page.controlButton=_4c9;dojo.connect(_4c9,"onClick",dojo.hitch(this,"onButtonClick",page));if(page.closable){dojo.connect(_4c9,"onClickCloseButton",dojo.hitch(this,"onCloseButtonClick",page));var _4ca=dojo.i18n.getLocalization("dijit","common");var _4cb=new dijit.Menu({targetNodeIds:[_4c9.id],id:_4c9.id+"_Menu"});var _4cc=new dijit.MenuItem({label:_4ca.itemClose});dojo.connect(_4cc,"onClick",dojo.hitch(this,"onCloseButtonClick",page));_4cb.addChild(_4cc);this.pane2menu[page]=_4cb;}if(!this._currentChild){_4c9.focusNode.setAttribute("tabIndex","0");this._currentChild=page;}if(!this.isLeftToRight()&&dojo.isIE&&this._rectifyRtlTabList){this._rectifyRtlTabList();}},onRemoveChild:function(page){if(this._currentChild===page){this._currentChild=null;}var _4ce=this.pane2button[page];var menu=this.pane2menu[page];if(menu){menu.destroy();}if(_4ce){_4ce.destroy();}this.pane2button[page]=null;},onSelectChild:function(page){if(!page){return;}if(this._currentChild){var _4d1=this.pane2button[this._currentChild];_4d1.setAttribute("checked",false);_4d1.focusNode.setAttribute("tabIndex","-1");}var _4d2=this.pane2button[page];_4d2.setAttribute("checked",true);this._currentChild=page;_4d2.focusNode.setAttribute("tabIndex","0");var _4d3=dijit.byId(this.containerId);dijit.setWaiState(_4d3.containerNode||_4d3.domNode,"labelledby",_4d2.id);},onButtonClick:function(page){var _4d5=dijit.byId(this.containerId);_4d5.selectChild(page);},onCloseButtonClick:function(page){var _4d7=dijit.byId(this.containerId);_4d7.closeChild(page);var b=this.pane2button[this._currentChild];if(b){dijit.focus(b.focusNode||b.domNode);}},adjacent:function(_4d9){if(!this.isLeftToRight()&&(!this.tabPosition||/top|bottom/.test(this.tabPosition))){_4d9=!_4d9;}var _4da=this.getChildren();var _4db=dojo.indexOf(_4da,this.pane2button[this._currentChild]);var _4dc=_4d9?1:_4da.length-1;return _4da[(_4db+_4dc)%_4da.length];},onkeypress:function(e){if(this.disabled||e.altKey){return;}var _4de=null;if(e.ctrlKey||!e._djpage){var k=dojo.keys;switch(e.keyCode){case k.LEFT_ARROW:case k.UP_ARROW:if(!e._djpage){_4de=false;}break;case k.PAGE_UP:if(e.ctrlKey){_4de=false;}break;case k.RIGHT_ARROW:case k.DOWN_ARROW:if(!e._djpage){_4de=true;}break;case k.PAGE_DOWN:if(e.ctrlKey){_4de=true;}break;case k.DELETE:if(this._currentChild.closable){this.onCloseButtonClick(this._currentChild);}dojo.stopEvent(e);break;default:if(e.ctrlKey){if(e.keyCode==k.TAB){this.adjacent(!e.shiftKey).onClick();dojo.stopEvent(e);}else{if(e.keyChar=="w"){if(this._currentChild.closable){this.onCloseButtonClick(this._currentChild);}dojo.stopEvent(e);}}}}if(_4de!==null){this.adjacent(_4de).onClick();dojo.stopEvent(e);}}},onContainerKeyPress:function(info){info.e._djpage=info.page;this.onkeypress(info.e);}});dojo.declare("dijit.layout._StackButton",dijit.form.ToggleButton,{tabIndex:"-1",postCreate:function(evt){dijit.setWaiRole((this.focusNode||this.domNode),"tab");this.inherited(arguments);},onClick:function(evt){dijit.focus(this.focusNode);},onClickCloseButton:function(evt){evt.stopPropagation();}});dojo.extend(dijit._Widget,{title:"",selected:false,closable:false,onClose:function(){return true;}});}if(!dojo._hasResource["dijit.layout.TabContainer"]){dojo._hasResource["dijit.layout.TabContainer"]=true;dojo.provide("dijit.layout.TabContainer");dojo.declare("dijit.layout.TabContainer",[dijit.layout.StackContainer,dijit._Templated],{tabPosition:"top",templateString:null,templateString:"<div class=\"dijitTabContainer\">\n\t<div dojoAttachPoint=\"tablistNode\"></div>\n\t<div class=\"dijitTabPaneWrapper\" dojoAttachPoint=\"containerNode\"></div>\n</div>\n",_controllerWidget:"dijit.layout.TabController",postCreate:function(){this.inherited(arguments);var _4e4=dojo.getObject(this._controllerWidget);this.tablist=new _4e4({id:this.id+"_tablist",tabPosition:this.tabPosition,doLayout:this.doLayout,containerId:this.id},this.tablistNode);},_setupChild:function(tab){dojo.addClass(tab.domNode,"dijitTabPane");this.inherited(arguments);return tab;},startup:function(){if(this._started){return;}this.tablist.startup();this.inherited(arguments);if(dojo.isSafari){setTimeout(dojo.hitch(this,"layout"),0);}if(dojo.isIE&&!this.isLeftToRight()&&this.tabPosition=="right-h"&&this.tablist&&this.tablist.pane2button){for(var pane in this.tablist.pane2button){var _4e7=this.tablist.pane2button[pane];if(!_4e7.closeButton){continue;}tabButtonStyle=_4e7.closeButtonNode.style;tabButtonStyle.position="absolute";if(dojo.isIE<7){tabButtonStyle.left=_4e7.domNode.offsetWidth+"px";}else{tabButtonStyle.padding="0px";}}}},layout:function(){if(!this.doLayout){return;}var _4e8=this.tabPosition.replace(/-h/,"");var _4e9=[{domNode:this.tablist.domNode,layoutAlign:_4e8},{domNode:this.containerNode,layoutAlign:"client"}];dijit.layout.layoutChildren(this.domNode,this._contentBox,_4e9);this._containerContentBox=dijit.layout.marginBox2contentBox(this.containerNode,_4e9[1]);if(this.selectedChildWidget){this._showChild(this.selectedChildWidget);if(this.doLayout&&this.selectedChildWidget.resize){this.selectedChildWidget.resize(this._containerContentBox);}}},destroy:function(){if(this.tablist){this.tablist.destroy();}this.inherited(arguments);}});dojo.declare("dijit.layout.TabController",dijit.layout.StackController,{templateString:"<div wairole='tablist' dojoAttachEvent='onkeypress:onkeypress'></div>",tabPosition:"top",doLayout:true,buttonWidget:"dijit.layout._TabButton",postMixInProperties:function(){this["class"]="dijitTabLabels-"+this.tabPosition+(this.doLayout?"":" dijitTabNoLayout");this.inherited(arguments);},_rectifyRtlTabList:function(){if(0>=this.tabPosition.indexOf("-h")){return;}if(!this.pane2button){return;}var _4ea=0;for(var pane in this.pane2button){_4ea=Math.max(_4ea,dojo.marginBox(this.pane2button[pane].innerDiv).w);}for(pane in this.pane2button){this.pane2button[pane].innerDiv.style.width=_4ea+"px";}}});dojo.declare("dijit.layout._TabButton",dijit.layout._StackButton,{baseClass:"dijitTab",templateString:"<div waiRole=\"presentation\" dojoAttachEvent='onclick:onClick,onmouseenter:_onMouse,onmouseleave:_onMouse'>\n    <div waiRole=\"presentation\" class='dijitTabInnerDiv' dojoAttachPoint='innerDiv'>\n        <div waiRole=\"presentation\" class='dijitTabContent' dojoAttachPoint='tabContent'>\n\t        <span dojoAttachPoint='containerNode,focusNode' class='tabLabel'>${!label}</span>\n\t        <span dojoAttachPoint='closeButtonNode' class='closeImage' dojoAttachEvent='onmouseenter:_onMouse, onmouseleave:_onMouse, onclick:onClickCloseButton' stateModifier='CloseButton'>\n\t            <span dojoAttachPoint='closeText' class='closeText'>x</span>\n\t        </span>\n        </div>\n    </div>\n</div>\n",postCreate:function(){if(this.closeButton){dojo.addClass(this.innerDiv,"dijitClosable");}else{this.closeButtonNode.style.display="none";}this.inherited(arguments);dojo.setSelectable(this.containerNode,false);}});}if(!dojo._hasResource["dijit.form.TextBox"]){dojo._hasResource["dijit.form.TextBox"]=true;dojo.provide("dijit.form.TextBox");dojo.declare("dijit.form.TextBox",dijit.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",templateString:"<input class=\"dijit dijitReset dijitLeft\" dojoAttachPoint='textbox,focusNode' name=\"${name}\"\n\tdojoAttachEvent='onmouseenter:_onMouse,onmouseleave:_onMouse,onfocus:_onMouse,onblur:_onMouse,onkeypress:_onKeyPress'\n\tautocomplete=\"off\" type=\"${type}\"\n\t/>\n",baseClass:"dijitTextBox",attributeMap:dojo.mixin(dojo.clone(dijit.form._FormValueWidget.prototype.attributeMap),{maxLength:"focusNode"}),getDisplayedValue:function(){return this.filter(this.textbox.value);},getValue:function(){return this.parse(this.getDisplayedValue(),this.constraints);},setValue:function(_4ec,_4ed,_4ee){var _4ef=this.filter(_4ec);if((((typeof _4ef==typeof _4ec)&&(_4ec!==undefined))||(_4ec===null))&&(_4ee==null||_4ee==undefined)){_4ee=this.format(_4ef,this.constraints);}if(_4ee!=null&&_4ee!=undefined){this.textbox.value=_4ee;}dijit.form.TextBox.superclass.setValue.call(this,_4ef,_4ed);},setDisplayedValue:function(_4f0,_4f1){this.textbox.value=_4f0;this.setValue(this.getValue(),_4f1);},format:function(_4f2,_4f3){return ((_4f2==null||_4f2==undefined)?"":(_4f2.toString?_4f2.toString():_4f2));},parse:function(_4f4,_4f5){return _4f4;},postCreate:function(){this.textbox.setAttribute("value",this.getDisplayedValue());this.inherited(arguments);this._layoutHack();},filter:function(val){if(val===null||val===undefined){return "";}else{if(typeof val!="string"){return val;}}if(this.trim){val=dojo.trim(val);}if(this.uppercase){val=val.toUpperCase();}if(this.lowercase){val=val.toLowerCase();}if(this.propercase){val=val.replace(/[^\s]+/g,function(word){return word.substring(0,1).toUpperCase()+word.substring(1);});}return val;},_setBlurValue:function(){this.setValue(this.getValue(),(this.isValid?this.isValid():true));},_onBlur:function(){this._setBlurValue();this.inherited(arguments);}});dijit.selectInputText=function(_4f8,_4f9,stop){var _4fb=dojo.global;var _4fc=dojo.doc;_4f8=dojo.byId(_4f8);if(isNaN(_4f9)){_4f9=0;}if(isNaN(stop)){stop=_4f8.value?_4f8.value.length:0;}_4f8.focus();if(_4fc["selection"]&&dojo.body()["createTextRange"]){if(_4f8.createTextRange){var _4fd=_4f8.createTextRange();with(_4fd){collapse(true);moveStart("character",_4f9);moveEnd("character",stop);select();}}}else{if(_4fb["getSelection"]){var _4fe=_4fb.getSelection();if(_4f8.setSelectionRange){_4f8.setSelectionRange(_4f9,stop);}}}};}if(!dojo._hasResource["dijit.Tooltip"]){dojo._hasResource["dijit.Tooltip"]=true;dojo.provide("dijit.Tooltip");dojo.declare("dijit._MasterTooltip",[dijit._Widget,dijit._Templated],{duration:200,templateString:"<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\">\n\t<div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" waiRole='alert'></div>\n\t<div class=\"dijitTooltipConnector\"></div>\n</div>\n",postCreate:function(){dojo.body().appendChild(this.domNode);this.bgIframe=new dijit.BackgroundIframe(this.domNode);this.fadeIn=dojo.fadeIn({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onShow")});this.fadeOut=dojo.fadeOut({node:this.domNode,duration:this.duration,onEnd:dojo.hitch(this,"_onHide")});},show:function(_4ff,_500,_501){if(this.aroundNode&&this.aroundNode===_500){return;}if(this.fadeOut.status()=="playing"){this._onDeck=arguments;return;}this.containerNode.innerHTML=_4ff;this.domNode.style.top=(this.domNode.offsetTop+1)+"px";var _502={};var ltr=this.isLeftToRight();dojo.forEach((_501&&_501.length)?_501:dijit.Tooltip.defaultPosition,function(pos){switch(pos){case "after":_502[ltr?"BR":"BL"]=ltr?"BL":"BR";break;case "before":_502[ltr?"BL":"BR"]=ltr?"BR":"BL";break;case "below":_502[ltr?"BL":"BR"]=ltr?"TL":"TR";_502[ltr?"BR":"BL"]=ltr?"TR":"TL";break;case "above":default:_502[ltr?"TL":"TR"]=ltr?"BL":"BR";_502[ltr?"TR":"TL"]=ltr?"BR":"BL";break;}});var pos=dijit.placeOnScreenAroundElement(this.domNode,_500,_502,dojo.hitch(this,"orient"));dojo.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=_500;},orient:function(node,_507,_508){node.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[_507+"-"+_508];},_onShow:function(){if(dojo.isIE){this.domNode.style.filter="";}},hide:function(_509){if(!this.aroundNode||this.aroundNode!==_509){return;}if(this._onDeck){this._onDeck=null;return;}this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play();},_onHide:function(){this.domNode.style.cssText="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null;}}});dijit.showTooltip=function(_50a,_50b,_50c){if(!dijit._masterTT){dijit._masterTT=new dijit._MasterTooltip();}return dijit._masterTT.show(_50a,_50b,_50c);};dijit.hideTooltip=function(_50d){if(!dijit._masterTT){dijit._masterTT=new dijit._MasterTooltip();}return dijit._masterTT.hide(_50d);};dojo.declare("dijit.Tooltip",dijit._Widget,{label:"",showDelay:400,connectId:[],position:[],postCreate:function(){if(this.srcNodeRef){this.srcNodeRef.style.display="none";}this._connectNodes=[];dojo.forEach(this.connectId,function(id){var node=dojo.byId(id);if(node){this._connectNodes.push(node);dojo.forEach(["onMouseOver","onMouseOut","onFocus","onBlur","onHover","onUnHover"],function(_510){this.connect(node,_510.toLowerCase(),"_"+_510);},this);if(dojo.isIE){node.style.zoom=1;}}},this);},_onMouseOver:function(e){this._onHover(e);},_onMouseOut:function(e){if(dojo.isDescendant(e.relatedTarget,e.target)){return;}this._onUnHover(e);},_onFocus:function(e){this._focus=true;this._onHover(e);this.inherited(arguments);},_onBlur:function(e){this._focus=false;this._onUnHover(e);this.inherited(arguments);},_onHover:function(e){if(!this._showTimer){var _516=e.target;this._showTimer=setTimeout(dojo.hitch(this,function(){this.open(_516);}),this.showDelay);}},_onUnHover:function(e){if(this._focus){return;}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}this.close();},open:function(_518){_518=_518||this._connectNodes[0];if(!_518){return;}if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}dijit.showTooltip(this.label||this.domNode.innerHTML,_518,this.position);this._connectNode=_518;},close:function(){dijit.hideTooltip(this._connectNode);delete this._connectNode;if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer;}},uninitialize:function(){this.close();}});dijit.Tooltip.defaultPosition=["after","before"];}if(!dojo._hasResource["dijit.form.ValidationTextBox"]){dojo._hasResource["dijit.form.ValidationTextBox"]=true;dojo.provide("dijit.form.ValidationTextBox");dojo.declare("dijit.form.ValidationTextBox",dijit.form.TextBox,{templateString:"<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\"\n\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\" waiRole=\"presentation\"\n\t><div style=\"overflow:hidden;\"\n\t\t><div class=\"dijitReset dijitValidationIcon\"><br></div\n\t\t><div class=\"dijitReset dijitValidationIconText\">&Chi;</div\n\t\t><div class=\"dijitReset dijitInputField\"\n\t\t\t><input class=\"dijitReset\" dojoAttachPoint='textbox,focusNode' dojoAttachEvent='onfocus:_update,onkeyup:_update,onblur:_onMouse,onkeypress:_onKeyPress' autocomplete=\"off\"\n\t\t\ttype='${type}' name='${name}'\n\t\t/></div\n\t></div\n></div>\n",baseClass:"dijitTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",constraints:{},regExp:".*",regExpGen:function(_519){return this.regExp;},state:"",tooltipPosition:[],setValue:function(){this.inherited(arguments);this.validate(this._focused);},validator:function(_51a,_51b){return (new RegExp("^("+this.regExpGen(_51b)+")"+(this.required?"":"?")+"$")).test(_51a)&&(!this.required||!this._isEmpty(_51a))&&(this._isEmpty(_51a)||this.parse(_51a,_51b)!==undefined);},isValid:function(_51c){return this.validator(this.textbox.value,this.constraints);},_isEmpty:function(_51d){return /^\s*$/.test(_51d);},getErrorMessage:function(_51e){return this.invalidMessage;},getPromptMessage:function(_51f){return this.promptMessage;},validate:function(_520){var _521="";var _522=this.isValid(_520);var _523=this._isEmpty(this.textbox.value);this.state=(_522||(!this._hasBeenBlurred&&_523))?"":"Error";this._setStateClass();dijit.setWaiState(this.focusNode,"invalid",_522?"false":"true");if(_520){if(_523){_521=this.getPromptMessage(true);}if(!_521&&this.state=="Error"){_521=this.getErrorMessage(true);}}this.displayMessage(_521);return _522;},_message:"",displayMessage:function(_524){if(this._message==_524){return;}this._message=_524;dijit.hideTooltip(this.domNode);if(_524){dijit.showTooltip(_524,this.domNode,this.tooltipPosition);}},_refreshState:function(){this.validate(this._focused);},_update:function(e){this._refreshState();this._onMouse(e);},constructor:function(){this.constraints={};},postMixInProperties:function(){this.inherited(arguments);this.constraints.locale=this.lang;this.messages=dojo.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$"){this.invalidMessage=this.messages.invalidMessage;}var p=this.regExpGen(this.constraints);this.regExp=p;}});dojo.declare("dijit.form.MappedTextBox",dijit.form.ValidationTextBox,{serialize:function(val,_528){return val.toString?val.toString():"";},toString:function(){var val=this.filter(this.getValue());return val!=null?(typeof val=="string"?val:this.serialize(val,this.constraints)):"";},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments);},setAttribute:function(attr,_52b){this.inherited(arguments);switch(attr){case "disabled":if(this.valueNode){this.valueNode.disabled=this.disabled;}}},postCreate:function(){var _52c=this.textbox;var _52d=(this.valueNode=dojo.doc.createElement("input"));_52d.setAttribute("type",_52c.type);_52d.setAttribute("value",this.toString());dojo.style(_52d,"display","none");_52d.name=this.textbox.name;_52d.disabled=this.textbox.disabled;this.textbox.name=this.textbox.name+"_displayed_";this.textbox.removeAttribute("name");dojo.place(_52d,_52c,"after");this.inherited(arguments);}});dojo.declare("dijit.form.RangeBoundTextBox",dijit.form.MappedTextBox,{rangeMessage:"",compare:function(val1,val2){return val1-val2;},rangeCheck:function(_530,_531){var _532="min" in _531;var _533="max" in _531;if(_532||_533){return (!_532||this.compare(_530,_531.min)>=0)&&(!_533||this.compare(_530,_531.max)<=0);}return true;},isInRange:function(_534){return this.rangeCheck(this.getValue(),this.constraints);},isValid:function(_535){return this.inherited(arguments)&&((this._isEmpty(this.textbox.value)&&!this.required)||this.isInRange(_535));},getErrorMessage:function(_536){if(dijit.form.RangeBoundTextBox.superclass.isValid.call(this,false)&&!this.isInRange(_536)){return this.rangeMessage;}return this.inherited(arguments);},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=dojo.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage;}},postCreate:function(){this.inherited(arguments);if(this.constraints.min!==undefined){dijit.setWaiState(this.focusNode,"valuemin",this.constraints.min);}if(this.constraints.max!==undefined){dijit.setWaiState(this.focusNode,"valuemax",this.constraints.max);}},setValue:function(_537,_538){dijit.setWaiState(this.focusNode,"valuenow",_537);this.inherited("setValue",arguments);}});}if(!dojo._hasResource["dijit.form.ComboBox"]){dojo._hasResource["dijit.form.ComboBox"]=true;dojo.provide("dijit.form.ComboBox");dojo.declare("dijit.form.ComboBoxMixin",null,{item:null,pageSize:Infinity,store:null,query:{},autoComplete:false,searchDelay:100,searchAttr:"name",queryExpr:"${0}*",ignoreCase:true,hasDownArrow:true,templateString:"<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\"\n\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\" dojoAttachPoint=\"comboNode\" waiRole=\"combobox\" tabIndex=\"-1\"\n\t><div style=\"overflow:hidden;\"\n\t\t><div class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton'\n\t\t\tdojoAttachPoint=\"downArrowNode\" waiRole=\"presentation\"\n\t\t\tdojoAttachEvent=\"onmousedown:_onArrowMouseDown,onmouseup:_onMouse,onmouseenter:_onMouse,onmouseleave:_onMouse\"\n\t\t\t><div class=\"dijitArrowButtonInner\">&thinsp;</div\n\t\t\t><div class=\"dijitArrowButtonChar\">&#9660;</div\n\t\t></div\n\t\t><div class=\"dijitReset dijitValidationIcon\"><br></div\n\t\t><div class=\"dijitReset dijitValidationIconText\">&Chi;</div\n\t\t><div class=\"dijitReset dijitInputField\"\n\t\t\t><input type=\"text\" autocomplete=\"off\" name=\"${name}\" class='dijitReset'\n\t\t\tdojoAttachEvent=\"onkeypress:_onKeyPress, onfocus:_update, compositionend\"\n\t\t\tdojoAttachPoint=\"textbox,focusNode\" waiRole=\"textbox\" waiState=\"haspopup-true,autocomplete-list\"\n\t\t/></div\n\t></div\n></div>\n",baseClass:"dijitComboBox",_getCaretPos:function(_539){var pos=0;if(typeof (_539.selectionStart)=="number"){pos=_539.selectionStart;}else{if(dojo.isIE){var tr=dojo.doc.selection.createRange().duplicate();var ntr=_539.createTextRange();tr.move("character",0);ntr.move("character",0);try{ntr.setEndPoint("EndToEnd",tr);pos=String(ntr.text).replace(/\r/g,"").length;}catch(e){}}}return pos;},_setCaretPos:function(_53d,_53e){_53e=parseInt(_53e);dijit.selectInputText(_53d,_53e,_53e);},_setAttribute:function(attr,_540){if(attr=="disabled"){dijit.setWaiState(this.comboNode,"disabled",_540);}},_onKeyPress:function(evt){if(evt.altKey||(evt.ctrlKey&&evt.charCode!=118)){return;}var _542=false;var pw=this._popupWidget;var dk=dojo.keys;if(this._isShowingNow){pw.handleKey(evt);}switch(evt.keyCode){case dk.PAGE_DOWN:case dk.DOWN_ARROW:if(!this._isShowingNow||this._prev_key_esc){this._arrowPressed();_542=true;}else{this._announceOption(pw.getHighlightedOption());}dojo.stopEvent(evt);this._prev_key_backspace=false;this._prev_key_esc=false;break;case dk.PAGE_UP:case dk.UP_ARROW:if(this._isShowingNow){this._announceOption(pw.getHighlightedOption());}dojo.stopEvent(evt);this._prev_key_backspace=false;this._prev_key_esc=false;break;case dk.ENTER:var _545;if(this._isShowingNow&&(_545=pw.getHighlightedOption())){if(_545==pw.nextButton){this._nextSearch(1);dojo.stopEvent(evt);break;}else{if(_545==pw.previousButton){this._nextSearch(-1);dojo.stopEvent(evt);break;}}}else{this.setDisplayedValue(this.getDisplayedValue());}evt.preventDefault();case dk.TAB:var _546=this.getDisplayedValue();if(pw&&(_546==pw._messages["previousMessage"]||_546==pw._messages["nextMessage"])){break;}if(this._isShowingNow){this._prev_key_backspace=false;this._prev_key_esc=false;if(pw.getHighlightedOption()){pw.setValue({target:pw.getHighlightedOption()},true);}this._hideResultList();}break;case dk.SPACE:this._prev_key_backspace=false;this._prev_key_esc=false;if(this._isShowingNow&&pw.getHighlightedOption()){dojo.stopEvent(evt);this._selectOption();this._hideResultList();}else{_542=true;}break;case dk.ESCAPE:this._prev_key_backspace=false;this._prev_key_esc=true;if(this._isShowingNow){dojo.stopEvent(evt);this._hideResultList();}this.inherited(arguments);break;case dk.DELETE:case dk.BACKSPACE:this._prev_key_esc=false;this._prev_key_backspace=true;_542=true;break;case dk.RIGHT_ARROW:case dk.LEFT_ARROW:this._prev_key_backspace=false;this._prev_key_esc=false;break;default:this._prev_key_backspace=false;this._prev_key_esc=false;if(dojo.isIE||evt.charCode!=0){_542=true;}}if(this.searchTimer){clearTimeout(this.searchTimer);}if(_542){setTimeout(dojo.hitch(this,"_startSearchFromInput"),1);}},_autoCompleteText:function(text){var fn=this.focusNode;dijit.selectInputText(fn,fn.value.length);var _549=this.ignoreCase?"toLowerCase":"substr";if(text[_549](0).indexOf(this.focusNode.value[_549](0))==0){var cpos=this._getCaretPos(fn);if((cpos+1)>fn.value.length){fn.value=text;dijit.selectInputText(fn,cpos);}}else{fn.value=text;dijit.selectInputText(fn);}},_openResultList:function(_54b,_54c){if(this.disabled||this.readOnly||(_54c.query[this.searchAttr]!=this._lastQuery)){return;}this._popupWidget.clearResultList();if(!_54b.length){this._hideResultList();return;}var _54d=new String(this.store.getValue(_54b[0],this.searchAttr));if(_54d&&this.autoComplete&&!this._prev_key_backspace&&(_54c.query[this.searchAttr]!="*")){this._autoCompleteText(_54d);}this._popupWidget.createOptions(_54b,_54c,dojo.hitch(this,"_getMenuLabelFromItem"));this._showResultList();if(_54c.direction){if(1==_54c.direction){this._popupWidget.highlightFirstOption();}else{if(-1==_54c.direction){this._popupWidget.highlightLastOption();}}this._announceOption(this._popupWidget.getHighlightedOption());}},_showResultList:function(){this._hideResultList();var _54e=this._popupWidget.getItems(),_54f=Math.min(_54e.length,this.maxListLength);this._arrowPressed();this.displayMessage("");with(this._popupWidget.domNode.style){width="";height="";}var best=this.open();var _551=dojo.marginBox(this._popupWidget.domNode);this._popupWidget.domNode.style.overflow=((best.h==_551.h)&&(best.w==_551.w))?"hidden":"auto";var _552=best.w;if(best.h<this._popupWidget.domNode.scrollHeight){_552+=16;}dojo.marginBox(this._popupWidget.domNode,{h:best.h,w:Math.max(_552,this.domNode.offsetWidth)});dijit.setWaiState(this.comboNode,"expanded","true");},_hideResultList:function(){if(this._isShowingNow){dijit.popup.close(this._popupWidget);this._arrowIdle();this._isShowingNow=false;dijit.setWaiState(this.comboNode,"expanded","false");dijit.removeWaiState(this.focusNode,"activedescendant");}},_setBlurValue:function(){var _553=this.getDisplayedValue();var pw=this._popupWidget;if(pw&&(_553==pw._messages["previousMessage"]||_553==pw._messages["nextMessage"])){this.setValue(this._lastValueReported,true);}else{this.setDisplayedValue(_553);}},_onBlur:function(){this._hideResultList();this._arrowIdle();this.inherited(arguments);},_announceOption:function(node){if(node==null){return;}var _556;if(node==this._popupWidget.nextButton||node==this._popupWidget.previousButton){_556=node.innerHTML;}else{_556=this.store.getValue(node.item,this.searchAttr);}this.focusNode.value=this.focusNode.value.substring(0,this._getCaretPos(this.focusNode));dijit.setWaiState(this.focusNode,"activedescendant",dojo.attr(node,"id"));this._autoCompleteText(_556);},_selectOption:function(evt){var tgt=null;if(!evt){evt={target:this._popupWidget.getHighlightedOption()};}if(!evt.target){this.setDisplayedValue(this.getDisplayedValue());return;}else{tgt=evt.target;}if(!evt.noHide){this._hideResultList();this._setCaretPos(this.focusNode,this.store.getValue(tgt.item,this.searchAttr).length);}this._doSelect(tgt);},_doSelect:function(tgt){this.item=tgt.item;this.setValue(this.store.getValue(tgt.item,this.searchAttr),true);},_onArrowMouseDown:function(evt){if(this.disabled||this.readOnly){return;}dojo.stopEvent(evt);this.focus();if(this._isShowingNow){this._hideResultList();}else{this._startSearch("");}},_startSearchFromInput:function(){this._startSearch(this.focusNode.value);},_getQueryString:function(text){return dojo.string.substitute(this.queryExpr,[text]);},_startSearch:function(key){if(!this._popupWidget){var _55d=this.id+"_popup";this._popupWidget=new dijit.form._ComboBoxMenu({onChange:dojo.hitch(this,this._selectOption),id:_55d});dijit.removeWaiState(this.focusNode,"activedescendant");dijit.setWaiState(this.textbox,"owns",_55d);}this.item=null;var _55e=dojo.clone(this.query);this._lastQuery=_55e[this.searchAttr]=this._getQueryString(key);this.searchTimer=setTimeout(dojo.hitch(this,function(_55f,_560){var _561=this.store.fetch({queryOptions:{ignoreCase:this.ignoreCase,deep:true},query:_55f,onComplete:dojo.hitch(this,"_openResultList"),onError:function(_562){console.error("dijit.form.ComboBox: "+_562);dojo.hitch(_560,"_hideResultList")();},start:0,count:this.pageSize});var _563=function(_564,_565){_564.start+=_564.count*_565;_564.direction=_565;this.store.fetch(_564);};this._nextSearch=this._popupWidget.onPage=dojo.hitch(this,_563,_561);},_55e,this),this.searchDelay);},_getValueField:function(){return this.searchAttr;},_arrowPressed:function(){if(!this.disabled&&!this.readOnly&&this.hasDownArrow){dojo.addClass(this.downArrowNode,"dijitArrowButtonActive");}},_arrowIdle:function(){if(!this.disabled&&!this.readOnly&&this.hasDownArrow){dojo.removeClass(this.downArrowNode,"dojoArrowButtonPushed");}},compositionend:function(evt){this.onkeypress({charCode:-1});},constructor:function(){this.query={};},postMixInProperties:function(){if(!this.hasDownArrow){this.baseClass="dijitTextBox";}if(!this.store){var _567=this.srcNodeRef;this.store=new dijit.form._ComboBoxDataStore(_567);if(!this.value||((typeof _567.selectedIndex=="number")&&_567.selectedIndex.toString()===this.value)){var item=this.store.fetchSelectedItem();if(item){this.value=this.store.getValue(item,this._getValueField());}}}},_postCreate:function(){var _569=dojo.query("label[for=\""+this.id+"\"]");if(_569.length){_569[0].id=(this.id+"_label");var cn=this.comboNode;dijit.setWaiState(cn,"labelledby",_569[0].id);dijit.setWaiState(cn,"disabled",this.disabled);}},uninitialize:function(){if(this._popupWidget){this._hideResultList();this._popupWidget.destroy();}},_getMenuLabelFromItem:function(item){return {html:false,label:this.store.getValue(item,this.searchAttr)};},open:function(){this._isShowingNow=true;return dijit.popup.open({popup:this._popupWidget,around:this.domNode,parent:this});},reset:function(){this.item=null;this.inherited(arguments);}});dojo.declare("dijit.form._ComboBoxMenu",[dijit._Widget,dijit._Templated],{templateString:"<ul class='dijitMenu' dojoAttachEvent='onmousedown:_onMouseDown,onmouseup:_onMouseUp,onmouseover:_onMouseOver,onmouseout:_onMouseOut' tabIndex='-1' style='overflow:\"auto\";'>"+"<li class='dijitMenuItem dijitMenuPreviousButton' dojoAttachPoint='previousButton'></li>"+"<li class='dijitMenuItem dijitMenuNextButton' dojoAttachPoint='nextButton'></li>"+"</ul>",_messages:null,postMixInProperties:function(){this._messages=dojo.i18n.getLocalization("dijit.form","ComboBox",this.lang);this.inherited("postMixInProperties",arguments);},setValue:function(_56c){this.value=_56c;this.onChange(_56c);},onChange:function(_56d){},onPage:function(_56e){},postCreate:function(){this.previousButton.innerHTML=this._messages["previousMessage"];this.nextButton.innerHTML=this._messages["nextMessage"];this.inherited("postCreate",arguments);},onClose:function(){this._blurOptionNode();},_createOption:function(item,_570){var _571=_570(item);var _572=dojo.doc.createElement("li");dijit.setWaiRole(_572,"option");if(_571.html){_572.innerHTML=_571.label;}else{_572.appendChild(dojo.doc.createTextNode(_571.label));}if(_572.innerHTML==""){_572.innerHTML="&nbsp;";}_572.item=item;return _572;},createOptions:function(_573,_574,_575){this.previousButton.style.display=(_574.start==0)?"none":"";dojo.attr(this.previousButton,"id",this.id+"_prev");dojo.forEach(_573,function(item,i){var _578=this._createOption(item,_575);_578.className="dijitMenuItem";dojo.attr(_578,"id",this.id+i);this.domNode.insertBefore(_578,this.nextButton);},this);this.nextButton.style.display=(_574.count==_573.length)?"":"none";dojo.attr(this.nextButton,"id",this.id+"_next");},clearResultList:function(){while(this.domNode.childNodes.length>2){this.domNode.removeChild(this.domNode.childNodes[this.domNode.childNodes.length-2]);}},getItems:function(){return this.domNode.childNodes;},getListLength:function(){return this.domNode.childNodes.length-2;},_onMouseDown:function(evt){dojo.stopEvent(evt);},_onMouseUp:function(evt){if(evt.target===this.domNode){return;}else{if(evt.target==this.previousButton){this.onPage(-1);}else{if(evt.target==this.nextButton){this.onPage(1);}else{var tgt=evt.target;while(!tgt.item){tgt=tgt.parentNode;}this.setValue({target:tgt},true);}}}},_onMouseOver:function(evt){if(evt.target===this.domNode){return;}var tgt=evt.target;if(!(tgt==this.previousButton||tgt==this.nextButton)){while(!tgt.item){tgt=tgt.parentNode;}}this._focusOptionNode(tgt);},_onMouseOut:function(evt){if(evt.target===this.domNode){return;}this._blurOptionNode();},_focusOptionNode:function(node){if(this._highlighted_option!=node){this._blurOptionNode();this._highlighted_option=node;dojo.addClass(this._highlighted_option,"dijitMenuItemHover");}},_blurOptionNode:function(){if(this._highlighted_option){dojo.removeClass(this._highlighted_option,"dijitMenuItemHover");this._highlighted_option=null;}},_highlightNextOption:function(){var fc=this.domNode.firstChild;if(!this.getHighlightedOption()){this._focusOptionNode(fc.style.display=="none"?fc.nextSibling:fc);}else{var ns=this._highlighted_option.nextSibling;if(ns&&ns.style.display!="none"){this._focusOptionNode(ns);}}dijit.scrollIntoView(this._highlighted_option);},highlightFirstOption:function(){this._focusOptionNode(this.domNode.firstChild.nextSibling);dijit.scrollIntoView(this._highlighted_option);},highlightLastOption:function(){this._focusOptionNode(this.domNode.lastChild.previousSibling);dijit.scrollIntoView(this._highlighted_option);},_highlightPrevOption:function(){var lc=this.domNode.lastChild;if(!this.getHighlightedOption()){this._focusOptionNode(lc.style.display=="none"?lc.previousSibling:lc);}else{var ps=this._highlighted_option.previousSibling;if(ps&&ps.style.display!="none"){this._focusOptionNode(ps);}}dijit.scrollIntoView(this._highlighted_option);},_page:function(up){var _585=0;var _586=this.domNode.scrollTop;var _587=dojo.style(this.domNode,"height");if(!this.getHighlightedOption()){this._highlightNextOption();}while(_585<_587){if(up){if(!this.getHighlightedOption().previousSibling||this._highlighted_option.previousSibling.style.display=="none"){break;}this._highlightPrevOption();}else{if(!this.getHighlightedOption().nextSibling||this._highlighted_option.nextSibling.style.display=="none"){break;}this._highlightNextOption();}var _588=this.domNode.scrollTop;_585+=(_588-_586)*(up?-1:1);_586=_588;}},pageUp:function(){this._page(true);},pageDown:function(){this._page(false);},getHighlightedOption:function(){var ho=this._highlighted_option;return (ho&&ho.parentNode)?ho:null;},handleKey:function(evt){switch(evt.keyCode){case dojo.keys.DOWN_ARROW:this._highlightNextOption();break;case dojo.keys.PAGE_DOWN:this.pageDown();break;case dojo.keys.UP_ARROW:this._highlightPrevOption();break;case dojo.keys.PAGE_UP:this.pageUp();break;}}});dojo.declare("dijit.form.ComboBox",[dijit.form.ValidationTextBox,dijit.form.ComboBoxMixin],{postMixInProperties:function(){dijit.form.ComboBoxMixin.prototype.postMixInProperties.apply(this,arguments);dijit.form.ValidationTextBox.prototype.postMixInProperties.apply(this,arguments);},postCreate:function(){dijit.form.ComboBoxMixin.prototype._postCreate.apply(this,arguments);dijit.form.ValidationTextBox.prototype.postCreate.apply(this,arguments);},setAttribute:function(attr,_58c){dijit.form.ValidationTextBox.prototype.setAttribute.apply(this,arguments);dijit.form.ComboBoxMixin.prototype._setAttribute.apply(this,arguments);}});dojo.declare("dijit.form._ComboBoxDataStore",null,{constructor:function(root){this.root=root;},getValue:function(item,_58f,_590){return (_58f=="value")?item.value:(item.innerText||item.textContent||"");},isItemLoaded:function(_591){return true;},fetch:function(args){var _593="^"+args.query.name.replace(/([\\\|\(\)\[\{\^\$\+\?\.\<\>])/g,"\\$1").replace("*",".*")+"$",_594=new RegExp(_593,args.queryOptions.ignoreCase?"i":""),_595=dojo.query("> option",this.root).filter(function(_596){return (_596.innerText||_596.textContent||"").match(_594);});var _597=args.start||0,end=("count" in args&&args.count!=Infinity)?(_597+args.count):_595.length;args.onComplete(_595.slice(_597,end),args);return args;},close:function(_599){return;},getLabel:function(item){return item.innerHTML;},getIdentity:function(item){return dojo.attr(item,"value");},fetchItemByIdentity:function(args){var item=dojo.query("option[value='"+args.identity+"']",this.root)[0];args.onItem(item);},fetchSelectedItem:function(){var root=this.root,si=root.selectedIndex;return dojo.query("> option:nth-child("+(si!=-1?si+1:1)+")",root)[0];}});}if(!dojo._hasResource["dijit.form.FilteringSelect"]){dojo._hasResource["dijit.form.FilteringSelect"]=true;dojo.provide("dijit.form.FilteringSelect");dojo.declare("dijit.form.FilteringSelect",[dijit.form.MappedTextBox,dijit.form.ComboBoxMixin],{labelAttr:"",labelType:"text",_isvalid:true,_lastDisplayedValue:"",isValid:function(){return this._isvalid;},_callbackSetLabel:function(_5a0,_5a1,_5a2){if(_5a1&&_5a1.query[this.searchAttr]!=this._lastQuery){return;}if(!_5a0.length){if(!this._focused){this.valueNode.value="";}dijit.form.TextBox.superclass.setValue.call(this,undefined,!this._focused);this._isvalid=false;this.validate(this._focused);}else{this._setValueFromItem(_5a0[0],_5a2);}},_openResultList:function(_5a3,_5a4){if(_5a4.query[this.searchAttr]!=this._lastQuery){return;}this._isvalid=_5a3.length!=0;this.validate(true);dijit.form.ComboBoxMixin.prototype._openResultList.apply(this,arguments);},getValue:function(){return this.valueNode.value;},_getValueField:function(){return "value";},_setValue:function(_5a5,_5a6,_5a7){this.valueNode.value=_5a5;dijit.form.FilteringSelect.superclass.setValue.call(this,_5a5,_5a7,_5a6);this._lastDisplayedValue=_5a6;},setValue:function(_5a8,_5a9){if(!_5a8){return;}var self=this;var _5ab=function(item,_5ad){if(item){if(self.store.isItemLoaded(item)){self._callbackSetLabel([item],undefined,_5ad);}else{self.store.loadItem({item:item,onItem:function(_5ae,_5af){self._callbackSetLabel(_5ae,_5af,_5ad);}});}}else{self._isvalid=false;self.validate(false);}};this.store.fetchItemByIdentity({identity:_5a8,onItem:function(item){_5ab(item,_5a9);}});},_setValueFromItem:function(item,_5b2){this._isvalid=true;this._setValue(this.store.getIdentity(item),this.labelFunc(item,this.store),_5b2);},labelFunc:function(item,_5b4){return _5b4.getValue(item,this.searchAttr);},_doSelect:function(tgt){this.item=tgt.item;this._setValueFromItem(tgt.item,true);},setDisplayedValue:function(_5b6,_5b7){if(this.store){var _5b8=dojo.clone(this.query);this._lastQuery=_5b8[this.searchAttr]=_5b6;this.textbox.value=_5b6;this._lastDisplayedValue=_5b6;var _5b9=this;this.store.fetch({query:_5b8,queryOptions:{ignoreCase:this.ignoreCase,deep:true},onComplete:function(_5ba,_5bb){dojo.hitch(_5b9,"_callbackSetLabel")(_5ba,_5bb,_5b7);},onError:function(_5bc){console.error("dijit.form.FilteringSelect: "+_5bc);dojo.hitch(_5b9,"_setValue")(undefined,_5b6,false);}});}},_getMenuLabelFromItem:function(item){if(this.labelAttr){return {html:this.labelType=="html",label:this.store.getValue(item,this.labelAttr)};}else{return dijit.form.ComboBoxMixin.prototype._getMenuLabelFromItem.apply(this,arguments);}},postMixInProperties:function(){dijit.form.ComboBoxMixin.prototype.postMixInProperties.apply(this,arguments);dijit.form.MappedTextBox.prototype.postMixInProperties.apply(this,arguments);},postCreate:function(){dijit.form.ComboBoxMixin.prototype._postCreate.apply(this,arguments);dijit.form.MappedTextBox.prototype.postCreate.apply(this,arguments);},setAttribute:function(attr,_5bf){dijit.form.MappedTextBox.prototype.setAttribute.apply(this,arguments);dijit.form.ComboBoxMixin.prototype._setAttribute.apply(this,arguments);},undo:function(){this.setDisplayedValue(this._lastDisplayedValue);},_valueChanged:function(){return this.getDisplayedValue()!=this._lastDisplayedValue;}});}if(!dojo._hasResource["dojo.cldr.supplemental"]){dojo._hasResource["dojo.cldr.supplemental"]=true;dojo.provide("dojo.cldr.supplemental");dojo.cldr.supplemental.getFirstDayOfWeek=function(_5c0){var _5c1={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,lb:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,tn:6,ye:6,as:0,au:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,ie:0,il:0,is:0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,za:0,zw:0,et:0,mw:0,ng:0,tj:0,sy:4};var _5c2=dojo.cldr.supplemental._region(_5c0);var dow=_5c1[_5c2];return (dow===undefined)?1:dow;};dojo.cldr.supplemental._region=function(_5c4){_5c4=dojo.i18n.normalizeLocale(_5c4);var tags=_5c4.split("-");var _5c6=tags[1];if(!_5c6){_5c6={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[tags[0]];}else{if(_5c6.length==4){_5c6=tags[2];}}return _5c6;};dojo.cldr.supplemental.getWeekend=function(_5c7){var _5c8={eg:5,il:5,sy:5,"in":0,ae:4,bh:4,dz:4,iq:4,jo:4,kw:4,lb:4,ly:4,ma:4,om:4,qa:4,sa:4,sd:4,tn:4,ye:4};var _5c9={ae:5,bh:5,dz:5,iq:5,jo:5,kw:5,lb:5,ly:5,ma:5,om:5,qa:5,sa:5,sd:5,tn:5,ye:5,af:5,ir:5,eg:6,il:6,sy:6};var _5ca=dojo.cldr.supplemental._region(_5c7);var _5cb=_5c8[_5ca];var end=_5c9[_5ca];if(_5cb===undefined){_5cb=6;}if(end===undefined){end=0;}return {start:_5cb,end:end};};}if(!dojo._hasResource["dojo.date"]){dojo._hasResource["dojo.date"]=true;dojo.provide("dojo.date");dojo.date.getDaysInMonth=function(_5cd){var _5ce=_5cd.getMonth();var days=[31,28,31,30,31,30,31,31,30,31,30,31];if(_5ce==1&&dojo.date.isLeapYear(_5cd)){return 29;}return days[_5ce];};dojo.date.isLeapYear=function(_5d0){var year=_5d0.getFullYear();return !(year%400)||(!(year%4)&&!!(year%100));};dojo.date.getTimezoneName=function(_5d2){var str=_5d2.toString();var tz="";var _5d5;var pos=str.indexOf("(");if(pos>-1){tz=str.substring(++pos,str.indexOf(")"));}else{var pat=/([A-Z\/]+) \d{4}$/;if((_5d5=str.match(pat))){tz=_5d5[1];}else{str=_5d2.toLocaleString();pat=/ ([A-Z\/]+)$/;if((_5d5=str.match(pat))){tz=_5d5[1];}}}return (tz=="AM"||tz=="PM")?"":tz;};dojo.date.compare=function(_5d8,_5d9,_5da){_5d8=new Date(Number(_5d8));_5d9=new Date(Number(_5d9||new Date()));if(_5da!=="undefined"){if(_5da=="date"){_5d8.setHours(0,0,0,0);_5d9.setHours(0,0,0,0);}else{if(_5da=="time"){_5d8.setFullYear(0,0,0);_5d9.setFullYear(0,0,0);}}}if(_5d8>_5d9){return 1;}if(_5d8<_5d9){return -1;}return 0;};dojo.date.add=function(date,_5dc,_5dd){var sum=new Date(Number(date));var _5df=false;var _5e0="Date";switch(_5dc){case "day":break;case "weekday":var days,_5e2;var mod=_5dd%5;if(!mod){days=(_5dd>0)?5:-5;_5e2=(_5dd>0)?((_5dd-5)/5):((_5dd+5)/5);}else{days=mod;_5e2=parseInt(_5dd/5);}var strt=date.getDay();var adj=0;if(strt==6&&_5dd>0){adj=1;}else{if(strt==0&&_5dd<0){adj=-1;}}var trgt=strt+days;if(trgt==0||trgt==6){adj=(_5dd>0)?2:-2;}_5dd=(7*_5e2)+days+adj;break;case "year":_5e0="FullYear";_5df=true;break;case "week":_5dd*=7;break;case "quarter":_5dd*=3;case "month":_5df=true;_5e0="Month";break;case "hour":case "minute":case "second":case "millisecond":_5e0="UTC"+_5dc.charAt(0).toUpperCase()+_5dc.substring(1)+"s";}if(_5e0){sum["set"+_5e0](sum["get"+_5e0]()+_5dd);}if(_5df&&(sum.getDate()<date.getDate())){sum.setDate(0);}return sum;};dojo.date.difference=function(_5e7,_5e8,_5e9){_5e8=_5e8||new Date();_5e9=_5e9||"day";var _5ea=_5e8.getFullYear()-_5e7.getFullYear();var _5eb=1;switch(_5e9){case "quarter":var m1=_5e7.getMonth();var m2=_5e8.getMonth();var q1=Math.floor(m1/3)+1;var q2=Math.floor(m2/3)+1;q2+=(_5ea*4);_5eb=q2-q1;break;case "weekday":var days=Math.round(dojo.date.difference(_5e7,_5e8,"day"));var _5f1=parseInt(dojo.date.difference(_5e7,_5e8,"week"));var mod=days%7;if(mod==0){days=_5f1*5;}else{var adj=0;var aDay=_5e7.getDay();var bDay=_5e8.getDay();_5f1=parseInt(days/7);mod=days%7;var _5f6=new Date(_5e7);_5f6.setDate(_5f6.getDate()+(_5f1*7));var _5f7=_5f6.getDay();if(days>0){switch(true){case aDay==6:adj=-1;break;case aDay==0:adj=0;break;case bDay==6:adj=-1;break;case bDay==0:adj=-2;break;case (_5f7+mod)>5:adj=-2;}}else{if(days<0){switch(true){case aDay==6:adj=0;break;case aDay==0:adj=1;break;case bDay==6:adj=2;break;case bDay==0:adj=1;break;case (_5f7+mod)<0:adj=2;}}}days+=adj;days-=(_5f1*2);}_5eb=days;break;case "year":_5eb=_5ea;break;case "month":_5eb=(_5e8.getMonth()-_5e7.getMonth())+(_5ea*12);break;case "week":_5eb=parseInt(dojo.date.difference(_5e7,_5e8,"day")/7);break;case "day":_5eb/=24;case "hour":_5eb/=60;case "minute":_5eb/=60;case "second":_5eb/=1000;case "millisecond":_5eb*=_5e8.getTime()-_5e7.getTime();}return Math.round(_5eb);};}if(!dojo._hasResource["dojo.date.locale"]){dojo._hasResource["dojo.date.locale"]=true;dojo.provide("dojo.date.locale");(function(){function formatPattern(_5f8,_5f9,_5fa,_5fb){return _5fb.replace(/([a-z])\1*/ig,function(_5fc){var s,pad;var c=_5fc.charAt(0);var l=_5fc.length;var _601=["abbr","wide","narrow"];switch(c){case "G":s=_5f9[(l<4)?"eraAbbr":"eraNames"][_5f8.getFullYear()<0?0:1];break;case "y":s=_5f8.getFullYear();switch(l){case 1:break;case 2:if(!_5fa){s=String(s);s=s.substr(s.length-2);break;}default:pad=true;}break;case "Q":case "q":s=Math.ceil((_5f8.getMonth()+1)/3);pad=true;break;case "M":case "L":var m=_5f8.getMonth();var _603;switch(l){case 1:case 2:s=m+1;pad=true;break;case 3:case 4:case 5:_603=_601[l-3];break;}if(_603){var _604=(c=="L")?"standalone":"format";var _605=["months",_604,_603].join("-");s=_5f9[_605][m];}break;case "w":var _606=0;s=dojo.date.locale._getWeekOfYear(_5f8,_606);pad=true;break;case "d":s=_5f8.getDate();pad=true;break;case "D":s=dojo.date.locale._getDayOfYear(_5f8);pad=true;break;case "E":case "e":case "c":var d=_5f8.getDay();var _608;switch(l){case 1:case 2:if(c=="e"){var _609=dojo.cldr.supplemental.getFirstDayOfWeek(options.locale);d=(d-_609+7)%7;}if(c!="c"){s=d+1;pad=true;break;}case 3:case 4:case 5:_608=_601[l-3];break;}if(_608){var _60a=(c=="c")?"standalone":"format";var _60b=["days",_60a,_608].join("-");s=_5f9[_60b][d];}break;case "a":var _60c=(_5f8.getHours()<12)?"am":"pm";s=_5f9[_60c];break;case "h":case "H":case "K":case "k":var h=_5f8.getHours();switch(c){case "h":s=(h%12)||12;break;case "H":s=h;break;case "K":s=(h%12);break;case "k":s=h||24;break;}pad=true;break;case "m":s=_5f8.getMinutes();pad=true;break;case "s":s=_5f8.getSeconds();pad=true;break;case "S":s=Math.round(_5f8.getMilliseconds()*Math.pow(10,l-3));pad=true;break;case "v":case "z":s=dojo.date.getTimezoneName(_5f8);if(s){break;}l=4;case "Z":var _60e=_5f8.getTimezoneOffset();var tz=[(_60e<=0?"+":"-"),dojo.string.pad(Math.floor(Math.abs(_60e)/60),2),dojo.string.pad(Math.abs(_60e)%60,2)];if(l==4){tz.splice(0,0,"GMT");tz.splice(3,0,":");}s=tz.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+_5fb);}if(pad){s=dojo.string.pad(s,l);}return s;});};dojo.date.locale.format=function(_610,_611){_611=_611||{};var _612=dojo.i18n.normalizeLocale(_611.locale);var _613=_611.formatLength||"short";var _614=dojo.date.locale._getGregorianBundle(_612);var str=[];var _616=dojo.hitch(this,formatPattern,_610,_614,_611.fullYear);if(_611.selector=="year"){var year=_610.getFullYear();if(_612.match(/^zh|^ja/)){year+="年";}return year;}if(_611.selector!="time"){var _618=_611.datePattern||_614["dateFormat-"+_613];if(_618){str.push(_processPattern(_618,_616));}}if(_611.selector!="date"){var _619=_611.timePattern||_614["timeFormat-"+_613];if(_619){str.push(_processPattern(_619,_616));}}var _61a=str.join(" ");return _61a;};dojo.date.locale.regexp=function(_61b){return dojo.date.locale._parseInfo(_61b).regexp;};dojo.date.locale._parseInfo=function(_61c){_61c=_61c||{};var _61d=dojo.i18n.normalizeLocale(_61c.locale);var _61e=dojo.date.locale._getGregorianBundle(_61d);var _61f=_61c.formatLength||"short";var _620=_61c.datePattern||_61e["dateFormat-"+_61f];var _621=_61c.timePattern||_61e["timeFormat-"+_61f];var _622;if(_61c.selector=="date"){_622=_620;}else{if(_61c.selector=="time"){_622=_621;}else{_622=_620+" "+_621;}}var _623=[];var re=_processPattern(_622,dojo.hitch(this,_buildDateTimeRE,_623,_61e,_61c));return {regexp:re,tokens:_623,bundle:_61e};};dojo.date.locale.parse=function(_625,_626){var info=dojo.date.locale._parseInfo(_626);var _628=info.tokens,_629=info.bundle;var re=new RegExp("^"+info.regexp+"$");var _62b=re.exec(_625);if(!_62b){return null;}var _62c=["abbr","wide","narrow"];var _62d=[1970,0,1,0,0,0,0];var amPm="";var _62f=dojo.every(_62b,function(v,i){if(!i){return true;}var _632=_628[i-1];var l=_632.length;switch(_632.charAt(0)){case "y":if(l!=2&&_626.strict){_62d[0]=v;}else{if(v<100){v=Number(v);var year=""+new Date().getFullYear();var _635=year.substring(0,2)*100;var _636=Math.min(Number(year.substring(2,4))+20,99);var num=(v<_636)?_635+v:_635-100+v;_62d[0]=num;}else{if(_626.strict){return false;}_62d[0]=v;}}break;case "M":if(l>2){var _638=_629["months-format-"+_62c[l-3]].concat();if(!_626.strict){v=v.replace(".","").toLowerCase();_638=dojo.map(_638,function(s){return s.replace(".","").toLowerCase();});}v=dojo.indexOf(_638,v);if(v==-1){return false;}}else{v--;}_62d[1]=v;break;case "E":case "e":var days=_629["days-format-"+_62c[l-3]].concat();if(!_626.strict){v=v.toLowerCase();days=dojo.map(days,function(d){return d.toLowerCase();});}v=dojo.indexOf(days,v);if(v==-1){return false;}break;case "D":_62d[1]=0;case "d":_62d[2]=v;break;case "a":var am=_626.am||_629.am;var pm=_626.pm||_629.pm;if(!_626.strict){var _63e=/\./g;v=v.replace(_63e,"").toLowerCase();am=am.replace(_63e,"").toLowerCase();pm=pm.replace(_63e,"").toLowerCase();}if(_626.strict&&v!=am&&v!=pm){return false;}amPm=(v==pm)?"p":(v==am)?"a":"";break;case "K":if(v==24){v=0;}case "h":case "H":case "k":if(v>23){return false;}_62d[3]=v;break;case "m":_62d[4]=v;break;case "s":_62d[5]=v;break;case "S":_62d[6]=v;}return true;});var _63f=+_62d[3];if(amPm==="p"&&_63f<12){_62d[3]=_63f+12;}else{if(amPm==="a"&&_63f==12){_62d[3]=0;}}var _640=new Date(_62d[0],_62d[1],_62d[2],_62d[3],_62d[4],_62d[5],_62d[6]);if(_626.strict){_640.setFullYear(_62d[0]);}var _641=_628.join("");if(!_62f||(_641.indexOf("M")!=-1&&_640.getMonth()!=_62d[1])||(_641.indexOf("d")!=-1&&_640.getDate()!=_62d[2])){return null;}return _640;};function _processPattern(_642,_643,_644,_645){var _646=function(x){return x;};_643=_643||_646;_644=_644||_646;_645=_645||_646;var _648=_642.match(/(''|[^'])+/g);var _649=false;dojo.forEach(_648,function(_64a,i){if(!_64a){_648[i]="";}else{_648[i]=(_649?_644:_643)(_64a);_649=!_649;}});return _645(_648.join(""));};function _buildDateTimeRE(_64c,_64d,_64e,_64f){_64f=dojo.regexp.escapeString(_64f);if(!_64e.strict){_64f=_64f.replace(" a"," ?a");}return _64f.replace(/([a-z])\1*/ig,function(_650){var s;var c=_650.charAt(0);var l=_650.length;var p2="",p3="";if(_64e.strict){if(l>1){p2="0"+"{"+(l-1)+"}";}if(l>2){p3="0"+"{"+(l-2)+"}";}}else{p2="0?";p3="0{0,2}";}switch(c){case "y":s="\\d{2,4}";break;case "M":s=(l>2)?"\\S+":p2+"[1-9]|1[0-2]";break;case "D":s=p2+"[1-9]|"+p3+"[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6]";break;case "d":s=p2+"[1-9]|[12]\\d|3[01]";break;case "w":s=p2+"[1-9]|[1-4][0-9]|5[0-3]";break;case "E":s="\\S+";break;case "h":s=p2+"[1-9]|1[0-2]";break;case "k":s=p2+"\\d|1[01]";break;case "H":s=p2+"\\d|1\\d|2[0-3]";break;case "K":s=p2+"[1-9]|1\\d|2[0-4]";break;case "m":case "s":s="[0-5]\\d";break;case "S":s="\\d{"+l+"}";break;case "a":var am=_64e.am||_64d.am||"AM";var pm=_64e.pm||_64d.pm||"PM";if(_64e.strict){s=am+"|"+pm;}else{s=am+"|"+pm;if(am!=am.toLowerCase()){s+="|"+am.toLowerCase();}if(pm!=pm.toLowerCase()){s+="|"+pm.toLowerCase();}}break;default:s=".*";}if(_64c){_64c.push(_650);}return "("+s+")";}).replace(/[\xa0 ]/g,"[\\s\\xa0]");};})();(function(){var _658=[];dojo.date.locale.addCustomFormats=function(_659,_65a){_658.push({pkg:_659,name:_65a});};dojo.date.locale._getGregorianBundle=function(_65b){var _65c={};dojo.forEach(_658,function(desc){var _65e=dojo.i18n.getLocalization(desc.pkg,desc.name,_65b);_65c=dojo.mixin(_65c,_65e);},this);return _65c;};})();dojo.date.locale.addCustomFormats("dojo.cldr","gregorian");dojo.date.locale.getNames=function(item,type,use,_662){var _663;var _664=dojo.date.locale._getGregorianBundle(_662);var _665=[item,use,type];if(use=="standAlone"){_663=_664[_665.join("-")];}_665[1]="format";return (_663||_664[_665.join("-")]).concat();};dojo.date.locale.isWeekend=function(_666,_667){var _668=dojo.cldr.supplemental.getWeekend(_667);var day=(_666||new Date()).getDay();if(_668.end<_668.start){_668.end+=7;if(day<_668.start){day+=7;}}return day>=_668.start&&day<=_668.end;};dojo.date.locale._getDayOfYear=function(_66a){return dojo.date.difference(new Date(_66a.getFullYear(),0,1),_66a)+1;};dojo.date.locale._getWeekOfYear=function(_66b,_66c){if(arguments.length==1){_66c=0;}var _66d=new Date(_66b.getFullYear(),0,1).getDay();var adj=(_66d-_66c+7)%7;var week=Math.floor((dojo.date.locale._getDayOfYear(_66b)+adj-1)/7);if(_66d==_66c){week++;}return week;};}if(!dojo._hasResource["dijit._Calendar"]){dojo._hasResource["dijit._Calendar"]=true;dojo.provide("dijit._Calendar");dojo.declare("dijit._Calendar",[dijit._Widget,dijit._Templated],{templateString:"<table cellspacing=\"0\" cellpadding=\"0\" class=\"dijitCalendarContainer\">\n\t<thead>\n\t\t<tr class=\"dijitReset dijitCalendarMonthContainer\" valign=\"top\">\n\t\t\t<th class='dijitReset' dojoAttachPoint=\"decrementMonth\">\n\t\t\t\t<div class=\"dijitInline dijitCalendarIncrementControl dijitCalendarDecrease\"><span dojoAttachPoint=\"decreaseArrowNode\" class=\"dijitA11ySideArrow dijitCalendarIncrementControl dijitCalendarDecreaseInner\">-</span></div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' colspan=\"5\">\n\t\t\t\t<div dojoAttachPoint=\"monthLabelSpacer\" class=\"dijitCalendarMonthLabelSpacer\"></div>\n\t\t\t\t<div dojoAttachPoint=\"monthLabelNode\" class=\"dijitCalendarMonthLabel\"></div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' dojoAttachPoint=\"incrementMonth\">\n\t\t\t\t<div class=\"dijitInline dijitCalendarIncrementControl dijitCalendarIncrease\"><span dojoAttachPoint=\"increaseArrowNode\" class=\"dijitA11ySideArrow dijitCalendarIncrementControl dijitCalendarIncreaseInner\">+</span></div>\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th class=\"dijitReset dijitCalendarDayLabelTemplate\"><span class=\"dijitCalendarDayLabel\"></span></th>\n\t\t</tr>\n\t</thead>\n\t<tbody dojoAttachEvent=\"onclick: _onDayClick\" class=\"dijitReset dijitCalendarBodyContainer\">\n\t\t<tr class=\"dijitReset dijitCalendarWeekTemplate\">\n\t\t\t<td class=\"dijitReset dijitCalendarDateTemplate\"><span class=\"dijitCalendarDateLabel\"></span></td>\n\t\t</tr>\n\t</tbody>\n\t<tfoot class=\"dijitReset dijitCalendarYearContainer\">\n\t\t<tr>\n\t\t\t<td class='dijitReset' valign=\"top\" colspan=\"7\">\n\t\t\t\t<h3 class=\"dijitCalendarYearLabel\">\n\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\" class=\"dijitInline dijitCalendarPreviousYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"currentYearLabelNode\" class=\"dijitInline dijitCalendarSelectedYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" class=\"dijitInline dijitCalendarNextYear\"></span>\n\t\t\t\t</h3>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\t\n",value:new Date(),dayWidth:"narrow",setValue:function(_670){if(!this.value||dojo.date.compare(_670,this.value)){_670=new Date(_670);this.displayMonth=new Date(_670);if(!this.isDisabledDate(_670,this.lang)){this.value=_670;this.value.setHours(0,0,0,0);this.onChange(this.value);}this._populateGrid();}},_setText:function(node,text){while(node.firstChild){node.removeChild(node.firstChild);}node.appendChild(dojo.doc.createTextNode(text));},_populateGrid:function(){var _673=this.displayMonth;_673.setDate(1);var _674=_673.getDay();var _675=dojo.date.getDaysInMonth(_673);var _676=dojo.date.getDaysInMonth(dojo.date.add(_673,"month",-1));var _677=new Date();var _678=this.value;var _679=dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);if(_679>_674){_679-=7;}dojo.query(".dijitCalendarDateTemplate",this.domNode).forEach(function(_67a,i){i+=_679;var date=new Date(_673);var _67d,_67e="dijitCalendar",adj=0;if(i<_674){_67d=_676-_674+i+1;adj=-1;_67e+="Previous";}else{if(i>=(_674+_675)){_67d=i-_674-_675+1;adj=1;_67e+="Next";}else{_67d=i-_674+1;_67e+="Current";}}if(adj){date=dojo.date.add(date,"month",adj);}date.setDate(_67d);if(!dojo.date.compare(date,_677,"date")){_67e="dijitCalendarCurrentDate "+_67e;}if(!dojo.date.compare(date,_678,"date")){_67e="dijitCalendarSelectedDate "+_67e;}if(this.isDisabledDate(date,this.lang)){_67e="dijitCalendarDisabledDate "+_67e;}var _680=this.getClassForDate(date,this.lang);if(_680){_67e+=_680+" "+_67e;}_67a.className=_67e+"Month dijitCalendarDateTemplate";_67a.dijitDateValue=date.valueOf();var _681=dojo.query(".dijitCalendarDateLabel",_67a)[0];this._setText(_681,date.getDate());},this);var _682=dojo.date.locale.getNames("months","wide","standAlone",this.lang);this._setText(this.monthLabelNode,_682[_673.getMonth()]);var y=_673.getFullYear()-1;var d=new Date();dojo.forEach(["previous","current","next"],function(name){d.setFullYear(y++);this._setText(this[name+"YearLabelNode"],dojo.date.locale.format(d,{selector:"year",locale:this.lang}));},this);var _686=this;var _687=function(_688,_689,adj){dijit.typematic.addMouseListener(_686[_688],_686,function(_68b){if(_68b>=0){_686._adjustDisplay(_689,adj);}},0.8,500);};_687("incrementMonth","month",1);_687("decrementMonth","month",-1);_687("nextYearLabelNode","year",1);_687("previousYearLabelNode","year",-1);},goToToday:function(){this.setValue(new Date());},postCreate:function(){this.inherited(arguments);var _68c=dojo.hitch(this,function(_68d,n){var _68f=dojo.query(_68d,this.domNode)[0];for(var i=0;i<n;i++){_68f.parentNode.appendChild(_68f.cloneNode(true));}});_68c(".dijitCalendarDayLabelTemplate",6);_68c(".dijitCalendarDateTemplate",6);_68c(".dijitCalendarWeekTemplate",5);var _691=dojo.date.locale.getNames("days",this.dayWidth,"standAlone",this.lang);var _692=dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);dojo.query(".dijitCalendarDayLabel",this.domNode).forEach(function(_693,i){this._setText(_693,_691[(i+_692)%7]);},this);var _695=dojo.date.locale.getNames("months","wide","standAlone",this.lang);dojo.forEach(_695,function(name){var _697=dojo.doc.createElement("div");this._setText(_697,name);this.monthLabelSpacer.appendChild(_697);},this);this.value=null;this.setValue(new Date());},_adjustDisplay:function(part,_699){this.displayMonth=dojo.date.add(this.displayMonth,part,_699);this._populateGrid();},_onDayClick:function(evt){var node=evt.target;dojo.stopEvent(evt);while(!node.dijitDateValue){node=node.parentNode;}if(!dojo.hasClass(node,"dijitCalendarDisabledDate")){this.setValue(node.dijitDateValue);this.onValueSelected(this.value);}},onValueSelected:function(date){},onChange:function(date){},isDisabledDate:function(_69e,_69f){},getClassForDate:function(_6a0,_6a1){}});}if(!dojo._hasResource["dijit.form._DateTimeTextBox"]){dojo._hasResource["dijit.form._DateTimeTextBox"]=true;dojo.provide("dijit.form._DateTimeTextBox");dojo.declare("dijit.form._DateTimeTextBox",dijit.form.RangeBoundTextBox,{regExpGen:dojo.date.locale.regexp,compare:dojo.date.compare,format:function(_6a2,_6a3){if(!_6a2){return "";}return dojo.date.locale.format(_6a2,_6a3);},parse:function(_6a4,_6a5){return dojo.date.locale.parse(_6a4,_6a5)||undefined;},serialize:dojo.date.stamp.toISOString,value:new Date(""),popupClass:"",_selector:"",postMixInProperties:function(){this.inherited(arguments);if(!this.value||this.value.toString()==dijit.form._DateTimeTextBox.prototype.value.toString()){this.value=undefined;}var _6a6=this.constraints;_6a6.selector=this._selector;_6a6.fullYear=true;var _6a7=dojo.date.stamp.fromISOString;if(typeof _6a6.min=="string"){_6a6.min=_6a7(_6a6.min);}if(typeof _6a6.max=="string"){_6a6.max=_6a7(_6a6.max);}},_onFocus:function(evt){this._open();},setValue:function(_6a9,_6aa,_6ab){this.inherited(arguments);if(this._picker){if(!_6a9){_6a9=new Date();}this._picker.setValue(_6a9);}},_open:function(){if(this.disabled||this.readOnly||!this.popupClass){return;}var _6ac=this;if(!this._picker){var _6ad=dojo.getObject(this.popupClass,false);this._picker=new _6ad({onValueSelected:function(_6ae){_6ac.focus();setTimeout(dojo.hitch(_6ac,"_close"),1);dijit.form._DateTimeTextBox.superclass.setValue.call(_6ac,_6ae,true);},lang:_6ac.lang,constraints:_6ac.constraints,isDisabledDate:function(date){var _6b0=dojo.date.compare;var _6b1=_6ac.constraints;return _6b1&&(_6b1.min&&(_6b0(_6b1.min,date,"date")>0)||(_6b1.max&&_6b0(_6b1.max,date,"date")<0));}});this._picker.setValue(this.getValue()||new Date());}if(!this._opened){dijit.popup.open({parent:this,popup:this._picker,around:this.domNode,onCancel:dojo.hitch(this,this._close),onClose:function(){_6ac._opened=false;}});this._opened=true;}dojo.marginBox(this._picker.domNode,{w:this.domNode.offsetWidth});},_close:function(){if(this._opened){dijit.popup.close(this._picker);this._opened=false;}},_onBlur:function(){this._close();if(this._picker){this._picker.destroy();delete this._picker;}this.inherited(arguments);},getDisplayedValue:function(){return this.textbox.value;},setDisplayedValue:function(_6b2,_6b3){this.setValue(this.parse(_6b2,this.constraints),_6b3,_6b2);},destroy:function(){if(this._picker){this._picker.destroy();delete this._picker;}this.inherited(arguments);},_onKeyPress:function(e){if(dijit.form._DateTimeTextBox.superclass._onKeyPress.apply(this,arguments)){if(this._opened&&e.keyCode==dojo.keys.ESCAPE&&!e.shiftKey&&!e.ctrlKey&&!e.altKey){this._close();dojo.stopEvent(e);}}}});}if(!dojo._hasResource["dijit.form.DateTextBox"]){dojo._hasResource["dijit.form.DateTextBox"]=true;dojo.provide("dijit.form.DateTextBox");dojo.declare("dijit.form.DateTextBox",dijit.form._DateTimeTextBox,{popupClass:"dijit._Calendar",_selector:"date"});}if(!dojo._hasResource["dijit.dijit"]){dojo._hasResource["dijit.dijit"]=true;dojo.provide("dijit.dijit");}if(!dojo._hasResource["dojo.data.util.filter"]){dojo._hasResource["dojo.data.util.filter"]=true;dojo.provide("dojo.data.util.filter");dojo.data.util.filter.patternToRegExp=function(_6b5,_6b6){var rxp="^";var c=null;for(var i=0;i<_6b5.length;i++){c=_6b5.charAt(i);switch(c){case "\\":rxp+=c;i++;rxp+=_6b5.charAt(i);break;case "*":rxp+=".*";break;case "?":rxp+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":rxp+="\\";default:rxp+=c;}}rxp+="$";if(_6b6){return new RegExp(rxp,"i");}else{return new RegExp(rxp);}};}if(!dojo._hasResource["dojo.data.util.sorter"]){dojo._hasResource["dojo.data.util.sorter"]=true;dojo.provide("dojo.data.util.sorter");dojo.data.util.sorter.basicComparator=function(a,b){var ret=0;if(a>b||typeof a==="undefined"||a===null){ret=1;}else{if(a<b||typeof b==="undefined"||b===null){ret=-1;}}return ret;};dojo.data.util.sorter.createSortFunction=function(_6bd,_6be){var _6bf=[];function createSortFunction(attr,dir){return function(_6c2,_6c3){var a=_6be.getValue(_6c2,attr);var b=_6be.getValue(_6c3,attr);var _6c6=null;if(_6be.comparatorMap){if(typeof attr!=="string"){attr=_6be.getIdentity(attr);}_6c6=_6be.comparatorMap[attr]||dojo.data.util.sorter.basicComparator;}_6c6=_6c6||dojo.data.util.sorter.basicComparator;return dir*_6c6(a,b);};};for(var i=0;i<_6bd.length;i++){sortAttribute=_6bd[i];if(sortAttribute.attribute){var _6c8=(sortAttribute.descending)?-1:1;_6bf.push(createSortFunction(sortAttribute.attribute,_6c8));}}return function(rowA,rowB){var i=0;while(i<_6bf.length){var ret=_6bf[i++](rowA,rowB);if(ret!==0){return ret;}}return 0;};};}if(!dojo._hasResource["dojo.data.util.simpleFetch"]){dojo._hasResource["dojo.data.util.simpleFetch"]=true;dojo.provide("dojo.data.util.simpleFetch");dojo.data.util.simpleFetch.fetch=function(_6cd){_6cd=_6cd||{};if(!_6cd.store){_6cd.store=this;}var self=this;var _6cf=function(_6d0,_6d1){if(_6d1.onError){var _6d2=_6d1.scope||dojo.global;_6d1.onError.call(_6d2,_6d0,_6d1);}};var _6d3=function(_6d4,_6d5){var _6d6=_6d5.abort||null;var _6d7=false;var _6d8=_6d5.start?_6d5.start:0;var _6d9=_6d5.count?(_6d8+_6d5.count):_6d4.length;_6d5.abort=function(){_6d7=true;if(_6d6){_6d6.call(_6d5);}};var _6da=_6d5.scope||dojo.global;if(!_6d5.store){_6d5.store=self;}if(_6d5.onBegin){_6d5.onBegin.call(_6da,_6d4.length,_6d5);}if(_6d5.sort){_6d4.sort(dojo.data.util.sorter.createSortFunction(_6d5.sort,self));}if(_6d5.onItem){for(var i=_6d8;(i<_6d4.length)&&(i<_6d9);++i){var item=_6d4[i];if(!_6d7){_6d5.onItem.call(_6da,item,_6d5);}}}if(_6d5.onComplete&&!_6d7){var _6dd=null;if(!_6d5.onItem){_6dd=_6d4.slice(_6d8,_6d9);}_6d5.onComplete.call(_6da,_6dd,_6d5);}};this._fetchItems(_6cd,_6d3,_6cf);return _6cd;};}if(!dojo._hasResource["dojo.data.ItemFileReadStore"]){dojo._hasResource["dojo.data.ItemFileReadStore"]=true;dojo.provide("dojo.data.ItemFileReadStore");dojo.declare("dojo.data.ItemFileReadStore",null,{constructor:function(_6de){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._jsonFileUrl=_6de.url;this._jsonData=_6de.data;this._datatypeMap=_6de.typeMap||{};if(!this._datatypeMap["Date"]){this._datatypeMap["Date"]={type:Date,deserialize:function(_6df){return dojo.date.stamp.fromISOString(_6df);}};}this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];},url:"",_assertIsItem:function(item){if(!this.isItem(item)){throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");}},_assertIsAttribute:function(_6e1){if(typeof _6e1!=="string"){throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");}},getValue:function(item,_6e3,_6e4){var _6e5=this.getValues(item,_6e3);return (_6e5.length>0)?_6e5[0]:_6e4;},getValues:function(item,_6e7){this._assertIsItem(item);this._assertIsAttribute(_6e7);return item[_6e7]||[];},getAttributes:function(item){this._assertIsItem(item);var _6e9=[];for(var key in item){if((key!==this._storeRefPropName)&&(key!==this._itemNumPropName)&&(key!==this._rootItemPropName)&&(key!==this._reverseRefMap)){_6e9.push(key);}}return _6e9;},hasAttribute:function(item,_6ec){return this.getValues(item,_6ec).length>0;},containsValue:function(item,_6ee,_6ef){var _6f0=undefined;if(typeof _6ef==="string"){_6f0=dojo.data.util.filter.patternToRegExp(_6ef,false);}return this._containsValue(item,_6ee,_6ef,_6f0);},_containsValue:function(item,_6f2,_6f3,_6f4){return dojo.some(this.getValues(item,_6f2),function(_6f5){if(_6f5!==null&&!dojo.isObject(_6f5)&&_6f4){if(_6f5.toString().match(_6f4)){return true;}}else{if(_6f3===_6f5){return true;}}});},isItem:function(_6f6){if(_6f6&&_6f6[this._storeRefPropName]===this){if(this._arrayOfAllItems[_6f6[this._itemNumPropName]]===_6f6){return true;}}return false;},isItemLoaded:function(_6f7){return this.isItem(_6f7);},loadItem:function(_6f8){this._assertIsItem(_6f8.item);},getFeatures:function(){return this._features;},getLabel:function(item){if(this._labelAttr&&this.isItem(item)){return this.getValue(item,this._labelAttr);}return undefined;},getLabelAttributes:function(item){if(this._labelAttr){return [this._labelAttr];}return null;},_fetchItems:function(_6fb,_6fc,_6fd){var self=this;var _6ff=function(_700,_701){var _702=[];if(_700.query){var _703=_700.queryOptions?_700.queryOptions.ignoreCase:false;var _704={};for(var key in _700.query){var _706=_700.query[key];if(typeof _706==="string"){_704[key]=dojo.data.util.filter.patternToRegExp(_706,_703);}}for(var i=0;i<_701.length;++i){var _708=true;var _709=_701[i];if(_709===null){_708=false;}else{for(var key in _700.query){var _706=_700.query[key];if(!self._containsValue(_709,key,_706,_704[key])){_708=false;}}}if(_708){_702.push(_709);}}_6fc(_702,_700);}else{for(var i=0;i<_701.length;++i){var item=_701[i];if(item!==null){_702.push(item);}}_6fc(_702,_700);}};if(this._loadFinished){_6ff(_6fb,this._getItemsArray(_6fb.queryOptions));}else{if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_6fb,filter:_6ff});}else{this._loadInProgress=true;var _70b={url:self._jsonFileUrl,handleAs:"json-comment-optional"};var _70c=dojo.xhrGet(_70b);_70c.addCallback(function(data){try{self._getItemsFromLoadedData(data);self._loadFinished=true;self._loadInProgress=false;_6ff(_6fb,self._getItemsArray(_6fb.queryOptions));self._handleQueuedFetches();}catch(e){self._loadFinished=true;self._loadInProgress=false;_6fd(e,_6fb);}});_70c.addErrback(function(_70e){self._loadInProgress=false;_6fd(_70e,_6fb);});}}else{if(this._jsonData){try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;_6ff(_6fb,this._getItemsArray(_6fb.queryOptions));}catch(e){_6fd(e,_6fb);}}else{_6fd(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),_6fb);}}}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i<this._queuedFetches.length;i++){var _710=this._queuedFetches[i];var _711=_710.args;var _712=_710.filter;if(_712){_712(_711,this._getItemsArray(_711.queryOptions));}else{this.fetchItemByIdentity(_711);}}this._queuedFetches=[];}},_getItemsArray:function(_713){if(_713&&_713.deep){return this._arrayOfAllItems;}return this._arrayOfTopLevelItems;},close:function(_714){},_getItemsFromLoadedData:function(_715){function valueIsAnItem(_716){var _717=((_716!=null)&&(typeof _716=="object")&&(!dojo.isArray(_716))&&(!dojo.isFunction(_716))&&(_716.constructor==Object)&&(typeof _716._reference=="undefined")&&(typeof _716._type=="undefined")&&(typeof _716._value=="undefined"));return _717;};var self=this;function addItemAndSubItemsToArrayOfAllItems(_719){self._arrayOfAllItems.push(_719);for(var _71a in _719){var _71b=_719[_71a];if(_71b){if(dojo.isArray(_71b)){var _71c=_71b;for(var k=0;k<_71c.length;++k){var _71e=_71c[k];if(valueIsAnItem(_71e)){addItemAndSubItemsToArrayOfAllItems(_71e);}}}else{if(valueIsAnItem(_71b)){addItemAndSubItemsToArrayOfAllItems(_71b);}}}}};this._labelAttr=_715.label;var i;var item;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=_715.items;for(i=0;i<this._arrayOfTopLevelItems.length;++i){item=this._arrayOfTopLevelItems[i];addItemAndSubItemsToArrayOfAllItems(item);item[this._rootItemPropName]=true;}var _721={};var key;for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];for(key in item){if(key!==this._rootItemPropName){var _723=item[key];if(_723!==null){if(!dojo.isArray(_723)){item[key]=[_723];}}else{item[key]=[null];}}_721[key]=key;}}while(_721[this._storeRefPropName]){this._storeRefPropName+="_";}while(_721[this._itemNumPropName]){this._itemNumPropName+="_";}while(_721[this._reverseRefMap]){this._reverseRefMap+="_";}var _724;var _725=_715.identifier;if(_725){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=_725;for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];_724=item[_725];var _726=_724[0];if(!this._itemsByIdentity[_726]){this._itemsByIdentity[_726]=item;}else{if(this._jsonFileUrl){throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+_725+"].  Value collided: ["+_726+"]");}else{if(this._jsonData){throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+_725+"].  Value collided: ["+_726+"]");}}}}}else{this._features["dojo.data.api.Identity"]=Number;}for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];item[this._storeRefPropName]=this;item[this._itemNumPropName]=i;}for(i=0;i<this._arrayOfAllItems.length;++i){item=this._arrayOfAllItems[i];for(key in item){_724=item[key];for(var j=0;j<_724.length;++j){_723=_724[j];if(_723!==null&&typeof _723=="object"){if(_723._type&&_723._value){var type=_723._type;var _729=this._datatypeMap[type];if(!_729){throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+type+"'");}else{if(dojo.isFunction(_729)){_724[j]=new _729(_723._value);}else{if(dojo.isFunction(_729.deserialize)){_724[j]=_729.deserialize(_723._value);}else{throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");}}}}if(_723._reference){var _72a=_723._reference;if(!dojo.isObject(_72a)){_724[j]=this._itemsByIdentity[_72a];}else{for(var k=0;k<this._arrayOfAllItems.length;++k){var _72c=this._arrayOfAllItems[k];var _72d=true;for(var _72e in _72a){if(_72c[_72e]!=_72a[_72e]){_72d=false;}}if(_72d){_724[j]=_72c;}}}if(this.referenceIntegrity){var _72f=_724[j];if(this.isItem(_72f)){this._addReferenceToMap(_72f,item,key);}}}else{if(this.isItem(_723)){if(this.referenceIntegrity){this._addReferenceToMap(_723,item,key);}}}}}}}},_addReferenceToMap:function(_730,_731,_732){},getIdentity:function(item){var _734=this._features["dojo.data.api.Identity"];if(_734===Number){return item[this._itemNumPropName];}else{var _735=item[_734];if(_735){return _735[0];}}return null;},fetchItemByIdentity:function(_736){if(!this._loadFinished){var self=this;if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_736});}else{this._loadInProgress=true;var _738={url:self._jsonFileUrl,handleAs:"json-comment-optional"};var _739=dojo.xhrGet(_738);_739.addCallback(function(data){var _73b=_736.scope?_736.scope:dojo.global;try{self._getItemsFromLoadedData(data);self._loadFinished=true;self._loadInProgress=false;var item=self._getItemByIdentity(_736.identity);if(_736.onItem){_736.onItem.call(_73b,item);}self._handleQueuedFetches();}catch(error){self._loadInProgress=false;if(_736.onError){_736.onError.call(_73b,error);}}});_739.addErrback(function(_73d){self._loadInProgress=false;if(_736.onError){var _73e=_736.scope?_736.scope:dojo.global;_736.onError.call(_73e,_73d);}});}}else{if(this._jsonData){self._getItemsFromLoadedData(self._jsonData);self._jsonData=null;self._loadFinished=true;var item=self._getItemByIdentity(_736.identity);if(_736.onItem){var _740=_736.scope?_736.scope:dojo.global;_736.onItem.call(_740,item);}}}}else{var item=this._getItemByIdentity(_736.identity);if(_736.onItem){var _740=_736.scope?_736.scope:dojo.global;_736.onItem.call(_740,item);}}},_getItemByIdentity:function(_741){var item=null;if(this._itemsByIdentity){item=this._itemsByIdentity[_741];}else{item=this._arrayOfAllItems[_741];}if(item===undefined){item=null;}return item;},getIdentityAttributes:function(item){var _744=this._features["dojo.data.api.Identity"];if(_744===Number){return null;}else{return [_744];}},_forceLoad:function(){var self=this;if(this._jsonFileUrl){var _746={url:self._jsonFileUrl,handleAs:"json-comment-optional",sync:true};var _747=dojo.xhrGet(_746);_747.addCallback(function(data){try{if(self._loadInProgress!==true&&!self._loadFinished){self._getItemsFromLoadedData(data);self._loadFinished=true;}}catch(e){console.log(e);throw e;}});_747.addErrback(function(_749){throw _749;});}else{if(this._jsonData){self._getItemsFromLoadedData(self._jsonData);self._jsonData=null;self._loadFinished=true;}}}});dojo.extend(dojo.data.ItemFileReadStore,dojo.data.util.simpleFetch);}if(!dojo._hasResource["dojox.data.QueryReadStore"]){dojo._hasResource["dojox.data.QueryReadStore"]=true;dojo.provide("dojox.data.QueryReadStore");dojo.declare("dojox.data.QueryReadStore",null,{url:"",requestMethod:"get",_className:"dojox.data.QueryReadStore",_items:[],_lastServerQuery:null,lastRequestHash:null,doClientPaging:false,doClientSorting:false,_itemsByIdentity:null,_identifier:null,_features:{"dojo.data.api.Read":true,"dojo.data.api.Identity":true},_labelAttr:"label",constructor:function(_74a){dojo.mixin(this,_74a);},getValue:function(item,_74c,_74d){this._assertIsItem(item);if(!dojo.isString(_74c)){throw new Error(this._className+".getValue(): Invalid attribute, string expected!");}if(!this.hasAttribute(item,_74c)){if(_74d){return _74d;}console.log(this._className+".getValue(): Item does not have the attribute '"+_74c+"'.");}return item.i[_74c];},getValues:function(item,_74f){this._assertIsItem(item);var ret=[];if(this.hasAttribute(item,_74f)){ret.push(item.i[_74f]);}return ret;},getAttributes:function(item){this._assertIsItem(item);var ret=[];for(var i in item.i){ret.push(i);}return ret;},hasAttribute:function(item,_755){return this.isItem(item)&&typeof item.i[_755]!="undefined";},containsValue:function(item,_757,_758){var _759=this.getValues(item,_757);var len=_759.length;for(var i=0;i<len;i++){if(_759[i]==_758){return true;}}return false;},isItem:function(_75c){if(_75c){return typeof _75c.r!="undefined"&&_75c.r==this;}return false;},isItemLoaded:function(_75d){return this.isItem(_75d);},loadItem:function(args){if(this.isItemLoaded(args.item)){return;}},fetch:function(_75f){_75f=_75f||{};if(!_75f.store){_75f.store=this;}var self=this;var _761=function(_762,_763){if(_763.onError){var _764=_763.scope||dojo.global;_763.onError.call(_764,_762,_763);}};var _765=function(_766,_767,_768){var _769=_767.abort||null;var _76a=false;var _76b=_767.start?_767.start:0;if(self.doClientPaging==false){_76b=0;}var _76c=_767.count?(_76b+_767.count):_766.length;_767.abort=function(){_76a=true;if(_769){_769.call(_767);}};var _76d=_767.scope||dojo.global;if(!_767.store){_767.store=self;}if(_767.onBegin){_767.onBegin.call(_76d,_768,_767);}if(_767.sort&&this.doClientSorting){_766.sort(dojo.data.util.sorter.createSortFunction(_767.sort,self));}if(_767.onItem){for(var i=_76b;(i<_766.length)&&(i<_76c);++i){var item=_766[i];if(!_76a){_767.onItem.call(_76d,item,_767);}}}if(_767.onComplete&&!_76a){var _770=null;if(!_767.onItem){_770=_766.slice(_76b,_76c);}_767.onComplete.call(_76d,_770,_767);}};this._fetchItems(_75f,_765,_761);return _75f;},getFeatures:function(){return this._features;},close:function(_771){},getLabel:function(item){if(this._labelAttr&&this.isItem(item)){return this.getValue(item,this._labelAttr);}return undefined;},getLabelAttributes:function(item){if(this._labelAttr){return [this._labelAttr];}return null;},_fetchItems:function(_774,_775,_776){var _777=_774.serverQuery||_774.query||{};if(!this.doClientPaging){_777.start=_774.start||0;if(_774.count){_777.count=_774.count;}}if(!this.doClientSorting){if(_774.sort){var sort=_774.sort[0];if(sort&&sort.attribute){var _779=sort.attribute;if(sort.descending){_779="-"+_779;}_777.sort=_779;}}}if(this.doClientPaging&&this._lastServerQuery!==null&&dojo.toJson(_777)==dojo.toJson(this._lastServerQuery)){_775(this._items,_774);}else{var _77a=this.requestMethod.toLowerCase()=="post"?dojo.xhrPost:dojo.xhrGet;var _77b=_77a({url:this.url,handleAs:"json-comment-optional",content:_777});_77b.addCallback(dojo.hitch(this,function(data){data=this._filterResponse(data);if(data.label){this._labelAttr=data.label;}var _77d=data.numRows||-1;this._items=[];dojo.forEach(data.items,function(e){this._items.push({i:e,r:this});},this);var _77f=data.identifier;this._itemsByIdentity={};if(_77f){this._identifier=_77f;for(i=0;i<this._items.length;++i){var item=this._items[i].i;var _781=item[_77f];if(!this._itemsByIdentity[_781]){this._itemsByIdentity[_781]=item;}else{throw new Error(this._className+":  The json data as specified by: ["+this.url+"] is malformed.  Items within the list have identifier: ["+_77f+"].  Value collided: ["+_781+"]");}}}else{this._identifier=Number;for(i=0;i<this._items.length;++i){this._items[i].n=i;}}_77d=(_77d===-1)?this._items.length:_77d;_775(this._items,_774,_77d);}));_77b.addErrback(function(_782){_776(_782,_774);});this.lastRequestHash=new Date().getTime()+"-"+String(Math.random()).substring(2);this._lastServerQuery=dojo.mixin({},_777);}},_filterResponse:function(data){return data;},_assertIsItem:function(item){if(!this.isItem(item)){throw new Error(this._className+": Invalid item argument.");}},_assertIsAttribute:function(_785){if(typeof _785!=="string"){throw new Error(this._className+": Invalid attribute argument ('"+_785+"').");}},fetchItemByIdentity:function(_786){if(this._itemsByIdentity){var item=this._itemsByIdentity[_786.identity];if(!(item===undefined)){if(_786.onItem){var _788=_786.scope?_786.scope:dojo.global;_786.onItem.call(_788,{i:item,r:this});}return;}}var _789=function(_78a,_78b){var _78c=_786.scope?_786.scope:dojo.global;if(_786.onError){_786.onError.call(_78c,error);}};var _78d=function(_78e,_78f){var _790=_786.scope?_786.scope:dojo.global;try{var item=null;if(_78e&&_78e.length==1){item=_78e[0];}if(_786.onItem){_786.onItem.call(_790,item);}}catch(error){if(_786.onError){_786.onError.call(_790,error);}}};var _792={serverQuery:{id:_786.identity}};this._fetchItems(_792,_78d,_789);},getIdentity:function(item){var _794=null;if(this._identifier===Number){_794=item.n;}else{_794=item.i[this._identifier];}return _794;},getIdentityAttributes:function(item){return [this._identifier];}});}if(!dojo._hasResource["dijit.Declaration"]){dojo._hasResource["dijit.Declaration"]=true;dojo.provide("dijit.Declaration");dojo.declare("dijit.Declaration",dijit._Widget,{_noScript:true,widgetClass:"",replaceVars:true,defaults:null,mixins:[],buildRendering:function(){var src=this.srcNodeRef.parentNode.removeChild(this.srcNodeRef);var _797=dojo.query("> script[type='dojo/method'][event='preamble']",src).orphan();var _798=dojo.query("> script[type^='dojo/']",src).orphan();var _799=src.nodeName;var _79a=this.defaults||{};this.mixins=this.mixins.length?dojo.map(this.mixins,function(name){return dojo.getObject(name);}):[dijit._Widget,dijit._Templated];if(_797.length){_79a.preamble=dojo.parser._functionFromScript(_797[0]);}var _79c=dojo.map(_798,function(s){var evt=s.getAttribute("event")||"postscript";return {event:evt,func:dojo.parser._functionFromScript(s)};});this.mixins.push(function(){dojo.forEach(_79c,function(s){dojo.connect(this,s.event,this,s.func);},this);});_79a.widgetsInTemplate=true;_79a._skipNodeCache=true;_79a.templateString="<"+_799+" class='"+src.className+"' dojoAttachPoint='"+(src.getAttribute("dojoAttachPoint")||"")+"' dojoAttachEvent='"+(src.getAttribute("dojoAttachEvent")||"")+"' >"+src.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+_799+">";dojo.query("[dojoType]",src).forEach(function(node){node.removeAttribute("dojoType");});dojo.declare(this.widgetClass,this.mixins,_79a);}});}if(!dojo._hasResource["dojox.grid._grid.lib"]){dojo._hasResource["dojox.grid._grid.lib"]=true;dojo.provide("dojox.grid._grid.lib");dojo.mixin(dojox.grid,{na:"...",nop:function(){},getTdIndex:function(td){return td.cellIndex>=0?td.cellIndex:dojo.indexOf(td.parentNode.cells,td);},getTrIndex:function(tr){return tr.rowIndex>=0?tr.rowIndex:dojo.indexOf(tr.parentNode.childNodes,tr);},getTr:function(_7a3,_7a4){return _7a3&&((_7a3.rows||0)[_7a4]||_7a3.childNodes[_7a4]);},getTd:function(_7a5,_7a6,_7a7){return (dojox.grid.getTr(inTable,_7a6)||0)[_7a7];},findTable:function(node){for(var n=node;n&&n.tagName!="TABLE";n=n.parentNode){}return n;},ascendDom:function(_7aa,_7ab){for(var n=_7aa;n&&_7ab(n);n=n.parentNode){}return n;},makeNotTagName:function(_7ad){var name=_7ad.toUpperCase();return function(node){return node.tagName!=name;};},fire:function(ob,ev,args){var fn=ob&&ev&&ob[ev];return fn&&(args?fn.apply(ob,args):ob[ev]());},setStyleText:function(_7b4,_7b5){if(_7b4.style.cssText==undefined){_7b4.setAttribute("style",_7b5);}else{_7b4.style.cssText=_7b5;}},getStyleText:function(_7b6,_7b7){return (_7b6.style.cssText==undefined?_7b6.getAttribute("style"):_7b6.style.cssText);},setStyle:function(_7b8,_7b9,_7ba){if(_7b8&&_7b8.style[_7b9]!=_7ba){_7b8.style[_7b9]=_7ba;}},setStyleHeightPx:function(_7bb,_7bc){if(_7bc>=0){dojox.grid.setStyle(_7bb,"height",_7bc+"px");}},mouseEvents:["mouseover","mouseout","mousedown","mouseup","click","dblclick","contextmenu"],keyEvents:["keyup","keydown","keypress"],funnelEvents:function(_7bd,_7be,_7bf,_7c0){var evts=(_7c0?_7c0:dojox.grid.mouseEvents.concat(dojox.grid.keyEvents));for(var i=0,l=evts.length;i<l;i++){dojo.connect(_7bd,"on"+evts[i],_7be,_7bf);}},removeNode:function(_7c4){_7c4=dojo.byId(_7c4);_7c4&&_7c4.parentNode&&_7c4.parentNode.removeChild(_7c4);return _7c4;},getScrollbarWidth:function(){if(this._scrollBarWidth){return this._scrollBarWidth;}this._scrollBarWidth=18;try{var e=document.createElement("div");e.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";document.body.appendChild(e);this._scrollBarWidth=e.offsetWidth-e.clientWidth;document.body.removeChild(e);delete e;}catch(ex){}return this._scrollBarWidth;},getRef:function(name,_7c7,_7c8){var obj=_7c8||dojo.global,_7ca=name.split("."),prop=_7ca.pop();for(var i=0,p;obj&&(p=_7ca[i]);i++){obj=(p in obj?obj[p]:(_7c7?obj[p]={}:undefined));}return {obj:obj,prop:prop};},getProp:function(name,_7cf,_7d0){with(dojox.grid.getRef(name,_7cf,_7d0)){return (obj)&&(prop)&&(prop in obj?obj[prop]:(_7cf?obj[prop]={}:undefined));}},indexInParent:function(_7d1){var i=0,n,p=_7d1.parentNode;while((n=p.childNodes[i++])){if(n==_7d1){return i-1;}}return -1;},cleanNode:function(_7d5){if(!_7d5){return;}var _7d6=function(inW){return inW.domNode&&dojo.isDescendant(inW.domNode,_7d5,true);};var ws=dijit.registry.filter(_7d6);for(var i=0,w;(w=ws[i]);i++){w.destroy();}delete ws;},getTagName:function(_7db){var node=dojo.byId(_7db);return (node&&node.tagName?node.tagName.toLowerCase():"");},nodeKids:function(_7dd,_7de){var _7df=[];var i=0,n;while((n=_7dd.childNodes[i++])){if(dojox.grid.getTagName(n)==_7de){_7df.push(n);}}return _7df;},divkids:function(_7e2){return dojox.grid.nodeKids(_7e2,"div");},focusSelectNode:function(_7e3){try{dojox.grid.fire(_7e3,"focus");dojox.grid.fire(_7e3,"select");}catch(e){}},whenIdle:function(){setTimeout(dojo.hitch.apply(dojo,arguments),0);},arrayCompare:function(inA,inB){for(var i=0,l=inA.length;i<l;i++){if(inA[i]!=inB[i]){return false;}}return (inA.length==inB.length);},arrayInsert:function(_7e8,_7e9,_7ea){if(_7e8.length<=_7e9){_7e8[_7e9]=_7ea;}else{_7e8.splice(_7e9,0,_7ea);}},arrayRemove:function(_7eb,_7ec){_7eb.splice(_7ec,1);},arraySwap:function(_7ed,inI,inJ){var _7f0=_7ed[inI];_7ed[inI]=_7ed[inJ];_7ed[inJ]=_7f0;},initTextSizePoll:function(_7f1){var f=document.createElement("div");with(f.style){top="0px";left="0px";position="absolute";visibility="hidden";}f.innerHTML="TheQuickBrownFoxJumpedOverTheLazyDog";document.body.appendChild(f);var fw=f.offsetWidth;var job=function(){if(f.offsetWidth!=fw){fw=f.offsetWidth;dojox.grid.textSizeChanged();}};window.setInterval(job,_7f1||200);dojox.grid.initTextSizePoll=dojox.grid.nop;},textSizeChanged:function(){}});dojox.grid.jobs={cancel:function(_7f5){if(_7f5){window.clearTimeout(_7f5);}},jobs:[],job:function(_7f6,_7f7,_7f8){dojox.grid.jobs.cancelJob(_7f6);var job=function(){delete dojox.grid.jobs.jobs[_7f6];_7f8();};dojox.grid.jobs.jobs[_7f6]=setTimeout(job,_7f7);},cancelJob:function(_7fa){dojox.grid.jobs.cancel(dojox.grid.jobs.jobs[_7fa]);}};}if(!dojo._hasResource["dojox.grid._grid.scroller"]){dojo._hasResource["dojox.grid._grid.scroller"]=true;dojo.provide("dojox.grid._grid.scroller");dojo.declare("dojox.grid.scroller.base",null,{constructor:function(){this.pageHeights=[];this.stack=[];},rowCount:0,defaultRowHeight:10,keepRows:100,contentNode:null,scrollboxNode:null,defaultPageHeight:0,keepPages:10,pageCount:0,windowHeight:0,firstVisibleRow:0,lastVisibleRow:0,page:0,pageTop:0,init:function(_7fb,_7fc,_7fd){switch(arguments.length){case 3:this.rowsPerPage=_7fd;case 2:this.keepRows=_7fc;case 1:this.rowCount=_7fb;}this.defaultPageHeight=this.defaultRowHeight*this.rowsPerPage;this.pageCount=Math.ceil(this.rowCount/this.rowsPerPage);this.setKeepInfo(this.keepRows);this.invalidate();if(this.scrollboxNode){this.scrollboxNode.scrollTop=0;this.scroll(0);this.scrollboxNode.onscroll=dojo.hitch(this,"onscroll");}},setKeepInfo:function(_7fe){this.keepRows=_7fe;this.keepPages=!this.keepRows?this.keepRows:Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2);},invalidate:function(){this.invalidateNodes();this.pageHeights=[];this.height=(this.pageCount?(this.pageCount-1)*this.defaultPageHeight+this.calcLastPageHeight():0);this.resize();},updateRowCount:function(_7ff){this.invalidateNodes();this.rowCount=_7ff;oldPageCount=this.pageCount;this.pageCount=Math.ceil(this.rowCount/this.rowsPerPage);if(this.pageCount<oldPageCount){for(var i=oldPageCount-1;i>=this.pageCount;i--){this.height-=this.getPageHeight(i);delete this.pageHeights[i];}}else{if(this.pageCount>oldPageCount){this.height+=this.defaultPageHeight*(this.pageCount-oldPageCount-1)+this.calcLastPageHeight();}}this.resize();},pageExists:function(_801){},measurePage:function(_802){},positionPage:function(_803,_804){},repositionPages:function(_805){},installPage:function(_806){},preparePage:function(_807,_808,_809){},renderPage:function(_80a){},removePage:function(_80b){},pacify:function(_80c){},pacifying:false,pacifyTicks:200,setPacifying:function(_80d){if(this.pacifying!=_80d){this.pacifying=_80d;this.pacify(this.pacifying);}},startPacify:function(){this.startPacifyTicks=new Date().getTime();},doPacify:function(){var _80e=(new Date().getTime()-this.startPacifyTicks)>this.pacifyTicks;this.setPacifying(true);this.startPacify();return _80e;},endPacify:function(){this.setPacifying(false);},resize:function(){if(this.scrollboxNode){this.windowHeight=this.scrollboxNode.clientHeight;}dojox.grid.setStyleHeightPx(this.contentNode,this.height);},calcLastPageHeight:function(){if(!this.pageCount){return 0;}var _80f=this.pageCount-1;var _810=((this.rowCount%this.rowsPerPage)||(this.rowsPerPage))*this.defaultRowHeight;this.pageHeights[_80f]=_810;return _810;},updateContentHeight:function(inDh){this.height+=inDh;this.resize();},updatePageHeight:function(_812){if(this.pageExists(_812)){var oh=this.getPageHeight(_812);var h=(this.measurePage(_812))||(oh);this.pageHeights[_812]=h;if((h)&&(oh!=h)){this.updateContentHeight(h-oh);this.repositionPages(_812);}}},rowHeightChanged:function(_815){this.updatePageHeight(Math.floor(_815/this.rowsPerPage));},invalidateNodes:function(){while(this.stack.length){this.destroyPage(this.popPage());}},createPageNode:function(){var p=document.createElement("div");p.style.position="absolute";p.style[dojo._isBodyLtr()?"left":"right"]="0";return p;},getPageHeight:function(_817){var ph=this.pageHeights[_817];return (ph!==undefined?ph:this.defaultPageHeight);},pushPage:function(_819){return this.stack.push(_819);},popPage:function(){return this.stack.shift();},findPage:function(_81a){var i=0,h=0;for(var ph=0;i<this.pageCount;i++,h+=ph){ph=this.getPageHeight(i);if(h+ph>=_81a){break;}}this.page=i;this.pageTop=h;},buildPage:function(_81e,_81f,_820){this.preparePage(_81e,_81f);this.positionPage(_81e,_820);this.installPage(_81e);this.renderPage(_81e);this.pushPage(_81e);},needPage:function(_821,_822){var h=this.getPageHeight(_821),oh=h;if(!this.pageExists(_821)){this.buildPage(_821,this.keepPages&&(this.stack.length>=this.keepPages),_822);h=this.measurePage(_821)||h;this.pageHeights[_821]=h;if(h&&(oh!=h)){this.updateContentHeight(h-oh);}}else{this.positionPage(_821,_822);}return h;},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop);},scroll:function(_825){this.startPacify();this.findPage(_825);var h=this.height;var b=this.getScrollBottom(_825);for(var p=this.page,y=this.pageTop;(p<this.pageCount)&&((b<0)||(y<b));p++){y+=this.needPage(p,y);}this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,_825);this.lastVisibleRow=this.getLastVisibleRow(p-1,y,b);if(h!=this.height){this.repositionPages(p-1);}this.endPacify();},getScrollBottom:function(_82a){return (this.windowHeight>=0?_82a+this.windowHeight:-1);},processNodeEvent:function(e,_82c){var t=e.target;while(t&&(t!=_82c)&&t.parentNode&&(t.parentNode.parentNode!=_82c)){t=t.parentNode;}if(!t||!t.parentNode||(t.parentNode.parentNode!=_82c)){return false;}var page=t.parentNode;e.topRowIndex=page.pageIndex*this.rowsPerPage;e.rowIndex=e.topRowIndex+dojox.grid.indexInParent(t);e.rowTarget=t;return true;},processEvent:function(e){return this.processNodeEvent(e,this.contentNode);},dummy:0});dojo.declare("dojox.grid.scroller",dojox.grid.scroller.base,{constructor:function(){this.pageNodes=[];},renderRow:function(_830,_831){},removeRow:function(_832){},getDefaultNodes:function(){return this.pageNodes;},getDefaultPageNode:function(_833){return this.getDefaultNodes()[_833];},positionPageNode:function(_834,_835){_834.style.top=_835+"px";},getPageNodePosition:function(_836){return _836.offsetTop;},repositionPageNodes:function(_837,_838){var last=0;for(var i=0;i<this.stack.length;i++){last=Math.max(this.stack[i],last);}var n=_838[_837];var y=(n?this.getPageNodePosition(n)+this.getPageHeight(_837):0);for(var p=_837+1;p<=last;p++){n=_838[p];if(n){if(this.getPageNodePosition(n)==y){return;}this.positionPage(p,y);}y+=this.getPageHeight(p);}},invalidatePageNode:function(_83e,_83f){var p=_83f[_83e];if(p){delete _83f[_83e];this.removePage(_83e,p);dojox.grid.cleanNode(p);p.innerHTML="";}return p;},preparePageNode:function(_841,_842,_843){var p=(_842===null?this.createPageNode():this.invalidatePageNode(_842,_843));p.pageIndex=_841;p.id=(this._pageIdPrefix||"")+"page-"+_841;_843[_841]=p;},pageExists:function(_845){return Boolean(this.getDefaultPageNode(_845));},measurePage:function(_846){return this.getDefaultPageNode(_846).offsetHeight;},positionPage:function(_847,_848){this.positionPageNode(this.getDefaultPageNode(_847),_848);},repositionPages:function(_849){this.repositionPageNodes(_849,this.getDefaultNodes());},preparePage:function(_84a,_84b){this.preparePageNode(_84a,(_84b?this.popPage():null),this.getDefaultNodes());},installPage:function(_84c){this.contentNode.appendChild(this.getDefaultPageNode(_84c));},destroyPage:function(_84d){var p=this.invalidatePageNode(_84d,this.getDefaultNodes());dojox.grid.removeNode(p);},renderPage:function(_84f){var node=this.pageNodes[_84f];for(var i=0,j=_84f*this.rowsPerPage;(i<this.rowsPerPage)&&(j<this.rowCount);i++,j++){this.renderRow(j,node);}},removePage:function(_853){for(var i=0,j=_853*this.rowsPerPage;i<this.rowsPerPage;i++,j++){this.removeRow(j);}},getPageRow:function(_856){return _856*this.rowsPerPage;},getLastPageRow:function(_857){return Math.min(this.rowCount,this.getPageRow(_857+1))-1;},getFirstVisibleRowNodes:function(_858,_859,_85a,_85b){var row=this.getPageRow(_858);var rows=dojox.grid.divkids(_85b[_858]);for(var i=0,l=rows.length;i<l&&_859<_85a;i++,row++){_859+=rows[i].offsetHeight;}return (row?row-1:row);},getFirstVisibleRow:function(_860,_861,_862){if(!this.pageExists(_860)){return 0;}return this.getFirstVisibleRowNodes(_860,_861,_862,this.getDefaultNodes());},getLastVisibleRowNodes:function(_863,_864,_865,_866){var row=this.getLastPageRow(_863);var rows=dojox.grid.divkids(_866[_863]);for(var i=rows.length-1;i>=0&&_864>_865;i--,row--){_864-=rows[i].offsetHeight;}return row+1;},getLastVisibleRow:function(_86a,_86b,_86c){if(!this.pageExists(_86a)){return 0;}return this.getLastVisibleRowNodes(_86a,_86b,_86c,this.getDefaultNodes());},findTopRowForNodes:function(_86d,_86e){var rows=dojox.grid.divkids(_86e[this.page]);for(var i=0,l=rows.length,t=this.pageTop,h;i<l;i++){h=rows[i].offsetHeight;t+=h;if(t>=_86d){this.offset=h-(t-_86d);return i+this.page*this.rowsPerPage;}}return -1;},findScrollTopForNodes:function(_874,_875){var _876=Math.floor(_874/this.rowsPerPage);var t=0;for(var i=0;i<_876;i++){t+=this.getPageHeight(i);}this.pageTop=t;this.needPage(_876,this.pageTop);var rows=dojox.grid.divkids(_875[_876]);var r=_874-this.rowsPerPage*_876;for(var i=0,l=rows.length;i<l&&i<r;i++){t+=rows[i].offsetHeight;}return t;},findTopRow:function(_87c){return this.findTopRowForNodes(_87c,this.getDefaultNodes());},findScrollTop:function(_87d){return this.findScrollTopForNodes(_87d,this.getDefaultNodes());},dummy:0});dojo.declare("dojox.grid.scroller.columns",dojox.grid.scroller,{constructor:function(_87e){this.setContentNodes(_87e);},setContentNodes:function(_87f){this.contentNodes=_87f;this.colCount=(this.contentNodes?this.contentNodes.length:0);this.pageNodes=[];for(var i=0;i<this.colCount;i++){this.pageNodes[i]=[];}},getDefaultNodes:function(){return this.pageNodes[0]||[];},scroll:function(_881){if(this.colCount){dojox.grid.scroller.prototype.scroll.call(this,_881);}},resize:function(){if(this.scrollboxNode){this.windowHeight=this.scrollboxNode.clientHeight;}for(var i=0;i<this.colCount;i++){dojox.grid.setStyleHeightPx(this.contentNodes[i],this.height);}},positionPage:function(_883,_884){for(var i=0;i<this.colCount;i++){this.positionPageNode(this.pageNodes[i][_883],_884);}},preparePage:function(_886,_887){var p=(_887?this.popPage():null);for(var i=0;i<this.colCount;i++){this.preparePageNode(_886,p,this.pageNodes[i]);}},installPage:function(_88a){for(var i=0;i<this.colCount;i++){this.contentNodes[i].appendChild(this.pageNodes[i][_88a]);}},destroyPage:function(_88c){for(var i=0;i<this.colCount;i++){dojox.grid.removeNode(this.invalidatePageNode(_88c,this.pageNodes[i]));}},renderPage:function(_88e){var _88f=[];for(var i=0;i<this.colCount;i++){_88f[i]=this.pageNodes[i][_88e];}for(var i=0,j=_88e*this.rowsPerPage;(i<this.rowsPerPage)&&(j<this.rowCount);i++,j++){this.renderRow(j,_88f);}}});}if(!dojo._hasResource["dojox.grid._grid.drag"]){dojo._hasResource["dojox.grid._grid.drag"]=true;dojo.provide("dojox.grid._grid.drag");(function(){var _892=dojox.grid.drag={};_892.dragging=false;_892.hysteresis=2;_892.capture=function(_893){if(_893.setCapture){_893.setCapture();}else{document.addEventListener("mousemove",_893.onmousemove,true);document.addEventListener("mouseup",_893.onmouseup,true);document.addEventListener("click",_893.onclick,true);}};_892.release=function(_894){if(_894.releaseCapture){_894.releaseCapture();}else{document.removeEventListener("click",_894.onclick,true);document.removeEventListener("mouseup",_894.onmouseup,true);document.removeEventListener("mousemove",_894.onmousemove,true);}};_892.start=function(_895,_896,_897,_898,_899){if(!_895||_892.dragging){console.debug("failed to start drag: bad input node or already dragging");return;}_892.dragging=true;_892.elt=_895;_892.events={drag:_896||dojox.grid.nop,end:_897||dojox.grid.nop,start:_899||dojox.grid.nop,oldmove:_895.onmousemove,oldup:_895.onmouseup,oldclick:_895.onclick};_892.positionX=(_898&&("screenX" in _898)?_898.screenX:false);_892.positionY=(_898&&("screenY" in _898)?_898.screenY:false);_892.started=(_892.position===false);_895.onmousemove=_892.mousemove;_895.onmouseup=_892.mouseup;_895.onclick=_892.click;_892.capture(_892.elt);};_892.end=function(){_892.release(_892.elt);_892.elt.onmousemove=_892.events.oldmove;_892.elt.onmouseup=_892.events.oldup;_892.elt.onclick=_892.events.oldclick;_892.elt=null;try{if(_892.started){_892.events.end();}}finally{_892.dragging=false;}};_892.calcDelta=function(_89a){_89a.deltaX=_89a.screenX-_892.positionX;_89a.deltaY=_89a.screenY-_892.positionY;};_892.hasMoved=function(_89b){return Math.abs(_89b.deltaX)+Math.abs(_89b.deltaY)>_892.hysteresis;};_892.mousemove=function(_89c){_89c=dojo.fixEvent(_89c);dojo.stopEvent(_89c);_892.calcDelta(_89c);if((!_892.started)&&(_892.hasMoved(_89c))){_892.events.start(_89c);_892.started=true;}if(_892.started){_892.events.drag(_89c);}};_892.mouseup=function(_89d){dojo.stopEvent(dojo.fixEvent(_89d));_892.end();};_892.click=function(_89e){dojo.stopEvent(dojo.fixEvent(_89e));};})();}if(!dojo._hasResource["dojox.grid._grid.builder"]){dojo._hasResource["dojox.grid._grid.builder"]=true;dojo.provide("dojox.grid._grid.builder");dojo.declare("dojox.grid.Builder",null,{constructor:function(_89f){this.view=_89f;this.grid=_89f.grid;},view:null,_table:"<table class=\"dojoxGrid-row-table\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" role=\"wairole:presentation\">",generateCellMarkup:function(_8a0,_8a1,_8a2,_8a3){var _8a4=[],html;if(_8a3){html=["<th tabIndex=\"-1\" role=\"wairole:columnheader\""];}else{html=["<td tabIndex=\"-1\" role=\"wairole:gridcell\""];}_8a0.colSpan&&html.push(" colspan=\"",_8a0.colSpan,"\"");_8a0.rowSpan&&html.push(" rowspan=\"",_8a0.rowSpan,"\"");html.push(" class=\"dojoxGrid-cell ");_8a0.classes&&html.push(_8a0.classes," ");_8a2&&html.push(_8a2," ");_8a4.push(html.join(""));_8a4.push("");html=["\" idx=\"",_8a0.index,"\" style=\""];html.push(_8a0.styles,_8a1||"");_8a0.unitWidth&&html.push("width:",_8a0.unitWidth,";");_8a4.push(html.join(""));_8a4.push("");html=["\""];_8a0.attrs&&html.push(" ",_8a0.attrs);html.push(">");_8a4.push(html.join(""));_8a4.push("");_8a4.push("</td>");return _8a4;},isCellNode:function(_8a6){return Boolean(_8a6&&_8a6.getAttribute&&_8a6.getAttribute("idx"));},getCellNodeIndex:function(_8a7){return _8a7?Number(_8a7.getAttribute("idx")):-1;},getCellNode:function(_8a8,_8a9){for(var i=0,row;row=dojox.grid.getTr(_8a8.firstChild,i);i++){for(var j=0,cell;cell=row.cells[j];j++){if(this.getCellNodeIndex(cell)==_8a9){return cell;}}}},findCellTarget:function(_8ae,_8af){var n=_8ae;while(n&&(!this.isCellNode(n)||(dojox.grid.gridViewTag in n.offsetParent.parentNode&&n.offsetParent.parentNode[dojox.grid.gridViewTag]!=this.view.id))&&(n!=_8af)){n=n.parentNode;}return n!=_8af?n:null;},baseDecorateEvent:function(e){e.dispatch="do"+e.type;e.grid=this.grid;e.sourceView=this.view;e.cellNode=this.findCellTarget(e.target,e.rowNode);e.cellIndex=this.getCellNodeIndex(e.cellNode);e.cell=(e.cellIndex>=0?this.grid.getCell(e.cellIndex):null);},findTarget:function(_8b2,_8b3){var n=_8b2;while(n&&(n!=this.domNode)&&(!(_8b3 in n)||(dojox.grid.gridViewTag in n&&n[dojox.grid.gridViewTag]!=this.view.id))){n=n.parentNode;}return (n!=this.domNode)?n:null;},findRowTarget:function(_8b5){return this.findTarget(_8b5,dojox.grid.rowIndexTag);},isIntraNodeEvent:function(e){try{return (e.cellNode&&e.relatedTarget&&dojo.isDescendant(e.relatedTarget,e.cellNode));}catch(x){return false;}},isIntraRowEvent:function(e){try{var row=e.relatedTarget&&this.findRowTarget(e.relatedTarget);return !row&&(e.rowIndex==-1)||row&&(e.rowIndex==row.gridRowIndex);}catch(x){return false;}},dispatchEvent:function(e){if(e.dispatch in this){return this[e.dispatch](e);}},domouseover:function(e){if(e.cellNode&&(e.cellNode!=this.lastOverCellNode)){this.lastOverCellNode=e.cellNode;this.grid.onMouseOver(e);}this.grid.onMouseOverRow(e);},domouseout:function(e){if(e.cellNode&&(e.cellNode==this.lastOverCellNode)&&!this.isIntraNodeEvent(e,this.lastOverCellNode)){this.lastOverCellNode=null;this.grid.onMouseOut(e);if(!this.isIntraRowEvent(e)){this.grid.onMouseOutRow(e);}}},domousedown:function(e){if(e.cellNode){this.grid.onMouseDown(e);}this.grid.onMouseDownRow(e);}});dojo.declare("dojox.grid.contentBuilder",dojox.grid.Builder,{update:function(){this.prepareHtml();},prepareHtml:function(){var _8bd=this.grid.get,rows=this.view.structure.rows;for(var j=0,row;(row=rows[j]);j++){for(var i=0,cell;(cell=row[i]);i++){cell.get=cell.get||(cell.value==undefined)&&_8bd;cell.markup=this.generateCellMarkup(cell,cell.cellStyles,cell.cellClasses,false);}}},generateHtml:function(_8c3,_8c4){var html=[this._table],v=this.view,obr=v.onBeforeRow,rows=v.structure.rows;obr&&obr(_8c4,rows);for(var j=0,row;(row=rows[j]);j++){if(row.hidden||row.header){continue;}html.push(!row.invisible?"<tr>":"<tr class=\"dojoxGrid-invisible\">");for(var i=0,cell,m,cc,cs;(cell=row[i]);i++){m=cell.markup,cc=cell.customClasses=[],cs=cell.customStyles=[];m[5]=cell.format(_8c3);m[1]=cc.join(" ");m[3]=cs.join(";");html.push.apply(html,m);}html.push("</tr>");}html.push("</table>");return html.join("");},decorateEvent:function(e){e.rowNode=this.findRowTarget(e.target);if(!e.rowNode){return false;}e.rowIndex=e.rowNode[dojox.grid.rowIndexTag];this.baseDecorateEvent(e);e.cell=this.grid.getCell(e.cellIndex);return true;}});dojo.declare("dojox.grid.headerBuilder",dojox.grid.Builder,{bogusClickTime:0,overResizeWidth:4,minColWidth:1,_table:"<table class=\"dojoxGrid-row-table\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" role=\"wairole:presentation\"",update:function(){this.tableMap=new dojox.grid.tableMap(this.view.structure.rows);},generateHtml:function(_8d1,_8d2){var html=[this._table],rows=this.view.structure.rows;if(this.view.viewWidth){html.push([" style=\"width:",this.view.viewWidth,";\""].join(""));}html.push(">");dojox.grid.fire(this.view,"onBeforeRow",[-1,rows]);for(var j=0,row;(row=rows[j]);j++){if(row.hidden){continue;}html.push(!row.invisible?"<tr>":"<tr class=\"dojoxGrid-invisible\">");for(var i=0,cell,_8d9;(cell=row[i]);i++){cell.customClasses=[];cell.customStyles=[];_8d9=this.generateCellMarkup(cell,cell.headerStyles,cell.headerClasses,true);_8d9[5]=(_8d2!=undefined?_8d2:_8d1(cell));_8d9[3]=cell.customStyles.join(";");_8d9[1]=cell.customClasses.join(" ");html.push(_8d9.join(""));}html.push("</tr>");}html.push("</table>");return html.join("");},getCellX:function(e){var x=e.layerX;if(dojo.isMoz){var n=dojox.grid.ascendDom(e.target,dojox.grid.makeNotTagName("th"));x-=(n&&n.offsetLeft)||0;var t=e.sourceView.getScrollbarWidth();if(!dojo._isBodyLtr()&&e.sourceView.headerNode.scrollLeft<t){x-=t;}}var n=dojox.grid.ascendDom(e.target,function(){if(!n||n==e.cellNode){return false;}x+=(n.offsetLeft<0?0:n.offsetLeft);return true;});return x;},decorateEvent:function(e){this.baseDecorateEvent(e);e.rowIndex=-1;e.cellX=this.getCellX(e);return true;},prepareResize:function(e,mod){var i=dojox.grid.getTdIndex(e.cellNode);e.cellNode=(i?e.cellNode.parentNode.cells[i+mod]:null);e.cellIndex=(e.cellNode?this.getCellNodeIndex(e.cellNode):-1);return Boolean(e.cellNode);},canResize:function(e){if(!e.cellNode||e.cellNode.colSpan>1){return false;}var cell=this.grid.getCell(e.cellIndex);return !cell.noresize&&!cell.isFlex();},overLeftResizeArea:function(e){if(dojo._isBodyLtr()){return (e.cellIndex>0)&&(e.cellX<this.overResizeWidth)&&this.prepareResize(e,-1);}return t=e.cellNode&&(e.cellX<this.overResizeWidth);},overRightResizeArea:function(e){if(dojo._isBodyLtr()){return e.cellNode&&(e.cellX>=e.cellNode.offsetWidth-this.overResizeWidth);}return (e.cellIndex>0)&&(e.cellX>=e.cellNode.offsetWidth-this.overResizeWidth)&&this.prepareResize(e,-1);},domousemove:function(e){var c=(this.overRightResizeArea(e)?"e-resize":(this.overLeftResizeArea(e)?"w-resize":""));if(c&&!this.canResize(e)){c="not-allowed";}e.sourceView.headerNode.style.cursor=c||"";if(c){dojo.stopEvent(e);}},domousedown:function(e){if(!dojox.grid.drag.dragging){if((this.overRightResizeArea(e)||this.overLeftResizeArea(e))&&this.canResize(e)){this.beginColumnResize(e);}else{this.grid.onMouseDown(e);this.grid.onMouseOverRow(e);}}},doclick:function(e){if(new Date().getTime()<this.bogusClickTime){dojo.stopEvent(e);return true;}},beginColumnResize:function(e){dojo.stopEvent(e);var _8eb=[],_8ec=this.tableMap.findOverlappingNodes(e.cellNode);for(var i=0,cell;(cell=_8ec[i]);i++){_8eb.push({node:cell,index:this.getCellNodeIndex(cell),width:cell.offsetWidth});}var drag={scrollLeft:e.sourceView.headerNode.scrollLeft,view:e.sourceView,node:e.cellNode,index:e.cellIndex,w:e.cellNode.clientWidth,spanners:_8eb};dojox.grid.drag.start(e.cellNode,dojo.hitch(this,"doResizeColumn",drag),dojo.hitch(this,"endResizeColumn",drag),e);},doResizeColumn:function(_8f0,_8f1){var _8f2=dojo._isBodyLtr();if(_8f2){var w=_8f0.w+_8f1.deltaX;}else{var w=_8f0.w-_8f1.deltaX;}if(w>=this.minColWidth){for(var i=0,s,sw;(s=_8f0.spanners[i]);i++){if(_8f2){sw=s.width+_8f1.deltaX;}else{sw=s.width-_8f1.deltaX;}s.node.style.width=sw+"px";_8f0.view.setColWidth(s.index,sw);}_8f0.node.style.width=w+"px";_8f0.view.setColWidth(_8f0.index,w);if(!_8f2){_8f0.view.headerNode.scrollLeft=(_8f0.scrollLeft-_8f1.deltaX);}}if(_8f0.view.flexCells&&!_8f0.view.testFlexCells()){var t=dojox.grid.findTable(_8f0.node);t&&(t.style.width="");}},endResizeColumn:function(_8f8){this.bogusClickTime=new Date().getTime()+30;setTimeout(dojo.hitch(_8f8.view,"update"),50);}});dojo.declare("dojox.grid.tableMap",null,{constructor:function(_8f9){this.mapRows(_8f9);},map:null,mapRows:function(_8fa){var _8fb=_8fa.length;if(!_8fb){return;}this.map=[];for(var j=0,row;(row=_8fa[j]);j++){this.map[j]=[];}for(var j=0,row;(row=_8fa[j]);j++){for(var i=0,x=0,cell,_901,_902;(cell=row[i]);i++){while(this.map[j][x]){x++;}this.map[j][x]={c:i,r:j};_902=cell.rowSpan||1;_901=cell.colSpan||1;for(var y=0;y<_902;y++){for(var s=0;s<_901;s++){this.map[j+y][x+s]=this.map[j][x];}}x+=_901;}}},dumpMap:function(){for(var j=0,row,h="";(row=this.map[j]);j++,h=""){for(var i=0,cell;(cell=row[i]);i++){h+=cell.r+","+cell.c+"   ";}console.log(h);}},getMapCoords:function(_90a,_90b){for(var j=0,row;(row=this.map[j]);j++){for(var i=0,cell;(cell=row[i]);i++){if(cell.c==_90b&&cell.r==_90a){return {j:j,i:i};}}}return {j:-1,i:-1};},getNode:function(_910,_911,_912){var row=_910&&_910.rows[_911];return row&&row.cells[_912];},_findOverlappingNodes:function(_914,_915,_916){var _917=[];var m=this.getMapCoords(_915,_916);var row=this.map[m.j];for(var j=0,row;(row=this.map[j]);j++){if(j==m.j){continue;}with(row[m.i]){var n=this.getNode(_914,r,c);if(n){_917.push(n);}}}return _917;},findOverlappingNodes:function(_91c){return this._findOverlappingNodes(dojox.grid.findTable(_91c),dojox.grid.getTrIndex(_91c.parentNode),dojox.grid.getTdIndex(_91c));}});dojox.grid.rowIndexTag="gridRowIndex";dojox.grid.gridViewTag="gridView";}if(!dojo._hasResource["dojox.grid._grid.view"]){dojo._hasResource["dojox.grid._grid.view"]=true;dojo.provide("dojox.grid._grid.view");dojo.declare("dojox.GridView",[dijit._Widget,dijit._Templated],{defaultWidth:"18em",viewWidth:"",templateString:"<div class=\"dojoxGrid-view\">\n\t<div class=\"dojoxGrid-header\" dojoAttachPoint=\"headerNode\">\n\t\t<div dojoAttachPoint=\"headerNodeContainer\" style=\"width:9000em\">\n\t\t\t<div dojoAttachPoint=\"headerContentNode\"></div>\n\t\t</div>\n\t</div>\n\t<input type=\"checkbox\" class=\"dojoxGrid-hidden-focus\" dojoAttachPoint=\"hiddenFocusNode\" />\n\t<input type=\"checkbox\" class=\"dojoxGrid-hidden-focus\" />\n\t<div class=\"dojoxGrid-scrollbox\" dojoAttachPoint=\"scrollboxNode\">\n\t\t<div class=\"dojoxGrid-content\" dojoAttachPoint=\"contentNode\" hidefocus=\"hidefocus\"></div>\n\t</div>\n</div>\n",themeable:false,classTag:"dojoxGrid",marginBottom:0,rowPad:2,postMixInProperties:function(){this.rowNodes=[];},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");dojox.grid.funnelEvents(this.contentNode,this,"doContentEvent",["mouseover","mouseout","click","dblclick","contextmenu","mousedown"]);dojox.grid.funnelEvents(this.headerNode,this,"doHeaderEvent",["dblclick","mouseover","mouseout","mousemove","mousedown","click","contextmenu"]);this.content=new dojox.grid.contentBuilder(this);this.header=new dojox.grid.headerBuilder(this);if(!dojo._isBodyLtr()){this.headerNodeContainer.style.width="";}},destroy:function(){dojox.grid.removeNode(this.headerNode);this.inherited("destroy",arguments);},focus:function(){if(dojo.isSafari||dojo.isOpera){this.hiddenFocusNode.focus();}else{this.scrollboxNode.focus();}},setStructure:function(_91d){var vs=this.structure=_91d;if(vs.width&&!isNaN(vs.width)){this.viewWidth=vs.width+"em";}else{this.viewWidth=vs.width||this.viewWidth;}this.onBeforeRow=vs.onBeforeRow;this.noscroll=vs.noscroll;if(this.noscroll){this.scrollboxNode.style.overflow="hidden";}this.testFlexCells();this.updateStructure();},testFlexCells:function(){this.flexCells=false;for(var j=0,row;(row=this.structure.rows[j]);j++){for(var i=0,cell;(cell=row[i]);i++){cell.view=this;this.flexCells=this.flexCells||cell.isFlex();}}return this.flexCells;},updateStructure:function(){this.header.update();this.content.update();},getScrollbarWidth:function(){return (this.noscroll?0:dojox.grid.getScrollbarWidth());},getColumnsWidth:function(){return this.headerContentNode.firstChild.offsetWidth;},getWidth:function(){return this.viewWidth||(this.getColumnsWidth()+this.getScrollbarWidth())+"px";},getContentWidth:function(){return Math.max(0,dojo._getContentBox(this.domNode).w-this.getScrollbarWidth())+"px";},render:function(){this.scrollboxNode.style.height="";this.renderHeader();},renderHeader:function(){this.headerContentNode.innerHTML=this.header.generateHtml(this._getHeaderContent);},_getHeaderContent:function(_923){var n=_923.name||_923.grid.getCellName(_923);if(_923.index!=_923.grid.getSortIndex()){return n;}return ["<div class=\"",_923.grid.sortInfo>0?"dojoxGrid-sort-down":"dojoxGrid-sort-up","\"><div class=\"gridArrowButtonChar\">",_923.grid.sortInfo>0?"&#9660;":"&#9650;","</div>",n,"</div>"].join("");},resize:function(){this.adaptHeight();this.adaptWidth();},hasScrollbar:function(){return (this.scrollboxNode.clientHeight!=this.scrollboxNode.offsetHeight);},adaptHeight:function(){if(!this.grid.autoHeight){var h=this.domNode.clientHeight;if(!this.hasScrollbar()){h-=dojox.grid.getScrollbarWidth();}dojox.grid.setStyleHeightPx(this.scrollboxNode,h);}},adaptWidth:function(){if(this.flexCells){this.contentWidth=this.getContentWidth();this.headerContentNode.firstChild.style.width=this.contentWidth;}var w=this.scrollboxNode.offsetWidth-this.getScrollbarWidth();w=Math.max(w,this.getColumnsWidth())+"px";with(this.contentNode){style.width="";offsetWidth;style.width=w;}},setSize:function(w,h){with(this.domNode.style){if(w){width=w;}height=(h>=0?h+"px":"");}with(this.headerNode.style){if(w){width=w;}}},renderRow:function(_929,_92a){var _92b=this.createRowNode(_929);this.buildRow(_929,_92b,_92a);this.grid.edit.restore(this,_929);return _92b;},createRowNode:function(_92c){var node=document.createElement("div");node.className=this.classTag+"-row";node[dojox.grid.gridViewTag]=this.id;node[dojox.grid.rowIndexTag]=_92c;this.rowNodes[_92c]=node;return node;},buildRow:function(_92e,_92f){this.buildRowContent(_92e,_92f);this.styleRow(_92e,_92f);},buildRowContent:function(_930,_931){_931.innerHTML=this.content.generateHtml(_930,_930);if(this.flexCells){_931.firstChild.style.width=this.contentWidth;}},rowRemoved:function(_932){this.grid.edit.save(this,_932);delete this.rowNodes[_932];},getRowNode:function(_933){return this.rowNodes[_933];},getCellNode:function(_934,_935){var row=this.getRowNode(_934);if(row){return this.content.getCellNode(row,_935);}},styleRow:function(_937,_938){_938._style=dojox.grid.getStyleText(_938);this.styleRowNode(_937,_938);},styleRowNode:function(_939,_93a){if(_93a){this.doStyleRowNode(_939,_93a);}},doStyleRowNode:function(_93b,_93c){this.grid.styleRowNode(_93b,_93c);},updateRow:function(_93d,_93e,_93f){var _940=this.getRowNode(_93d);if(_940){_940.style.height="";this.buildRow(_93d,_940);}return _940;},updateRowStyles:function(_941){this.styleRowNode(_941,this.getRowNode(_941));},lastTop:0,firstScroll:0,doscroll:function(_942){var _943=dojo._isBodyLtr();if(this.firstScroll<2){if((!_943&&this.firstScroll==1)||(_943&&this.firstScroll==0)){var s=dojo.marginBox(this.headerNodeContainer);if(dojo.isIE){this.headerNodeContainer.style.width=s.w+this.getScrollbarWidth()+"px";}else{if(dojo.isMoz){this.headerNodeContainer.style.width=s.w-this.getScrollbarWidth()+"px";if(_943){this.scrollboxNode.scrollLeft=this.scrollboxNode.scrollWidth-this.scrollboxNode.clientWidth;}else{this.scrollboxNode.scrollLeft=this.scrollboxNode.clientWidth-this.scrollboxNode.scrollWidth;}}}}this.firstScroll++;}this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;var top=this.scrollboxNode.scrollTop;if(top!=this.lastTop){this.grid.scrollTo(top);}},setScrollTop:function(_946){this.lastTop=_946;this.scrollboxNode.scrollTop=_946;return this.scrollboxNode.scrollTop;},doContentEvent:function(e){if(this.content.decorateEvent(e)){this.grid.onContentEvent(e);}},doHeaderEvent:function(e){if(this.header.decorateEvent(e)){this.grid.onHeaderEvent(e);}},dispatchContentEvent:function(e){return this.content.dispatchEvent(e);},dispatchHeaderEvent:function(e){return this.header.dispatchEvent(e);},setColWidth:function(_94b,_94c){this.grid.setCellWidth(_94b,_94c+"px");},update:function(){var left=this.scrollboxNode.scrollLeft;this.content.update();this.grid.update();this.scrollboxNode.scrollLeft=left;this.headerNode.scrollLeft=left;}});}if(!dojo._hasResource["dojox.grid._grid.views"]){dojo._hasResource["dojox.grid._grid.views"]=true;dojo.provide("dojox.grid._grid.views");dojo.declare("dojox.grid.views",null,{constructor:function(_94e){this.grid=_94e;},defaultWidth:200,views:[],resize:function(){this.onEach("resize");},render:function(){this.onEach("render");},addView:function(_94f){_94f.idx=this.views.length;this.views.push(_94f);},destroyViews:function(){for(var i=0,v;v=this.views[i];i++){v.destroy();}this.views=[];},getContentNodes:function(){var _952=[];for(var i=0,v;v=this.views[i];i++){_952.push(v.contentNode);}return _952;},forEach:function(_955){for(var i=0,v;v=this.views[i];i++){_955(v,i);}},onEach:function(_958,_959){_959=_959||[];for(var i=0,v;v=this.views[i];i++){if(_958 in v){v[_958].apply(v,_959);}}},normalizeHeaderNodeHeight:function(){var _95c=[];for(var i=0,v;(v=this.views[i]);i++){if(v.headerContentNode.firstChild){_95c.push(v.headerContentNode);}}this.normalizeRowNodeHeights(_95c);},normalizeRowNodeHeights:function(_95f){var h=0;for(var i=0,n,o;(n=_95f[i]);i++){h=Math.max(h,(n.firstChild.clientHeight)||(n.firstChild.offsetHeight));}h=(h>=0?h:0);var hpx=h+"px";for(var i=0,n;(n=_95f[i]);i++){if(n.firstChild.clientHeight!=h){n.firstChild.style.height=hpx;}}if(_95f&&_95f[0]){_95f[0].parentNode.offsetHeight;}},resetHeaderNodeHeight:function(){for(var i=0,v,n;(v=this.views[i]);i++){n=v.headerContentNode.firstChild;if(n){n.style.height="";}}},renormalizeRow:function(_968){var _969=[];for(var i=0,v,n;(v=this.views[i])&&(n=v.getRowNode(_968));i++){n.firstChild.style.height="";_969.push(n);}this.normalizeRowNodeHeights(_969);},getViewWidth:function(_96d){return this.views[_96d].getWidth()||this.defaultWidth;},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(_96e){_96e.headerContentNode.style.height="";});var h=0;this.forEach(function(_970){h=Math.max(_970.headerNode.offsetHeight,h);});return h;},measureContent:function(){var h=0;this.forEach(function(_972){h=Math.max(_972.domNode.offsetHeight,h);});return h;},findClient:function(_973){var c=this.grid.elasticView||-1;if(c<0){for(var i=1,v;(v=this.views[i]);i++){if(v.viewWidth){for(i=1;(v=this.views[i]);i++){if(!v.viewWidth){c=i;break;}}break;}}}if(c<0){c=Math.floor(this.views.length/2);}return c;},arrange:function(l,w){var i,v,vw,len=this.views.length;var c=(w<=0?len:this.findClient());var _97e=function(v,l){with(v.domNode.style){if(!dojo._isBodyLtr()){right=l+"px";}else{left=l+"px";}top=0+"px";}with(v.headerNode.style){if(!dojo._isBodyLtr()){right=l+"px";}else{left=l+"px";}top=0;}};for(i=0;(v=this.views[i])&&(i<c);i++){vw=this.getViewWidth(i);v.setSize(vw,0);_97e(v,l);vw=v.domNode.offsetWidth;l+=vw;}i++;var r=w;for(var j=len-1;(v=this.views[j])&&(i<=j);j--){vw=this.getViewWidth(j);v.setSize(vw,0);vw=v.domNode.offsetWidth;r-=vw;_97e(v,r);}if(c<len){v=this.views[c];vw=Math.max(1,r-l);v.setSize(vw+"px",0);_97e(v,l);}return l;},renderRow:function(_983,_984){var _985=[];for(var i=0,v,n,_989;(v=this.views[i])&&(n=_984[i]);i++){_989=v.renderRow(_983);n.appendChild(_989);_985.push(_989);}this.normalizeRowNodeHeights(_985);},rowRemoved:function(_98a){this.onEach("rowRemoved",[_98a]);},updateRow:function(_98b,_98c){for(var i=0,v;v=this.views[i];i++){v.updateRow(_98b,_98c);}this.renormalizeRow(_98b);},updateRowStyles:function(_98f){this.onEach("updateRowStyles",[_98f]);},setScrollTop:function(_990){var top=_990;for(var i=0,v;v=this.views[i];i++){top=v.setScrollTop(_990);}return top;},getFirstScrollingView:function(){for(var i=0,v;(v=this.views[i]);i++){if(v.hasScrollbar()){return v;}}}});}if(!dojo._hasResource["dojox.grid._grid.cell"]){dojo._hasResource["dojox.grid._grid.cell"]=true;dojo.provide("dojox.grid._grid.cell");dojo.declare("dojox.grid.cell",null,{styles:"",constructor:function(_996){dojo.mixin(this,_996);if(this.editor){this.editor=new this.editor(this);}},format:function(_997){var f,i=this.grid.edit.info,d=this.get?this.get(_997):this.value;if(this.editor&&(this.editor.alwaysOn||(i.rowIndex==_997&&i.cell==this))){return this.editor.format(d,_997);}else{return (f=this.formatter)?f.call(this,d,_997):d;}},getNode:function(_99b){return this.view.getCellNode(_99b,this.index);},isFlex:function(){var uw=this.unitWidth;return uw&&(uw=="auto"||uw.slice(-1)=="%");},applyEdit:function(_99d,_99e){this.grid.edit.applyCellEdit(_99d,this,_99e);},cancelEdit:function(_99f){this.grid.doCancelEdit(_99f);},_onEditBlur:function(_9a0){if(this.grid.edit.isEditCell(_9a0,this.index)){this.grid.edit.apply();}},registerOnBlur:function(_9a1,_9a2){if(this.commitOnBlur){dojo.connect(_9a1,"onblur",function(e){setTimeout(dojo.hitch(this,"_onEditBlur",_9a2),250);});}}});}if(!dojo._hasResource["dojox.grid._grid.layout"]){dojo._hasResource["dojox.grid._grid.layout"]=true;dojo.provide("dojox.grid._grid.layout");dojo.declare("dojox.grid.layout",null,{constructor:function(_9a4){this.grid=_9a4;},cells:[],structure:null,defaultWidth:"6em",setStructure:function(_9a5){this.fieldIndex=0;this.cells=[];var s=this.structure=[];for(var i=0,_9a8,rows;(_9a8=_9a5[i]);i++){s.push(this.addViewDef(_9a8));}this.cellCount=this.cells.length;},addViewDef:function(_9aa){this._defaultCellProps=_9aa.defaultCell||{};return dojo.mixin({},_9aa,{rows:this.addRowsDef(_9aa.rows||_9aa.cells)});},addRowsDef:function(_9ab){var _9ac=[];for(var i=0,row;_9ab&&(row=_9ab[i]);i++){_9ac.push(this.addRowDef(i,row));}return _9ac;},addRowDef:function(_9af,_9b0){var _9b1=[];for(var i=0,def,cell;(def=_9b0[i]);i++){cell=this.addCellDef(_9af,i,def);_9b1.push(cell);this.cells.push(cell);}return _9b1;},addCellDef:function(_9b5,_9b6,_9b7){var w=0;if(_9b7.colSpan>1){w=0;}else{if(!isNaN(_9b7.width)){w=_9b7.width+"em";}else{w=_9b7.width||this.defaultWidth;}}var _9b9=_9b7.field!=undefined?_9b7.field:(_9b7.get?-1:this.fieldIndex);if((_9b7.field!=undefined)||!_9b7.get){this.fieldIndex=(_9b7.field>-1?_9b7.field:this.fieldIndex)+1;}return new dojox.grid.cell(dojo.mixin({},this._defaultCellProps,_9b7,{grid:this.grid,subrow:_9b5,layoutIndex:_9b6,index:this.cells.length,fieldIndex:_9b9,unitWidth:w}));}});}if(!dojo._hasResource["dojox.grid._grid.rows"]){dojo._hasResource["dojox.grid._grid.rows"]=true;dojo.provide("dojox.grid._grid.rows");dojo.declare("dojox.grid.rows",null,{constructor:function(_9ba){this.grid=_9ba;},linesToEms:2,defaultRowHeight:1,overRow:-2,getHeight:function(_9bb){return "";},getDefaultHeightPx:function(){return 32;},prepareStylingRow:function(_9bc,_9bd){return {index:_9bc,node:_9bd,odd:Boolean(_9bc&1),selected:this.grid.selection.isSelected(_9bc),over:this.isOver(_9bc),customStyles:"",customClasses:"dojoxGrid-row"};},styleRowNode:function(_9be,_9bf){var row=this.prepareStylingRow(_9be,_9bf);this.grid.onStyleRow(row);this.applyStyles(row);},applyStyles:function(_9c1){with(_9c1){node.className=customClasses;var h=node.style.height;dojox.grid.setStyleText(node,customStyles+";"+(node._style||""));node.style.height=h;}},updateStyles:function(_9c3){this.grid.updateRowStyles(_9c3);},setOverRow:function(_9c4){var last=this.overRow;this.overRow=_9c4;if((last!=this.overRow)&&(last>=0)){this.updateStyles(last);}this.updateStyles(this.overRow);},isOver:function(_9c6){return (this.overRow==_9c6);}});}if(!dojo._hasResource["dojox.grid._grid.focus"]){dojo._hasResource["dojox.grid._grid.focus"]=true;dojo.provide("dojox.grid._grid.focus");dojo.declare("dojox.grid.focus",null,{constructor:function(_9c7){this.grid=_9c7;this.cell=null;this.rowIndex=-1;dojo.connect(this.grid.domNode,"onfocus",this,"doFocus");},tabbingOut:false,focusClass:"dojoxGrid-cell-focus",focusView:null,initFocusView:function(){this.focusView=this.grid.views.getFirstScrollingView();},isFocusCell:function(_9c8,_9c9){return (this.cell==_9c8)&&(this.rowIndex==_9c9);},isLastFocusCell:function(){return (this.rowIndex==this.grid.rowCount-1)&&(this.cell.index==this.grid.layout.cellCount-1);},isFirstFocusCell:function(){return (this.rowIndex==0)&&(this.cell.index==0);},isNoFocusCell:function(){return (this.rowIndex<0)||!this.cell;},_focusifyCellNode:function(_9ca){var n=this.cell&&this.cell.getNode(this.rowIndex);if(n){dojo.toggleClass(n,this.focusClass,_9ca);if(_9ca){this.scrollIntoView();try{if(!this.grid.edit.isEditing()){dojox.grid.fire(n,"focus");}}catch(e){}}}},scrollIntoView:function(){if(!this.cell){return;}var c=this.cell,s=c.view.scrollboxNode,sr={w:s.clientWidth,l:s.scrollLeft,t:s.scrollTop,h:s.clientHeight},n=c.getNode(this.rowIndex),r=c.view.getRowNode(this.rowIndex),rt=this.grid.scroller.findScrollTop(this.rowIndex);if(n.offsetLeft+n.offsetWidth>sr.l+sr.w){s.scrollLeft=n.offsetLeft+n.offsetWidth-sr.w;}else{if(n.offsetLeft<sr.l){s.scrollLeft=n.offsetLeft;}}if(rt+r.offsetHeight>sr.t+sr.h){this.grid.setScrollTop(rt+r.offsetHeight-sr.h);}else{if(rt<sr.t){this.grid.setScrollTop(rt);}}},styleRow:function(_9d2){return;},setFocusIndex:function(_9d3,_9d4){this.setFocusCell(this.grid.getCell(_9d4),_9d3);},setFocusCell:function(_9d5,_9d6){if(_9d5&&!this.isFocusCell(_9d5,_9d6)){this.tabbingOut=false;this.focusGridView();this._focusifyCellNode(false);this.cell=_9d5;this.rowIndex=_9d6;this._focusifyCellNode(true);}if(dojo.isOpera){setTimeout(dojo.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);}else{this.grid.onCellFocus(this.cell,this.rowIndex);}},next:function(){var row=this.rowIndex,col=this.cell.index+1,cc=this.grid.layout.cellCount-1,rc=this.grid.rowCount-1;if(col>cc){col=0;row++;}if(row>rc){col=cc;row=rc;}this.setFocusIndex(row,col);},previous:function(){var row=(this.rowIndex||0),col=(this.cell.index||0)-1;if(col<0){col=this.grid.layout.cellCount-1;row--;}if(row<0){row=0;col=0;}this.setFocusIndex(row,col);},move:function(_9dd,_9de){var rc=this.grid.rowCount-1,cc=this.grid.layout.cellCount-1,r=this.rowIndex,i=this.cell.index,row=Math.min(rc,Math.max(0,r+_9dd)),col=Math.min(cc,Math.max(0,i+_9de));this.setFocusIndex(row,col);if(_9dd){this.grid.updateRow(r);}},previousKey:function(e){if(this.isFirstFocusCell()){this.tabOut(this.grid.domNode);}else{dojo.stopEvent(e);this.previous();}},nextKey:function(e){if(this.isLastFocusCell()){this.tabOut(this.grid.lastFocusNode);}else{dojo.stopEvent(e);this.next();}},tabOut:function(_9e7){this.tabbingOut=true;_9e7.focus();},focusGridView:function(){dojox.grid.fire(this.focusView,"focus");},focusGrid:function(_9e8){this.focusGridView();this._focusifyCellNode(true);},doFocus:function(e){if(e&&e.target!=e.currentTarget){return;}if(!this.tabbingOut&&this.isNoFocusCell()){this.setFocusIndex(0,0);}this.tabbingOut=false;}});}if(!dojo._hasResource["dojox.grid._grid.selection"]){dojo._hasResource["dojox.grid._grid.selection"]=true;dojo.provide("dojox.grid._grid.selection");dojo.declare("dojox.grid.selection",null,{constructor:function(_9ea){this.grid=_9ea;this.selected=[];},multiSelect:true,selected:null,updating:0,selectedIndex:-1,onCanSelect:function(_9eb){return this.grid.onCanSelect(_9eb);},onCanDeselect:function(_9ec){return this.grid.onCanDeselect(_9ec);},onSelected:function(_9ed){return this.grid.onSelected(_9ed);},onDeselected:function(_9ee){return this.grid.onDeselected(_9ee);},onChanging:function(){},onChanged:function(){return this.grid.onSelectionChanged();},isSelected:function(_9ef){return this.selected[_9ef];},getFirstSelected:function(){for(var i=0,l=this.selected.length;i<l;i++){if(this.selected[i]){return i;}}return -1;},getNextSelected:function(_9f2){for(var i=_9f2+1,l=this.selected.length;i<l;i++){if(this.selected[i]){return i;}}return -1;},getSelected:function(){var _9f5=[];for(var i=0,l=this.selected.length;i<l;i++){if(this.selected[i]){_9f5.push(i);}}return _9f5;},getSelectedCount:function(){var c=0;for(var i=0;i<this.selected.length;i++){if(this.selected[i]){c++;}}return c;},beginUpdate:function(){if(this.updating==0){this.onChanging();}this.updating++;},endUpdate:function(){this.updating--;if(this.updating==0){this.onChanged();}},select:function(_9fa){this.unselectAll(_9fa);this.addToSelection(_9fa);},addToSelection:function(_9fb){_9fb=Number(_9fb);if(this.selected[_9fb]){this.selectedIndex=_9fb;}else{if(this.onCanSelect(_9fb)!==false){this.selectedIndex=_9fb;this.beginUpdate();this.selected[_9fb]=true;this.grid.onSelected(_9fb);this.endUpdate();}}},deselect:function(_9fc){_9fc=Number(_9fc);if(this.selectedIndex==_9fc){this.selectedIndex=-1;}if(this.selected[_9fc]){if(this.onCanDeselect(_9fc)===false){return;}this.beginUpdate();delete this.selected[_9fc];this.grid.onDeselected(_9fc);this.endUpdate();}},setSelected:function(_9fd,_9fe){this[(_9fe?"addToSelection":"deselect")](_9fd);},toggleSelect:function(_9ff){this.setSelected(_9ff,!this.selected[_9ff]);},insert:function(_a00){this.selected.splice(_a00,0,false);if(this.selectedIndex>=_a00){this.selectedIndex++;}},remove:function(_a01){this.selected.splice(_a01,1);if(this.selectedIndex>=_a01){this.selectedIndex--;}},unselectAll:function(_a02){for(var i in this.selected){if((i!=_a02)&&(this.selected[i]===true)){this.deselect(i);}}},shiftSelect:function(_a04,inTo){var s=(_a04>=0?_a04:inTo),e=inTo;if(s>e){e=s;s=inTo;}for(var i=s;i<=e;i++){this.addToSelection(i);}},clickSelect:function(_a09,_a0a,_a0b){this.beginUpdate();if(!this.multiSelect){this.select(_a09);}else{var _a0c=this.selectedIndex;if(!_a0a){this.unselectAll(_a09);}if(_a0b){this.shiftSelect(_a0c,_a09);}else{if(_a0a){this.toggleSelect(_a09);}else{this.addToSelection(_a09);}}}this.endUpdate();},clickSelectEvent:function(e){this.clickSelect(e.rowIndex,e.ctrlKey,e.shiftKey);},clear:function(){this.beginUpdate();this.unselectAll();this.endUpdate();}});}if(!dojo._hasResource["dojox.grid._grid.edit"]){dojo._hasResource["dojox.grid._grid.edit"]=true;dojo.provide("dojox.grid._grid.edit");dojo.declare("dojox.grid.edit",null,{constructor:function(_a0e){this.grid=_a0e;this.connections=[];if(dojo.isIE){this.connections.push(dojo.connect(document.body,"onfocus",dojo.hitch(this,"_boomerangFocus")));}},info:{},destroy:function(){dojo.forEach(this.connections,dojo.disconnect);},cellFocus:function(_a0f,_a10){if(this.grid.singleClickEdit||this.isEditRow(_a10)){this.setEditCell(_a0f,_a10);}else{this.apply();}if(this.isEditing()||(_a0f&&(_a0f.editor||0).alwaysOn)){this._focusEditor(_a0f,_a10);}},rowClick:function(e){if(this.isEditing()&&!this.isEditRow(e.rowIndex)){this.apply();}},styleRow:function(_a12){if(_a12.index==this.info.rowIndex){_a12.customClasses+=" dojoxGrid-row-editing";}},dispatchEvent:function(e){var c=e.cell,ed=c&&c.editor;return ed&&ed.dispatchEvent(e.dispatch,e);},isEditing:function(){return this.info.rowIndex!==undefined;},isEditCell:function(_a16,_a17){return (this.info.rowIndex===_a16)&&(this.info.cell.index==_a17);},isEditRow:function(_a18){return this.info.rowIndex===_a18;},setEditCell:function(_a19,_a1a){if(!this.isEditCell(_a1a,_a19.index)&&this.grid.canEdit(_a19,_a1a)){this.start(_a19,_a1a,this.isEditRow(_a1a)||_a19.editor);}},_focusEditor:function(_a1b,_a1c){dojox.grid.fire(_a1b.editor,"focus",[_a1c]);},focusEditor:function(){if(this.isEditing()){this._focusEditor(this.info.cell,this.info.rowIndex);}},_boomerangWindow:500,_shouldCatchBoomerang:function(){return this._catchBoomerang>new Date().getTime();},_boomerangFocus:function(){if(this._shouldCatchBoomerang()){this.grid.focus.focusGrid();this.focusEditor();this._catchBoomerang=0;}},_doCatchBoomerang:function(){if(dojo.isIE){this._catchBoomerang=new Date().getTime()+this._boomerangWindow;}},start:function(_a1d,_a1e,_a1f){this.grid.beginUpdate();this.editorApply();if(this.isEditing()&&!this.isEditRow(_a1e)){this.applyRowEdit();this.grid.updateRow(_a1e);}if(_a1f){this.info={cell:_a1d,rowIndex:_a1e};this.grid.doStartEdit(_a1d,_a1e);this.grid.updateRow(_a1e);}else{this.info={};}this.grid.endUpdate();this.grid.focus.focusGrid();this._focusEditor(_a1d,_a1e);this._doCatchBoomerang();},_editorDo:function(_a20){var c=this.info.cell;c&&c.editor&&c.editor[_a20](this.info.rowIndex);},editorApply:function(){this._editorDo("apply");},editorCancel:function(){this._editorDo("cancel");},applyCellEdit:function(_a22,_a23,_a24){if(this.grid.canEdit(_a23,_a24)){this.grid.doApplyCellEdit(_a22,_a24,_a23.fieldIndex);}},applyRowEdit:function(){this.grid.doApplyEdit(this.info.rowIndex);},apply:function(){if(this.isEditing()){this.grid.beginUpdate();this.editorApply();this.applyRowEdit();this.info={};this.grid.endUpdate();this.grid.focus.focusGrid();this._doCatchBoomerang();}},cancel:function(){if(this.isEditing()){this.grid.beginUpdate();this.editorCancel();this.info={};this.grid.endUpdate();this.grid.focus.focusGrid();this._doCatchBoomerang();}},save:function(_a25,_a26){var c=this.info.cell;if(this.isEditRow(_a25)&&(!_a26||c.view==_a26)&&c.editor){c.editor.save(c,this.info.rowIndex);}},restore:function(_a28,_a29){var c=this.info.cell;if(this.isEditRow(_a29)&&c.view==_a28&&c.editor){c.editor.restore(c,this.info.rowIndex);}}});}if(!dojo._hasResource["dojox.grid._grid.rowbar"]){dojo._hasResource["dojox.grid._grid.rowbar"]=true;dojo.provide("dojox.grid._grid.rowbar");dojo.declare("dojox.GridRowView",dojox.GridView,{defaultWidth:"3em",noscroll:true,padBorderWidth:2,buildRendering:function(){this.inherited("buildRendering",arguments);this.scrollboxNode.style.overflow="hidden";this.headerNode.style.visibility="hidden";},getWidth:function(){return this.viewWidth||this.defaultWidth;},buildRowContent:function(_a2b,_a2c){var w=this.contentNode.offsetWidth-this.padBorderWidth;_a2c.innerHTML="<table style=\"width:"+w+"px;\" role=\"wairole:presentation\"><tr><td class=\"dojoxGrid-rowbar-inner\"></td></tr></table>";},renderHeader:function(){},resize:function(){this.adaptHeight();},adaptWidth:function(){},doStyleRowNode:function(_a2e,_a2f){var n=["dojoxGrid-rowbar"];if(this.grid.rows.isOver(_a2e)){n.push("dojoxGrid-rowbar-over");}if(this.grid.selection.isSelected(_a2e)){n.push("dojoxGrid-rowbar-selected");}_a2f.className=n.join(" ");},domouseover:function(e){this.grid.onMouseOverRow(e);},domouseout:function(e){if(!this.isIntraRowEvent(e)){this.grid.onMouseOutRow(e);}}});}if(!dojo._hasResource["dojox.grid._grid.publicEvents"]){dojo._hasResource["dojox.grid._grid.publicEvents"]=true;dojo.provide("dojox.grid._grid.publicEvents");dojox.grid.publicEvents={cellOverClass:"dojoxGrid-cell-over",onKeyEvent:function(e){this.dispatchKeyEvent(e);},onContentEvent:function(e){this.dispatchContentEvent(e);},onHeaderEvent:function(e){this.dispatchHeaderEvent(e);},onStyleRow:function(_a36){with(_a36){customClasses+=(odd?" dojoxGrid-row-odd":"")+(selected?" dojoxGrid-row-selected":"")+(over?" dojoxGrid-row-over":"");}this.focus.styleRow(_a36);this.edit.styleRow(_a36);},onKeyDown:function(e){if(e.altKey||e.ctrlKey||e.metaKey){return;}var dk=dojo.keys;switch(e.keyCode){case dk.ESCAPE:this.edit.cancel();break;case dk.ENTER:if(!e.shiftKey){var _a39=this.edit.isEditing();this.edit.apply();if(!_a39){this.edit.setEditCell(this.focus.cell,this.focus.rowIndex);}}break;case dk.TAB:this.focus[e.shiftKey?"previousKey":"nextKey"](e);break;case dk.LEFT_ARROW:case dk.RIGHT_ARROW:if(!this.edit.isEditing()){dojo.stopEvent(e);var _a3a=(e.keyCode==dk.LEFT_ARROW)?1:-1;if(dojo._isBodyLtr()){_a3a*=-1;}this.focus.move(0,_a3a);}break;case dk.UP_ARROW:if(!this.edit.isEditing()&&this.focus.rowIndex!=0){dojo.stopEvent(e);this.focus.move(-1,0);}break;case dk.DOWN_ARROW:if(!this.edit.isEditing()&&this.focus.rowIndex+1!=this.model.count){dojo.stopEvent(e);this.focus.move(1,0);}break;case dk.PAGE_UP:if(!this.edit.isEditing()&&this.focus.rowIndex!=0){dojo.stopEvent(e);if(this.focus.rowIndex!=this.scroller.firstVisibleRow+1){this.focus.move(this.scroller.firstVisibleRow-this.focus.rowIndex,0);}else{this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex-1));this.focus.move(this.scroller.firstVisibleRow-this.scroller.lastVisibleRow+1,0);}}break;case dk.PAGE_DOWN:if(!this.edit.isEditing()&&this.focus.rowIndex+1!=this.model.count){dojo.stopEvent(e);if(this.focus.rowIndex!=this.scroller.lastVisibleRow-1){this.focus.move(this.scroller.lastVisibleRow-this.focus.rowIndex-1,0);}else{this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex+1));this.focus.move(this.scroller.lastVisibleRow-this.scroller.firstVisibleRow-1,0);}}break;}},onMouseOver:function(e){e.rowIndex==-1?this.onHeaderCellMouseOver(e):this.onCellMouseOver(e);},onMouseOut:function(e){e.rowIndex==-1?this.onHeaderCellMouseOut(e):this.onCellMouseOut(e);},onMouseDown:function(e){e.rowIndex==-1?this.onHeaderCellMouseDown(e):this.onCellMouseDown(e);},onMouseOverRow:function(e){if(!this.rows.isOver(e.rowIndex)){this.rows.setOverRow(e.rowIndex);e.rowIndex==-1?this.onHeaderMouseOver(e):this.onRowMouseOver(e);}},onMouseOutRow:function(e){if(this.rows.isOver(-1)){this.onHeaderMouseOut(e);}else{if(!this.rows.isOver(-2)){this.rows.setOverRow(-2);this.onRowMouseOut(e);}}},onMouseDownRow:function(e){if(e.rowIndex!=-1){this.onRowMouseDown(e);}},onCellMouseOver:function(e){dojo.addClass(e.cellNode,this.cellOverClass);},onCellMouseOut:function(e){dojo.removeClass(e.cellNode,this.cellOverClass);},onCellMouseDown:function(e){},onCellClick:function(e){this._click[0]=this._click[1];this._click[1]=e;if(!this.edit.isEditCell(e.rowIndex,e.cellIndex)){this.focus.setFocusCell(e.cell,e.rowIndex);}this.onRowClick(e);},onCellDblClick:function(e){if(dojo.isIE){this.edit.setEditCell(this._click[1].cell,this._click[1].rowIndex);}else{if(this._click[0].rowIndex!=this._click[1].rowIndex){this.edit.setEditCell(this._click[0].cell,this._click[0].rowIndex);}else{this.edit.setEditCell(e.cell,e.rowIndex);}}this.onRowDblClick(e);},onCellContextMenu:function(e){this.onRowContextMenu(e);},onCellFocus:function(_a47,_a48){this.edit.cellFocus(_a47,_a48);},onRowClick:function(e){this.edit.rowClick(e);this.selection.clickSelectEvent(e);},onRowDblClick:function(e){},onRowMouseOver:function(e){},onRowMouseOut:function(e){},onRowMouseDown:function(e){},onRowContextMenu:function(e){dojo.stopEvent(e);},onHeaderMouseOver:function(e){},onHeaderMouseOut:function(e){},onHeaderCellMouseOver:function(e){dojo.addClass(e.cellNode,this.cellOverClass);},onHeaderCellMouseOut:function(e){dojo.removeClass(e.cellNode,this.cellOverClass);},onHeaderCellMouseDown:function(e){},onHeaderClick:function(e){},onHeaderCellClick:function(e){this.setSortIndex(e.cell.index);this.onHeaderClick(e);},onHeaderDblClick:function(e){},onHeaderCellDblClick:function(e){this.onHeaderDblClick(e);},onHeaderCellContextMenu:function(e){this.onHeaderContextMenu(e);},onHeaderContextMenu:function(e){dojo.stopEvent(e);},onStartEdit:function(_a5a,_a5b){},onApplyCellEdit:function(_a5c,_a5d,_a5e){},onCancelEdit:function(_a5f){},onApplyEdit:function(_a60){},onCanSelect:function(_a61){return true;},onCanDeselect:function(_a62){return true;},onSelected:function(_a63){this.updateRowStyles(_a63);},onDeselected:function(_a64){this.updateRowStyles(_a64);},onSelectionChanged:function(){}};}if(!dojo._hasResource["dojox.grid.VirtualGrid"]){dojo._hasResource["dojox.grid.VirtualGrid"]=true;dojo.provide("dojox.grid.VirtualGrid");dojo.declare("dojox.VirtualGrid",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"dojoxGrid\" hidefocus=\"hidefocus\" role=\"wairole:grid\">\n\t<div class=\"dojoxGrid-master-header\" dojoAttachPoint=\"viewsHeaderNode\"></div>\n\t<div class=\"dojoxGrid-master-view\" dojoAttachPoint=\"viewsNode\"></div>\n\t<span dojoAttachPoint=\"lastFocusNode\" tabindex=\"0\"></span>\n</div>\n",classTag:"dojoxGrid",get:function(_a65){},rowCount:5,keepRows:75,rowsPerPage:25,autoWidth:false,autoHeight:false,autoRender:true,defaultHeight:"15em",structure:"",elasticView:-1,singleClickEdit:false,_click:null,sortInfo:0,themeable:true,buildRendering:function(){this.inherited(arguments);if(this.get==dojox.VirtualGrid.prototype.get){this.get=null;}if(!this.domNode.getAttribute("tabIndex")){this.domNode.tabIndex="0";}this.createScroller();this.createLayout();this.createViews();this.createManagers();dojox.grid.initTextSizePoll();this.connect(dojox.grid,"textSizeChanged","textSizeChanged");dojox.grid.funnelEvents(this.domNode,this,"doKeyEvent",dojox.grid.keyEvents);this.connect(this,"onShow","renderOnIdle");},postCreate:function(){this.styleChanged=this._styleChanged;this.setStructure(this.structure);this._click=[];},destroy:function(){this.domNode.onReveal=null;this.domNode.onSizeChange=null;this.edit.destroy();this.views.destroyViews();this.inherited(arguments);},styleChanged:function(){this.setStyledClass(this.domNode,"");},_styleChanged:function(){this.styleChanged();this.update();},textSizeChanged:function(){setTimeout(dojo.hitch(this,"_textSizeChanged"),1);},_textSizeChanged:function(){if(this.domNode){this.views.forEach(function(v){v.content.update();});this.render();}},sizeChange:function(){dojox.grid.jobs.job(this.id+"SizeChange",50,dojo.hitch(this,"update"));},renderOnIdle:function(){setTimeout(dojo.hitch(this,"render"),1);},createManagers:function(){this.rows=new dojox.grid.rows(this);this.focus=new dojox.grid.focus(this);this.selection=new dojox.grid.selection(this);this.edit=new dojox.grid.edit(this);},createScroller:function(){this.scroller=new dojox.grid.scroller.columns();this.scroller._pageIdPrefix=this.id+"-";this.scroller.renderRow=dojo.hitch(this,"renderRow");this.scroller.removeRow=dojo.hitch(this,"rowRemoved");},createLayout:function(){this.layout=new dojox.grid.layout(this);},createViews:function(){this.views=new dojox.grid.views(this);this.views.createView=dojo.hitch(this,"createView");},createView:function(_a67){if(dojo.isAIR){var obj=window;var _a69=_a67.split(".");for(var i=0;i<_a69.length;i++){if(typeof obj[_a69[i]]=="undefined"){var _a6b=_a69[0];for(var j=1;j<=i;j++){_a6b+="."+_a69[j];}throw new Error(_a6b+" is undefined");}obj=obj[_a69[i]];}var c=obj;}else{var c=eval(_a67);}var view=new c({grid:this});this.viewsNode.appendChild(view.domNode);this.viewsHeaderNode.appendChild(view.headerNode);this.views.addView(view);return view;},buildViews:function(){for(var i=0,vs;(vs=this.layout.structure[i]);i++){this.createView(vs.type||dojox._scopeName+".GridView").setStructure(vs);}this.scroller.setContentNodes(this.views.getContentNodes());},setStructure:function(_a71){this.views.destroyViews();this.structure=_a71;if((this.structure)&&(dojo.isString(this.structure))){this.structure=dojox.grid.getProp(this.structure);}if(!this.structure){this.structure=window["layout"];}if(!this.structure){return;}this.layout.setStructure(this.structure);this._structureChanged();},_structureChanged:function(){this.buildViews();if(this.autoRender){this.render();}},hasLayout:function(){return this.layout.cells.length;},resize:function(_a72){this._sizeBox=_a72;this._resize();this.sizeChange();},_getPadBorder:function(){this._padBorder=this._padBorder||dojo._getPadBorderExtents(this.domNode);return this._padBorder;},_resize:function(){if(!this.domNode.parentNode||this.domNode.parentNode.nodeType!=1||!this.hasLayout()){return;}var _a73=this._getPadBorder();if(this.autoHeight){this.domNode.style.height="auto";this.viewsNode.style.height="";}else{if(this.flex>0){}else{if(this.domNode.clientHeight<=_a73.h){if(this.domNode.parentNode==document.body){this.domNode.style.height=this.defaultHeight;}else{this.fitTo="parent";}}}}if(this._sizeBox){dojo.contentBox(this.domNode,this._sizeBox);}else{if(this.fitTo=="parent"){var h=dojo._getContentBox(this.domNode.parentNode).h;dojo.marginBox(this.domNode,{h:Math.max(0,h)});}}var h=dojo._getContentBox(this.domNode).h;if(h==0&&!this.autoHeight){this.viewsHeaderNode.style.display="none";}else{this.viewsHeaderNode.style.display="block";}this.adaptWidth();this.adaptHeight();this.scroller.defaultRowHeight=this.rows.getDefaultHeightPx()+1;this.postresize();},adaptWidth:function(){var w=this.autoWidth?0:this.domNode.clientWidth||(this.domNode.offsetWidth-this._getPadBorder().w);vw=this.views.arrange(1,w);this.views.onEach("adaptWidth");if(this.autoWidth){this.domNode.style.width=vw+"px";}},adaptHeight:function(){var vns=this.viewsHeaderNode.style,t=vns.display=="none"?0:this.views.measureHeader();vns.height=t+"px";this.views.normalizeHeaderNodeHeight();var h=(this.autoHeight?-1:Math.max(this.domNode.clientHeight-t,0)||0);this.views.onEach("setSize",[0,h]);this.views.onEach("adaptHeight");this.scroller.windowHeight=h;},render:function(){if(!this.domNode){return;}if(!this.hasLayout()){this.scroller.init(0,this.keepRows,this.rowsPerPage);return;}this.update=this.defaultUpdate;this.scroller.init(this.rowCount,this.keepRows,this.rowsPerPage);this.prerender();this.setScrollTop(0);this.postrender();},prerender:function(){this.keepRows=this.autoHeight?0:this.constructor.prototype.keepRows;this.scroller.setKeepInfo(this.keepRows);this.views.render();this._resize();},postrender:function(){this.postresize();this.focus.initFocusView();dojo.setSelectable(this.domNode,false);},postresize:function(){if(this.autoHeight){this.viewsNode.style.height=this.views.measureContent()+"px";}},renderRow:function(_a79,_a7a){this.views.renderRow(_a79,_a7a);},rowRemoved:function(_a7b){this.views.rowRemoved(_a7b);},invalidated:null,updating:false,beginUpdate:function(){this.invalidated=[];this.updating=true;},endUpdate:function(){this.updating=false;var i=this.invalidated;if(i.all){this.update();}else{if(i.rowCount!=undefined){this.updateRowCount(i.rowCount);}else{for(r in i){this.updateRow(Number(r));}}}this.invalidated=null;},defaultUpdate:function(){if(!this.domNode){return;}if(this.updating){this.invalidated.all=true;return;}this.prerender();this.scroller.invalidateNodes();this.setScrollTop(this.scrollTop);this.postrender();},update:function(){this.render();},updateRow:function(_a7d){_a7d=Number(_a7d);if(this.updating){this.invalidated[_a7d]=true;}else{this.views.updateRow(_a7d,this.rows.getHeight(_a7d));this.scroller.rowHeightChanged(_a7d);}},updateRowCount:function(_a7e){if(this.updating){this.invalidated.rowCount=_a7e;}else{this.rowCount=_a7e;if(this.layout.cells.length){this.scroller.updateRowCount(_a7e);this.setScrollTop(this.scrollTop);}this._resize();}},updateRowStyles:function(_a7f){this.views.updateRowStyles(_a7f);},rowHeightChanged:function(_a80){this.views.renormalizeRow(_a80);this.scroller.rowHeightChanged(_a80);},fastScroll:true,delayScroll:false,scrollRedrawThreshold:(dojo.isIE?100:50),scrollTo:function(_a81){if(!this.fastScroll){this.setScrollTop(_a81);return;}var _a82=Math.abs(this.lastScrollTop-_a81);this.lastScrollTop=_a81;if(_a82>this.scrollRedrawThreshold||this.delayScroll){this.delayScroll=true;this.scrollTop=_a81;this.views.setScrollTop(_a81);dojox.grid.jobs.job("dojoxGrid-scroll",200,dojo.hitch(this,"finishScrollJob"));}else{this.setScrollTop(_a81);}},finishScrollJob:function(){this.delayScroll=false;this.setScrollTop(this.scrollTop);},setScrollTop:function(_a83){this.scrollTop=this.views.setScrollTop(_a83);this.scroller.scroll(this.scrollTop);},scrollToRow:function(_a84){this.setScrollTop(this.scroller.findScrollTop(_a84)+1);},styleRowNode:function(_a85,_a86){if(_a86){this.rows.styleRowNode(_a85,_a86);}},getCell:function(_a87){return this.layout.cells[_a87];},setCellWidth:function(_a88,_a89){this.getCell(_a88).unitWidth=_a89;},getCellName:function(_a8a){return "Cell "+_a8a.index;},canSort:function(_a8b){},sort:function(){},getSortAsc:function(_a8c){_a8c=_a8c==undefined?this.sortInfo:_a8c;return Boolean(_a8c>0);},getSortIndex:function(_a8d){_a8d=_a8d==undefined?this.sortInfo:_a8d;return Math.abs(_a8d)-1;},setSortIndex:function(_a8e,_a8f){var si=_a8e+1;if(_a8f!=undefined){si*=(_a8f?1:-1);}else{if(this.getSortIndex()==_a8e){si=-this.sortInfo;}}this.setSortInfo(si);},setSortInfo:function(_a91){if(this.canSort(_a91)){this.sortInfo=_a91;this.sort();this.update();}},doKeyEvent:function(e){e.dispatch="do"+e.type;this.onKeyEvent(e);},_dispatch:function(m,e){if(m in this){return this[m](e);}},dispatchKeyEvent:function(e){this._dispatch(e.dispatch,e);},dispatchContentEvent:function(e){this.edit.dispatchEvent(e)||e.sourceView.dispatchContentEvent(e)||this._dispatch(e.dispatch,e);},dispatchHeaderEvent:function(e){e.sourceView.dispatchHeaderEvent(e)||this._dispatch("doheader"+e.type,e);},dokeydown:function(e){this.onKeyDown(e);},doclick:function(e){if(e.cellNode){this.onCellClick(e);}else{this.onRowClick(e);}},dodblclick:function(e){if(e.cellNode){this.onCellDblClick(e);}else{this.onRowDblClick(e);}},docontextmenu:function(e){if(e.cellNode){this.onCellContextMenu(e);}else{this.onRowContextMenu(e);}},doheaderclick:function(e){if(e.cellNode){this.onHeaderCellClick(e);}else{this.onHeaderClick(e);}},doheaderdblclick:function(e){if(e.cellNode){this.onHeaderCellDblClick(e);}else{this.onHeaderDblClick(e);}},doheadercontextmenu:function(e){if(e.cellNode){this.onHeaderCellContextMenu(e);}else{this.onHeaderContextMenu(e);}},doStartEdit:function(_a9f,_aa0){this.onStartEdit(_a9f,_aa0);},doApplyCellEdit:function(_aa1,_aa2,_aa3){this.onApplyCellEdit(_aa1,_aa2,_aa3);},doCancelEdit:function(_aa4){this.onCancelEdit(_aa4);},doApplyEdit:function(_aa5){this.onApplyEdit(_aa5);},addRow:function(){this.updateRowCount(this.rowCount+1);},removeSelectedRows:function(){this.updateRowCount(Math.max(0,this.rowCount-this.selection.getSelected().length));this.selection.clear();}});dojo.mixin(dojox.VirtualGrid.prototype,dojox.grid.publicEvents);}if(!dojo._hasResource["dojox.grid._data.fields"]){dojo._hasResource["dojox.grid._data.fields"]=true;dojo.provide("dojox.grid._data.fields");dojo.declare("dojox.grid.data.Mixer",null,{constructor:function(){this.defaultValue={};this.values=[];},count:function(){return this.values.length;},clear:function(){this.values=[];},build:function(_aa6){var _aa7=dojo.mixin({owner:this},this.defaultValue);_aa7.key=_aa6;this.values[_aa6]=_aa7;return _aa7;},getDefault:function(){return this.defaultValue;},setDefault:function(_aa8){for(var i=0,a;(a=arguments[i]);i++){dojo.mixin(this.defaultValue,a);}},get:function(_aab){return this.values[_aab]||this.build(_aab);},_set:function(_aac,_aad){var v=this.get(_aac);for(var i=1;i<arguments.length;i++){dojo.mixin(v,arguments[i]);}this.values[_aac]=v;},set:function(){if(arguments.length<1){return;}var a=arguments[0];if(!dojo.isArray(a)){this._set.apply(this,arguments);}else{if(a.length&&a[0]["default"]){this.setDefault(a.shift());}for(var i=0,l=a.length;i<l;i++){this._set(i,a[i]);}}},insert:function(_ab3,_ab4){if(_ab3>=this.values.length){this.values[_ab3]=_ab4;}else{this.values.splice(_ab3,0,_ab4);}},remove:function(_ab5){this.values.splice(_ab5,1);},swap:function(_ab6,_ab7){dojox.grid.arraySwap(this.values,_ab6,_ab7);},move:function(_ab8,_ab9){dojox.grid.arrayMove(this.values,_ab8,_ab9);}});dojox.grid.data.compare=function(a,b){return (a>b?1:(a==b?0:-1));};dojo.declare("dojox.grid.data.Field",null,{constructor:function(_abc){this.name=_abc;this.compare=dojox.grid.data.compare;},na:dojox.grid.na});dojo.declare("dojox.grid.data.Fields",dojox.grid.data.Mixer,{constructor:function(_abd){var _abe=_abd?_abd:dojox.grid.data.Field;this.defaultValue=new _abe();},indexOf:function(_abf){for(var i=0;i<this.values.length;i++){var v=this.values[i];if(v&&v.key==_abf){return i;}}return -1;}});}if(!dojo._hasResource["dojox.grid._data.model"]){dojo._hasResource["dojox.grid._data.model"]=true;dojo.provide("dojox.grid._data.model");dojo.declare("dojox.grid.data.Model",null,{constructor:function(_ac2,_ac3){this.observers=[];this.fields=new dojox.grid.data.Fields();if(_ac2){this.fields.set(_ac2);}this.setData(_ac3);},count:0,updating:0,observer:function(_ac4,_ac5){this.observers.push({o:_ac4,p:_ac5||"model"});},notObserver:function(_ac6){for(var i=0,m,o;(o=this.observers[i]);i++){if(o.o==_ac6){this.observers.splice(i,1);return;}}},notify:function(_aca,_acb){if(!this.isUpdating()){var a=_acb||[];for(var i=0,m,o;(o=this.observers[i]);i++){m=o.p+_aca;o=o.o;(m in o)&&(o[m].apply(o,a));}}},clear:function(){this.fields.clear();this.clearData();},beginUpdate:function(){this.updating++;},endUpdate:function(){if(this.updating){this.updating--;}},isUpdating:function(){return Boolean(this.updating);},clearData:function(){this.setData(null);},change:function(){this.notify("Change",arguments);},insertion:function(){this.notify("Insertion",arguments);this.notify("Change",arguments);},removal:function(){this.notify("Removal",arguments);this.notify("Change",arguments);},insert:function(_ad0){if(!this._insert.apply(this,arguments)){return false;}this.insertion.apply(this,dojo._toArray(arguments,1));return true;},remove:function(_ad1){if(!this._remove.apply(this,arguments)){return false;}this.removal.apply(this,arguments);return true;},canSort:function(){return this.sort!=null;},generateComparator:function(_ad2,_ad3,_ad4,_ad5){return function(a,b){var ineq=_ad2(a[_ad3],b[_ad3]);return ineq?(_ad4?ineq:-ineq):_ad5&&_ad5(a,b);};},makeComparator:function(_ad9){var idx,col,_adc,_add=null;for(var i=_ad9.length-1;i>=0;i--){idx=_ad9[i];col=Math.abs(idx)-1;if(col>=0){_adc=this.fields.get(col);_add=this.generateComparator(_adc.compare,_adc.key,idx>0,_add);}}return _add;},sort:null,dummy:0});dojo.declare("dojox.grid.data.Rows",dojox.grid.data.Model,{allChange:function(){this.notify("AllChange",arguments);this.notify("Change",arguments);},rowChange:function(){this.notify("RowChange",arguments);},datumChange:function(){this.notify("DatumChange",arguments);},beginModifyRow:function(_adf){if(!this.cache[_adf]){this.cache[_adf]=this.copyRow(_adf);}},endModifyRow:function(_ae0){var _ae1=this.cache[_ae0];if(_ae1){var data=this.getRow(_ae0);if(!dojox.grid.arrayCompare(_ae1,data)){this.update(_ae1,data,_ae0);}delete this.cache[_ae0];}},cancelModifyRow:function(_ae3){var _ae4=this.cache[_ae3];if(_ae4){this.setRow(_ae4,_ae3);delete this.cache[_ae3];}}});dojo.declare("dojox.grid.data.Table",dojox.grid.data.Rows,{constructor:function(){this.cache=[];},colCount:0,data:null,cache:null,measure:function(){this.count=this.getRowCount();this.colCount=this.getColCount();this.allChange();},getRowCount:function(){return (this.data?this.data.length:0);},getColCount:function(){return (this.data&&this.data.length?this.data[0].length:this.fields.count());},badIndex:function(_ae5,_ae6){console.debug("dojox.grid.data.Table: badIndex");},isGoodIndex:function(_ae7,_ae8){return (_ae7>=0&&_ae7<this.count&&(arguments.length<2||(_ae8>=0&&_ae8<this.colCount)));},getRow:function(_ae9){return this.data[_ae9];},copyRow:function(_aea){return this.getRow(_aea).slice(0);},getDatum:function(_aeb,_aec){return this.data[_aeb][_aec];},get:function(){throw ("Plain \"get\" no longer supported. Use \"getRow\" or \"getDatum\".");},setData:function(_aed){this.data=(_aed||[]);this.allChange();},setRow:function(_aee,_aef){this.data[_aef]=_aee;this.rowChange(_aee,_aef);this.change();},setDatum:function(_af0,_af1,_af2){this.data[_af1][_af2]=_af0;this.datumChange(_af0,_af1,_af2);},set:function(){throw ("Plain \"set\" no longer supported. Use \"setData\", \"setRow\", or \"setDatum\".");},setRows:function(_af3,_af4){for(var i=0,l=_af3.length,r=_af4;i<l;i++,r++){this.setRow(_af3[i],r);}},update:function(_af8,_af9,_afa){return true;},_insert:function(_afb,_afc){dojox.grid.arrayInsert(this.data,_afc,_afb);this.count++;return true;},_remove:function(_afd){for(var i=_afd.length-1;i>=0;i--){dojox.grid.arrayRemove(this.data,_afd[i]);}this.count-=_afd.length;return true;},sort:function(){this.data.sort(this.makeComparator(arguments));},swap:function(_aff,_b00){dojox.grid.arraySwap(this.data,_aff,_b00);this.rowChange(this.getRow(_aff),_aff);this.rowChange(this.getRow(_b00),_b00);this.change();},dummy:0});dojo.declare("dojox.grid.data.Objects",dojox.grid.data.Table,{constructor:function(_b01,_b02,_b03){if(!_b01){this.autoAssignFields();}},allChange:function(){this.notify("FieldsChange");this.inherited(arguments);},autoAssignFields:function(){var d=this.data[0],i=0,_b06;for(var f in d){_b06=this.fields.get(i++);if(!dojo.isString(_b06.key)){_b06.key=f;}}},setData:function(_b08){this.data=(_b08||[]);this.autoAssignFields();this.allChange();},getDatum:function(_b09,_b0a){return this.data[_b09][this.fields.get(_b0a).key];}});dojo.declare("dojox.grid.data.Dynamic",dojox.grid.data.Table,{constructor:function(){this.page=[];this.pages=[];},page:null,pages:null,rowsPerPage:100,requests:0,bop:-1,eop:-1,clearData:function(){this.pages=[];this.bop=this.eop=-1;this.setData([]);},getRowCount:function(){return this.count;},getColCount:function(){return this.fields.count();},setRowCount:function(_b0b){this.count=_b0b;this.change();},requestsPending:function(_b0c){},rowToPage:function(_b0d){return (this.rowsPerPage?Math.floor(_b0d/this.rowsPerPage):_b0d);},pageToRow:function(_b0e){return (this.rowsPerPage?this.rowsPerPage*_b0e:_b0e);},requestRows:function(_b0f,_b10){},rowsProvided:function(_b11,_b12){this.requests--;if(this.requests==0){this.requestsPending(false);}},requestPage:function(_b13){var row=this.pageToRow(_b13);var _b15=Math.min(this.rowsPerPage,this.count-row);if(_b15>0){this.requests++;this.requestsPending(true);setTimeout(dojo.hitch(this,"requestRows",row,_b15),1);}},needPage:function(_b16){if(!this.pages[_b16]){this.pages[_b16]=true;this.requestPage(_b16);}},preparePage:function(_b17,_b18){if(_b17<this.bop||_b17>=this.eop){var _b19=this.rowToPage(_b17);this.needPage(_b19);this.bop=_b19*this.rowsPerPage;this.eop=this.bop+(this.rowsPerPage||this.count);}},isRowLoaded:function(_b1a){return Boolean(this.data[_b1a]);},removePages:function(_b1b){for(var i=0,r;((r=_b1b[i])!=undefined);i++){this.pages[this.rowToPage(r)]=false;}this.bop=this.eop=-1;},remove:function(_b1e){this.removePages(_b1e);dojox.grid.data.Table.prototype.remove.apply(this,arguments);},getRow:function(_b1f){var row=this.data[_b1f];if(!row){this.preparePage(_b1f);}return row;},getDatum:function(_b21,_b22){var row=this.getRow(_b21);return (row?row[_b22]:this.fields.get(_b22).na);},setDatum:function(_b24,_b25,_b26){var row=this.getRow(_b25);if(row){row[_b26]=_b24;this.datumChange(_b24,_b25,_b26);}else{console.debug("["+this.declaredClass+"] dojox.grid.data.dynamic.set: cannot set data on an non-loaded row");}},canSort:function(){return false;}});dojox.grid.data.table=dojox.grid.data.Table;dojox.grid.data.dynamic=dojox.grid.data.Dynamic;dojo.declare("dojox.grid.data.DojoData",dojox.grid.data.Dynamic,{constructor:function(_b28,_b29,args){this.count=1;this._rowIdentities={};this._currentlyProcessing=[];if(args){dojo.mixin(this,args);}if(this.store){var f=this.store.getFeatures();this._canNotify=f["dojo.data.api.Notification"];this._canWrite=f["dojo.data.api.Write"];this._canIdentify=f["dojo.data.api.Identity"];if(this._canNotify){dojo.connect(this.store,"onSet",this,"_storeDatumChange");dojo.connect(this.store,"onDelete",this,"_storeDatumDelete");dojo.connect(this.store,"onNew",this,"_storeDatumNew");}if(this._canWrite){dojo.connect(this.store,"revert",this,"refresh");}}},markupFactory:function(args,node){return new dojox.grid.data.DojoData(null,null,args);},query:{name:"*"},store:null,_currentlyProcessing:null,_canNotify:false,_canWrite:false,_canIdentify:false,_rowIdentities:{},clientSort:false,sortFields:null,queryOptions:null,setData:function(_b2e){this.store=_b2e;this.data=[];this.allChange();},setRowCount:function(_b2f){this.count=_b2f;this.allChange();},beginReturn:function(_b30){if(this.count!=_b30){this.setRowCount(_b30);}},_setupFields:function(_b31){if(this.fields._nameMaps){return;}var m={};var _b33=dojo.map(this.store.getAttributes(_b31),function(item,idx){m[item]=idx;m[idx+".idx"]=item;return {name:item,key:item};},this);this.fields._nameMaps=m;this.fields.set(_b33);this.notify("FieldsChange");},_getRowFromItem:function(item){},_createRow:function(item){var row={};row.__dojo_data_item=item;dojo.forEach(this.fields.values,function(a){value=this.store.getValue(item,a.name);row[a.name]=(value===undefined||value===null)?"":value;},this);return row;},processRows:function(_b3a,_b3b){if(!_b3a||_b3a.length==0){return;}this._setupFields(_b3a[0]);dojo.forEach(_b3a,function(item,idx){var row=this._createRow(item);this._setRowId(item,_b3b.start,idx);this.setRow(row,_b3b.start+idx);},this);},requestRows:function(_b3f,_b40){var row=_b3f||0;var _b42={start:row,count:this.rowsPerPage,query:this.query,sort:this.sortFields,queryOptions:this.queryOptions,onBegin:dojo.hitch(this,"beginReturn"),onComplete:dojo.hitch(this,"processRows"),onError:dojo.hitch(this,"processError")};this.store.fetch(_b42);},getDatum:function(_b43,_b44){var row=this.getRow(_b43);var _b46=this.fields.values[_b44];return row&&_b46?row[_b46.name]:_b46?_b46.na:"?";},setDatum:function(_b47,_b48,_b49){var n=this.fields._nameMaps[_b49+".idx"];if(n){this.data[_b48][n]=_b47;this.datumChange(_b47,_b48,_b49);}},copyRow:function(_b4b){var row={};var _b4d={};var src=this.getRow(_b4b);for(var x in src){if(src[x]!=_b4d[x]){row[x]=src[x];}}return row;},_attrCompare:function(_b50,data){dojo.forEach(this.fields.values,function(a){if(_b50[a.name]!=data[a.name]){return false;}},this);return true;},endModifyRow:function(_b53){var _b54=this.cache[_b53];if(_b54){var data=this.getRow(_b53);if(!this._attrCompare(_b54,data)){this.update(_b54,data,_b53);}delete this.cache[_b53];}},cancelModifyRow:function(_b56){var _b57=this.cache[_b56];if(_b57){this.setRow(_b57,_b56);delete this.cache[_b56];}},_setRowId:function(item,_b59,idx){if(this._canIdentify){this._rowIdentities[this.store.getIdentity(item)]={rowId:_b59+idx,item:item};}else{var _b5b=dojo.toJson(this.query)+":start:"+_b59+":idx:"+idx+":sort:"+dojo.toJson(this.sortFields);this._rowIdentities[_b5b]={rowId:_b59+idx,item:item};}},_getRowId:function(item,_b5d){var _b5e=null;if(this._canIdentify&&!_b5d){_b5e=this._rowIdentities[this.store.getIdentity(item)].rowId;}else{var id;for(id in this._rowIdentities){if(this._rowIdentities[id].item===item){_b5e=this._rowIdentities[id].rowId;break;}}}return _b5e;},_storeDatumChange:function(item,attr,_b62,_b63){var _b64=this._getRowId(item);var row=this.getRow(_b64);if(row){row[attr]=_b63;var _b66=this.fields._nameMaps[attr];this.notify("DatumChange",[_b63,_b64,_b66]);}},_storeDatumDelete:function(item){if(dojo.indexOf(this._currentlyProcessing,item)!=-1){return;}var _b68=this._getRowId(item,true);if(_b68!=null){this._removeItems([_b68]);}},_storeDatumNew:function(item){if(this._disableNew){return;}this._insertItem(item,this.data.length);},insert:function(item,_b6b){this._disableNew=true;var i=this.store.newItem(item);this._disableNew=false;this._insertItem(i,_b6b);},_insertItem:function(_b6d,_b6e){if(!this.fields._nameMaps){this._setupFields(_b6d);}var row=this._createRow(_b6d);this._setRowId(_b6d,0,_b6e);dojox.grid.data.Dynamic.prototype.insert.apply(this,[row,_b6e]);},datumChange:function(_b70,_b71,_b72){if(this._canWrite){var row=this.getRow(_b71);var _b74=this.fields._nameMaps[_b72+".idx"];this.store.setValue(row.__dojo_data_item,_b74,_b70);}else{this.notify("DatumChange",arguments);}},insertion:function(){console.debug("Insertion",arguments);this.notify("Insertion",arguments);this.notify("Change",arguments);},removal:function(){console.debug("Removal",arguments);this.notify("Removal",arguments);this.notify("Change",arguments);},remove:function(_b75){for(var i=_b75.length-1;i>=0;i--){var item=this.data[_b75[i]].__dojo_data_item;this._currentlyProcessing.push(item);this.store.deleteItem(item);}this._removeItems(_b75);this._currentlyProcessing=[];},_removeItems:function(_b78){dojox.grid.data.Dynamic.prototype.remove.apply(this,arguments);this._rowIdentities={};for(var i=0;i<this.data.length;i++){this._setRowId(this.data[i].__dojo_data_item,0,i);}},canSort:function(){return true;},sort:function(_b7a){var col=Math.abs(_b7a)-1;this.sortFields=[{"attribute":this.fields.values[col].name,"descending":(_b7a>0)}];this.refresh();},refresh:function(){this.clearData(true);this.requestRows();},clearData:function(_b7c){this._rowIdentities={};this.pages=[];this.bop=this.eop=-1;this.count=0;this.setData((_b7c?this.store:[]));},processError:function(_b7d,_b7e){console.log(_b7d);}});}if(!dojo._hasResource["dojox.grid._data.editors"]){dojo._hasResource["dojox.grid._data.editors"]=true;dojo.provide("dojox.grid._data.editors");dojo.provide("dojox.grid.editors");dojo.declare("dojox.grid.editors.Base",null,{constructor:function(_b7f){this.cell=_b7f;},_valueProp:"value",_formatPending:false,format:function(_b80,_b81){},needFormatNode:function(_b82,_b83){this._formatPending=true;dojox.grid.whenIdle(this,"_formatNode",_b82,_b83);},cancelFormatNode:function(){this._formatPending=false;},_formatNode:function(_b84,_b85){if(this._formatPending){this._formatPending=false;dojo.setSelectable(this.cell.grid.domNode,true);this.formatNode(this.getNode(_b85),_b84,_b85);}},getNode:function(_b86){return (this.cell.getNode(_b86)||0).firstChild||0;},formatNode:function(_b87,_b88,_b89){if(dojo.isIE){dojox.grid.whenIdle(this,"focus",_b89,_b87);}else{this.focus(_b89,_b87);}},dispatchEvent:function(m,e){if(m in this){return this[m](e);}},getValue:function(_b8c){return this.getNode(_b8c)[this._valueProp];},setValue:function(_b8d,_b8e){var n=this.getNode(_b8d);if(n){n[this._valueProp]=_b8e;}},focus:function(_b90,_b91){dojox.grid.focusSelectNode(_b91||this.getNode(_b90));},save:function(_b92){this.value=this.value||this.getValue(_b92);},restore:function(_b93){this.setValue(_b93,this.value);},_finish:function(_b94){dojo.setSelectable(this.cell.grid.domNode,false);this.cancelFormatNode(this.cell);},apply:function(_b95){this.cell.applyEdit(this.getValue(_b95),_b95);this._finish(_b95);},cancel:function(_b96){this.cell.cancelEdit(_b96);this._finish(_b96);}});dojox.grid.editors.base=dojox.grid.editors.Base;dojo.declare("dojox.grid.editors.Input",dojox.grid.editors.Base,{constructor:function(_b97){this.keyFilter=this.keyFilter||this.cell.keyFilter;},keyFilter:null,format:function(_b98,_b99){this.needFormatNode(_b98,_b99);return "<input class=\"dojoxGrid-input\" type=\"text\" value=\""+_b98+"\">";},formatNode:function(_b9a,_b9b,_b9c){this.inherited(arguments);this.cell.registerOnBlur(_b9a,_b9c);},doKey:function(e){if(this.keyFilter){var key=String.fromCharCode(e.charCode);if(key.search(this.keyFilter)==-1){dojo.stopEvent(e);}}},_finish:function(_b9f){this.inherited(arguments);var n=this.getNode(_b9f);try{dojox.grid.fire(n,"blur");}catch(e){}}});dojox.grid.editors.input=dojox.grid.editors.Input;dojo.declare("dojox.grid.editors.Select",dojox.grid.editors.Input,{constructor:function(_ba1){this.options=this.options||this.cell.options;this.values=this.values||this.cell.values||this.options;},format:function(_ba2,_ba3){this.needFormatNode(_ba2,_ba3);var h=["<select class=\"dojoxGrid-select\">"];for(var i=0,o,v;((o=this.options[i])!==undefined)&&((v=this.values[i])!==undefined);i++){h.push("<option",(_ba2==v?" selected":"")," value=\""+v+"\"",">",o,"</option>");}h.push("</select>");return h.join("");},getValue:function(_ba8){var n=this.getNode(_ba8);if(n){var i=n.selectedIndex,o=n.options[i];return this.cell.returnIndex?i:o.value||o.innerHTML;}}});dojox.grid.editors.select=dojox.grid.editors.Select;dojo.declare("dojox.grid.editors.AlwaysOn",dojox.grid.editors.Input,{alwaysOn:true,_formatNode:function(_bac,_bad){this.formatNode(this.getNode(_bad),_bac,_bad);},applyStaticValue:function(_bae){var e=this.cell.grid.edit;e.applyCellEdit(this.getValue(_bae),this.cell,_bae);e.start(this.cell,_bae,true);}});dojox.grid.editors.alwaysOn=dojox.grid.editors.AlwaysOn;dojo.declare("dojox.grid.editors.Bool",dojox.grid.editors.AlwaysOn,{_valueProp:"checked",format:function(_bb0,_bb1){return "<input class=\"dojoxGrid-input\" type=\"checkbox\""+(_bb0?" checked=\"checked\"":"")+" style=\"width: auto\" />";},doclick:function(e){if(e.target.tagName=="INPUT"){this.applyStaticValue(e.rowIndex);}}});dojox.grid.editors.bool=dojox.grid.editors.Bool;}if(!dojo._hasResource["dijit._TimePicker"]){dojo._hasResource["dijit._TimePicker"]=true;dojo.provide("dijit._TimePicker");dojo.declare("dijit._TimePicker",[dijit._Widget,dijit._Templated],{templateString:"<div id=\"widget_${id}\" class=\"dijitMenu\"\n    ><div dojoAttachPoint=\"upArrow\" class=\"dijitButtonNode\"><span class=\"dijitTimePickerA11yText\">&#9650;</span></div\n    ><div dojoAttachPoint=\"timeMenu,focusNode\" dojoAttachEvent=\"onclick:_onOptionSelected,onmouseover,onmouseout\"></div\n    ><div dojoAttachPoint=\"downArrow\" class=\"dijitButtonNode\"><span class=\"dijitTimePickerA11yText\">&#9660;</span></div\n></div>\n",baseClass:"dijitTimePicker",clickableIncrement:"T00:15:00",visibleIncrement:"T01:00:00",visibleRange:"T05:00:00",value:new Date(),_visibleIncrement:2,_clickableIncrement:1,_totalIncrements:10,constraints:{},serialize:dojo.date.stamp.toISOString,setValue:function(date,_bb4){this.value=date;this._showText();},isDisabledDate:function(_bb5,_bb6){return false;},_showText:function(){this.timeMenu.innerHTML="";var _bb7=dojo.date.stamp.fromISOString;this._clickableIncrementDate=_bb7(this.clickableIncrement);this._visibleIncrementDate=_bb7(this.visibleIncrement);this._visibleRangeDate=_bb7(this.visibleRange);var _bb8=function(date){return date.getHours()*60*60+date.getMinutes()*60+date.getSeconds();};var _bba=_bb8(this._clickableIncrementDate);var _bbb=_bb8(this._visibleIncrementDate);var _bbc=_bb8(this._visibleRangeDate);var time=this.value.getTime();this._refDate=new Date(time-time%(_bbb*1000));this._refDate.setFullYear(1970,0,1);this._clickableIncrement=1;this._totalIncrements=_bbc/_bba;this._visibleIncrement=_bbb/_bba;for(var i=-(this._totalIncrements>>1);i<(this._totalIncrements>>1);i+=this._clickableIncrement){this.timeMenu.appendChild(this._createOption(i));}},postCreate:function(){if(this.constraints===dijit._TimePicker.prototype.constraints){this.constraints={};}dojo.mixin(this,this.constraints);if(!this.constraints.locale){this.constraints.locale=this.lang;}this.connect(this.timeMenu,dojo.isIE?"onmousewheel":"DOMMouseScroll","_mouseWheeled");var _bbf=dijit.typematic.addMouseListener;_bbf(this.upArrow,this,this._onArrowUp,0.8,500);_bbf(this.downArrow,this,this._onArrowDown,0.8,500);this.inherited(arguments);this.setValue(this.value);},_createOption:function(_bc0){var div=dojo.doc.createElement("div");var date=(div.date=new Date(this._refDate));div.index=_bc0;var _bc3=this._clickableIncrementDate;date.setHours(date.getHours()+_bc3.getHours()*_bc0,date.getMinutes()+_bc3.getMinutes()*_bc0,date.getSeconds()+_bc3.getSeconds()*_bc0);var _bc4=dojo.doc.createElement("div");dojo.addClass(div,this.baseClass+"Item");dojo.addClass(_bc4,this.baseClass+"ItemInner");_bc4.innerHTML=dojo.date.locale.format(date,this.constraints);div.appendChild(_bc4);if(_bc0%this._visibleIncrement<1&&_bc0%this._visibleIncrement>-1){dojo.addClass(div,this.baseClass+"Marker");}else{if(!(_bc0%this._clickableIncrement)){dojo.addClass(div,this.baseClass+"Tick");}}if(this.isDisabledDate(date)){dojo.addClass(div,this.baseClass+"ItemDisabled");}if(!dojo.date.compare(this.value,date,this.constraints.selector)){div.selected=true;dojo.addClass(div,this.baseClass+"ItemSelected");}return div;},_onOptionSelected:function(tgt){var _bc6=tgt.target.date||tgt.target.parentNode.date;if(!_bc6||this.isDisabledDate(_bc6)){return;}this.setValue(_bc6);this.onValueSelected(_bc6);},onValueSelected:function(_bc7){},onmouseover:function(e){var tgr=(e.target.parentNode===this.timeMenu)?e.target:e.target.parentNode;this._highlighted_option=tgr;dojo.addClass(tgr,this.baseClass+"ItemHover");},onmouseout:function(e){var tgr=(e.target.parentNode===this.timeMenu)?e.target:e.target.parentNode;if(this._highlighted_option===tgr){dojo.removeClass(tgr,this.baseClass+"ItemHover");}},_mouseWheeled:function(e){dojo.stopEvent(e);var _bcd=(dojo.isIE?e.wheelDelta:-e.detail);this[(_bcd>0?"_onArrowUp":"_onArrowDown")]();},_onArrowUp:function(){var _bce=this.timeMenu.childNodes[0].index-1;var div=this._createOption(_bce);this.timeMenu.removeChild(this.timeMenu.childNodes[this.timeMenu.childNodes.length-1]);this.timeMenu.insertBefore(div,this.timeMenu.childNodes[0]);},_onArrowDown:function(){var _bd0=this.timeMenu.childNodes[this.timeMenu.childNodes.length-1].index+1;var div=this._createOption(_bd0);this.timeMenu.removeChild(this.timeMenu.childNodes[0]);this.timeMenu.appendChild(div);}});}if(!dojo._hasResource["dijit.form.TimeTextBox"]){dojo._hasResource["dijit.form.TimeTextBox"]=true;dojo.provide("dijit.form.TimeTextBox");dojo.declare("dijit.form.TimeTextBox",dijit.form._DateTimeTextBox,{popupClass:"dijit._TimePicker",_selector:"time"});}if(!dojo._hasResource["dijit.form.CheckBox"]){dojo._hasResource["dijit.form.CheckBox"]=true;dojo.provide("dijit.form.CheckBox");dojo.declare("dijit.form.CheckBox",dijit.form.ToggleButton,{templateString:"<div class=\"dijitReset dijitInline\" waiRole=\"presentation\"\n\t><input\n\t \ttype=\"${type}\" name=\"${name}\"\n\t\tclass=\"dijitReset dijitCheckBoxInput\"\n\t\tdojoAttachPoint=\"focusNode\"\n\t \tdojoAttachEvent=\"onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick\"\n/></div>\n",baseClass:"dijitCheckBox",type:"checkbox",value:"on",setValue:function(_bd2){if(typeof _bd2=="string"){this.setAttribute("value",_bd2);_bd2=true;}this.setAttribute("checked",_bd2);},_getValueDeprecated:false,getValue:function(){return (this.checked?this.value:false);},reset:function(){this.inherited(arguments);this.setAttribute("value",this._resetValueAttr);},postCreate:function(){this.inherited(arguments);this._resetValueAttr=this.value;}});dojo.declare("dijit.form.RadioButton",dijit.form.CheckBox,{type:"radio",baseClass:"dijitRadio",_groups:{},postCreate:function(){(this._groups[this.name]=this._groups[this.name]||[]).push(this);this.inherited(arguments);},uninitialize:function(){dojo.forEach(this._groups[this.name],function(_bd3,i,arr){if(_bd3===this){arr.splice(i,1);return;}},this);},setAttribute:function(attr,_bd7){this.inherited(arguments);switch(attr){case "checked":if(this.checked){dojo.forEach(this._groups[this.name],function(_bd8){if(_bd8!=this&&_bd8.checked){_bd8.setAttribute("checked",false);}},this);}}},_clicked:function(e){if(!this.checked){this.setAttribute("checked",true);}}});}if(!dojo._hasResource["dijit.form._Spinner"]){dojo._hasResource["dijit.form._Spinner"]=true;dojo.provide("dijit.form._Spinner");dojo.declare("dijit.form._Spinner",dijit.form.RangeBoundTextBox,{defaultTimeout:500,timeoutChangeRate:0.9,smallDelta:1,largeDelta:10,templateString:"<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\"\n\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\" waiRole=\"presentation\"\n\t><div class=\"dijitInputLayoutContainer\"\n\t\t><div class=\"dijitReset dijitSpinnerButtonContainer\"\n\t\t\t>&nbsp;<div class=\"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitUpArrowButton\"\n\t\t\t\tdojoAttachPoint=\"upArrowNode\"\n\t\t\t\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse\"\n\t\t\t\tstateModifier=\"UpArrow\"\n\t\t\t\t><div class=\"dijitArrowButtonInner\">&thinsp;</div\n\t\t\t\t><div class=\"dijitArrowButtonChar\">&#9650;</div\n\t\t\t></div\n\t\t\t><div class=\"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitDownArrowButton\"\n\t\t\t\tdojoAttachPoint=\"downArrowNode\"\n\t\t\t\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse\"\n\t\t\t\tstateModifier=\"DownArrow\"\n\t\t\t\t><div class=\"dijitArrowButtonInner\">&thinsp;</div\n\t\t\t\t><div class=\"dijitArrowButtonChar\">&#9660;</div\n\t\t\t></div\n\t\t></div\n\t\t><div class=\"dijitReset dijitValidationIcon\"><br></div\n\t\t><div class=\"dijitReset dijitValidationIconText\">&Chi;</div\n\t\t><div class=\"dijitReset dijitInputField\"\n\t\t\t><input class='dijitReset' dojoAttachPoint=\"textbox,focusNode\" type=\"${type}\" dojoAttachEvent=\"onfocus:_update,onkeyup:_update,onkeypress:_onKeyPress\"\n\t\t\t\twaiRole=\"spinbutton\" autocomplete=\"off\" name=\"${name}\"\n\t\t/></div\n\t></div\n></div>\n",baseClass:"dijitSpinner",adjust:function(val,_bdb){return val;},_arrowState:function(node,_bdd){this._active=_bdd;this.stateModifier=node.getAttribute("stateModifier")||"";this._setStateClass();},_arrowPressed:function(_bde,_bdf){if(this.disabled||this.readOnly){return;}this._arrowState(_bde,true);this.setValue(this.adjust(this.getValue(),_bdf*this.smallDelta),false);dijit.selectInputText(this.textbox,this.textbox.value.length);},_arrowReleased:function(node){this._wheelTimer=null;if(this.disabled||this.readOnly){return;}this._arrowState(node,false);},_typematicCallback:function(_be1,node,evt){if(node==this.textbox){node=(evt.keyCode==dojo.keys.UP_ARROW)?this.upArrowNode:this.downArrowNode;}if(_be1==-1){this._arrowReleased(node);}else{this._arrowPressed(node,(node==this.upArrowNode)?1:-1);}},_wheelTimer:null,_mouseWheeled:function(evt){dojo.stopEvent(evt);var _be5=0;if(typeof evt.wheelDelta=="number"){_be5=evt.wheelDelta;}else{if(typeof evt.detail=="number"){_be5=-evt.detail;}}var node,dir;if(_be5>0){node=this.upArrowNode;dir=+1;}else{if(_be5<0){node=this.downArrowNode;dir=-1;}else{return;}}this._arrowPressed(node,dir);if(this._wheelTimer!=null){clearTimeout(this._wheelTimer);}var _be8=this;this._wheelTimer=setTimeout(function(){_be8._arrowReleased(node);},50);},postCreate:function(){this.inherited("postCreate",arguments);this.connect(this.textbox,dojo.isIE?"onmousewheel":"DOMMouseScroll","_mouseWheeled");this._connects.push(dijit.typematic.addListener(this.upArrowNode,this.textbox,{keyCode:dojo.keys.UP_ARROW,ctrlKey:false,altKey:false,shiftKey:false},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout));this._connects.push(dijit.typematic.addListener(this.downArrowNode,this.textbox,{keyCode:dojo.keys.DOWN_ARROW,ctrlKey:false,altKey:false,shiftKey:false},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout));if(dojo.isIE){var _be9=this;this.connect(this.domNode,"onresize",function(){setTimeout(dojo.hitch(_be9,function(){this.upArrowNode.style.behavior="";this.downArrowNode.style.behavior="";this._setStateClass();}),0);});}}});}if(!dojo._hasResource["dijit.form.NumberTextBox"]){dojo._hasResource["dijit.form.NumberTextBox"]=true;dojo.provide("dijit.form.NumberTextBox");dojo.declare("dijit.form.NumberTextBoxMixin",null,{regExpGen:dojo.number.regexp,editOptions:{pattern:"#.######"},_onFocus:function(){this.setValue(this.getValue(),false);this.inherited(arguments);},_formatter:dojo.number.format,format:function(_bea,_beb){if(typeof _bea=="string"){return _bea;}if(isNaN(_bea)){return "";}if(this.editOptions&&this._focused){_beb=dojo.mixin(dojo.mixin({},this.editOptions),this.constraints);}return this._formatter(_bea,_beb);},parse:dojo.number.parse,filter:function(_bec){if(typeof _bec=="string"){return this.inherited("filter",arguments);}return isNaN(_bec)?"":_bec;},value:NaN});dojo.declare("dijit.form.NumberTextBox",[dijit.form.RangeBoundTextBox,dijit.form.NumberTextBoxMixin],{});}if(!dojo._hasResource["dijit.form.NumberSpinner"]){dojo._hasResource["dijit.form.NumberSpinner"]=true;dojo.provide("dijit.form.NumberSpinner");dojo.declare("dijit.form.NumberSpinner",[dijit.form._Spinner,dijit.form.NumberTextBoxMixin],{required:true,adjust:function(val,_bee){var _bef=val+_bee;if(isNaN(val)||isNaN(_bef)){return val;}if((typeof this.constraints.max=="number")&&(_bef>this.constraints.max)){_bef=this.constraints.max;}if((typeof this.constraints.min=="number")&&(_bef<this.constraints.min)){_bef=this.constraints.min;}return _bef;}});}if(!dojo._hasResource["dojo.cldr.monetary"]){dojo._hasResource["dojo.cldr.monetary"]=true;dojo.provide("dojo.cldr.monetary");dojo.cldr.monetary.getData=function(code){var _bf1={ADP:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0,DJF:0,ESP:0,GNF:0,IQD:3,ITL:0,JOD:3,JPY:0,KMF:0,KRW:0,KWD:3,LUF:0,LYD:3,MGA:0,MGF:0,OMR:3,PYG:0,RWF:0,TND:3,TRL:0,VUV:0,XAF:0,XOF:0,XPF:0};var _bf2={CHF:5};var _bf3=_bf1[code],_bf4=_bf2[code];if(typeof _bf3=="undefined"){_bf3=2;}if(typeof _bf4=="undefined"){_bf4=0;}return {places:_bf3,round:_bf4};};}if(!dojo._hasResource["dojo.currency"]){dojo._hasResource["dojo.currency"]=true;dojo.provide("dojo.currency");dojo.currency._mixInDefaults=function(_bf5){_bf5=_bf5||{};_bf5.type="currency";var _bf6=dojo.i18n.getLocalization("dojo.cldr","currency",_bf5.locale)||{};var iso=_bf5.currency;var data=dojo.cldr.monetary.getData(iso);dojo.forEach(["displayName","symbol","group","decimal"],function(prop){data[prop]=_bf6[iso+"_"+prop];});data.fractional=[true,false];return dojo.mixin(data,_bf5);};dojo.currency.format=function(_bfa,_bfb){return dojo.number.format(_bfa,dojo.currency._mixInDefaults(_bfb));};dojo.currency.regexp=function(_bfc){return dojo.number.regexp(dojo.currency._mixInDefaults(_bfc));};dojo.currency.parse=function(_bfd,_bfe){return dojo.number.parse(_bfd,dojo.currency._mixInDefaults(_bfe));};}if(!dojo._hasResource["dijit.form.CurrencyTextBox"]){dojo._hasResource["dijit.form.CurrencyTextBox"]=true;dojo.provide("dijit.form.CurrencyTextBox");dojo.declare("dijit.form.CurrencyTextBox",dijit.form.NumberTextBox,{currency:"",regExpGen:dojo.currency.regexp,_formatter:dojo.currency.format,parse:dojo.currency.parse,postMixInProperties:function(){if(this.constraints===dijit.form.ValidationTextBox.prototype.constraints){this.constraints={};}this.constraints.currency=this.currency;dijit.form.CurrencyTextBox.superclass.postMixInProperties.apply(this,arguments);}});}if(!dojo._hasResource["dojo.dnd.move"]){dojo._hasResource["dojo.dnd.move"]=true;dojo.provide("dojo.dnd.move");dojo.declare("dojo.dnd.move.constrainedMoveable",dojo.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(_bff,node){return new dojo.dnd.move.constrainedMoveable(node,_bff);},constructor:function(node,_c02){if(!_c02){_c02={};}this.constraints=_c02.constraints;this.within=_c02.within;},onFirstMove:function(_c03){var c=this.constraintBox=this.constraints.call(this,_c03);c.r=c.l+c.w;c.b=c.t+c.h;if(this.within){var mb=dojo.marginBox(_c03.node);c.r-=mb.w;c.b-=mb.h;}},onMove:function(_c06,_c07){var c=this.constraintBox,s=_c06.node.style;s.left=(_c07.l<c.l?c.l:c.r<_c07.l?c.r:_c07.l)+"px";s.top=(_c07.t<c.t?c.t:c.b<_c07.t?c.b:_c07.t)+"px";}});dojo.declare("dojo.dnd.move.boxConstrainedMoveable",dojo.dnd.move.constrainedMoveable,{box:{},markupFactory:function(_c0a,node){return new dojo.dnd.move.boxConstrainedMoveable(node,_c0a);},constructor:function(node,_c0d){var box=_c0d&&_c0d.box;this.constraints=function(){return box;};}});dojo.declare("dojo.dnd.move.parentConstrainedMoveable",dojo.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(_c0f,node){return new dojo.dnd.move.parentConstrainedMoveable(node,_c0f);},constructor:function(node,_c12){var area=_c12&&_c12.area;this.constraints=function(){var n=this.node.parentNode,s=dojo.getComputedStyle(n),mb=dojo._getMarginBox(n,s);if(area=="margin"){return mb;}var t=dojo._getMarginExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;if(area=="border"){return mb;}t=dojo._getBorderExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;if(area=="padding"){return mb;}t=dojo._getPadExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;return mb;};}});dojo.dnd.move.constrainedMover=function(fun,_c19){dojo.deprecated("dojo.dnd.move.constrainedMover, use dojo.dnd.move.constrainedMoveable instead");var _c1a=function(node,e,_c1d){dojo.dnd.Mover.call(this,node,e,_c1d);};dojo.extend(_c1a,dojo.dnd.Mover.prototype);dojo.extend(_c1a,{onMouseMove:function(e){dojo.dnd.autoScroll(e);var m=this.marginBox,c=this.constraintBox,l=m.l+e.pageX,t=m.t+e.pageY;l=l<c.l?c.l:c.r<l?c.r:l;t=t<c.t?c.t:c.b<t?c.b:t;this.host.onMove(this,{l:l,t:t});},onFirstMove:function(){dojo.dnd.Mover.prototype.onFirstMove.call(this);var c=this.constraintBox=fun.call(this);c.r=c.l+c.w;c.b=c.t+c.h;if(_c19){var mb=dojo.marginBox(this.node);c.r-=mb.w;c.b-=mb.h;}}});return _c1a;};dojo.dnd.move.boxConstrainedMover=function(box,_c26){dojo.deprecated("dojo.dnd.move.boxConstrainedMover, use dojo.dnd.move.boxConstrainedMoveable instead");return dojo.dnd.move.constrainedMover(function(){return box;},_c26);};dojo.dnd.move.parentConstrainedMover=function(area,_c28){dojo.deprecated("dojo.dnd.move.parentConstrainedMover, use dojo.dnd.move.parentConstrainedMoveable instead");var fun=function(){var n=this.node.parentNode,s=dojo.getComputedStyle(n),mb=dojo._getMarginBox(n,s);if(area=="margin"){return mb;}var t=dojo._getMarginExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;if(area=="border"){return mb;}t=dojo._getBorderExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;if(area=="padding"){return mb;}t=dojo._getPadExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;return mb;};return dojo.dnd.move.constrainedMover(fun,_c28);};dojo.dnd.constrainedMover=dojo.dnd.move.constrainedMover;dojo.dnd.boxConstrainedMover=dojo.dnd.move.boxConstrainedMover;dojo.dnd.parentConstrainedMover=dojo.dnd.move.parentConstrainedMover;}if(!dojo._hasResource["dijit.form.Slider"]){dojo._hasResource["dijit.form.Slider"]=true;dojo.provide("dijit.form.Slider");dojo.declare("dijit.form.HorizontalSlider",[dijit.form._FormValueWidget,dijit._Container],{templateString:"<table class=\"dijit dijitReset dijitSlider\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"containerNode,topDecoration\" class=\"dijitReset\" style=\"text-align:center;width:100%;\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderDecrementIconH\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"decrementButton\" dojoAttachEvent=\"onclick: decrement\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderLeftBumper dijitSliderLeftBumper\" dojoAttachEvent=\"onclick:_onClkDecBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" name=\"${name}\"\n\t\t\t/><div waiRole=\"presentation\" style=\"position:relative;\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"progressBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderProgressBar dijitSliderProgressBarH\" dojoAttachEvent=\"onclick:_onBarClick\"\n\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle,focusNode\" class=\"dijitSliderMoveable dijitSliderMoveableH\" dojoAttachEvent=\"onkeypress:_onKeyPress,onmousedown:_onHandleClick\" waiRole=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"\n\t\t\t\t\t\t><div class=\"dijitSliderImageHandle dijitSliderImageHandleH\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderRemainingBar dijitSliderRemainingBarH\" dojoAttachEvent=\"onclick:_onBarClick\"></div\n\t\t\t></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderRightBumper dijitSliderRightBumper\" dojoAttachEvent=\"onclick:_onClkIncBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\" style=\"right:0px;\"\n\t\t\t><div class=\"dijitSliderIncrementIconH\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"incrementButton\" dojoAttachEvent=\"onclick: increment\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"containerNode,bottomDecoration\" class=\"dijitReset\" style=\"text-align:center;\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n></table>\n",value:0,showButtons:true,minimum:0,maximum:100,discreteValues:Infinity,pageIncrement:2,clickSelect:true,slideDuration:1000,widgetsInTemplate:true,attributeMap:dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap),{id:"",name:"valueNode"}),baseClass:"dijitSlider",_mousePixelCoord:"pageX",_pixelCount:"w",_startingPixelCoord:"x",_startingPixelCount:"l",_handleOffsetCoord:"left",_progressPixelSize:"width",_onKeyPress:function(e){if(this.disabled||this.readOnly||e.altKey||e.ctrlKey){return;}switch(e.keyCode){case dojo.keys.HOME:this.setValue(this.minimum,true);break;case dojo.keys.END:this.setValue(this.maximum,true);break;case ((this._descending||this.isLeftToRight())?dojo.keys.RIGHT_ARROW:dojo.keys.LEFT_ARROW):case (this._descending===false?dojo.keys.DOWN_ARROW:dojo.keys.UP_ARROW):case (this._descending===false?dojo.keys.PAGE_DOWN:dojo.keys.PAGE_UP):this.increment(e);break;case ((this._descending||this.isLeftToRight())?dojo.keys.LEFT_ARROW:dojo.keys.RIGHT_ARROW):case (this._descending===false?dojo.keys.UP_ARROW:dojo.keys.DOWN_ARROW):case (this._descending===false?dojo.keys.PAGE_UP:dojo.keys.PAGE_DOWN):this.decrement(e);break;default:this.inherited(arguments);return;}dojo.stopEvent(e);},_onHandleClick:function(e){if(this.disabled||this.readOnly){return;}if(!dojo.isIE){dijit.focus(this.sliderHandle);}dojo.stopEvent(e);},_isReversed:function(){return !this.isLeftToRight();},_onBarClick:function(e){if(this.disabled||this.readOnly||!this.clickSelect){return;}dijit.focus(this.sliderHandle);dojo.stopEvent(e);var _c31=dojo.coords(this.sliderBarContainer,true);var _c32=e[this._mousePixelCoord]-_c31[this._startingPixelCoord];this._setPixelValue(this._isReversed()?(_c31[this._pixelCount]-_c32):_c32,_c31[this._pixelCount],true);},_setPixelValue:function(_c33,_c34,_c35){if(this.disabled||this.readOnly){return;}_c33=_c33<0?0:_c34<_c33?_c34:_c33;var _c36=this.discreteValues;if(_c36<=1||_c36==Infinity){_c36=_c34;}_c36--;var _c37=_c34/_c36;var _c38=Math.round(_c33/_c37);this.setValue((this.maximum-this.minimum)*_c38/_c36+this.minimum,_c35);},setValue:function(_c39,_c3a){this.valueNode.value=this.value=_c39;dijit.setWaiState(this.focusNode,"valuenow",_c39);this.inherited(arguments);var _c3b=(_c39-this.minimum)/(this.maximum-this.minimum);var _c3c=(this._descending===false)?this.remainingBar:this.progressBar;var _c3d=(this._descending===false)?this.progressBar:this.remainingBar;if(_c3a&&this.slideDuration>0&&_c3c.style[this._progressPixelSize]){var _c3e=this;var _c3f={};var _c40=parseFloat(_c3c.style[this._progressPixelSize]);var _c41=this.slideDuration*(_c3b-_c40/100);if(_c41==0){return;}if(_c41<0){_c41=0-_c41;}_c3f[this._progressPixelSize]={start:_c40,end:_c3b*100,units:"%"};dojo.animateProperty({node:_c3c,duration:_c41,onAnimate:function(v){_c3d.style[_c3e._progressPixelSize]=(100-parseFloat(v[_c3e._progressPixelSize]))+"%";},properties:_c3f}).play();}else{_c3c.style[this._progressPixelSize]=(_c3b*100)+"%";_c3d.style[this._progressPixelSize]=((1-_c3b)*100)+"%";}},_bumpValue:function(_c43){if(this.disabled||this.readOnly){return;}var s=dojo.getComputedStyle(this.sliderBarContainer);var c=dojo._getContentBox(this.sliderBarContainer,s);var _c46=this.discreteValues;if(_c46<=1||_c46==Infinity){_c46=c[this._pixelCount];}_c46--;var _c47=(this.value-this.minimum)*_c46/(this.maximum-this.minimum)+_c43;if(_c47<0){_c47=0;}if(_c47>_c46){_c47=_c46;}_c47=_c47*(this.maximum-this.minimum)/_c46+this.minimum;this.setValue(_c47,true);},_onClkIncBumper:function(){this.setValue(this._descending===false?this.minimum:this.maximum,true);},_onClkDecBumper:function(){this.setValue(this._descending===false?this.maximum:this.minimum,true);},decrement:function(e){this._bumpValue(e.keyCode==dojo.keys.PAGE_DOWN?-this.pageIncrement:-1);},increment:function(e){this._bumpValue(e.keyCode==dojo.keys.PAGE_UP?this.pageIncrement:1);},_mouseWheeled:function(evt){dojo.stopEvent(evt);var _c4b=0;if(typeof evt.wheelDelta=="number"){_c4b=evt.wheelDelta;}else{if(typeof evt.detail=="number"){_c4b=-evt.detail;}}if(_c4b>0){this.increment(evt);}else{if(_c4b<0){this.decrement(evt);}}},startup:function(){dojo.forEach(this.getChildren(),function(_c4c){if(this[_c4c.container]!=this.containerNode){this[_c4c.container].appendChild(_c4c.domNode);}},this);},postCreate:function(){if(this.showButtons){this.incrementButton.style.display="";this.decrementButton.style.display="";}this.connect(this.domNode,dojo.isIE?"onmousewheel":"DOMMouseScroll","_mouseWheeled");var _c4d=this;var _c4e=function(){dijit.form._SliderMover.apply(this,arguments);this.widget=_c4d;};dojo.extend(_c4e,dijit.form._SliderMover.prototype);this._movable=new dojo.dnd.Moveable(this.sliderHandle,{mover:_c4e});dijit.setWaiState(this.focusNode,"valuemin",this.minimum);dijit.setWaiState(this.focusNode,"valuemax",this.maximum);this.inherited(arguments);},destroy:function(){this._movable.destroy();this.inherited(arguments);}});dojo.declare("dijit.form.VerticalSlider",dijit.form.HorizontalSlider,{templateString:"<table class=\"dijitReset dijitSlider\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\"\n><tbody class=\"dijitReset\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderIncrementIconV\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"incrementButton\" dojoAttachEvent=\"onclick:_topButtonClicked\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderTopBumper dijitSliderTopBumper\" dojoAttachEvent=\"onclick:_onClkIncBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td dojoAttachPoint=\"leftDecoration\" class=\"dijitReset\" style=\"text-align:center;height:100%;\"></td\n\t\t><td class=\"dijitReset\" style=\"height:100%;\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" name=\"${name}\"\n\t\t\t/><center waiRole=\"presentation\" style=\"position:relative;height:100%;\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderRemainingBar dijitSliderRemainingBarV\" dojoAttachEvent=\"onclick:_onBarClick\"><!--#5629--></div\n\t\t\t\t><div waiRole=\"presentation\" dojoAttachPoint=\"progressBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderProgressBar dijitSliderProgressBarV\" dojoAttachEvent=\"onclick:_onBarClick\"\n\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle,focusNode\" class=\"dijitSliderMoveable\" dojoAttachEvent=\"onkeypress:_onKeyPress,onmousedown:_onHandleClick\" style=\"vertical-align:top;\" waiRole=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"\n\t\t\t\t\t\t><div class=\"dijitSliderImageHandle dijitSliderImageHandleV\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t></center\n\t\t></td\n\t\t><td dojoAttachPoint=\"containerNode,rightDecoration\" class=\"dijitReset\" style=\"text-align:center;height:100%;\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderBottomBumper dijitSliderBottomBumper\" dojoAttachEvent=\"onclick:_onClkDecBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderDecrementIconV\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"decrementButton\" dojoAttachEvent=\"onclick:_bottomButtonClicked\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n></tbody></table>\n",_mousePixelCoord:"pageY",_pixelCount:"h",_startingPixelCoord:"y",_startingPixelCount:"t",_handleOffsetCoord:"top",_progressPixelSize:"height",_descending:true,startup:function(){if(this._started){return;}if(!this.isLeftToRight()&&dojo.isMoz){if(this.leftDecoration){this._rtlRectify(this.leftDecoration);}if(this.rightDecoration){this._rtlRectify(this.rightDecoration);}}this.inherited(arguments);},_isReversed:function(){return this._descending;},_topButtonClicked:function(e){if(this._descending){this.increment(e);}else{this.decrement(e);}},_bottomButtonClicked:function(e){if(this._descending){this.decrement(e);}else{this.increment(e);}},_rtlRectify:function(_c51){var _c52=[];while(_c51.firstChild){_c52.push(_c51.firstChild);_c51.removeChild(_c51.firstChild);}for(var i=_c52.length-1;i>=0;i--){if(_c52[i]){_c51.appendChild(_c52[i]);}}}});dojo.declare("dijit.form._SliderMover",dojo.dnd.Mover,{onMouseMove:function(e){var _c55=this.widget;var _c56=_c55._abspos;if(!_c56){_c56=_c55._abspos=dojo.coords(_c55.sliderBarContainer,true);_c55._setPixelValue_=dojo.hitch(_c55,"_setPixelValue");_c55._isReversed_=_c55._isReversed();}var _c57=e[_c55._mousePixelCoord]-_c56[_c55._startingPixelCoord];_c55._setPixelValue_(_c55._isReversed_?(_c56[_c55._pixelCount]-_c57):_c57,_c56[_c55._pixelCount],false);},destroy:function(e){dojo.dnd.Mover.prototype.destroy.apply(this,arguments);var _c59=this.widget;_c59.setValue(_c59.value,true);}});dojo.declare("dijit.form.HorizontalRule",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerH\"></div>",count:3,container:"containerNode",ruleStyle:"",_positionPrefix:"<div class=\"dijitRuleMark dijitRuleMarkH\" style=\"left:",_positionSuffix:"%;",_suffix:"\"></div>",_genHTML:function(pos,ndx){return this._positionPrefix+pos+this._positionSuffix+this.ruleStyle+this._suffix;},_isHorizontal:true,postCreate:function(){var _c5c;if(this.count==1){_c5c=this._genHTML(50,0);}else{var i;var _c5e=100/(this.count-1);if(!this._isHorizontal||this.isLeftToRight()){_c5c=this._genHTML(0,0);for(i=1;i<this.count-1;i++){_c5c+=this._genHTML(_c5e*i,i);}_c5c+=this._genHTML(100,this.count-1);}else{_c5c=this._genHTML(100,0);for(i=1;i<this.count-1;i++){_c5c+=this._genHTML(100-_c5e*i,i);}_c5c+=this._genHTML(0,this.count-1);}}this.domNode.innerHTML=_c5c;}});dojo.declare("dijit.form.VerticalRule",dijit.form.HorizontalRule,{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerV\"></div>",_positionPrefix:"<div class=\"dijitRuleMark dijitRuleMarkV\" style=\"top:",_isHorizontal:false});dojo.declare("dijit.form.HorizontalRuleLabels",dijit.form.HorizontalRule,{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerH\"></div>",labelStyle:"",labels:[],numericMargin:0,minimum:0,maximum:1,constraints:{pattern:"#%"},_positionPrefix:"<div class=\"dijitRuleLabelContainer dijitRuleLabelContainerH\" style=\"left:",_labelPrefix:"\"><span class=\"dijitRuleLabel dijitRuleLabelH\">",_suffix:"</span></div>",_calcPosition:function(pos){return pos;},_genHTML:function(pos,ndx){return this._positionPrefix+this._calcPosition(pos)+this._positionSuffix+this.labelStyle+this._labelPrefix+this.labels[ndx]+this._suffix;},getLabels:function(){var _c62=this.labels;if(!_c62.length){_c62=dojo.query("> li",this.srcNodeRef).map(function(node){return String(node.innerHTML);});}this.srcNodeRef.innerHTML="";if(!_c62.length&&this.count>1){var _c64=this.minimum;var inc=(this.maximum-_c64)/(this.count-1);for(var i=0;i<this.count;i++){_c62.push((i<this.numericMargin||i>=(this.count-this.numericMargin))?"":dojo.number.format(_c64,this.constraints));_c64+=inc;}}return _c62;},postMixInProperties:function(){this.inherited(arguments);this.labels=this.getLabels();this.count=this.labels.length;}});dojo.declare("dijit.form.VerticalRuleLabels",dijit.form.HorizontalRuleLabels,{templateString:"<div class=\"dijitRuleContainer dijitRuleContainerV\"></div>",_positionPrefix:"<div class=\"dijitRuleLabelContainer dijitRuleLabelContainerV\" style=\"top:",_labelPrefix:"\"><span class=\"dijitRuleLabel dijitRuleLabelV\">",_calcPosition:function(pos){return 100-pos;},_isHorizontal:false});}if(!dojo._hasResource["dojox.grid._data.dijitEditors"]){dojo._hasResource["dojox.grid._data.dijitEditors"]=true;dojo.provide("dojox.grid._data.dijitEditors");dojo.declare("dojox.grid.editors.Dijit",dojox.grid.editors.base,{editorClass:"dijit.form.TextBox",constructor:function(_c68){this.editor=null;this.editorClass=dojo.getObject(this.cell.editorClass||this.editorClass);},format:function(_c69,_c6a){this.needFormatNode(_c69,_c6a);return "<div></div>";},getValue:function(_c6b){return this.editor.getValue();},setValue:function(_c6c,_c6d){if(this.editor&&this.editor.setValue){this.editor.setValue(_c6d);}else{this.inherited(arguments);}},getEditorProps:function(_c6e){return dojo.mixin({},this.cell.editorProps||{},{constraints:dojo.mixin({},this.cell.constraint)||{},value:_c6e});},createEditor:function(_c6f,_c70,_c71){return new this.editorClass(this.getEditorProps(_c70),_c6f);},attachEditor:function(_c72,_c73,_c74){_c72.appendChild(this.editor.domNode);this.setValue(_c74,_c73);},formatNode:function(_c75,_c76,_c77){if(!this.editorClass){return _c76;}if(!this.editor){this.editor=this.createEditor.apply(this,arguments);}else{this.attachEditor.apply(this,arguments);}this.sizeEditor.apply(this,arguments);this.cell.grid.rowHeightChanged(_c77);this.focus();},sizeEditor:function(_c78,_c79,_c7a){var p=this.cell.getNode(_c7a),box=dojo.contentBox(p);dojo.marginBox(this.editor.domNode,{w:box.w});},focus:function(_c7d,_c7e){if(this.editor){setTimeout(dojo.hitch(this.editor,function(){dojox.grid.fire(this,"focus");}),0);}},_finish:function(_c7f){this.inherited(arguments);dojox.grid.removeNode(this.editor.domNode);}});dojo.declare("dojox.grid.editors.ComboBox",dojox.grid.editors.Dijit,{editorClass:"dijit.form.ComboBox",getEditorProps:function(_c80){var _c81=[];dojo.forEach(this.cell.options,function(o){_c81.push({name:o,value:o});});var _c83=new dojo.data.ItemFileReadStore({data:{identifier:"name",items:_c81}});return dojo.mixin({},this.cell.editorProps||{},{value:_c80,store:_c83});},getValue:function(){var e=this.editor;e.setDisplayedValue(e.getDisplayedValue());return e.getValue();}});dojo.declare("dojox.grid.editors.DateTextBox",dojox.grid.editors.Dijit,{editorClass:"dijit.form.DateTextBox",setValue:function(_c85,_c86){if(this.editor){this.editor.setValue(new Date(_c86));}else{this.inherited(arguments);}},getEditorProps:function(_c87){return dojo.mixin(this.inherited(arguments),{value:new Date(_c87)});}});dojo.declare("dojox.grid.editors.CheckBox",dojox.grid.editors.Dijit,{editorClass:"dijit.form.CheckBox",getValue:function(){return this.editor.checked;},setValue:function(_c88,_c89){if(this.editor&&this.editor.setAttribute){this.editor.setAttribute("checked",_c89);}else{this.inherited(arguments);}},sizeEditor:function(_c8a,_c8b,_c8c){return;}});dojo.declare("dojox.grid.editors.Editor",dojox.grid.editors.Dijit,{editorClass:"dijit.Editor",getEditorProps:function(_c8d){return dojo.mixin({},this.cell.editorProps||{},{height:this.cell.editorHeight||"100px"});},createEditor:function(_c8e,_c8f,_c90){var _c91=new this.editorClass(this.getEditorProps(_c8f),_c8e);_c91.setValue(_c8f);return _c91;},formatNode:function(_c92,_c93,_c94){this.inherited(arguments);var e=this.editor;e.open();if(this.cell.editorToolbar){dojo.place(e.toolbar.domNode,e.editingArea,"before");}}});}if(!dojo._hasResource["dojox.grid.Grid"]){dojo._hasResource["dojox.grid.Grid"]=true;dojo.provide("dojox.grid.Grid");dojo.declare("dojox.Grid",dojox.VirtualGrid,{model:"dojox.grid.data.Table",postCreate:function(){if(this.model){var m=this.model;if(dojo.isString(m)){m=dojo.getObject(m);}this.model=(dojo.isFunction(m))?new m():m;this._setModel(this.model);}this.inherited(arguments);},destroy:function(){this.setModel(null);this.inherited(arguments);},_structureChanged:function(){this.indexCellFields();this.inherited(arguments);},_setModel:function(_c97){this.model=_c97;if(this.model){this.model.observer(this);this.model.measure();this.indexCellFields();}},setModel:function(_c98){if(this.model){this.model.notObserver(this);}this._setModel(_c98);},get:function(_c99){return this.grid.model.getDatum(_c99,this.fieldIndex);},modelAllChange:function(){this.rowCount=(this.model?this.model.getRowCount():0);this.updateRowCount(this.rowCount);},modelRowChange:function(_c9a,_c9b){this.updateRow(_c9b);},modelDatumChange:function(_c9c,_c9d,_c9e){this.updateRow(_c9d);},modelFieldsChange:function(){this.indexCellFields();this.render();},modelInsertion:function(_c9f){this.updateRowCount(this.model.getRowCount());},modelRemoval:function(_ca0){this.updateRowCount(this.model.getRowCount());},getCellName:function(_ca1){var v=this.model.fields.values,i=_ca1.fieldIndex;return i>=0&&i<v.length&&v[i].name||this.inherited(arguments);},indexCellFields:function(){var _ca4=this.layout.cells;for(var i=0,c;_ca4&&(c=_ca4[i]);i++){if(dojo.isString(c.field)){c.fieldIndex=this.model.fields.indexOf(c.field);}}},refresh:function(){this.edit.cancel();this.model.measure();},canSort:function(_ca7){var f=this.getSortField(_ca7);return f&&this.model.canSort(f);},getSortField:function(_ca9){var c=this.getCell(this.getSortIndex(_ca9));return (c.fieldIndex+1)*(this.sortInfo>0?1:-1);},sort:function(){this.edit.apply();this.model.sort(this.getSortField());},addRow:function(_cab,_cac){this.edit.apply();var i=_cac||-1;if(i<0){i=this.selection.getFirstSelected()||0;}if(i<0){i=0;}this.model.insert(_cab,i);this.model.beginModifyRow(i);for(var j=0,c;((c=this.getCell(j))&&!c.editor);j++){}if(c&&c.editor){this.edit.setEditCell(c,i);this.focus.setFocusCell(c,i);}else{this.focus.setFocusCell(this.getCell(0),i);}},removeSelectedRows:function(){this.edit.apply();var s=this.selection.getSelected();if(s.length){this.model.remove(s);this.selection.clear();}},canEdit:function(_cb1,_cb2){return (this.model.canModify?this.model.canModify(_cb2):true);},doStartEdit:function(_cb3,_cb4){this.model.beginModifyRow(_cb4);this.onStartEdit(_cb3,_cb4);},doApplyCellEdit:function(_cb5,_cb6,_cb7){this.model.setDatum(_cb5,_cb6,_cb7);this.onApplyCellEdit(_cb5,_cb6,_cb7);},doCancelEdit:function(_cb8){this.model.cancelModifyRow(_cb8);this.onCancelEdit.apply(this,arguments);},doApplyEdit:function(_cb9){this.model.endModifyRow(_cb9);this.onApplyEdit(_cb9);},styleRowState:function(_cba){if(this.model.getState){var _cbb=this.model.getState(_cba.index),c="";for(var i=0,ss=["inflight","error","inserting"],s;s=ss[i];i++){if(_cbb[s]){c=" dojoxGrid-row-"+s;break;}}_cba.customClasses+=c;}},onStyleRow:function(_cc0){this.styleRowState(_cc0);this.inherited(arguments);}});dojox.Grid.markupFactory=function(_cc1,node,ctor){var d=dojo;var _cc5=function(n){var w=d.attr(n,"width")||"auto";if((w!="auto")&&(w.substr(-2)!="em")){w=parseInt(w)+"px";}return w;};if(!_cc1.model&&d.hasAttr(node,"store")){var _cc8=node.cloneNode(false);d.attr(_cc8,{"jsId":null,"dojoType":d.attr(node,"dataModelClass")||"dojox.grid.data.DojoData"});_cc1.model=d.parser.instantiate([_cc8])[0];}if(!_cc1.structure&&node.nodeName.toLowerCase()=="table"){_cc1.structure=d.query("> colgroup",node).map(function(cg){var sv=d.attr(cg,"span");var v={noscroll:(d.attr(cg,"noscroll")=="true")?true:false,__span:(!!sv?parseInt(sv):1),cells:[]};if(d.hasAttr(cg,"width")){v.width=_cc5(cg);}return v;});if(!_cc1.structure.length){_cc1.structure.push({__span:Infinity,cells:[]});}d.query("thead > tr",node).forEach(function(tr,_ccd){var _cce=0;var _ccf=0;var _cd0;var _cd1=null;d.query("> th",tr).map(function(th){if(!_cd1){_cd0=0;_cd1=_cc1.structure[0];}else{if(_cce>=(_cd0+_cd1.__span)){_ccf++;_cd0+=_cd1.__span;lastView=_cd1;_cd1=_cc1.structure[_ccf];}}var cell={name:d.trim(d.attr(th,"name")||th.innerHTML),field:d.trim(d.attr(th,"field")||""),colSpan:parseInt(d.attr(th,"colspan")||1)};_cce+=cell.colSpan;cell.field=cell.field||cell.name;cell.width=_cc5(th);if(!_cd1.cells[_ccd]){_cd1.cells[_ccd]=[];}_cd1.cells[_ccd].push(cell);});});}return new dojox.Grid(_cc1,node);};dojox.grid.Grid=dojox.Grid;}dojo.declare("civicrm.FilteringSelect",[dijit.form.FilteringSelect],{isValid:function(){return true;}});if(!dojo._hasResource["dojox.layout.ContentPane"]){dojo._hasResource["dojox.layout.ContentPane"]=true;dojo.provide("dojox.layout.ContentPane");(function(){if(dojo.isIE){var _cd4=/(AlphaImageLoader\([^)]*?src=(['"]))(?![a-z]+:|\/)([^\r\n;}]+?)(\2[^)]*\)\s*[;}]?)/g;}var _cd5=/(?:(?:@import\s*(['"])(?![a-z]+:|\/)([^\r\n;{]+?)\1)|url\(\s*(['"]?)(?![a-z]+:|\/)([^\r\n;]+?)\3\s*\))([a-z, \s]*[;}]?)/g;function adjustCssPaths(_cd6,_cd7){if(!_cd7||!_cd6){return;}if(_cd4){_cd7=_cd7.replace(_cd4,function(_cd8,pre,_cda,url,post){return pre+(new dojo._Url(_cd6,"./"+url).toString())+post;});}return _cd7.replace(_cd5,function(_cdd,_cde,_cdf,_ce0,_ce1,_ce2){if(_cdf){return "@import \""+(new dojo._Url(_cd6,"./"+_cdf).toString())+"\""+_ce2;}else{return "url("+(new dojo._Url(_cd6,"./"+_ce1).toString())+")"+_ce2;}});};var _ce3=/(<[a-z][a-z0-9]*\s[^>]*)(?:(href|src)=(['"]?)([^>]*?)\3|style=(['"]?)([^>]*?)\5)([^>]*>)/gi;function adjustHtmlPaths(_ce4,cont){var url=_ce4||"./";return cont.replace(_ce3,function(tag,_ce8,name,_cea,_ceb,_cec,_ced,end){return _ce8+(name?(name+"="+_cea+(new dojo._Url(url,_ceb).toString())+_cea):("style="+_cec+adjustCssPaths(url,_ced)+_cec))+end;});};function secureForInnerHtml(cont){return cont.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"");};function snarfStyles(_cf0,cont,_cf2){_cf2.attributes=[];return cont.replace(/(?:<style([^>]*)>([\s\S]*?)<\/style>|<link\s+(?=[^>]*rel=['"]?stylesheet)([^>]*?href=(['"])([^>]*?)\4[^>\/]*)\/?>)/gi,function(_cf3,_cf4,_cf5,_cf6,_cf7,href){var i,attr=(_cf4||_cf6||"").replace(/^\s*([\s\S]*?)\s*$/i,"$1");if(_cf5){i=_cf2.push(_cf0?adjustCssPaths(_cf0,_cf5):_cf5);}else{i=_cf2.push("@import \""+href+"\";");attr=attr.replace(/\s*(?:rel|href)=(['"])?[^\s]*\1\s*/gi,"");}if(attr){attr=attr.split(/\s+/);var _cfb={},tmp;for(var j=0,e=attr.length;j<e;j++){tmp=attr[j].split("=");_cfb[tmp[0]]=tmp[1].replace(/^\s*['"]?([\s\S]*?)['"]?\s*$/,"$1");}_cf2.attributes[i-1]=_cfb;}return "";});};function snarfScripts(cont,_d00){_d00.code="";function download(src){if(_d00.downloadRemote){dojo.xhrGet({url:src,sync:true,load:function(code){_d00.code+=code+";";},error:_d00.errBack});}};return cont.replace(/<script\s*(?![^>]*type=['"]?dojo)(?:[^>]*?(?:src=(['"]?)([^>]*?)\1[^>]*)?)*>([\s\S]*?)<\/script>/gi,function(_d03,_d04,src,code){if(src){download(src);}else{_d00.code+=code;}return "";});};function evalInGlobal(code,_d08){_d08=_d08||dojo.doc.body;var n=_d08.ownerDocument.createElement("script");n.type="text/javascript";_d08.appendChild(n);n.text=code;};dojo.declare("dojox.layout.ContentPane",dijit.layout.ContentPane,{adjustPaths:false,cleanContent:false,renderStyles:false,executeScripts:true,scriptHasHooks:false,constructor:function(){this.ioArgs={};this.ioMethod=dojo.xhrGet;this.onLoadDeferred=new dojo.Deferred();this.onUnloadDeferred=new dojo.Deferred();},postCreate:function(){this._setUpDeferreds();dijit.layout.ContentPane.prototype.postCreate.apply(this,arguments);},onExecError:function(e){},setContent:function(data){if(!this._isDownloaded){var _d0c=this._setUpDeferreds();}dijit.layout.ContentPane.prototype.setContent.apply(this,arguments);return _d0c;},cancel:function(){if(this._xhrDfd&&this._xhrDfd.fired==-1){this.onUnloadDeferred=null;}dijit.layout.ContentPane.prototype.cancel.apply(this,arguments);},_setUpDeferreds:function(){var _t=this,_d0e=function(){_t.cancel();};var _d0f=(_t.onLoadDeferred=new dojo.Deferred());var _d10=(_t._nextUnloadDeferred=new dojo.Deferred());return {cancel:_d0e,addOnLoad:function(func){_d0f.addCallback(func);},addOnUnload:function(func){_d10.addCallback(func);}};},_onLoadHandler:function(){dijit.layout.ContentPane.prototype._onLoadHandler.apply(this,arguments);if(this.onLoadDeferred){this.onLoadDeferred.callback(true);}},_onUnloadHandler:function(){this.isLoaded=false;this.cancel();if(this.onUnloadDeferred){this.onUnloadDeferred.callback(true);}dijit.layout.ContentPane.prototype._onUnloadHandler.apply(this,arguments);if(this._nextUnloadDeferred){this.onUnloadDeferred=this._nextUnloadDeferred;}},_onError:function(type,err){dijit.layout.ContentPane.prototype._onError.apply(this,arguments);if(this.onLoadDeferred){this.onLoadDeferred.errback(err);}},_prepareLoad:function(_d15){var _d16=this._setUpDeferreds();dijit.layout.ContentPane.prototype._prepareLoad.apply(this,arguments);return _d16;},_setContent:function(cont){var _d18=[];if(dojo.isString(cont)){if(this.adjustPaths&&this.href){cont=adjustHtmlPaths(this.href,cont);}if(this.cleanContent){cont=secureForInnerHtml(cont);}if(this.renderStyles||this.cleanContent){cont=snarfStyles(this.href,cont,_d18);}if(this.executeScripts){var _t=this,code,_d1b={downloadRemote:true,errBack:function(e){_t._onError.call(_t,"Exec","Error downloading remote script in \""+_t.id+"\"",e);}};cont=snarfScripts(cont,_d1b);code=_d1b.code;}var node=(this.containerNode||this.domNode),pre=post="",walk=0;switch(node.nodeName.toLowerCase()){case "tr":pre="<tr>";post="</tr>";walk+=1;case "tbody":case "thead":pre="<tbody>"+pre;post+="</tbody>";walk+=1;case "table":pre="<table>"+pre;post+="</table>";walk+=1;break;}if(walk){var n=node.ownerDocument.createElement("div");n.innerHTML=pre+cont+post;do{n=n.firstChild;}while(--walk);cont=n.childNodes;}}dijit.layout.ContentPane.prototype._setContent.call(this,cont);if(this._styleNodes&&this._styleNodes.length){while(this._styleNodes.length){dojo._destroyElement(this._styleNodes.pop());}}if(this.renderStyles&&_d18&&_d18.length){this._renderStyles(_d18);}if(this.executeScripts&&code){if(this.cleanContent){code=code.replace(/(<!--|(?:\/\/)?-->|<!\[CDATA\[|\]\]>)/g,"");}if(this.scriptHasHooks){code=code.replace(/_container_(?!\s*=[^=])/g,dijit._scopeName+".byId('"+this.id+"')");}try{evalInGlobal(code,(this.containerNode||this.domNode));}catch(e){this._onError("Exec","Error eval script in "+this.id+", "+e.message,e);}}},_renderStyles:function(_d21){this._styleNodes=[];var st,att,_d24,doc=this.domNode.ownerDocument;var head=doc.getElementsByTagName("head")[0];for(var i=0,e=_d21.length;i<e;i++){_d24=_d21[i];att=_d21.attributes[i];st=doc.createElement("style");st.setAttribute("type","text/css");for(var x in att){st.setAttribute(x,att[x]);}this._styleNodes.push(st);head.appendChild(st);if(st.styleSheet){st.styleSheet.cssText=_d24;}else{st.appendChild(doc.createTextNode(_d24));}}}});})();}if(!dojo._hasResource["civicrm.TitlePane"]){dojo._hasResource["civicrm.TitlePane"]=true;dojo.provide("civicrm.TitlePane");dojo.declare("civicrm.TitlePane",[dojox.layout.ContentPane,dijit._Templated],{title:"",open:true,duration:250,baseClass:"dijitTitlePane",templateString:"<div class=\"dijitTitlePane\">\n\t<div dojoAttachEvent=\"onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus\" tabindex=\"0\"\n\t\t\twaiRole=\"button\" class=\"dijitTitlePaneTitle\" dojoAttachPoint=\"focusNode\">\n\t\t<div dojoAttachPoint=\"arrowNode\" class=\"dijitInline dijitArrowNode\"><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span></div>\n\t\t<div dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" waiRole=\"region\" tabindex=\"-1\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc.  Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n",postCreate:function(){this.setTitle(this.title);if(!this.open){this.hideNode.style.display=this.wipeNode.style.display="none";}this._setCss();dojo.setSelectable(this.titleNode,false);this.inherited("postCreate",arguments);dijit.setWaiState(this.containerNode,"labelledby",this.titleNode.id);dijit.setWaiState(this.focusNode,"haspopup","true");var _d2a=this.hideNode,_d2b=this.wipeNode;this._wipeIn=dojo.fx.wipeIn({node:this.wipeNode,duration:this.duration,beforeBegin:function(){_d2a.style.display="";}});this._wipeOut=dojo.fx.wipeOut({node:this.wipeNode,duration:this.duration,onEnd:function(){_d2a.style.display="none";}});},setContent:function(_d2c){if(this._wipeOut.status()=="playing"){this.inherited("setContent",arguments);}else{if(this._wipeIn.status()=="playing"){this._wipeIn.stop();}dojo.marginBox(this.wipeNode,{h:dojo.marginBox(this.wipeNode).h});this.inherited("setContent",arguments);this._wipeIn.play();}},toggle:function(){dojo.forEach([this._wipeIn,this._wipeOut],function(_d2d){if(_d2d.status()=="playing"){_d2d.stop();}});this[this.open?"_wipeOut":"_wipeIn"].play();this.open=!this.open;this._loadCheck();this._setCss();},_setCss:function(){var _d2e=["dijitClosed","dijitOpen"];var _d2f=this.open;dojo.removeClass(this.focusNode,_d2e[!_d2f+0]);this.focusNode.className+=" "+_d2e[_d2f+0];this.arrowNodeInner.innerHTML=this.open?"-":"+";},_onTitleKey:function(e){if(e.keyCode==dojo.keys.ENTER||e.charCode==dojo.keys.SPACE){this.toggle();}else{if(e.keyCode==dojo.keys.DOWN_ARROW){if(this.open){this.containerNode.focus();e.preventDefault();}}}},_handleFocus:function(e){dojo[(e.type=="focus"?"addClass":"removeClass")](this.focusNode,this.baseClass+"Focused");},setTitle:function(_d32){this.titleNode.innerHTML=_d32;}});}dojo.i18n._preloadLocalizations("dojo.nls.commonWidgets",["es-es","es","hu","it-it","de","pt-br","pl","fr-fr","zh-cn","pt","en-us","zh","ru","xx","fr","zh-tw","it","cs","en-gb","de-de","ja-jp","ko-kr","ko","en","ROOT","ja"]);
/*  Copyright Mihai Bazon, 2002-2005  |  www.bazon.net/mishoo
 * -----------------------------------------------------------
 *
 * The DHTML Calendar, version 1.0 "It is happening again"
 *
 * Details and latest version at:
 * www.dynarch.com/projects/calendar
 *
 * This script is developed by Dynarch.com.  Visit us at www.dynarch.com.
 *
 * This script is distributed under the GNU Lesser General Public License.
 * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
 */

// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $

/** The Calendar object constructor. */
Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {
	// member variables
	this.activeDiv = null;
	this.currentDateEl = null;
	this.getDateStatus = null;
	this.getDateToolTip = null;
	this.getDateText = null;
	this.timeout = null;
	this.onSelected = onSelected || null;
	this.onClose = onClose || null;
	this.dragging = false;
	this.hidden = false;
	this.minYear = 1970;
	this.maxYear = 2050;
	this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];
	this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"];
	this.isPopup = true;
	this.weekNumbers = true;
	this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc.
	this.showsOtherMonths = false;
	this.dateStr = dateStr;
	this.ar_days = null;
	this.showsTime = false;
	this.time24 = true;
	this.yearStep = 2;
	this.hiliteToday = true;
	this.multiple = null;
	// HTML elements
	this.table = null;
	this.element = null;
	this.tbody = null;
	this.firstdayname = null;
	// Combo boxes
	this.monthsCombo = null;
	this.yearsCombo = null;
	this.hilitedMonth = null;
	this.activeMonth = null;
	this.hilitedYear = null;
	this.activeYear = null;
	// Information
	this.dateClicked = false;

	// one-time initializations
	if (typeof Calendar._SDN == "undefined") {
		// table of short day names
		if (typeof Calendar._SDN_len == "undefined")
			Calendar._SDN_len = 3;
		var ar = new Array();
		for (var i = 8; i > 0;) {
			ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);
		}
		Calendar._SDN = ar;
		// table of short month names
		if (typeof Calendar._SMN_len == "undefined")
			Calendar._SMN_len = 3;
		ar = new Array();
		for (var i = 12; i > 0;) {
			ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);
		}
		Calendar._SMN = ar;
	}
};

// ** constants

/// "static", needed for event handlers.
Calendar._C = null;

/// detect a special case of "web browser"
Calendar.is_ie = ( /msie/i.test(navigator.userAgent) &&
		   !/opera/i.test(navigator.userAgent) );

Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) );

/// detect Opera browser
Calendar.is_opera = /opera/i.test(navigator.userAgent);

/// detect KHTML-based browsers
Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);

// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
//        library, at some point.

Calendar.getAbsolutePos = function(el) {
	var SL = 0, ST = 0;
	var is_div = /^div$/i.test(el.tagName);
	if (is_div && el.scrollLeft)
		SL = el.scrollLeft;
	if (is_div && el.scrollTop)
		ST = el.scrollTop;
	var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };
	if (el.offsetParent) {
		var tmp = this.getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
};

Calendar.isRelated = function (el, evt) {
	var related = evt.relatedTarget;
	if (!related) {
		var type = evt.type;
		if (type == "mouseover") {
			related = evt.fromElement;
		} else if (type == "mouseout") {
			related = evt.toElement;
		}
	}
	while (related) {
		if (related == el) {
			return true;
		}
		related = related.parentNode;
	}
	return false;
};

Calendar.removeClass = function(el, className) {
	if (!(el && el.className)) {
		return;
	}
	var cls = el.className.split(" ");
	var ar = new Array();
	for (var i = cls.length; i > 0;) {
		if (cls[--i] != className) {
			ar[ar.length] = cls[i];
		}
	}
	el.className = ar.join(" ");
};

Calendar.addClass = function(el, className) {
	Calendar.removeClass(el, className);
	el.className += " " + className;
};

// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately.
Calendar.getElement = function(ev) {
	var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget;
	while (f.nodeType != 1 || /^div$/i.test(f.tagName))
		f = f.parentNode;
	return f;
};

Calendar.getTargetElement = function(ev) {
	var f = Calendar.is_ie ? window.event.srcElement : ev.target;
	while (f.nodeType != 1)
		f = f.parentNode;
	return f;
};

Calendar.stopEvent = function(ev) {
	ev || (ev = window.event);
	if (Calendar.is_ie) {
		ev.cancelBubble = true;
		ev.returnValue = false;
	} else {
		ev.preventDefault();
		ev.stopPropagation();
	}
	return false;
};

Calendar.addEvent = function(el, evname, func) {
	if (el.attachEvent) { // IE
		el.attachEvent("on" + evname, func);
	} else if (el.addEventListener) { // Gecko / W3C
		el.addEventListener(evname, func, true);
	} else {
		el["on" + evname] = func;
	}
};

Calendar.removeEvent = function(el, evname, func) {
	if (el.detachEvent) { // IE
		el.detachEvent("on" + evname, func);
	} else if (el.removeEventListener) { // Gecko / W3C
		el.removeEventListener(evname, func, true);
	} else {
		el["on" + evname] = null;
	}
};

Calendar.createElement = function(type, parent) {
	var el = null;
	if (document.createElementNS) {
		// use the XHTML namespace; IE won't normally get here unless
		// _they_ "fix" the DOM2 implementation.
		el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
	} else {
		el = document.createElement(type);
	}
	if (typeof parent != "undefined") {
		parent.appendChild(el);
	}
	return el;
};

// END: UTILITY FUNCTIONS

// BEGIN: CALENDAR STATIC FUNCTIONS

/** Internal -- adds a set of events to make some element behave like a button. */
Calendar._add_evs = function(el) {
	with (Calendar) {
		addEvent(el, "mouseover", dayMouseOver);
		addEvent(el, "mousedown", dayMouseDown);
		addEvent(el, "mouseout", dayMouseOut);
		if (is_ie) {
			addEvent(el, "dblclick", dayMouseDblClick);
			el.setAttribute("unselectable", true);
		}
	}
};

Calendar.findMonth = function(el) {
	if (typeof el.month != "undefined") {
		return el;
	} else if (typeof el.parentNode.month != "undefined") {
		return el.parentNode;
	}
	return null;
};

Calendar.findYear = function(el) {
	if (typeof el.year != "undefined") {
		return el;
	} else if (typeof el.parentNode.year != "undefined") {
		return el.parentNode;
	}
	return null;
};

Calendar.showMonthsCombo = function () {
	var cal = Calendar._C;
	if (!cal) {
		return false;
	}
	var cal = cal;
	var cd = cal.activeDiv;
	var mc = cal.monthsCombo;
	if (cal.hilitedMonth) {
		Calendar.removeClass(cal.hilitedMonth, "hilite");
	}
	if (cal.activeMonth) {
		Calendar.removeClass(cal.activeMonth, "active");
	}
	var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];
	Calendar.addClass(mon, "active");
	cal.activeMonth = mon;
	var s = mc.style;
	s.display = "block";
	if (cd.navtype < 0)
		s.left = cd.offsetLeft + "px";
	else {
		var mcw = mc.offsetWidth;
		if (typeof mcw == "undefined")
			// Konqueror brain-dead techniques
			mcw = 50;
		s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px";
	}
	s.top = (cd.offsetTop + cd.offsetHeight) + "px";
};

Calendar.showYearsCombo = function (fwd) {
	var cal = Calendar._C;
	if (!cal) {
		return false;
	}
	var cal = cal;
	var cd = cal.activeDiv;
	var yc = cal.yearsCombo;
	if (cal.hilitedYear) {
		Calendar.removeClass(cal.hilitedYear, "hilite");
	}
	if (cal.activeYear) {
		Calendar.removeClass(cal.activeYear, "active");
	}
	cal.activeYear = null;
	var Y = cal.date.getFullYear() + (fwd ? 1 : -1);
	var yr = yc.firstChild;
	var show = false;
	for (var i = 12; i > 0; --i) {
		if (Y >= cal.minYear && Y <= cal.maxYear) {
			yr.innerHTML = Y;
			yr.year = Y;
			yr.style.display = "block";
			show = true;
		} else {
			yr.style.display = "none";
		}
		yr = yr.nextSibling;
		Y += fwd ? cal.yearStep : -cal.yearStep;
	}
	if (show) {
		var s = yc.style;
		s.display = "block";
		if (cd.navtype < 0)
			s.left = cd.offsetLeft + "px";
		else {
			var ycw = yc.offsetWidth;
			if (typeof ycw == "undefined")
				// Konqueror brain-dead techniques
				ycw = 50;
			s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px";
		}
		s.top = (cd.offsetTop + cd.offsetHeight) + "px";
	}
};

// event handlers

Calendar.tableMouseUp = function(ev) {
	var cal = Calendar._C;
	if (!cal) {
		return false;
	}
	if (cal.timeout) {
		clearTimeout(cal.timeout);
	}
	var el = cal.activeDiv;
	if (!el) {
		return false;
	}
	var target = Calendar.getTargetElement(ev);
	ev || (ev = window.event);
	Calendar.removeClass(el, "active");
	if (target == el || target.parentNode == el) {
		Calendar.cellClick(el, ev);
	}
	var mon = Calendar.findMonth(target);
	var date = null;
	if (mon) {
		date = new Date(cal.date);
		if (mon.month != date.getMonth()) {
			date.setMonth(mon.month);
			cal.setDate(date);
			cal.dateClicked = false;
			cal.callHandler();
		}
	} else {
		var year = Calendar.findYear(target);
		if (year) {
			date = new Date(cal.date);
			if (year.year != date.getFullYear()) {
				date.setFullYear(year.year);
				cal.setDate(date);
				cal.dateClicked = false;
				cal.callHandler();
			}
		}
	}
	with (Calendar) {
		removeEvent(document, "mouseup", tableMouseUp);
		removeEvent(document, "mouseover", tableMouseOver);
		removeEvent(document, "mousemove", tableMouseOver);
		cal._hideCombos();
		_C = null;
		return stopEvent(ev);
	}
};

Calendar.tableMouseOver = function (ev) {
	var cal = Calendar._C;
	if (!cal) {
		return;
	}
	var el = cal.activeDiv;
	var target = Calendar.getTargetElement(ev);
	if (target == el || target.parentNode == el) {
		Calendar.addClass(el, "hilite active");
		Calendar.addClass(el.parentNode, "rowhilite");
	} else {
		if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2)))
			Calendar.removeClass(el, "active");
		Calendar.removeClass(el, "hilite");
		Calendar.removeClass(el.parentNode, "rowhilite");
	}
	ev || (ev = window.event);
	if (el.navtype == 50 && target != el) {
		var pos = Calendar.getAbsolutePos(el);
		var w = el.offsetWidth;
		var x = ev.clientX;
		var dx;
		var decrease = true;
		if (x > pos.x + w) {
			dx = x - pos.x - w;
			decrease = false;
		} else
			dx = pos.x - x;

		if (dx < 0) dx = 0;
		var range = el._range;
		var current = el._current;
		var count = Math.floor(dx / 10) % range.length;
		for (var i = range.length; --i >= 0;)
			if (range[i] == current)
				break;
		while (count-- > 0)
			if (decrease) {
				if (--i < 0)
					i = range.length - 1;
			} else if ( ++i >= range.length )
				i = 0;
		var newval = range[i];
		el.innerHTML = newval;

		cal.onUpdateTime();
	}
	var mon = Calendar.findMonth(target);
	if (mon) {
		if (mon.month != cal.date.getMonth()) {
			if (cal.hilitedMonth) {
				Calendar.removeClass(cal.hilitedMonth, "hilite");
			}
			Calendar.addClass(mon, "hilite");
			cal.hilitedMonth = mon;
		} else if (cal.hilitedMonth) {
			Calendar.removeClass(cal.hilitedMonth, "hilite");
		}
	} else {
		if (cal.hilitedMonth) {
			Calendar.removeClass(cal.hilitedMonth, "hilite");
		}
		var year = Calendar.findYear(target);
		if (year) {
			if (year.year != cal.date.getFullYear()) {
				if (cal.hilitedYear) {
					Calendar.removeClass(cal.hilitedYear, "hilite");
				}
				Calendar.addClass(year, "hilite");
				cal.hilitedYear = year;
			} else if (cal.hilitedYear) {
				Calendar.removeClass(cal.hilitedYear, "hilite");
			}
		} else if (cal.hilitedYear) {
			Calendar.removeClass(cal.hilitedYear, "hilite");
		}
	}
	return Calendar.stopEvent(ev);
};

Calendar.tableMouseDown = function (ev) {
	if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
		return Calendar.stopEvent(ev);
	}
};

Calendar.calDragIt = function (ev) {
	var cal = Calendar._C;
	if (!(cal && cal.dragging)) {
		return false;
	}
	var posX;
	var posY;
	if (Calendar.is_ie) {
		posY = window.event.clientY + document.body.scrollTop;
		posX = window.event.clientX + document.body.scrollLeft;
	} else {
		posX = ev.pageX;
		posY = ev.pageY;
	}
	cal.hideShowCovered();
	var st = cal.element.style;
	st.left = (posX - cal.xOffs) + "px";
	st.top = (posY - cal.yOffs) + "px";
	return Calendar.stopEvent(ev);
};

Calendar.calDragEnd = function (ev) {
	var cal = Calendar._C;
	if (!cal) {
		return false;
	}
	cal.dragging = false;
	with (Calendar) {
		removeEvent(document, "mousemove", calDragIt);
		removeEvent(document, "mouseup", calDragEnd);
		tableMouseUp(ev);
	}
	cal.hideShowCovered();
};

Calendar.dayMouseDown = function(ev) {
	var el = Calendar.getElement(ev);
	if (el.disabled) {
		return false;
	}
	var cal = el.calendar;
	cal.activeDiv = el;
	Calendar._C = cal;
	if (el.navtype != 300) with (Calendar) {
		if (el.navtype == 50) {
			el._current = el.innerHTML;
			addEvent(document, "mousemove", tableMouseOver);
		} else
			addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver);
		addClass(el, "hilite active");
		addEvent(document, "mouseup", tableMouseUp);
	} else if (cal.isPopup) {
		cal._dragStart(ev);
	}
	if (el.navtype == -1 || el.navtype == 1) {
		if (cal.timeout) clearTimeout(cal.timeout);
		cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
	} else if (el.navtype == -2 || el.navtype == 2) {
		if (cal.timeout) clearTimeout(cal.timeout);
		cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
	} else {
		cal.timeout = null;
	}
	return Calendar.stopEvent(ev);
};

Calendar.dayMouseDblClick = function(ev) {
	Calendar.cellClick(Calendar.getElement(ev), ev || window.event);
	if (Calendar.is_ie) {
		document.selection.empty();
	}
};

Calendar.dayMouseOver = function(ev) {
	var el = Calendar.getElement(ev);
	if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
		return false;
	}
	if (el.ttip) {
		if (el.ttip.substr(0, 1) == "_") {
			el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
		}
		el.calendar.tooltips.innerHTML = el.ttip;
	}
	if (el.navtype != 300) {
		Calendar.addClass(el, "hilite");
		if (el.caldate) {
			Calendar.addClass(el.parentNode, "rowhilite");
		}
	}
	return Calendar.stopEvent(ev);
};

Calendar.dayMouseOut = function(ev) {
	with (Calendar) {
		var el = getElement(ev);
		if (isRelated(el, ev) || _C || el.disabled)
			return false;
		removeClass(el, "hilite");
		if (el.caldate)
			removeClass(el.parentNode, "rowhilite");
		if (el.calendar)
			el.calendar.tooltips.innerHTML = _TT["SEL_DATE"];
		return stopEvent(ev);
	}
};

/**
 *  A generic "click" handler :) handles all types of buttons defined in this
 *  calendar.
 */
Calendar.cellClick = function(el, ev) {
	var cal = el.calendar;
	var closing = false;
	var newdate = false;
	var date = null;
	if (typeof el.navtype == "undefined") {
		if (cal.currentDateEl) {
			Calendar.removeClass(cal.currentDateEl, "selected");
			Calendar.addClass(el, "selected");
			closing = (cal.currentDateEl == el);
			if (!closing) {
				cal.currentDateEl = el;
			}
		}
		cal.date.setDateOnly(el.caldate);
		date = cal.date;
		var other_month = !(cal.dateClicked = !el.otherMonth);
		if (!other_month && !cal.currentDateEl)
			cal._toggleMultipleDate(new Date(date));
		else
			newdate = !el.disabled;
		// a date was clicked
		if (other_month)
			cal._init(cal.firstDayOfWeek, date);
	} else {
		if (el.navtype == 200) {
			Calendar.removeClass(el, "hilite");
			cal.callCloseHandler();
			return;
		}
		date = new Date(cal.date);
		if (el.navtype == 0)
			date.setDateOnly(new Date()); // TODAY
		// unless "today" was clicked, we assume no date was clicked so
		// the selected handler will know not to close the calenar when
		// in single-click mode.
		// cal.dateClicked = (el.navtype == 0);
		cal.dateClicked = false;
		var year = date.getFullYear();
		var mon = date.getMonth();
		function setMonth(m) {
			var day = date.getDate();
			var max = date.getMonthDays(m);
			if (day > max) {
				date.setDate(max);
			}
			date.setMonth(m);
		};
		switch (el.navtype) {
		    case 400:
			Calendar.removeClass(el, "hilite");
			var text = Calendar._TT["ABOUT"];
			if (typeof text != "undefined") {
				text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : "";
			} else {
				// FIXME: this should be removed as soon as lang files get updated!
				text = "Help and about box text is not translated into this language.\n" +
					"If you know this language and you feel generous please update\n" +
					"the corresponding file in \"lang\" subdir to match calendar-en.js\n" +
					"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n" +
					"Thank you!\n" +
					"http://dynarch.com/mishoo/calendar.epl\n";
			}
			alert(text);
			return;
		    case -2:
			if (year > cal.minYear) {
				date.setFullYear(year - 1);
			}
			break;
		    case -1:
			if (mon > 0) {
				setMonth(mon - 1);
			} else if (year-- > cal.minYear) {
				date.setFullYear(year);
				setMonth(11);
			}
			break;
		    case 1:
			if (mon < 11) {
				setMonth(mon + 1);
			} else if (year < cal.maxYear) {
				date.setFullYear(year + 1);
				setMonth(0);
			}
			break;
		    case 2:
			if (year < cal.maxYear) {
				date.setFullYear(year + 1);
			}
			break;
		    case 100:
			cal.setFirstDayOfWeek(el.fdow);
			return;
		    case 50:
			var range = el._range;
			var current = el.innerHTML;
			for (var i = range.length; --i >= 0;)
				if (range[i] == current)
					break;
			if (ev && ev.shiftKey) {
				if (--i < 0)
					i = range.length - 1;
			} else if ( ++i >= range.length )
				i = 0;
			var newval = range[i];
			el.innerHTML = newval;
			cal.onUpdateTime();
			return;
		    case 0:
			// TODAY will bring us here
			if ((typeof cal.getDateStatus == "function") &&
			    cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) {
				return false;
			}
			break;
		}
		if (!date.equalsTo(cal.date)) {
			cal.setDate(date);
			newdate = true;
		} else if (el.navtype == 0)
			newdate = closing = true;
	}
	if (newdate) {
		ev && cal.callHandler();
	}
	if (closing) {
		Calendar.removeClass(el, "hilite");
		ev && cal.callCloseHandler();
	}
};

// END: CALENDAR STATIC FUNCTIONS

// BEGIN: CALENDAR OBJECT FUNCTIONS

/**
 *  This function creates the calendar inside the given parent.  If _par is
 *  null than it creates a popup calendar inside the BODY element.  If _par is
 *  an element, be it BODY, then it creates a non-popup calendar (still
 *  hidden).  Some properties need to be set before calling this function.
 */
Calendar.prototype.create = function (_par) {
	var parent = null;
	if (! _par) {
		// default parent is the document body, in which case we create
		// a popup calendar.
		parent = document.getElementsByTagName("body")[0];
		this.isPopup = true;
	} else {
		parent = _par;
		this.isPopup = false;
	}
	this.date = this.dateStr ? new Date(this.dateStr) : new Date();

	var table = Calendar.createElement("table");
	this.table = table;
	table.cellSpacing = 0;
	table.cellPadding = 0;
	table.calendar = this;
	Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);

	var div = Calendar.createElement("div");
	this.element = div;
	div.className = "calendar";
	if (this.isPopup) {
		div.style.position = "absolute";
		div.style.display = "none";
	}
	div.appendChild(table);

	var thead = Calendar.createElement("thead", table);
	var cell = null;
	var row = null;

	var cal = this;
	var hh = function (text, cs, navtype) {
		cell = Calendar.createElement("td", row);
		cell.colSpan = cs;
		cell.className = "button";
		if (navtype != 0 && Math.abs(navtype) <= 2)
			cell.className += " nav";
		Calendar._add_evs(cell);
		cell.calendar = cal;
		cell.navtype = navtype;
		cell.innerHTML = "<div unselectable='on'>" + text + "</div>";
		return cell;
	};

	row = Calendar.createElement("tr", thead);
	var title_length = 6;
	(this.isPopup) && --title_length;
	(this.weekNumbers) && ++title_length;

	hh("?", 1, 400).ttip = Calendar._TT["INFO"];
	this.title = hh("", title_length, 300);
	this.title.className = "title";
	if (this.isPopup) {
		this.title.ttip = Calendar._TT["DRAG_TO_MOVE"];
		this.title.style.cursor = "move";
		hh("&#x00d7;", 1, 200).ttip = Calendar._TT["CLOSE"];
	}

	row = Calendar.createElement("tr", thead);
	row.className = "headrow";

	this._nav_py = hh("&#x00ab;", 1, -2);
	this._nav_py.ttip = Calendar._TT["PREV_YEAR"];

	this._nav_pm = hh("&#x2039;", 1, -1);
	this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];

	this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0);
	this._nav_now.ttip = Calendar._TT["GO_TODAY"];

	this._nav_nm = hh("&#x203a;", 1, 1);
	this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];

	this._nav_ny = hh("&#x00bb;", 1, 2);
	this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"];

	// day names
	row = Calendar.createElement("tr", thead);
	row.className = "daynames";
	if (this.weekNumbers) {
		cell = Calendar.createElement("td", row);
		cell.className = "name wn";
		cell.innerHTML = Calendar._TT["WK"];
	}
	for (var i = 7; i > 0; --i) {
		cell = Calendar.createElement("td", row);
		if (!i) {
			cell.navtype = 100;
			cell.calendar = this;
			Calendar._add_evs(cell);
		}
	}
	this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild;
	this._displayWeekdays();

	var tbody = Calendar.createElement("tbody", table);
	this.tbody = tbody;

	for (i = 6; i > 0; --i) {
		row = Calendar.createElement("tr", tbody);
		if (this.weekNumbers) {
			cell = Calendar.createElement("td", row);
		}
		for (var j = 7; j > 0; --j) {
			cell = Calendar.createElement("td", row);
			cell.calendar = this;
			Calendar._add_evs(cell);
		}
	}

	if (this.showsTime) {
		row = Calendar.createElement("tr", tbody);
		row.className = "time";

		cell = Calendar.createElement("td", row);
		cell.className = "time";
		cell.colSpan = 2;
		cell.innerHTML = Calendar._TT["TIME"] || "&nbsp;";

		cell = Calendar.createElement("td", row);
		cell.className = "time";
		cell.colSpan = this.weekNumbers ? 4 : 3;

		(function(){
			function makeTimePart(className, init, range_start, range_end) {
				var part = Calendar.createElement("span", cell);
				part.className = className;
				part.innerHTML = init;
				part.calendar = cal;
				part.ttip = Calendar._TT["TIME_PART"];
				part.navtype = 50;
				part._range = [];
				if (typeof range_start != "number")
					part._range = range_start;
				else {
					for (var i = range_start; i <= range_end; ++i) {
						var txt;
						if (i < 10 && range_end >= 10) txt = '0' + i;
						else txt = '' + i;
						part._range[part._range.length] = txt;
					}
				}
				Calendar._add_evs(part);
				return part;
			};
			var hrs = cal.date.getHours();
			var mins = cal.date.getMinutes();
			var t12 = !cal.time24;
			var pm = (hrs > 12);
			if (t12 && pm) hrs -= 12;
			var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23);
			var span = Calendar.createElement("span", cell);
			span.innerHTML = ":";
			span.className = "colon";
			var M = makeTimePart("minute", mins, 0, 59);
			var AP = null;
			cell = Calendar.createElement("td", row);
			cell.className = "time";
			cell.colSpan = 2;
			if (t12)
				AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]);
			else
				cell.innerHTML = "&nbsp;";

			cal.onSetTime = function() {
				var pm, hrs = this.date.getHours(),
					mins = this.date.getMinutes();
				if (t12) {
					pm = (hrs >= 12);
					if (pm) hrs -= 12;
					if (hrs == 0) hrs = 12;
					AP.innerHTML = pm ? "pm" : "am";
				}
				H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs;
				M.innerHTML = (mins < 10) ? ("0" + mins) : mins;
			};

			cal.onUpdateTime = function() {
				var date = this.date;
				var h = parseInt(H.innerHTML, 10);
				if (t12) {
					if (/pm/i.test(AP.innerHTML) && h < 12)
						h += 12;
					else if (/am/i.test(AP.innerHTML) && h == 12)
						h = 0;
				}
				var d = date.getDate();
				var m = date.getMonth();
				var y = date.getFullYear();
				date.setHours(h);
				date.setMinutes(parseInt(M.innerHTML, 10));
				date.setFullYear(y);
				date.setMonth(m);
				date.setDate(d);
				this.dateClicked = false;
				this.callHandler();
			};
		})();
	} else {
		this.onSetTime = this.onUpdateTime = function() {};
	}

	var tfoot = Calendar.createElement("tfoot", table);

	row = Calendar.createElement("tr", tfoot);
	row.className = "footrow";

	cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300);
	cell.className = "ttip";
	if (this.isPopup) {
		cell.ttip = Calendar._TT["DRAG_TO_MOVE"];
		cell.style.cursor = "move";
	}
	this.tooltips = cell;

	div = Calendar.createElement("div", this.element);
	this.monthsCombo = div;
	div.className = "combo";
	for (i = 0; i < Calendar._MN.length; ++i) {
		var mn = Calendar.createElement("div");
		mn.className = Calendar.is_ie ? "label-IEfix" : "label";
		mn.month = i;
		mn.innerHTML = Calendar._SMN[i];
		div.appendChild(mn);
	}

	div = Calendar.createElement("div", this.element);
	this.yearsCombo = div;
	div.className = "combo";
	for (i = 12; i > 0; --i) {
		var yr = Calendar.createElement("div");
		yr.className = Calendar.is_ie ? "label-IEfix" : "label";
		div.appendChild(yr);
	}

	this._init(this.firstDayOfWeek, this.date);
	parent.appendChild(this.element);
};

/** keyboard navigation, only for popup calendars */
Calendar._keyEvent = function(ev) {
	var cal = window._dynarch_popupCalendar;
	if (!cal || cal.multiple)
		return false;
	(Calendar.is_ie) && (ev = window.event);
	var act = (Calendar.is_ie || ev.type == "keypress"),
		K = ev.keyCode;
	if (ev.ctrlKey) {
		switch (K) {
		    case 37: // KEY left
			act && Calendar.cellClick(cal._nav_pm);
			break;
		    case 38: // KEY up
			act && Calendar.cellClick(cal._nav_py);
			break;
		    case 39: // KEY right
			act && Calendar.cellClick(cal._nav_nm);
			break;
		    case 40: // KEY down
			act && Calendar.cellClick(cal._nav_ny);
			break;
		    default:
			return false;
		}
	} else switch (K) {
	    case 32: // KEY space (now)
		Calendar.cellClick(cal._nav_now);
		break;
	    case 27: // KEY esc
		act && cal.callCloseHandler();
		break;
	    case 37: // KEY left
	    case 38: // KEY up
	    case 39: // KEY right
	    case 40: // KEY down
		if (act) {
			var prev, x, y, ne, el, step;
			prev = K == 37 || K == 38;
			step = (K == 37 || K == 39) ? 1 : 7;
			function setVars() {
				el = cal.currentDateEl;
				var p = el.pos;
				x = p & 15;
				y = p >> 4;
				ne = cal.ar_days[y][x];
			};setVars();
			function prevMonth() {
				var date = new Date(cal.date);
				date.setDate(date.getDate() - step);
				cal.setDate(date);
			};
			function nextMonth() {
				var date = new Date(cal.date);
				date.setDate(date.getDate() + step);
				cal.setDate(date);
			};
			while (1) {
				switch (K) {
				    case 37: // KEY left
					if (--x >= 0)
						ne = cal.ar_days[y][x];
					else {
						x = 6;
						K = 38;
						continue;
					}
					break;
				    case 38: // KEY up
					if (--y >= 0)
						ne = cal.ar_days[y][x];
					else {
						prevMonth();
						setVars();
					}
					break;
				    case 39: // KEY right
					if (++x < 7)
						ne = cal.ar_days[y][x];
					else {
						x = 0;
						K = 40;
						continue;
					}
					break;
				    case 40: // KEY down
					if (++y < cal.ar_days.length)
						ne = cal.ar_days[y][x];
					else {
						nextMonth();
						setVars();
					}
					break;
				}
				break;
			}
			if (ne) {
				if (!ne.disabled)
					Calendar.cellClick(ne);
				else if (prev)
					prevMonth();
				else
					nextMonth();
			}
		}
		break;
	    case 13: // KEY enter
		if (act)
			Calendar.cellClick(cal.currentDateEl, ev);
		break;
	    default:
		return false;
	}
	return Calendar.stopEvent(ev);
};

/**
 *  (RE)Initializes the calendar to the given date and firstDayOfWeek
 */
Calendar.prototype._init = function (firstDayOfWeek, date) {
	var today = new Date(),
		TY = today.getFullYear(),
		TM = today.getMonth(),
		TD = today.getDate();
	this.table.style.visibility = "hidden";
	var year = date.getFullYear();
	if (year < this.minYear) {
		year = this.minYear;
		date.setFullYear(year);
	} else if (year > this.maxYear) {
		year = this.maxYear;
		date.setFullYear(year);
	}
	this.firstDayOfWeek = firstDayOfWeek;
	this.date = new Date(date);
	var month = date.getMonth();
	var mday = date.getDate();
	var no_days = date.getMonthDays();

	// calendar voodoo for computing the first day that would actually be
	// displayed in the calendar, even if it's from the previous month.
	// WARNING: this is magic. ;-)
	date.setDate(1);
	var day1 = (date.getDay() - this.firstDayOfWeek) % 7;
	if (day1 < 0)
		day1 += 7;
	date.setDate(-day1);
	date.setDate(date.getDate() + 1);

	var row = this.tbody.firstChild;
	var MN = Calendar._SMN[month];
	var ar_days = this.ar_days = new Array();
	var weekend = Calendar._TT["WEEKEND"];
	var dates = this.multiple ? (this.datesCells = {}) : null;
	for (var i = 0; i < 6; ++i, row = row.nextSibling) {
		var cell = row.firstChild;
		if (this.weekNumbers) {
			cell.className = "day wn";
			cell.innerHTML = date.getWeekNumber();
			cell = cell.nextSibling;
		}
		row.className = "daysrow";
		var hasdays = false, iday, dpos = ar_days[i] = [];
		for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) {
			iday = date.getDate();
			var wday = date.getDay();
			cell.className = "day";
			cell.pos = i << 4 | j;
			dpos[j] = cell;
			var current_month = (date.getMonth() == month);
			if (!current_month) {
				if (this.showsOtherMonths) {
					cell.className += " othermonth";
					cell.otherMonth = true;
				} else {
					cell.className = "emptycell";
					cell.innerHTML = "&nbsp;";
					cell.disabled = true;
					continue;
				}
			} else {
				cell.otherMonth = false;
				hasdays = true;
			}
			cell.disabled = false;
			cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday;
			if (dates)
				dates[date.print("%Y%m%d")] = cell;
			if (this.getDateStatus) {
				var status = this.getDateStatus(date, year, month, iday);
				if (this.getDateToolTip) {
					var toolTip = this.getDateToolTip(date, year, month, iday);
					if (toolTip)
						cell.title = toolTip;
				}
				if (status === true) {
					cell.className += " disabled";
					cell.disabled = true;
				} else {
					if (/disabled/i.test(status))
						cell.disabled = true;
					cell.className += " " + status;
				}
			}
			if (!cell.disabled) {
				cell.caldate = new Date(date);
				cell.ttip = "_";
				if (!this.multiple && current_month
				    && iday == mday && this.hiliteToday) {
					cell.className += " selected";
					this.currentDateEl = cell;
				}
				if (date.getFullYear() == TY &&
				    date.getMonth() == TM &&
				    iday == TD) {
					cell.className += " today";
					cell.ttip += Calendar._TT["PART_TODAY"];
				}
				if (weekend.indexOf(wday.toString()) != -1)
					cell.className += cell.otherMonth ? " oweekend" : " weekend";
			}
		}
		if (!(hasdays || this.showsOtherMonths))
			row.className = "emptyrow";
	}
	this.title.innerHTML = Calendar._MN[month] + ", " + year;
	this.onSetTime();
	this.table.style.visibility = "visible";
	this._initMultipleDates();
	// PROFILE
	// this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms";
};

Calendar.prototype._initMultipleDates = function() {
	if (this.multiple) {
		for (var i in this.multiple) {
			var cell = this.datesCells[i];
			var d = this.multiple[i];
			if (!d)
				continue;
			if (cell)
				cell.className += " selected";
		}
	}
};

Calendar.prototype._toggleMultipleDate = function(date) {
	if (this.multiple) {
		var ds = date.print("%Y%m%d");
		var cell = this.datesCells[ds];
		if (cell) {
			var d = this.multiple[ds];
			if (!d) {
				Calendar.addClass(cell, "selected");
				this.multiple[ds] = date;
			} else {
				Calendar.removeClass(cell, "selected");
				delete this.multiple[ds];
			}
		}
	}
};

Calendar.prototype.setDateToolTipHandler = function (unaryFunction) {
	this.getDateToolTip = unaryFunction;
};

/**
 *  Calls _init function above for going to a certain date (but only if the
 *  date is different than the currently selected one).
 */
Calendar.prototype.setDate = function (date) {
	if (!date.equalsTo(this.date)) {
		this._init(this.firstDayOfWeek, date);
	}
};

/**
 *  Refreshes the calendar.  Useful if the "disabledHandler" function is
 *  dynamic, meaning that the list of disabled date can change at runtime.
 *  Just * call this function if you think that the list of disabled dates
 *  should * change.
 */
Calendar.prototype.refresh = function () {
	this._init(this.firstDayOfWeek, this.date);
};

/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */
Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) {
	this._init(firstDayOfWeek, this.date);
	this._displayWeekdays();
};

/**
 *  Allows customization of what dates are enabled.  The "unaryFunction"
 *  parameter must be a function object that receives the date (as a JS Date
 *  object) and returns a boolean value.  If the returned value is true then
 *  the passed date will be marked as disabled.
 */
Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) {
	this.getDateStatus = unaryFunction;
};

/** Customization of allowed year range for the calendar. */
Calendar.prototype.setRange = function (a, z) {
	this.minYear = a;
	this.maxYear = z;
};

/** Calls the first user handler (selectedHandler). */
Calendar.prototype.callHandler = function () {
	if (this.onSelected) {
		this.onSelected(this, this.date.print(this.dateFormat));
	}
};

/** Calls the second user handler (closeHandler). */
Calendar.prototype.callCloseHandler = function () {
	if (this.onClose) {
		this.onClose(this);
	}
	this.hideShowCovered();
};

/** Removes the calendar object from the DOM tree and destroys it. */
Calendar.prototype.destroy = function () {
	var el = this.element.parentNode;
	el.removeChild(this.element);
	Calendar._C = null;
	window._dynarch_popupCalendar = null;
};

/**
 *  Moves the calendar element to a different section in the DOM tree (changes
 *  its parent).
 */
Calendar.prototype.reparent = function (new_parent) {
	var el = this.element;
	el.parentNode.removeChild(el);
	new_parent.appendChild(el);
};

// This gets called when the user presses a mouse button anywhere in the
// document, if the calendar is shown.  If the click was outside the open
// calendar this function closes it.
Calendar._checkCalendar = function(ev) {
	var calendar = window._dynarch_popupCalendar;
	if (!calendar) {
		return false;
	}
	var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
	for (; el != null && el != calendar.element; el = el.parentNode);
	if (el == null) {
		// calls closeHandler which should hide the calendar.
		window._dynarch_popupCalendar.callCloseHandler();
		return Calendar.stopEvent(ev);
	}
};

/** Shows the calendar. */
Calendar.prototype.show = function () {
	var rows = this.table.getElementsByTagName("tr");
	for (var i = rows.length; i > 0;) {
		var row = rows[--i];
		Calendar.removeClass(row, "rowhilite");
		var cells = row.getElementsByTagName("td");
		for (var j = cells.length; j > 0;) {
			var cell = cells[--j];
			Calendar.removeClass(cell, "hilite");
			Calendar.removeClass(cell, "active");
		}
	}
	this.element.style.display = "block";
	this.hidden = false;
	if (this.isPopup) {
		window._dynarch_popupCalendar = this;
		Calendar.addEvent(document, "keydown", Calendar._keyEvent);
		Calendar.addEvent(document, "keypress", Calendar._keyEvent);
		Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
	}
	this.hideShowCovered();
};

/**
 *  Hides the calendar.  Also removes any "hilite" from the class of any TD
 *  element.
 */
Calendar.prototype.hide = function () {
	if (this.isPopup) {
		Calendar.removeEvent(document, "keydown", Calendar._keyEvent);
		Calendar.removeEvent(document, "keypress", Calendar._keyEvent);
		Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar);
	}
	this.element.style.display = "none";
	this.hidden = true;
	this.hideShowCovered();
};

/**
 *  Shows the calendar at a given absolute position (beware that, depending on
 *  the calendar element style -- position property -- this might be relative
 *  to the parent's containing rectangle).
 */
Calendar.prototype.showAt = function (x, y) {
	var s = this.element.style;
	s.left = x + "px";
	s.top = y + "px";
	this.show();
};

/** Shows the calendar near a given element. */
Calendar.prototype.showAtElement = function (el, opts) {
	var self = this;
	var p = Calendar.getAbsolutePos(el);
	if (!opts || typeof opts != "string") {
		this.showAt(p.x, p.y + el.offsetHeight);
		return true;
	}
	function fixPosition(box) {
		if (box.x < 0)
			box.x = 0;
		if (box.y < 0)
			box.y = 0;
		var cp = document.createElement("div");
		var s = cp.style;
		s.position = "absolute";
		s.right = s.bottom = s.width = s.height = "0px";
		document.body.appendChild(cp);
		var br = Calendar.getAbsolutePos(cp);
		document.body.removeChild(cp);
		if (Calendar.is_ie) {
			br.y += document.body.scrollTop;
			br.x += document.body.scrollLeft;
		} else {
			br.y += window.scrollY;
			br.x += window.scrollX;
		}
		var tmp = box.x + box.width - br.x;
		if (tmp > 0) box.x -= tmp;
		tmp = box.y + box.height - br.y;
		if (tmp > 0) box.y -= tmp;
	};
	this.element.style.display = "block";
	Calendar.continuation_for_the_fucking_khtml_browser = function() {
		var w = self.element.offsetWidth;
		var h = self.element.offsetHeight;
		self.element.style.display = "none";
		var valign = opts.substr(0, 1);
		var halign = "l";
		if (opts.length > 1) {
			halign = opts.substr(1, 1);
		}
		// vertical alignment
		switch (valign) {
		    case "T": p.y -= h; break;
		    case "B": p.y += el.offsetHeight; break;
		    case "C": p.y += (el.offsetHeight - h) / 2; break;
		    case "t": p.y += el.offsetHeight - h; break;
		    case "b": break; // already there
		}
		// horizontal alignment
		switch (halign) {
		    case "L": p.x -= w; break;
		    case "R": p.x += el.offsetWidth; break;
		    case "C": p.x += (el.offsetWidth - w) / 2; break;
		    case "l": p.x += el.offsetWidth - w; break;
		    case "r": break; // already there
		}
		p.width = w;
		p.height = h + 40;
		self.monthsCombo.style.display = "none";
		fixPosition(p);
		self.showAt(p.x, p.y);
	};
	if (Calendar.is_khtml)
		setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
	else
		Calendar.continuation_for_the_fucking_khtml_browser();
};

/** Customizes the date format. */
Calendar.prototype.setDateFormat = function (str) {
	this.dateFormat = str;
};

/** Customizes the tooltip date format. */
Calendar.prototype.setTtDateFormat = function (str) {
	this.ttDateFormat = str;
};

/**
 *  Tries to identify the date represented in a string.  If successful it also
 *  calls this.setDate which moves the calendar to the given date.
 */
Calendar.prototype.parseDate = function(str, fmt) {
	if (!fmt)
		fmt = this.dateFormat;
	this.setDate(Date.parseDate(str, fmt));
};

Calendar.prototype.hideShowCovered = function () {
	if (!Calendar.is_ie && !Calendar.is_opera)
		return;
	function getVisib(obj){
		var value = obj.style.visibility;
		if (!value) {
			if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C
				if (!Calendar.is_khtml)
					value = document.defaultView.
						getComputedStyle(obj, "").getPropertyValue("visibility");
				else
					value = '';
			} else if (obj.currentStyle) { // IE
				value = obj.currentStyle.visibility;
			} else
				value = '';
		}
		return value;
	};

	var tags = new Array("applet", "iframe", "select");
	var el = this.element;

	var p = Calendar.getAbsolutePos(el);
	var EX1 = p.x;
	var EX2 = el.offsetWidth + EX1;
	var EY1 = p.y;
	var EY2 = el.offsetHeight + EY1;

	for (var k = tags.length; k > 0; ) {
		var ar = document.getElementsByTagName(tags[--k]);
		var cc = null;

		for (var i = ar.length; i > 0;) {
			cc = ar[--i];

			p = Calendar.getAbsolutePos(cc);
			var CX1 = p.x;
			var CX2 = cc.offsetWidth + CX1;
			var CY1 = p.y;
			var CY2 = cc.offsetHeight + CY1;

			if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
				if (!cc.__msh_save_visibility) {
					cc.__msh_save_visibility = getVisib(cc);
				}
				cc.style.visibility = cc.__msh_save_visibility;
			} else {
				if (!cc.__msh_save_visibility) {
					cc.__msh_save_visibility = getVisib(cc);
				}
				cc.style.visibility = "hidden";
			}
		}
	}
};

/** Internal function; it displays the bar with the names of the weekday. */
Calendar.prototype._displayWeekdays = function () {
	var fdow = this.firstDayOfWeek;
	var cell = this.firstdayname;
	var weekend = Calendar._TT["WEEKEND"];
	for (var i = 0; i < 7; ++i) {
		cell.className = "day name";
		var realday = (i + fdow) % 7;
		if (i) {
			cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]);
			cell.navtype = 100;
			cell.calendar = this;
			cell.fdow = realday;
			Calendar._add_evs(cell);
		}
		if (weekend.indexOf(realday.toString()) != -1) {
			Calendar.addClass(cell, "weekend");
		}
		cell.innerHTML = Calendar._SDN[(i + fdow) % 7];
		cell = cell.nextSibling;
	}
};

/** Internal function.  Hides all combo boxes that might be displayed. */
Calendar.prototype._hideCombos = function () {
	this.monthsCombo.style.display = "none";
	this.yearsCombo.style.display = "none";
};

/** Internal function.  Starts dragging the element. */
Calendar.prototype._dragStart = function (ev) {
	if (this.dragging) {
		return;
	}
	this.dragging = true;
	var posX;
	var posY;
	if (Calendar.is_ie) {
		posY = window.event.clientY + document.body.scrollTop;
		posX = window.event.clientX + document.body.scrollLeft;
	} else {
		posY = ev.clientY + window.scrollY;
		posX = ev.clientX + window.scrollX;
	}
	var st = this.element.style;
	this.xOffs = posX - parseInt(st.left);
	this.yOffs = posY - parseInt(st.top);
	with (Calendar) {
		addEvent(document, "mousemove", calDragIt);
		addEvent(document, "mouseup", calDragEnd);
	}
};

// BEGIN: DATE OBJECT PATCHES

/** Adds the number of days array to the Date object. */
Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

/** Constants used for time computations */
Date.SECOND = 1000 /* milliseconds */;
Date.MINUTE = 60 * Date.SECOND;
Date.HOUR   = 60 * Date.MINUTE;
Date.DAY    = 24 * Date.HOUR;
Date.WEEK   =  7 * Date.DAY;

Date.parseDate = function(str, fmt) {
	var today = new Date();
	var y = 0;
	var m = -1;
	var d = 0;
	var a = str.split(/\W+/);
	var b = fmt.match(/%./g);
	var i = 0, j = 0;
	var hr = 0;
	var min = 0;
	for (i = 0; i < a.length; ++i) {
		if (!a[i])
			continue;
		switch (b[i]) {
		    case "%d":
		    case "%e":
			d = parseInt(a[i], 10);
			break;

		    case "%m":
			m = parseInt(a[i], 10) - 1;
			break;

		    case "%Y":
		    case "%y":
			y = parseInt(a[i], 10);
			(y < 100) && (y += (y > 29) ? 1900 : 2000);
			break;

		    case "%b":
		    case "%B":
			for (j = 0; j < 12; ++j) {
				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
			}
			break;

		    case "%H":
		    case "%I":
		    case "%k":
		    case "%l":
			hr = parseInt(a[i], 10);
			break;

		    case "%P":
		    case "%p":
			if (/pm/i.test(a[i]) && hr < 12)
				hr += 12;
			else if (/am/i.test(a[i]) && hr >= 12)
				hr -= 12;
			break;

		    case "%M":
			min = parseInt(a[i], 10);
			break;
		}
	}
	if (isNaN(y)) y = today.getFullYear();
	if (isNaN(m)) m = today.getMonth();
	if (isNaN(d)) d = today.getDate();
	if (isNaN(hr)) hr = today.getHours();
	if (isNaN(min)) min = today.getMinutes();
	if (y != 0 && m != -1 && d != 0)
		return new Date(y, m, d, hr, min, 0);
	y = 0; m = -1; d = 0;
	for (i = 0; i < a.length; ++i) {
		if (a[i].search(/[a-zA-Z]+/) != -1) {
			var t = -1;
			for (j = 0; j < 12; ++j) {
				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
			}
			if (t != -1) {
				if (m != -1) {
					d = m+1;
				}
				m = t;
			}
		} else if (parseInt(a[i], 10) <= 12 && m == -1) {
			m = a[i]-1;
		} else if (parseInt(a[i], 10) > 31 && y == 0) {
			y = parseInt(a[i], 10);
			(y < 100) && (y += (y > 29) ? 1900 : 2000);
		} else if (d == 0) {
			d = a[i];
		}
	}
	if (y == 0)
		y = today.getFullYear();
	if (m != -1 && d != 0)
		return new Date(y, m, d, hr, min, 0);
	return today;
};

/** Returns the number of days in the current month */
Date.prototype.getMonthDays = function(month) {
	var year = this.getFullYear();
	if (typeof month == "undefined") {
		month = this.getMonth();
	}
	if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
		return 29;
	} else {
		return Date._MD[month];
	}
};

/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function() {
	var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
	var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
	var time = now - then;
	return Math.floor(time / Date.DAY);
};

/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function() {
	var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
	var DoW = d.getDay();
	d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
	var ms = d.valueOf(); // GMT
	d.setMonth(0);
	d.setDate(4); // Thu in Week 1
	return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1;
};

/** Checks date and time equality */
Date.prototype.equalsTo = function(date) {
	return ((this.getFullYear() == date.getFullYear()) &&
		(this.getMonth() == date.getMonth()) &&
		(this.getDate() == date.getDate()) &&
		(this.getHours() == date.getHours()) &&
		(this.getMinutes() == date.getMinutes()));
};

/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function(date) {
	var tmp = new Date(date);
	this.setDate(1);
	this.setFullYear(tmp.getFullYear());
	this.setMonth(tmp.getMonth());
	this.setDate(tmp.getDate());
};

/** Prints the date in a string according to the given format. */
Date.prototype.print = function (str) {
	var m = this.getMonth();
	var d = this.getDate();
	var y = this.getFullYear();
	var wn = this.getWeekNumber();
	var w = this.getDay();
	var s = {};
	var hr = this.getHours();
	var pm = (hr >= 12);
	var ir = (pm) ? (hr - 12) : hr;
	var dy = this.getDayOfYear();
	if (ir == 0)
		ir = 12;
	var min = this.getMinutes();
	var sec = this.getSeconds();
	s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N]
	s["%A"] = Calendar._DN[w]; // full weekday name
	s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N]
	s["%B"] = Calendar._MN[m]; // full month name
	// FIXME: %c : preferred date and time representation for the current locale
	s["%C"] = 1 + Math.floor(y / 100); // the century number
	s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
	s["%e"] = d; // the day of the month (range 1 to 31)
	// FIXME: %D : american date style: %m/%d/%y
	// FIXME: %E, %F, %G, %g, %h (man strftime)
	s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
	s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
	s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
	s["%k"] = hr;		// hour, range 0 to 23 (24h format)
	s["%l"] = ir;		// hour, range 1 to 12 (12h format)
	s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
	s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
	s["%n"] = "\n";		// a newline character
	s["%p"] = pm ? "PM" : "AM";
	s["%P"] = pm ? "pm" : "am";
	// FIXME: %r : the time in am/pm notation %I:%M:%S %p
	// FIXME: %R : the time in 24-hour notation %H:%M
	s["%s"] = Math.floor(this.getTime() / 1000);
	s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
	s["%t"] = "\t";		// a tab character
	// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
	s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
	s["%u"] = w + 1;	// the day of the week (range 1 to 7, 1 = MON)
	s["%w"] = w;		// the day of the week (range 0 to 6, 0 = SUN)
	// FIXME: %x : preferred date representation for the current locale without the time
	// FIXME: %X : preferred time representation for the current locale without the date
	s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
	s["%Y"] = y;		// year with the century
	s["%%"] = "%";		// a literal '%' character

	var re = /%./g;
	if (!Calendar.is_ie5 && !Calendar.is_khtml)
		return str.replace(re, function (par) { return s[par] || par; });

	var a = str.match(re);
	for (var i = 0; i < a.length; i++) {
		var tmp = s[a[i]];
		if (tmp) {
			re = new RegExp(a[i], 'g');
			str = str.replace(re, tmp);
		}
	}

	return str;
};

Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
Date.prototype.setFullYear = function(y) {
	var d = new Date(this);
	d.__msh_oldSetFullYear(y);
	if (d.getMonth() != this.getMonth())
		this.setDate(28);
	this.__msh_oldSetFullYear(y);
};

// END: DATE OBJECT PATCHES


// global object that remembers the calendar
window._dynarch_popupCalendar = null;
/*  Copyright Mihai Bazon, 2002, 2003  |  http://dynarch.com/mishoo/
 * ---------------------------------------------------------------------------
 *
 * The DHTML Calendar
 *
 * Details and latest version at:
 * http://dynarch.com/mishoo/calendar.epl
 *
 * This script is distributed under the GNU Lesser General Public License.
 * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
 *
 * This file defines helper functions for setting up the calendar.  They are
 * intended to help non-programmers get a working calendar on their site
 * quickly.  This script should not be seen as part of the calendar.  It just
 * shows you what one can do with the calendar, while in the same time
 * providing a quick and simple method for setting it up.  If you need
 * exhaustive customization of the calendar creation process feel free to
 * modify this code to suit your needs (this is recommended and much better
 * than modifying calendar.js itself).
 */

// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $

/**
 *  This function "patches" an input field (or other element) to use a calendar
 *  widget for date selection.
 *
 *  The "params" is a single object that can have the following properties:
 *
 *    prop. name   | description
 *  -------------------------------------------------------------------------------------------------
 *   inputField    | the ID of an input field to store the date
 *   displayArea   | the ID of a DIV or other element to show the date
 *   button        | ID of a button or other element that will trigger the calendar
 *   eventName     | event that will trigger the calendar, without the "on" prefix (default: "click")
 *   ifFormat      | date format that will be stored in the input field
 *   daFormat      | the date format that will be used to display the date in displayArea
 *   singleClick   | (true/false) wether the calendar is in single click mode or not (default: true)
 *   firstDay      | numeric: 0 to 6.  "0" means display Sunday first, "1" means display Monday first, etc.
 *   align         | alignment (default: "Br"); if you don't know what's this see the calendar documentation
 *   range         | array with 2 elements.  Default: [1900, 2999] -- the range of years available
 *   weekNumbers   | (true/false) if it's true (default) the calendar will display week numbers
 *   flat          | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
 *   flatCallback  | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
 *   disableFunc   | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
 *   onSelect      | function that gets called when a date is selected.  You don't _have_ to supply this (the default is generally okay)
 *   onClose       | function that gets called when the calendar is closed.  [default]
 *   onUpdate      | function that gets called after the date is updated in the input field.  Receives a reference to the calendar.
 *   date          | the date that the calendar will be initially displayed to
 *   showsTime     | default: false; if true the calendar will include a time selector
 *   timeFormat    | the time format; can be "12" or "24", default is "12"
 *   electric      | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
 *   step          | configures the step of the years in drop-down boxes; default: 2
 *   position      | configures the calendar absolute position; default: null
 *   cache         | if "true" (but default: "false") it will reuse the same calendar object, where possible
 *   showOthers    | if "true" (but default: "false") it will show days from other months too
 *
 *  None of them is required, they all have default values.  However, if you
 *  pass none of "inputField", "displayArea" or "button" you'll get a warning
 *  saying "nothing to setup".
 */
Calendar.setup = function (params) {
    function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
    
    param_default("inputField",     null);
    param_default("displayArea",    null);
    param_default("button",         null);
    param_default("eventName",      "click");
    param_default("ifFormat",       "%Y/%m/%d %I %M %p");
    param_default("daFormat",       "%Y/%m/%d %I %M %p");
    param_default("singleClick",    true);
    param_default("disableFunc",    null);
    param_default("dateStatusFunc", params["disableFunc"]);	// takes precedence if both are defined
    param_default("dateText",       null);
    param_default("firstDay",       null);
    param_default("align",          "Br");
    param_default("range",          [1900, 2999]);
    param_default("weekNumbers",    true);
    param_default("flat",           null);
    param_default("flatCallback",   null);
    param_default("onSelect",       null);
    param_default("onClose",        null);
    param_default("onUpdate",       null);
    param_default("date",           null);
    param_default("showsTime",      false);
    param_default("timeFormat",     "24");
    param_default("electric",       true);
    param_default("step",           2);
    param_default("position",       null);
    param_default("cache",          false);
    param_default("showOthers",     false);
    param_default("multiple",       null);
    param_default("dateField",      null);
    param_default("monthField",     null);
    param_default("yearField",      null);
    param_default("hourField",      null);
    param_default("minuteField",    null);
    param_default("ampmField",      null);
    
    var tmp = ["inputField", "displayArea", "button", "dateField", "monthField", "yearField", "hourField", "minuteField", "ampmField"];
    for (var i in tmp) {
	if (typeof params[tmp[i]] == "string") {
	    params[tmp[i]] = document.getElementById(params[tmp[i]]);
	}
    }
    if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button || params.dateField || params.monthField || params.yearField)) {
	alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");
	return false;
    }
    
    function onSelect(cal) {
	var p = cal.params;
	var update = (cal.dateClicked || p.electric);
	/*if (update && p.inputField) {*/
	if (update && p.dateField) {
	    p.dateField.value   = Math.abs(cal.date.print("%d"));
	    p.monthField.value  = Math.abs(cal.date.print("%m"));
	    p.yearField.value   = Math.abs(cal.date.print("%Y"));

	    if (p.hourField) {
		p.hourField.value   = Math.abs(cal.date.print("%I"));
		p.minuteField.value = Math.abs(cal.date.print("%M"));
		p.ampmField.value   = cal.date.print("%p");
	    }
	    
	    if (typeof p.dateField.onchange == "function")
		p.dateField.onchange();
	    
	    if (typeof p.monthField.onchange == "function")
		p.monthField.onchange();
	    
	    if (typeof p.yearField.onchange == "function")
		p.yearField.onchange();


	    if (p.hourField) {
		if (typeof p.hourField.onchange == "function")
		    p.hourField.onchange();
		
		if (typeof p.minuteField.onchange == "function")
		    p.minuteField.onchange();
		
		if (typeof p.ampmField.onchange == "function") 
		    p.ampmField.onchange();
	    }
	    
	}
	if (update && p.displayArea)
	p.displayArea.innerHTML = cal.date.print(p.daFormat);
	if (update && typeof p.onUpdate == "function")
	p.onUpdate(cal);
	if (update && p.flat) {
	    if (typeof p.flatCallback == "function")
		p.flatCallback(cal);
	}
	if (update && p.singleClick && cal.dateClicked)
	cal.callCloseHandler();
    };
    
    if (params.flat != null) {
	if (typeof params.flat == "string")
	    params.flat = document.getElementById(params.flat);
	if (!params.flat) {
	    alert("Calendar.setup:\n  Flat specified but can't find parent.");
	    return false;
	}
	var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
	cal.showsOtherMonths = params.showOthers;
	cal.showsTime = params.showsTime;
	cal.time24 = (params.timeFormat == "24");
	cal.params = params;
	cal.weekNumbers = params.weekNumbers;
	cal.setRange(params.range[0], params.range[1]);
	cal.setDateStatusHandler(params.dateStatusFunc);
	cal.getDateText = params.dateText;
	if (params.ifFormat) {
	    cal.setDateFormat(params.ifFormat);
	}
	if (params.inputField && typeof params.inputField.value == "string") {
	    cal.parseDate(params.inputField.value);
	}
	cal.create(params.flat);
	cal.show();
	return false;
    }
    
    var triggerEl = params.button || params.displayArea || params.inputField;
    
    triggerEl["on" + params.eventName] = function() {
	var tempDate = '';
	if (params.yearField.value) {
	    /*tempDate = params.yearField.value + '/' + params.monthField.value + '/' + params.dateField.value ;*/
	    tempDate = params.yearField.value + '/' + params.monthField.value + '/' + params.dateField.value ;
	}

        if (params.hourField) {
	   tempDate = tempDate + ' ' + params.hourField.value  + ' ' + params.minuteField.value + ' ' + params.ampmField.value;
        }
	/*	var dateEl = params.inputField || params.displayArea;*/
	var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
	var mustCreate = false;
	var cal = window.calendar;
	
	if (params.yearField)
	params.date = Date.parseDate(tempDate || params.yearField.innerHTML, dateFmt);

	if (!(cal && params.cache)) {
	    window.calendar = cal = new Calendar(params.firstDay,
						 params.date,
						 params.onSelect || onSelect,
						 params.onClose || function(cal) { cal.hide(); });
	    cal.showsTime = params.showsTime;
	    cal.time24 = (params.timeFormat == "24");
	    cal.weekNumbers = params.weekNumbers;
	    mustCreate = true;
	} else {
	    if (params.date)
	    cal.setDate(params.date);
	    cal.hide();
	}
	if (params.multiple) {
	    cal.multiple = {};
	    for (var i = params.multiple.length; --i >= 0;) {
		var d = params.multiple[i];
		var ds = d.print("%Y%m%d");
		cal.multiple[ds] = d;
	    }
	}
	cal.showsOtherMonths = params.showOthers;
	cal.yearStep = params.step;
	cal.setRange(params.range[0], params.range[1]);
	cal.params = params;
	cal.setDateStatusHandler(params.dateStatusFunc);
	cal.getDateText = params.dateText;
	/*cal.setDateFormat(dateFmt);*/
	if (mustCreate)
	cal.create();
	cal.refresh();
	if (!params.position)
	cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
	else
	cal.showAt(params.position[0], params.position[1]);
	return false;
    };
    return cal;
};
;(function($){var _remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).triggerHandler("remove");return _remove.apply(this,arguments);};function isVisible(element){function checkStyles(element){var style=element.style;return(style.display!='none'&&style.visibility!='hidden');}
var visible=checkStyles(element);(visible&&$.each($.dir(element,'parentNode'),function(){return(visible=checkStyles(this));}));return visible;}
$.extend($.expr[':'],{data:function(a,i,m){return $.data(a,m[3]);},tabbable:function(a,i,m){var nodeName=a.nodeName.toLowerCase();return(a.tabIndex>=0&&(('a'==nodeName&&a.href)||(/input|select|textarea|button/.test(nodeName)&&'hidden'!=a.type&&!a.disabled))&&isVisible(a));}});$.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};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)));(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace][name]=function(element,options){var self=this;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(e,key,value){return self._setData(key,value);}).bind('getData.'+name,function(e,key){return self._getData(key);}).bind('remove',function(){return self.destroy();});this._init();};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName);},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');}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,e,data){var eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);e=e||$.event.fix({type:eventName,target:this.element[0]});return this.element.triggerHandler(eventName,[e,data],this.options[type]);}};$.widget.defaults={disabled:false};$.ui={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){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},cssCache:{},css:function(name){if($.ui.cssCache[name]){return $.ui.cssCache[name];}
var tmp=$('<div class="ui-gen">').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){}
return $.ui.cssCache[name];},disableSelection:function(el){return $(el).attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},enableSelection:function(el){return $(el).attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},hasScroll:function(e,a){if($(e).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(e[scroll]>0){return true;}
e[scroll]=1;has=(e[scroll]>0);e[scroll]=0;return has;}};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(e){return self._mouseDown(e);});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(e){(this._mouseStarted&&this._mouseUp(e));this._mouseDownEvent=e;var self=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(e)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true;}}
this._mouseMoveDelegate=function(e){return self._mouseMove(e);};this._mouseUpDelegate=function(e){return self._mouseUp(e);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false;},_mouseMove:function(e){if($.browser.msie&&!e.button){return this._mouseUp(e);}
if(this._mouseStarted){this._mouseDrag(e);return false;}
if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e));}
return!this._mouseStarted;},_mouseUp:function(e){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._mouseStop(e);}
return false;},_mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance);},_mouseDelayMet:function(e){return this.mouseDelayMet;},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{getHandle:function(e){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==e.target)handle=true;});return handle;},createHelper:function(){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[e])):(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;},_init:function(){if(this.options.helper=='original'&&!(/^(?:r|a|f)/).test(this.element.css("position")))
this.element[0].style.position='relative';(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass('ui-draggable-disabled'));this._mouseInit();},_mouseCapture:function(e){var o=this.options;if(this.helper||o.disabled||$(e.target).is('.ui-resizable-handle'))
return false;this.handle=this.getHandle(e);if(!this.handle)
return false;return true;},_mouseStart:function(e){var o=this.options;this.helper=this.createHelper();if($.ui.ddmanager)
$.ui.ddmanager.current=this;this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top};this.cacheScrollParents();this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&$.browser.mozilla)po={top:0,left:0};this.offset.parent={top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};if(this.cssPosition=="relative"){var p=this.element.position();this.offset.relative={top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollTopParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollLeftParent.scrollLeft()};}else{this.offset.relative={top:0,left:0};}
this.originalPosition=this._generatePosition(e);this.cacheHelperProportions();if(o.cursorAt)
this.adjustOffsetFromHelper(o.cursorAt);$.extend(this,{PAGEY_INCLUDES_SCROLL:(this.cssPosition=="absolute"&&(!this.scrollTopParent[0].tagName||(/(html|body)/i).test(this.scrollTopParent[0].tagName))),PAGEX_INCLUDES_SCROLL:(this.cssPosition=="absolute"&&(!this.scrollLeftParent[0].tagName||(/(html|body)/i).test(this.scrollLeftParent[0].tagName))),OFFSET_PARENT_NOT_SCROLL_PARENT_Y:this.scrollTopParent[0]!=this.offsetParent[0]&&!(this.scrollTopParent[0]==document&&(/(body|html)/i).test(this.offsetParent[0].tagName)),OFFSET_PARENT_NOT_SCROLL_PARENT_X:this.scrollLeftParent[0]!=this.offsetParent[0]&&!(this.scrollLeftParent[0]==document&&(/(body|html)/i).test(this.offsetParent[0].tagName))});if(o.containment)
this.setContainment();this._propagate("start",e);this.cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,e);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(e);return true;},cacheScrollParents:function(){this.scrollTopParent=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this.helper);this.scrollLeftParent=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this.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;},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.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];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)-this.offset.relative.left-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-(this.cssPosition=="fixed"||this.PAGEY_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_Y?0:this.scrollTopParent.scrollTop())*mod
+(this.cssPosition=="fixed"?$(document).scrollTop():0)*mod
+this.margins.top*mod),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-(this.cssPosition=="fixed"||this.PAGEX_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_X?0:this.scrollLeftParent.scrollLeft())*mod
+(this.cssPosition=="fixed"?$(document).scrollLeft():0)*mod
+this.margins.left*mod)};},_generatePosition:function(e){var o=this.options;var position={top:(e.pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+(this.cssPosition=="fixed"||this.PAGEY_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_Y?0:this.scrollTopParent.scrollTop())
-(this.cssPosition=="fixed"?$(document).scrollTop():0)),left:(e.pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+(this.cssPosition=="fixed"||this.PAGEX_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_X?0:this.scrollLeftParent.scrollLeft())
-(this.cssPosition=="fixed"?$(document).scrollLeft():0))};if(!this.originalPosition)return position;if(this.containment){if(position.left<this.containment[0])position.left=this.containment[0];if(position.top<this.containment[1])position.top=this.containment[1];if(position.left>this.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3];}
if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalPosition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(top<this.containment[1]||top>this.containment[3])?top:(!(top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPosition.left+Math.round((position.left-this.originalPosition.left)/o.grid[0])*o.grid[0];position.left=this.containment?(!(left<this.containment[0]||left>this.containment[2])?left:(!(left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}
return position;},_mouseDrag:function(e){this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");this.position=this._propagate("drag",e)||this.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,e);return false;},_mouseStop:function(e){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)
var dropped=$.ui.ddmanager.drop(this,e);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)||500,function(){self._propagate("stop",e);self._clear();});}else{this._propagate("stop",e);this._clear();}
return false;},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!='original'&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},plugins:{},uiHash:function(e){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options};},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.uiHash()]);if(n=="drag")this.positionAbs=this._convertPositionTo("absolute");return this.element.triggerHandler(n=="drag"?n:"drag"+n,[e,this.uiHash()],this.options[n]);},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();}}));$.extend($.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original",scope:"default",cssNamespace:"ui"}});$.ui.plugin.add("draggable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor);},stop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor);}});$.ui.plugin.add("draggable","zIndex",{start:function(e,ui){var t=$(ui.helper);if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex);},stop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex);}});$.ui.plugin.add("draggable","opacity",{start:function(e,ui){var t=$(ui.helper);if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity);},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity);}});$.ui.plugin.add("draggable","iframeFix",{start:function(e,ui){$(ui.options.iframeFix===true?"iframe":ui.options.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(e,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","scroll",{start:function(e,ui){var o=ui.options;var i=$(this).data("draggable");o.scrollSensitivity=o.scrollSensitivity||20;o.scrollSpeed=o.scrollSpeed||20;i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(this);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.overflowYOffset=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset();},drag:function(e,ui){var o=ui.options,scrolled=false;var i=$(this).data("draggable");if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if((i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY<o.scrollSensitivity)
i.overflowY[0].scrollTop=scrolled=i.overflowY[0].scrollTop+o.scrollSpeed;if(e.pageY-i.overflowYOffset.top<o.scrollSensitivity)
i.overflowY[0].scrollTop=scrolled=i.overflowY[0].scrollTop-o.scrollSpeed;}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if((i.overflowXOffset.left+i.overflowX[0].offsetWidth)-e.pageX<o.scrollSensitivity)
i.overflowX[0].scrollLeft=scrolled=i.overflowX[0].scrollLeft+o.scrollSpeed;if(e.pageX-i.overflowXOffset.left<o.scrollSensitivity)
i.overflowX[0].scrollLeft=scrolled=i.overflowX[0].scrollLeft-o.scrollSpeed;}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}
if(scrolled!==false)
$.ui.ddmanager.prepareOffsets(i,e);}});$.ui.plugin.add("draggable","snap",{start:function(e,ui){var inst=$(this).data("draggable");inst.snapElements=[];$(ui.options.snap.constructor!=String?(ui.options.snap.items||':data(draggable)'):ui.options.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=inst.element[0])inst.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(e,ui){var inst=$(this).data("draggable");var d=ui.options.snapTolerance||20;var x1=ui.absolutePosition.left,x2=x1+inst.helperProportions.width,y1=ui.absolutePosition.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,null,$.extend(inst.uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}
if(ui.options.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;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left;}
var first=(ts||bs||ls||rs);if(ui.options.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;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left;}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))
(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,null,$.extend(inst.uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","connectToSortable",{start:function(e,ui){var inst=$(this).data("draggable");inst.sortables=[];$(ui.options.connectToSortable).each(function(){if($.data(this,'sortable')){var sortable=$.data(this,'sortable');inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._propagate("activate",e,inst);}});},stop:function(e,ui){var inst=$(this).data("draggable");$.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(e);this.instance.element.triggerHandler("sortreceive",[e,$.extend(this.instance.ui(),{sender:inst.element})],this.instance.options["receive"]);this.instance.options.helper=this.instance.options._helper;}else{this.instance._propagate("deactivate",e,inst);}});},drag:function(e,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var l=o.left,r=l+o.width,t=o.top,b=t+o.height;return(l<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<r&&t<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<b);};$.each(inst.sortables,function(i){if(checkPos.call(inst,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];};e.target=this.instance.currentItem[0];this.instance._mouseCapture(e,true);this.instance._mouseStart(e,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._propagate("toSortable",e);}
if(this.instance.currentItem)this.instance._mouseDrag(e);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(e,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._propagate("fromSortable",e);}};});}});$.ui.plugin.add("draggable","stack",{start:function(e,ui){var group=$.makeArray($(ui.options.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||ui.options.stack.min)-(parseInt($(b).css("zIndex"),10)||ui.options.stack.min);});$(group).each(function(i){this.style.zIndex=ui.options.stack.min+i;});this[0].style.zIndex=ui.options.stack.min+group.length;}});})(jQuery);(function($){$.widget("ui.droppable",{_setData:function(key,value){if(key=='accept'){this.options.accept=value&&$.isFunction(value)?value:function(d){return d.is(accept);};}else{$.widget.prototype._setData.apply(this,arguments);}},_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.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-droppable"));},plugins:{},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,absolutePosition:c.positionAbs,options:this.options,element:this.element};},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-disabled").removeData("droppable").unbind(".droppable");},_over:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){$.ui.plugin.call(this,'over',[e,this.ui(draggable)]);this.element.triggerHandler("dropover",[e,this.ui(draggable)],this.options.over);}},_out:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){$.ui.plugin.call(this,'out',[e,this.ui(draggable)]);this.element.triggerHandler("dropout",[e,this.ui(draggable)],this.options.out);}},_drop:function(e,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,(draggable.currentItem||draggable.element))){$.ui.plugin.call(this,'drop',[e,this.ui(draggable)]);this.element.triggerHandler("drop",[e,this.ui(draggable)],this.options.drop);return this.element;}
return false;},_activate:function(e){var draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'activate',[e,this.ui(draggable)]);if(draggable)this.element.triggerHandler("dropactivate",[e,this.ui(draggable)],this.options.activate);},_deactivate:function(e){var draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'deactivate',[e,this.ui(draggable)]);if(draggable)this.element.triggerHandler("dropdeactivate",[e,this.ui(draggable)],this.options.deactivate);}});$.extend($.ui.droppable,{defaults:{disabled:false,tolerance:'intersect',scope:'default',cssNamespace:'ui'}});$.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':return(l<((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left)&&((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left)<r&&t<((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top)&&((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top)<b);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,e){var m=$.ui.ddmanager.droppables[t.options.scope];var type=e?e.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,(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=="dragstart"||type=="sortactivate")m[i]._activate.call(m[i],e);}},drop:function(draggable,e){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,e);if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){this.isout=1;this.isover=0;this._deactivate.call(this,e);}});return dropped;},drag:function(draggable,e){if(draggable.options.refreshPositions)$.ui.ddmanager.prepareOffsets(draggable,e);$.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,e);}
this[c]=1;this[c=='isout'?'isover':'isout']=0;this[c=="isover"?"_over":"_out"].call(this,e);if(parentInstance&&c=='isout'){parentInstance['isout']=0;parentInstance['isover']=1;parentInstance._over.call(parentInstance,e);}});}};$.ui.plugin.add("droppable","activeClass",{activate:function(e,ui){$(this).addClass(ui.options.activeClass);},deactivate:function(e,ui){$(this).removeClass(ui.options.activeClass);},drop:function(e,ui){$(this).removeClass(ui.options.activeClass);}});$.ui.plugin.add("droppable","hoverClass",{over:function(e,ui){$(this).addClass(ui.options.hoverClass);},out:function(e,ui){$(this).removeClass(ui.options.hoverClass);},drop:function(e,ui){$(this).removeClass(ui.options.hoverClass);}});})(jQuery);(function($){$.widget("ui.resizable",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;var elpos=this.element.css('position');this.originalElement=this.element;this.element.addClass("ui-resizable").css({position:/static/.test(elpos)?'relative':elpos});$.extend(o,{_aspectRatio:!!(o.aspectRatio),helper:o.helper||o.ghost||o.animate?o.helper||'proxy':null,knobHandles:o.knobHandles===true?'ui-resizable-knob-handle':o.knobHandles});var aBorder='1px solid #DEDEDE';o.defaultTheme={'ui-resizable':{display:'block'},'ui-resizable-handle':{position:'absolute',background:'#F2F2F2',fontSize:'0.1px'},'ui-resizable-n':{cursor:'n-resize',height:'4px',left:'0px',right:'0px',borderTop:aBorder},'ui-resizable-s':{cursor:'s-resize',height:'4px',left:'0px',right:'0px',borderBottom:aBorder},'ui-resizable-e':{cursor:'e-resize',width:'4px',top:'0px',bottom:'0px',borderRight:aBorder},'ui-resizable-w':{cursor:'w-resize',width:'4px',top:'0px',bottom:'0px',borderLeft:aBorder},'ui-resizable-se':{cursor:'se-resize',width:'4px',height:'4px',borderRight:aBorder,borderBottom:aBorder},'ui-resizable-sw':{cursor:'sw-resize',width:'4px',height:'4px',borderBottom:aBorder,borderLeft:aBorder},'ui-resizable-ne':{cursor:'ne-resize',width:'4px',height:'4px',borderRight:aBorder,borderTop:aBorder},'ui-resizable-nw':{cursor:'nw-resize',width:'4px',height:'4px',borderLeft:aBorder,borderTop:aBorder}};o.knobTheme={'ui-resizable-handle':{background:'#F2F2F2',border:'1px solid #808080',height:'8px',width:'8px'},'ui-resizable-n':{cursor:'n-resize',top:'0px',left:'45%'},'ui-resizable-s':{cursor:'s-resize',bottom:'0px',left:'45%'},'ui-resizable-e':{cursor:'e-resize',right:'0px',top:'45%'},'ui-resizable-w':{cursor:'w-resize',left:'0px',top:'45%'},'ui-resizable-se':{cursor:'se-resize',right:'0px',bottom:'0px'},'ui-resizable-sw':{cursor:'sw-resize',left:'0px',bottom:'0px'},'ui-resizable-nw':{cursor:'nw-resize',left:'0px',top:'0px'},'ui-resizable-ne':{cursor:'ne-resize',right:'0px',top:'0px'}};o._nodeName=this.element[0].nodeName;if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)){var el=this.element;if(/relative/.test(el.css('position'))&&$.browser.opera)
el.css({position:'relative',top:'auto',left:'auto'});el.wrap($('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')}));var oel=this.element;this.element=this.element.parent();this.element.data('resizable',this);this.element.css({marginLeft:oel.css("marginLeft"),marginTop:oel.css("marginTop"),marginRight:oel.css("marginRight"),marginBottom:oel.css("marginBottom")});oel.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if($.browser.safari&&o.preventDefault)oel.css('resize','none');o.proportionallyResize=oel.css({position:'static',zoom:1,display:'block'});this.element.css({margin:oel.css('margin')});this._proportionallyResize();}
if(!o.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(o.handles.constructor==String){o.zIndex=o.zIndex||1000;if(o.handles=='all')o.handles='n,e,s,w,se,sw,ne,nw';var n=o.handles.split(",");o.handles={};var insertionsDefault={handle:'position: absolute; display: none; overflow:hidden;',n:'top: 0pt; width:100%;',e:'right: 0pt; height:100%;',s:'bottom: 0pt; width:100%;',w:'left: 0pt; height:100%;',se:'bottom: 0pt; right: 0px;',sw:'bottom: 0pt; left: 0px;',ne:'top: 0pt; right: 0px;',nw:'top: 0pt; left: 0px;'};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),dt=o.defaultTheme,hname='ui-resizable-'+handle,loadDefault=!$.ui.css(hname)&&!o.knobHandles,userKnobClass=$.ui.css('ui-resizable-knob-handle'),allDefTheme=$.extend(dt[hname],dt['ui-resizable-handle']),allKnobTheme=$.extend(o.knobTheme[hname],!userKnobClass?o.knobTheme['ui-resizable-handle']:{});var applyZIndex=/sw|se|ne|nw/.test(handle)?{zIndex:++o.zIndex}:{};var defCss=(loadDefault?insertionsDefault[handle]:''),axis=$(['<div class="ui-resizable-handle ',hname,'" style="',defCss,insertionsDefault.handle,'"></div>'].join('')).css(applyZIndex);o.handles[handle]='.ui-resizable-'+handle;this.element.append(axis.css(loadDefault?allDefTheme:{}).css(o.knobHandles?allKnobTheme:{}).addClass(o.knobHandles?'ui-resizable-knob-handle':'').addClass(o.knobHandles));}
if(o.knobHandles)this.element.addClass('ui-resizable-knob').css(!$.ui.css('ui-resizable-knob')?{}:{});}
this._renderAxis=function(target){target=target||this.element;for(var i in o.handles){if(o.handles[i].constructor==String)
o.handles[i]=$(o.handles[i],this.element).show();if(o.transparent)
o.handles[i].css({opacity:0});if(this.element.is('.ui-wrapper')&&o._nodeName.match(/textarea|input|select|button/i)){var axis=$(o.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("");if(!o.transparent)
target.css(padPos,padWrapper);this._proportionallyResize();}
if(!$(o.handles[i]).length)continue;}};this._renderAxis(this.element);o._handles=$('.ui-resizable-handle',self.element);if(o.disableSelection)
o._handles.each(function(i,e){$.ui.disableSelection(e);});o._handles.mouseover(function(){if(!o.resizing){if(this.className)
var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=o.axis=axis&&axis[1]?axis[1]:'se';}});if(o.autoHide){o._handles.hide();$(self.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");o._handles.show();},function(){if(!o.resizing){$(this).addClass("ui-resizable-autohide");o._handles.hide();}});}
this._mouseInit();},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,options:this.options,originalSize:this.originalSize,originalPosition:this.originalPosition};},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);if(n!="resize")this.element.triggerHandler(["resize",n].join(""),[e,this.ui()],this.options[n]);},destroy:function(){var el=this.element,wrapped=el.children(".ui-resizable").get(0);this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();};_destroy(el);if(el.is('.ui-wrapper')&&wrapped){el.parent().append($(wrapped).css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')})).end().remove();_destroy(wrapped);}},_mouseCapture:function(e){if(this.options.disabled)return false;var handle=false;for(var i in this.options.handles){if($(this.options.handles[i])[0]==e.target)handle=true;}
if(!handle)return false;return true;},_mouseStart:function(e){var o=this.options,iniPos=this.element.position(),el=this.element,num=function(v){return parseInt(v,10)||0;},ie6=$.browser.msie&&$.browser.version<7;o.resizing=true;o.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){var sOffset=$.browser.msie&&!o.containment&&(/absolute/).test(el.css('position'))&&!(/relative/).test(el.parent().css('position'));var dscrollt=sOffset?o.documentScroll.top:0,dscrolll=sOffset?o.documentScroll.left:0;el.css({position:'absolute',top:(iniPos.top+dscrollt),left:(iniPos.left+dscrolll)});}
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=o.helper||ie6?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=o.helper||ie6?{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:e.pageX,top:e.pageY};o.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);if(o.preserveCursor)
$('body').css('cursor',this.axis+'-resize');this._propagate("start",e);return true;},_mouseDrag:function(e){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(e.pageX-smp.left)||0,dy=(e.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[e,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(o._aspectRatio||e.shiftKey)
data=this._updateRatio(data,e);data=this._respectSize(data,e);this._propagate("resize",e);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!o.helper&&o.proportionallyResize)
this._proportionallyResize();this._updateCache(data);this.element.triggerHandler("resize",[e,this.ui()],this.options["resize"]);return false;},_mouseStop:function(e){this.options.resizing=false;var o=this.options,num=function(v){return parseInt(v,10)||0;},self=this;if(o.helper){var pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ista&&$.ui.hasScroll(pr.get(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}));if(o.helper&&!o.animate)this._proportionallyResize();}
if(o.preserveCursor)
$('body').css('cursor','auto');this._propagate("stop",e);if(o.helper)this.helper.remove();return false;},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(data.left)this.position.left=data.left;if(data.top)this.position.top=data.top;if(data.height)this.size.height=data.height;if(data.width)this.size.width=data.width;},_updateRatio:function(data,e){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height*o.aspectRatio);else if(data.width)data.height=(csize.width/o.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,e){var el=this.helper,o=this.options,pRatio=o._aspectRatio||e.shiftKey,a=this.axis,ismaxw=data.width&&o.maxWidth&&o.maxWidth<data.width,ismaxh=data.height&&o.maxHeight&&o.maxHeight<data.height,isminw=data.width&&o.minWidth&&o.minWidth>data.width,isminh=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(!o.proportionallyResize)return;var prel=o.proportionallyResize,el=this.helper||this.element;if(!o.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')];o.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});}
prel.css({height:(el.height()-o.borderDif[0]-o.borderDif[2])+"px",width:(el.width()-o.borderDif[1]-o.borderDif[3])+"px"});},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(o.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(o.helper).css({width:el.outerWidth()+pxyoffset,height:el.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body");if(o.disableSelection)
$.ui.disableSelection(this.helper.get(0));}else{this.helper=el;}},_change:{e:function(e,dx,dy){return{width:this.originalSize.width+dx};},w:function(e,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(e,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(e,dx,dy){return{height:this.originalSize.height+dy};},se:function(e,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]));},sw:function(e,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]));},ne:function(e,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]));},nw:function(e,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]));}}}));$.extend($.ui.resizable,{defaults:{cancel:":input",distance:1,delay:0,preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autoHide:false,knobHandles:false}});$.ui.plugin.add("resizable","containment",{start:function(e,ui){var o=ui.options,self=$(this).data("resizable"),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{self.containerOffset=$(ce).offset();self.containerPosition=$(ce).position();self.containerSize={height:$(ce).innerHeight(),width:$(ce).innerWidth()};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(e,ui){var o=ui.options,self=$(this).data("resizable"),ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=o._aspectRatio||e.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&/static/.test(ce.css('position')))
cop=self.containerPosition;if(cp.left<(o.helper?co.left:cop.left)){self.size.width=self.size.width+(o.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:cop.left;}
if(cp.top<(o.helper?co.top:0)){self.size.height=self.size.height+(o.helper?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height*o.aspectRatio;self.position.top=o.helper?co.top:0;}
var woset=(o.helper?self.offset.left-co.left:(self.position.left-cop.left))+self.sizeDiff.width,hoset=(o.helper?self.offset.top-co.top:self.position.top)+self.sizeDiff.height;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width/o.aspectRatio;}
if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height*o.aspectRatio;}},stop:function(e,ui){var o=ui.options,self=$(this).data("resizable"),cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.innerWidth(),h=helper.innerHeight();if(o.helper&&!o.animate&&/relative/.test(ce.css('position')))
$(this).css({left:(ho.left-co.left),top:(ho.top-co.top),width:w,height:h});if(o.helper&&!o.animate&&/static/.test(ce.css('position')))
$(this).css({left:cop.left+(ho.left-co.left),top:cop.top+(ho.top-co.top),width:w,height:h});}});$.ui.plugin.add("resizable","grid",{resize:function(e,ui){var o=ui.options,self=$(this).data("resizable"),cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||e.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;}}});$.ui.plugin.add("resizable","animate",{stop:function(e,ui){var o=ui.options,self=$(this).data("resizable");var pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ista&&$.ui.hasScroll(pr.get(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||"slow",easing:o.animateEasing||"swing",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.css({width:data.width,height:data.height});self._updateCache(data);self._propagate("animate",e);}});}});$.ui.plugin.add("resizable","ghost",{start:function(e,ui){var o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize,cs=self.size;if(!pr)self.ghost=self.element.clone();else self.ghost=pr.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(e,ui){var o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(e,ui){var o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("resizable","alsoResize",{start:function(e,ui){var o=ui.options,self=$(this).data("resizable"),_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'){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(e,ui){var o=ui.options,self=$(this).data("resizable"),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 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;});$(this).css(style);});};if(typeof(o.alsoResize)=='object'){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(e,ui){$(this).removeData("resizable-alsoresize-start");}});})(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.width(),bottom:pos.top+$this.height(),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");},toggle:function(){if(this.options.disabled){this.enable();}else{this.disable();}},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();},_mouseStart:function(e){var self=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled)
return;var options=this.options;this.selectees=$(options.filter,this.element[0]);this.element.triggerHandler("selectablestart",[e,{"selectable":this.element[0],"options":options}],options.start);$('body').append(this.helper);this.helper.css({"z-index":100,"position":"absolute","left":e.clientX,"top":e.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(!e.metaKey){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting);}});var isSelectee=false;$(e.target).parents().andSelf().each(function(){if($.data(this,"selectable-item"))isSelectee=true;});return this.options.keyboard?!isSelectee:true;},_mouseDrag:function(e){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=e.pageX,y2=e.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.element.triggerHandler("selectableselecting",[e,{selectable:self.element[0],selecting:selectee.element,options:options}],options.selecting);}}else{if(selectee.selecting){if(e.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.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting);}}
if(selectee.selected){if(!e.metaKey&&!selectee.startselected){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting);}}}});return false;},_mouseStop:function(e){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.element.triggerHandler("selectableunselected",[e,{selectable:self.element[0],unselected:selectee.element,options:options}],options.unselected);});$('.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.element.triggerHandler("selectableselected",[e,{selectable:self.element[0],selected:selectee.element,options:options}],options.selected);});this.element.triggerHandler("selectablestop",[e,{selectable:self.element[0],options:this.options}],this.options.stop);this.helper.remove();return false;}}));$.extend($.ui.selectable,{defaults:{distance:1,delay:0,cancel:":input",appendTo:'body',autoRefresh:true,filter:'*',tolerance:'touch'}});})(jQuery);(function($){function contains(a,b){var safari2=$.browser.safari&&$.browser.version<522;if(a.contains&&!safari2){return a.contains(b);}
if(a.compareDocumentPosition)
return!!(a.compareDocumentPosition(b)&16);while(b=b.parentNode)
if(b==a)return true;return false;};$.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();},plugins:{},ui:function(inst){return{helper:(inst||this)["helper"],placeholder:(inst||this)["placeholder"]||$([]),position:(inst||this)["position"],absolutePosition:(inst||this)["positionAbs"],options:this.options,element:this.element,item:(inst||this)["currentItem"],sender:inst?inst.element:null};},_propagate:function(n,e,inst,noPropagation){$.ui.plugin.call(this,n,[e,this.ui(inst)]);if(!noPropagation)this.element.triggerHandler(n=="sort"?n:"sort"+n,[e,this.ui(inst)],this.options[n]);},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(this.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=[];items.each(function(){ret.push($(this).attr(o.attr||'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=="guess"&&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);}},_intersectsWithEdge: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.tolerance=="guess"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){if(!isOverElement)return false;if(this.floating){if((x1+dxClick)>l&&(x1+dxClick)<l+item.width/2)return 2;if((x1+dxClick)>l+item.width/2&&(x1+dxClick)<r)return 1;}else{var height=item.height;var direction=y1-this.updateOriginalPosition.top<0?2:1;if(direction==1&&(y1+dyClick)<t+height/2){return 2;}
else if(direction==2&&(y1+dyClick)>t+height/2){return 1;}}}else{if(!(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b))return false;if(this.floating){if(x2>l&&x1<l)return 2;if(x1<r&&x2>r)return 1;}else{if(y2>t&&y1<t)return 1;if(y1<b&&y2>b)return 2;}}
return false;},refresh:function(){this._refreshItems();this.refreshPositions();},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];if(this.options.connectWith&&connected){for(var i=this.options.connectWith.length-1;i>=0;i--){var cur=$(this.options.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(){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element),this]];if(this.options.connectWith){for(var i=this.options.connectWith.length-1;i>=0;i--){var cur=$(this.options.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),inst]);this.containers.push(inst);}};};}
for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){$.data(this,'sortable-item',queries[i][1]);items.push({item:$(this),instance:queries[i][1],width:0,height:0,left:0,top:0});});};},refreshPositions:function(fast){if(this.offsetParent){var po=this.offsetParent.offset();this.offset.parent={top:po.top+this.offsetParentBorders.top,left:po.left+this.offsetParentBorders.left};}
for(var i=this.items.length-1;i>=0;i--){if(this.items[i].instance!=this.currentContainer&&this.currentContainer&&this.items[i].item[0]!=this.currentItem[0])
continue;var t=this.options.toleranceElement?$(this.options.toleranceElement,this.items[i].item):this.items[i].item;if(!fast){this.items[i].width=t[0].offsetWidth;this.items[i].height=t[0].offsetHeight;}
var p=t.offset();this.items[i].left=p.left;this.items[i].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();};}},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");},_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||"ui-sortable-placeholder")[0];if(!className){el.style.visibility="hidden";document.body.appendChild(el);el.innerHTML=self.currentItem[0].innerHTML;document.body.removeChild(el);};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.parent()[0].appendChild(self.placeholder[0]);self.placeholder[0].parentNode.insertBefore(self.placeholder[0],self.currentItem[0]);o.placeholder.update(self,self.placeholder);},_contactContainers:function(e){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(!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.options.sortIndicator.call(this,e,itemWithLeastDistance,null,true):this.options.sortIndicator.call(this,e,null,this.containers[i].element,true);this._propagate("change",e);this.containers[i]._propagate("change",e,this);this.options.placeholder.update(this.currentContainer,this.placeholder);}
this.containers[i]._propagate("over",e,this);this.containers[i].containerCache.over=1;}}else{if(this.containers[i].containerCache.over){this.containers[i]._propagate("out",e,this);this.containers[i].containerCache.over=0;}}};},_mouseCapture:function(e,overrideHandle){if(this.options.disabled||this.options.type=='static')return false;this._refreshItems();var currentItem=null,self=this,nodes=$(e.target).parents().each(function(){if($.data(this,'sortable-item')==self){currentItem=$(this);return false;}});if($.data(e.target,'sortable-item')==self)currentItem=$(e.target);if(!currentItem)return false;if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==e.target)validHandle=true;});if(!validHandle)return false;}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},createHelper:function(e){var o=this.options;var helper=typeof o.helper=='function'?$(o.helper.apply(this.element[0],[e,this.currentItem])):(o.helper=="original"?this.currentItem:this.currentItem.clone());if(!helper.parents('body').length)
$(o.appendTo!='parent'?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);return helper;},_mouseStart:function(e,overrideHandle,noActivation){var o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this.createHelper(e);this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();this.offsetParentBorders={top:(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};this.offset.parent={top:po.top+this.offsetParentBorders.top,left:po.left+this.offsetParentBorders.left};this.updateOriginalPosition=this.originalPosition=this._generatePosition(e);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(o.helper=="original"){this._storedCSS={position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left"),clear:this.currentItem.css("clear")};}else{this.currentItem.hide();}
this.helper.css({position:'absolute',clear:'both'}).addClass('ui-sortable-helper');this._createPlaceholder();this._propagate("start",e);if(!this._preserveHelperProportions)
this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(o.cursorAt){if(o.cursorAt.left!=undefined)this.offset.click.left=o.cursorAt.left;if(o.cursorAt.right!=undefined)this.offset.click.left=this.helperProportions.width-o.cursorAt.right;if(o.cursorAt.top!=undefined)this.offset.click.top=o.cursorAt.top;if(o.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-o.cursorAt.bottom;}
if(o.containment){if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.parent.left,0-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];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)-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.parent.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.currentItem.css("marginRight"),10)||0),co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.currentItem.css("marginBottom"),10)||0)];}}
if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._propagate("activate",e,this);}}
if($.ui.ddmanager)
$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,e);this.dragging=true;this._mouseDrag(e);return true;},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;return{top:(pos.top
+this.offset.parent.top*mod
-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*mod
+this.margins.top*mod),left:(pos.left
+this.offset.parent.left*mod
-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*mod
+this.margins.left*mod)};},_generatePosition:function(e){var o=this.options;var position={top:(e.pageY
-this.offset.click.top
-this.offset.parent.top
+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)),left:(e.pageX
-this.offset.click.left
-this.offset.parent.left
+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition)return position;if(this.containment){if(position.left<this.containment[0])position.left=this.containment[0];if(position.top<this.containment[1])position.top=this.containment[1];if(position.left>this.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3];}
if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalPosition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(top<this.containment[1]||top>this.containment[3])?top:(!(top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPosition.left+Math.round((position.left-this.originalPosition.left)/o.grid[0])*o.grid[0];position.left=this.containment?(!(left<this.containment[0]||left>this.containment[2])?left:(!(left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}
return position;},_mouseDrag:function(e){this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");$.ui.plugin.call(this,"sort",[e,this.ui()]);this.positionAbs=this._convertPositionTo("absolute");this.helper[0].style.left=this.position.left+'px';this.helper[0].style.top=this.position.top+'px';for(var i=this.items.length-1;i>=0;i--){var intersection=this._intersectsWithEdge(this.items[i]);if(!intersection)continue;if(this.items[i].item[0]!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=this.items[i].item[0]&&!contains(this.placeholder[0],this.items[i].item[0])&&(this.options.type=='semi-dynamic'?!contains(this.element[0],this.items[i].item[0]):true)){this.updateOriginalPosition=this._generatePosition(e);this.direction=intersection==1?"down":"up";this.options.sortIndicator.call(this,e,this.items[i]);this._propagate("change",e);break;}}
this._contactContainers(e);if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);this.element.triggerHandler("sort",[e,this.ui()],this.options["sort"]);return false;},_rearrange:function(e,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);},_mouseStop:function(e,noPropagation){if($.ui.ddmanager&&!this.options.dropBehaviour)
$.ui.ddmanager.drop(this,e);if(this.options.revert){var self=this;var cur=self.placeholder.offset();$(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(e);});}else{this._clear(e,noPropagation);}
return false;},_clear:function(e,noPropagation){if(!this._noFinalSort)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.options.helper=="original")
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else
this.currentItem.show();if(this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])this._propagate("update",e,null,noPropagation);if(!contains(this.element[0],this.currentItem[0])){this._propagate("remove",e,null,noPropagation);for(var i=this.containers.length-1;i>=0;i--){if(contains(this.containers[i].element[0],this.currentItem[0])){this.containers[i]._propagate("update",e,this,noPropagation);this.containers[i]._propagate("receive",e,this,noPropagation);}};};for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._propagate("deactivate",e,this,noPropagation);if(this.containers[i].containerCache.over){this.containers[i]._propagate("out",e,this);this.containers[i].containerCache.over=0;}}
this.dragging=false;if(this.cancelHelperRemoval){this._propagate("beforeStop",e,null,noPropagation);this._propagate("stop",e,null,noPropagation);return false;}
this._propagate("beforeStop",e,null,noPropagation);this.placeholder.remove();if(this.options.helper!="original")this.helper.remove();this.helper=null;this._propagate("stop",e,null,noPropagation);return true;}}));$.extend($.ui.sortable,{getter:"serialize toArray",defaults:{helper:"original",tolerance:"guess",distance:1,delay:0,scroll:true,scrollSensitivity:20,scrollSpeed:20,cancel:":input",items:'> *',zIndex:1000,dropOnEmpty:true,appendTo:"parent",sortIndicator:$.ui.sortable.prototype._rearrange,scope:"default",forcePlaceholderSize:false}});$.ui.plugin.add("sortable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor);},beforeStop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor);}});$.ui.plugin.add("sortable","zIndex",{start:function(e,ui){var t=ui.helper;if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex);},beforeStop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex);}});$.ui.plugin.add("sortable","opacity",{start:function(e,ui){var t=ui.helper;if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity);},beforeStop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity);}});$.ui.plugin.add("sortable","scroll",{start:function(e,ui){var o=ui.options;var i=$(this).data("sortable");i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(i.currentItem);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent();}while(el[0].parentNode);return $(document);}(i.currentItem);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.overflowYOffset=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset();},sort:function(e,ui){var o=ui.options;var i=$(this).data("sortable");if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if((i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY<o.scrollSensitivity)
i.overflowY[0].scrollTop=i.overflowY[0].scrollTop+o.scrollSpeed;if(e.pageY-i.overflowYOffset.top<o.scrollSensitivity)
i.overflowY[0].scrollTop=i.overflowY[0].scrollTop-o.scrollSpeed;}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)
$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)
$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if((i.overflowXOffset.left+i.overflowX[0].offsetWidth)-e.pageX<o.scrollSensitivity)
i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft+o.scrollSpeed;if(e.pageX-i.overflowXOffset.left<o.scrollSensitivity)
i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft-o.scrollSpeed;}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)
$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)
$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}});$.ui.plugin.add("sortable","axis",{sort:function(e,ui){var i=$(this).data("sortable");if(ui.options.axis=="y")i.position.left=i.originalPosition.left;if(ui.options.axis=="x")i.position.top=i.originalPosition.top;}});})(jQuery);(function($){$.widget("ui.accordion",{_init:function(){var options=this.options;if(options.navigation){var current=this.element.find("a").filter(options.navigationFilter);if(current.length){if(current.filter(options.header).length){options.active=current;}else{options.active=current.parent().parent().prev();current.addClass("current");}}}
options.headers=this.element.find(options.header);options.active=findActive(options.headers,options.active);if($.browser.msie){this.element.find('a').css('zoom','1');}
if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");$('<span class="ui-accordion-left"/>').insertBefore(options.headers);$('<span class="ui-accordion-right"/>').appendTo(options.headers);options.headers.addClass("ui-accordion-header").attr("tabindex","0");}
var maxHeight;if(options.fillSpace){maxHeight=this.element.parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight();});var maxPadding=0;options.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height());}).height(maxHeight-maxPadding);}else if(options.autoHeight){maxHeight=0;options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight());}).height(maxHeight);}
options.headers.not(options.active||"").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event){this.element.bind((options.event)+".accordion",clickHandler);}},activate:function(index){clickHandler.call(this.element[0],{target:findActive(this.options.headers,index)[0]});},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","");}
$.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion");}});function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments);};};function completed(cancel){if(!$.data(this,"accordion")){return;}
var instance=$.data(this,"accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running){return;}
if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""});}
instance._trigger('change',null,options.data);}
function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);$.data(this,"accordion")._trigger("changestart",null,options.data);options.running=toHide.size()===0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}}
function clickHandler(event){var options=$.data(this,"accordion").options;if(options.disabled){return false;}
if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.next(),data={options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=(options.active=$([]));toggle.call(this,toShow,toHide,data);return false;}
var clicked=$(event.target);clicked=$(clicked.parents(options.header)[0]||clicked);var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive)){return false;}
if(!clicked.is(options.header)){return;}
options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass);}
var toShow=clicked.next(),toHide=options.active.next(),data={options:options,newHeader:clickedActive&&!options.alwaysOpen?$([]):clicked,oldHeader:options.active,newContent:clickedActive&&!options.alwaysOpen?$([]):toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false;};function findActive(headers,selector){return selector?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)");}
$.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:'slide',event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current);}
options.toShow.height(current);},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","auto");}
options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200});},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700});}}});})(jQuery);(function($){$.widget("ui.autocomplete",{_init:function(){$.extend(this.options,{delay:this.options.url?$.Autocompleter.defaults.delay:10,max:!this.options.scroll?10:150,highlight:this.options.highlight||function(value){return value;},formatMatch:this.options.formatMatch||this.options.formatItem});new $.Autocompleter(this.element[0],this.options);},result:function(handler){return this.element.bind("result",handler);},search:function(handler){return this.element.trigger("search",[handler]);},flushCache:function(){return this.element.trigger("flushCache");},setData:function(key,value){return this.element.trigger("setOptions",[{key:value}]);},destroy:function(){return this.element.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);if(options.result)$input.bind('result.autocomplete',options.result);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.autocomplete("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 if(options.source&&typeof options.source=='function'){var resultData=options.source(term);var parsed=(options.parse)?options.parse(resultData):resultData;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:"ui-autocomplete-input",resultsClass:"ui-autocomplete-results",loadingClass:"ui-autocomplete-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};$.extend($.ui.autocomplete,{defaults:$.Autocompleter.defaults});$.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(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:"ui-autocomplete-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?"ui-autocomplete-even":"ui-autocomplete-odd").appendTo(list)[0];$.data(li,"ui-autocomplete-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;$(input).triggerHandler("autocompletehide",[{},{options:options}],options["hide"]);},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).width(),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")));}}}
$(input).triggerHandler("autocompleteshow",[{},{options:options}],options["show"]);},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ui-autocomplete-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($){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"};$.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr('title');this.options.title=this.options.title||this.originalTitle;var self=this,options=this.options,uiDialogContent=this.element.removeAttr('title').addClass('ui-dialog-content').wrap('<div/>').wrap('<div/>'),uiDialogContainer=(this.uiDialogContainer=uiDialogContent.parent()).addClass('ui-dialog-container').css({position:'relative',width:'100%',height:'100%'}),uiDialogTitlebar=(this.uiDialogTitlebar=$('<div/>')).addClass('ui-dialog-titlebar').append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(uiDialogContainer),title=options.title||'&nbsp;',titleId=$.ui.dialog.getTitleId(this.element),uiDialogTitle=$('<span/>').addClass('ui-dialog-title').attr('id',titleId).html(title).prependTo(uiDialogTitlebar),uiDialog=(this.uiDialog=uiDialogContainer.parent()).appendTo(document.body).hide().addClass('ui-dialog').addClass(options.dialogClass).addClass(uiDialogContent.attr('className')).removeClass('ui-dialog-content').css({position:'absolute',width:options.width,height:options.height,overflow:'hidden',zIndex:options.zIndex}).attr('tabIndex',-1).css('outline',0).keydown(function(ev){(options.closeOnEscape&&ev.keyCode&&ev.keyCode==$.keyCode.ESCAPE&&self.close());}).mousedown(function(){self._moveToTop();}),uiDialogButtonPane=(this.uiDialogButtonPane=$('<div/>')).addClass('ui-dialog-buttonpane').css({position:'absolute',bottom:0}).appendTo(uiDialog);this.uiDialogTitlebarClose=$('.ui-dialog-titlebar-close',uiDialogTitlebar).hover(function(){$(this).addClass('ui-dialog-titlebar-close-hover');},function(){$(this).removeClass('ui-dialog-titlebar-close-hover');}).mousedown(function(ev){ev.stopPropagation();}).click(function(){self.close();return false;});uiDialogTitlebar.find("*").add(uiDialogTitlebar).each(function(){$.ui.disableSelection(this);});(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').hide().appendTo('body');this.uiDialog.remove();(this.originalTitle&&this.element.attr('title',this.originalTitle));},close:function(){if(false===this._trigger('beforeclose',null,{options:this.options})){return;}
(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide).unbind('keypress.ui-dialog');this._trigger('close',null,{options:this.options});$.ui.dialog.overlay.resize();this._isOpen=false;},isOpen:function(){return this._isOpen;},open:function(){if(this._isOpen){return;}
this.overlay=this.options.modal?new $.ui.dialog.overlay(this):null;(this.uiDialog.next().length&&this.uiDialog.appendTo('body'));this._position(this.options.position);this.uiDialog.show(this.options.show);(this.options.autoResize&&this._size());this._moveToTop(true);(this.options.modal&&this.uiDialog.bind('keypress.ui-dialog',function(e){if(e.keyCode!=$.keyCode.TAB){return;}
var tabbables=$(':tabbable',this),first=tabbables.filter(':first')[0],last=tabbables.filter(':last')[0];if(e.target==last&&!e.shiftKey){setTimeout(function(){first.focus();},1);}else if(e.target==first&&e.shiftKey){setTimeout(function(){last.focus();},1);}}));this.uiDialog.find(':tabbable:first').focus();this._trigger('open',null,{options:this.options});this._isOpen=true;},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=this.uiDialogButtonPane;uiDialogButtonPane.empty().hide();$.each(buttons,function(){return!(hasButtons=true);});if(hasButtons){uiDialogButtonPane.show();$.each(buttons,function(name,fn){$('<button type="button"></button>').text(name).click(function(){fn.apply(self.element[0],arguments);}).appendTo(uiDialogButtonPane);});}},_makeDraggable:function(){var self=this,options=this.options;this.uiDialog.draggable({cancel:'.ui-dialog-content',helper:options.dragHelper,handle:'.ui-dialog-titlebar',start:function(){self._moveToTop();(options.dragStart&&options.dragStart.apply(self.element[0],arguments));},drag:function(){(options.drag&&options.drag.apply(self.element[0],arguments));},stop:function(){(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',helper:options.resizeHelper,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:function(){(options.resizeStart&&options.resizeStart.apply(self.element[0],arguments));},resize:function(){(options.autoResize&&self._size.apply(self));(options.resize&&options.resize.apply(self.element[0],arguments));},handles:resizeHandles,stop:function(){(options.autoResize&&self._size.apply(self));(options.resizeStop&&options.resizeStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}});},_moveToTop:function(force){if((this.options.modal&&!force)||(!this.options.stack&&!this.options.modal)){return this._trigger('focus',null,{options:this.options});}
var maxZ=this.options.zIndex,options=this.options;$('.ui-dialog:visible').each(function(){maxZ=Math.max(maxZ,parseInt($(this).css('z-index'),10)||options.zIndex);});(this.overlay&&this.overlay.$el.css('z-index',++maxZ));this.uiDialog.css('z-index',++maxZ);this._trigger('focus',null,{options:this.options});},_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.width();break;default:case'center':pLeft+=(wnd.width()-this.uiDialog.width())/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.height();break;default:case'middle':pTop+=(wnd.height()-this.uiDialog.height())/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"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 container=this.uiDialogContainer,titlebar=this.uiDialogTitlebar,content=this.element,tbMargin=(parseInt(content.css('margin-top'),10)||0)
+(parseInt(content.css('margin-bottom'),10)||0),lrMargin=(parseInt(content.css('margin-left'),10)||0)
+(parseInt(content.css('margin-right'),10)||0);content.height(container.height()-titlebar.outerHeight()-tbMargin);content.width(container.width()-lrMargin);}});$.extend($.ui.dialog,{defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:'center',resizable:true,stack:true,width:300,zIndex:1000},getter:'isOpen',uuid: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:[],events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(e){return e+'.dialog-overlay';}).join(' '),create:function(dialog){if(this.instances.length===0){setTimeout(function(){$('a, :input').bind($.ui.dialog.overlay.events,function(){var allow=false;var $dialog=$(this).parents('.ui-dialog');if($dialog.length){var $overlays=$('.ui-dialog-overlay');if($overlays.length){var maxZ=parseInt($overlays.css('z-index'),10);$overlays.each(function(){maxZ=Math.max(maxZ,parseInt($(this).css('z-index'),10));});allow=parseInt($dialog.css('z-index'),10)>maxZ;}else{allow=true;}}
return allow;});},1);$(document).bind('keydown.dialog-overlay',function(e){(dialog.options.closeOnEscape&&e.keyCode&&e.keyCode==$.keyCode.ESCAPE&&dialog.close());});$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);}
var $el=$('<div/>').appendTo(document.body).addClass('ui-dialog-overlay').css($.extend({borderWidth:0,margin:0,padding:0,position:'absolute',top:0,left:0,width:this.width(),height:this.height()},dialog.options.overlay));(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){$('a, :input').add([document,window]).unbind('.dialog-overlay');}
$el.remove();},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 if($.browser.opera){return Math.max(window.innerHeight,$(document).height())+'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 if($.browser.opera){return Math.max(window.innerWidth,$(document).width())+'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.tabs",{_init:function(){this.options.event+='.tabs';this._tabify(true);},_setData:function(key,value){if((/^selected/).test(key))
this.select(value);else{this.options[key]=value;this._tabify();}},length:function(){return this.$tabs.length;},_tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},ui:function(tab,panel){return{options:this.options,tab:tab,panel:panel,index:this.$tabs.index(tab)};},_tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0];});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#',''))
self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.tabs',a.href);$.data(a,'load.tabs',a.href);var id=self._tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.tabs',true);}
self.$panels=self.$panels.add($panel);}
else
o.disabled.push(i+1);});if(init){this.element.addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.addClass(o.panelClass);});if(o.selected===undefined){if(location.hash){this.$tabs.each(function(i,a){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);}
scrollTo(0,0);return false;}});}
else if(o.cookie){var index=parseInt($.cookie('ui-tabs-'+$.data(self.element[0])),10);if(index&&self.$tabs[index])
o.selected=index;}
else if(self.$lis.filter('.'+o.selectedClass).length)
o.selected=self.$lis.index(self.$lis.filter('.'+o.selectedClass)[0]);}
o.selected=o.selected===null||o.selected!==undefined?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter('.'+o.disabledClass),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(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass);var onShow=function(){self._trigger('show',null,self.ui(self.$tabs[o.selected],self.$panels[o.selected]));};if($.data(this.$tabs[o.selected],'load.tabs'))
this.load(o.selected,onShow);else
onShow();}
$(window).bind('unload',function(){self.$tabs.unbind('.tabs');self.$lis=self.$tabs=self.$panels=null;});}
else
o.selected=this.$lis.index(this.$lis.filter('.'+o.selectedClass)[0]);if(o.cookie)
$.cookie('ui-tabs-'+$.data(self.element[0]),o.selected,o.cookie);for(var i=0,li;li=this.$lis[i];i++)
$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?'addClass':'removeClass'](o.disabledClass);if(o.cache===false)
this.$tabs.removeData('cache.tabs');var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array)
hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else
hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie)
resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity)
$hide[0].style.filter='';if($show)
showTab(clicked,$show,$hide);});}
function showTab(clicked,$show,$hide){if(showFx===baseFx)
$show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity)
$show[0].style.filter='';self._trigger('show',null,self.ui(clicked,$show[0]));});}
function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);}
this.$tabs.unbind('.tabs').bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||self._trigger('select',null,self.ui(this,$show[0]))===false){this.blur();return false;}
self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});this.blur();return false;}}
if(o.cookie)
$.cookie('ui-tabs-'+$.data(self.element[0]),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show);}:function(){$li.addClass(o.selectedClass);showTab(a,$show);});}else
throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie)
this.blur();return false;});if(!(/^click/).test(o.event))
this.$tabs.bind('click.tabs',function(){return false;});},add:function(url,label,index){if(index==undefined)
index=this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label));$li.data('destroy.tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this._tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.hideClass).data('destroy.tabs',true);}
$panel.addClass(o.panelClass);if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element[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.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.tabs');if(href)
this.load(index,href);}
this._trigger('add',null,this.ui(this.$tabs[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(o.selectedClass)&&this.$tabs.length>1)
this.select(index+(index+1<this.$tabs.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;var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block');},0);}
o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this._trigger('enable',null,this.ui(this.$tabs[index],this.$panels[index]));},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();this._trigger('disable',null,this.ui(this.$tabs[index],this.$panels[index]));}},select:function(index){if(typeof index=='string')
index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event);},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data('load.tabs');callback=callback||function(){};if(!url||!bypassCache&&$.data(a,'cache.tabs')){callback();return;}
var inner=function(parent){var $parent=$(parent),$inner=$parent.find('*:last');return $inner.length&&$inner.is(':not(img)')&&$inner||$parent;};var cleanup=function(){self.$tabs.filter('.'+o.loadingClass).removeClass(o.loadingClass).each(function(){if(o.spinner)
inner(this).parent().html(inner(this).data('label.tabs'));});self.xhr=null;};if(o.spinner){var label=inner(a).html();inner(a).wrapInner('<em></em>').find('em').data('label.tabs',label).html(o.spinner);}
var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);cleanup();if(o.cache)
$.data(a,'cache.tabs',true);self._trigger('load',null,self.ui(self.$tabs[index],self.$panels[index]));o.ajaxOptions.success&&o.ajaxOptions.success(r,s);callback();}});if(this.xhr){this.xhr.abort();cleanup();}
$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},url:function(index,url){this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs',url);},destroy:function(){var o=this.options;this.element.unbind('.tabs').removeClass(o.navClass).removeData('tabs');this.$tabs.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.add(this.$panels).each(function(){if($.data(this,'destroy.tabs'))
$(this).remove();else
$(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '));});}});$.ui.tabs.defaults={unselect:false,event:'click',disabled:[],cookie:null,spinner:'Loading&#8230;',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading'};$.ui.tabs.getter="length";$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){continuing=continuing||false;var self=this,t=this.options.selected;function start(){self.rotation=setInterval(function(){t=++t<self.$tabs.length?t:0;self.select(t);},ms);}
function stop(e){if(!e||e.clientX){clearInterval(self.rotation);}}
if(ms){start();if(!continuing)
this.$tabs.bind(this.options.event,stop);else
this.$tabs.bind(this.options.event,function(){stop();t=self.options.selected;start();});}
else{stop();this.$tabs.unbind(this.options.event,stop);}}});})(jQuery);(function($){var PROP_NAME='datepicker';function Datepicker(){this.debug=false;this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId='ui-datepicker-div';this._inlineClass='ui-datepicker-inline';this._appendClass='ui-datepicker-append';this._triggerClass='ui-datepicker-trigger';this._dialogClass='ui-datepicker-dialog';this._promptClass='ui-datepicker-prompt';this._disableClass='ui-datepicker-disabled';this._unselectableClass='ui-datepicker-unselectable';this._currentClass='ui-datepicker-current-day';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};this._defaults={showOn:'focus',showAnim:'show',showOptions:{},defaultDate:null,appendText:'',buttonText:'...',buttonImage:'',buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,showBigPrevNext:false,gotoCurrent:false,changeMonth:true,changeYear:true,showMonthAfterYear:false,yearRange:'-10:+10',changeFirstDay:true,highlightWeek:false,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,duration:'normal',beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,rangeSelect:false,rangeSeparator:' - ',altField:'',altFormat:''};$.extend(this._defaults,this.regional['']);this.dpDiv=$('<div id="'+this._mainDivId+'" style="display: none;"></div>');}
$.extend(Datepicker.prototype,{markerClassName:'hasDatepicker',log:function(){if(this.debug)
console.log.apply('',arguments);},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute('date:'+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue);}catch(err){inlineSettings[attrName]=attrValue;}}}
var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=='div'||nodeName=='span');if(!target.id)
target.id='dp'+(++this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=='input'){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,'\\\\$1');return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+'"></div>'))};},_connectDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName))
return;var appendText=this._get(inst,'appendText');var isRTL=this._get(inst,'isRTL');if(appendText)
input[isRTL?'before':'after']('<span class="'+this._appendClass+'">'+appendText+'</span>');var showOn=this._get(inst,'showOn');if(showOn=='focus'||showOn=='both')
input.focus(this._showDatepicker);if(showOn=='button'||showOn=='both'){var buttonText=this._get(inst,'buttonText');var buttonImage=this._get(inst,'buttonImage');var trigger=$(this._get(inst,'buttonImageOnly')?$('<img/>').addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==''?buttonText:$('<img/>').attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?'before':'after'](trigger);trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target)
$.datepicker._hideDatepicker();else
$.datepicker._showDatepicker(target);return false;});}
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName))
return;divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);},_inlineShow:function(inst){var numMonths=this._getNumberOfMonths(inst);inst.dpDiv.width(numMonths[1]*$('.ui-datepicker',inst.dpDiv[0]).width());},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id='dp'+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');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||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}
this._dialogInput.css('left',this._pos[0]+'px').css('top',this._pos[1]+'px');inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI)
$.blockUI(this.dpDiv);$.data(this._dialogInput[0],PROP_NAME,inst);return this;},_destroyDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return;}
var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=='input'){$target.siblings('.'+this._appendClass).remove().end().siblings('.'+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind('focus',this._showDatepicker).unbind('keydown',this._doKeyDown).unbind('keypress',this._doKeyPress);}else if(nodeName=='div'||nodeName=='span')
$target.removeClass(this.markerClassName).empty();},_enableDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return;}
var nodeName=target.nodeName.toLowerCase();if(nodeName=='input'){target.disabled=false;$target.siblings('button.'+this._triggerClass).each(function(){this.disabled=false;}).end().siblings('img.'+this._triggerClass).css({opacity:'1.0',cursor:''});}
else if(nodeName=='div'||nodeName=='span'){$target.children('.'+this._disableClass).remove();}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});},_disableDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return;}
var nodeName=target.nodeName.toLowerCase();if(nodeName=='input'){target.disabled=true;$target.siblings('button.'+this._triggerClass).each(function(){this.disabled=true;}).end().siblings('img.'+this._triggerClass).css({opacity:'0.5',cursor:'default'});}
else if(nodeName=='div'||nodeName=='span'){var inline=$target.children('.'+this._inlineClass);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+'" style="'+
($.browser.msie?'background-color: transparent; ':'')+'width: '+inline.width()+'px; height: '+inline.height()+'px; left: '+(offset.left-relOffset.left)+'px; top: '+(offset.top-relOffset.top)+'px;"></div>');}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target)
return false;for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target)
return true;}
return false;},_getInst:function(target){try{return $.data(target,PROP_NAME);}
catch(err){throw'Missing instance data for this datepicker';}},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=='string'){settings={};settings[name]=value;}
var inst=this._getInst(target);if(inst){if(this._curInst==inst){this._hideDatepicker(null);}
extendRemove(inst.settings,settings);var date=new Date();extendRemove(inst,{rangeStart:null,endDay:null,endMonth:null,endYear:null,selectedDay:date.getDate(),selectedMonth:date.getMonth(),selectedYear:date.getFullYear(),currentDay:date.getDate(),currentMonth:date.getMonth(),currentYear:date.getFullYear(),drawMonth:date.getMonth(),drawYear:date.getFullYear()});this._updateDatepicker(inst);}},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline)
this._setDateFromField(inst);return(inst?this._getDate(inst):null);},_doKeyDown:function(e){var inst=$.datepicker._getInst(e.target);var handled=true;if($.datepicker._datepickerShowing)
switch(e.keyCode){case 9:$.datepicker._hideDatepicker(null,'');break;case 13:$.datepicker._selectDay(e.target,inst.selectedMonth,inst.selectedYear,$('td.ui-datepicker-days-cell-over',inst.dpDiv)[0]);return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration'));break;case 33:$.datepicker._adjustDate(e.target,(e.ctrlKey?-$.datepicker._get(inst,'stepBigMonths'):-$.datepicker._get(inst,'stepMonths')),'M');break;case 34:$.datepicker._adjustDate(e.target,(e.ctrlKey?+$.datepicker._get(inst,'stepBigMonths'):+$.datepicker._get(inst,'stepMonths')),'M');break;case 35:if(e.ctrlKey)$.datepicker._clearDate(e.target);handled=e.ctrlKey;break;case 36:if(e.ctrlKey)$.datepicker._gotoToday(e.target);handled=e.ctrlKey;break;case 37:if(e.ctrlKey)$.datepicker._adjustDate(e.target,-1,'D');handled=e.ctrlKey;break;case 38:if(e.ctrlKey)$.datepicker._adjustDate(e.target,-7,'D');handled=e.ctrlKey;break;case 39:if(e.ctrlKey)$.datepicker._adjustDate(e.target,+1,'D');handled=e.ctrlKey;break;case 40:if(e.ctrlKey)$.datepicker._adjustDate(e.target,+7,'D');handled=e.ctrlKey;break;default:handled=false;}
else if(e.keyCode==36&&e.ctrlKey)
$.datepicker._showDatepicker(this);else
handled=false;if(handled){e.preventDefault();e.stopPropagation();}},_doKeyPress:function(e){var inst=$.datepicker._getInst(e.target);var chars=$.datepicker._possibleChars($.datepicker._get(inst,'dateFormat'));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<' '||!chars||chars.indexOf(chr)>-1);},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!='input')
input=$('input',input.parentNode)[0];if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input)
return;var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,'beforeShow');extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,'');$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog)
input.value='';if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';return!isFixed;});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop;}
var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});$.datepicker._updateDatepicker(inst);inst.dpDiv.width($.datepicker._getNumberOfMonths(inst)[1]*$('.ui-datepicker',inst.dpDiv[0])[0].offsetWidth);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute')),display:'none',left:offset.left+'px',top:offset.top+'px'});if(!inst.inline){var showAnim=$.datepicker._get(inst,'showAnim')||'show';var duration=$.datepicker._get(inst,'duration');var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7)
$('iframe.ui-datepicker-cover').css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4});};if($.effects&&$.effects[showAnim])
inst.dpDiv.show(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);else
inst.dpDiv[showAnim](duration,postProcess);if(duration=='')
postProcess();if(inst.input[0].type!='hidden')
inst.input[0].focus();$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};inst.dpDiv.empty().append(this._generateHTML(inst)).find('iframe.ui-datepicker-cover').css({width:dims.width,height:dims.height});var numMonths=this._getNumberOfMonths(inst);inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?'add':'remove')+'Class']('ui-datepicker-multi');inst.dpDiv[(this._get(inst,'isRTL')?'add':'remove')+'Class']('ui-datepicker-rtl');if(inst.input&&inst.input[0].type!='hidden')
$(inst.input[0]).focus();},_checkOffset:function(inst,offset,isFixed){var pos=inst.input?this._findPos(inst.input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;if(this._get(inst,'isRTL')||(offset.left+inst.dpDiv.width()-scrollX)>browserWidth)
offset.left=Math.max((isFixed?0:scrollX),pos[0]+(inst.input?inst.input.width():0)-(isFixed?scrollX:0)-inst.dpDiv.width()-
(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0));else
offset.left-=(isFixed?scrollX:0);if((offset.top+inst.dpDiv.height()-scrollY)>browserHeight)
offset.top=Math.max((isFixed?0:scrollY),pos[1]-(isFixed?scrollY:0)-(this._inDialog?0:inst.dpDiv.height())-
(isFixed&&$.browser.opera?document.documentElement.scrollTop:0));else
offset.top-=(isFixed?scrollY:0);return offset;},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling;}
var position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME)))
return;var rangeSelect=this._get(inst,'rangeSelect');if(rangeSelect&&inst.stayOpen)
this._selectDate('#'+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,'duration'));var showAnim=this._get(inst,'showAnim');var postProcess=function(){$.datepicker._tidyDialog(inst);};if(duration!=''&&$.effects&&$.effects[showAnim])
inst.dpDiv.hide(showAnim,$.datepicker._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():''),inst]);this._datepickerShowing=false;this._lastInput=null;inst.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:'absolute',left:'0',top:'-100px'});if($.blockUI){$.unblockUI();$('body').append(this.dpDiv);}}
this._inDialog=false;}
this._curInst=null;},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker');$('.'+this._promptClass,inst.dpDiv).remove();},_checkExternalClick:function(event){if(!$.datepicker._curInst)
return;var $target=$(event.target);if(($target.parents('#'+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI))
$.datepicker._hideDatepicker(null,'');},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);this._adjustInstDate(inst,offset,period);this._updateDatepicker(inst);},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'gotoCurrent')&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}
else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();}
this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst['selected'+(period=='M'?'Month':'Year')]=inst['draw'+(period=='M'?'Month':'Year')]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie)
inst.input[0].focus();inst._selectingMonthYear=!inst._selectingMonthYear;},_changeFirstDay:function(id,day){var target=$(id);var inst=this._getInst(target[0]);inst.settings.firstDay=day;this._updateDatepicker(inst);},_selectDay:function(id,month,year,td){if($(td).hasClass(this._unselectableClass))
return;var target=$(id);var inst=this._getInst(target[0]);var rangeSelect=this._get(inst,'rangeSelect');if(rangeSelect){inst.stayOpen=!inst.stayOpen;if(inst.stayOpen){$('.ui-datepicker td',inst.dpDiv).removeClass(this._currentClass);$(td).addClass(this._currentClass);}}
inst.selectedDay=inst.currentDay=$('a',td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null;}
else if(rangeSelect){inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear;}
this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=new Date(inst.currentYear,inst.currentMonth,inst.currentDay);this._updateDatepicker(inst);}
else if(rangeSelect){inst.selectedDay=inst.currentDay=inst.rangeStart.getDate();inst.selectedMonth=inst.currentMonth=inst.rangeStart.getMonth();inst.selectedYear=inst.currentYear=inst.rangeStart.getFullYear();inst.rangeStart=null;if(inst.inline)
this._updateDatepicker(inst);}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'mandatory'))
return;inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,'');},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(this._get(inst,'rangeSelect')&&dateStr)
dateStr=(inst.rangeStart?this._formatDate(inst,inst.rangeStart):dateStr)+this._get(inst,'rangeSeparator')+dateStr;if(inst.input)
inst.input.val(dateStr);this._updateAlternate(inst);var onSelect=this._get(inst,'onSelect');if(onSelect)
onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);else if(inst.input)
inst.input.trigger('change');if(inst.inline)
this._updateDatepicker(inst);else if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,'duration'));this._lastInput=inst.input[0];if(typeof(inst.input[0])!='object')
inst.input[0].focus();this._lastInput=null;}},_updateAlternate:function(inst){var altField=this._get(inst,'altField');if(altField){var altFormat=this._get(inst,'altFormat');var date=this._getDate(inst);dateStr=(isArray(date)?(!date[0]&&!date[1]?'':this.formatDate(altFormat,date[0],this._getFormatConfig(inst))+
this._get(inst,'rangeSeparator')+this.formatDate(altFormat,date[1]||date[0],this._getFormatConfig(inst))):this.formatDate(altFormat,date,this._getFormatConfig(inst)));$(altField).each(function(){$(this).val(dateStr);});}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),''];},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate(),(date.getTimezoneOffset()/-60));var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate);}else if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1;}}
return Math.floor(((checkDate-firstMon)/86400000)/7)+1;},dateStatus:function(date,inst){return $.datepicker.formatDate($.datepicker._get(inst,'dateStatus'),date,$.datepicker._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;var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches)
iFormat++;return matches;};var getNumber=function(match){lookAhead(match);var origSize=(match=='@'?14:(match=='y'?4:(match=='o'?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>='0'&&value.charAt(iValue)<='9'){num=num*10+parseInt(value.charAt(iValue++),10);size--;}
if(size==origSize)
throw'Missing number at position '+iValue;return num;};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++)
size=Math.max(size,names[j].length);var name='';var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++)
if(name==names[i])
return i+1;size--;}
throw'Unknown name at position '+iInit;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat))
throw'Unexpected literal at position '+iValue;iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal)
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
checkLiteral();else
switch(format.charAt(iFormat)){case'd':day=getNumber('d');break;case'D':getName('D',dayNamesShort,dayNames);break;case'o':doy=getNumber('o');break;case'm':month=getNumber('m');break;case'M':month=getName('M',monthNamesShort,monthNames);break;case'y':year=getNumber('y');break;case'@':var date=new Date(getNumber('@'));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'"))
checkLiteral();else
literal=true;break;default:checkLiteral();}}
if(year<100)
year+=new Date().getFullYear()-new Date().getFullYear()%100+
(year<=shortYearCutoff?0:-100);if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim)
break;month++;day-=dim;}while(true);}
var date=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',TIMESTAMP:'@',W3C:'yy-mm-dd',formatDate:function(format,date,settings){if(!date)
return'';var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches)
iFormat++;return matches;};var formatNumber=function(match,value,len){var num=''+value;if(lookAhead(match))
while(num.length<len)
num='0'+num;return num;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);};var output='';var literal=false;if(date)
for(var iFormat=0;iFormat<format.length;iFormat++){if(literal)
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
output+=format.charAt(iFormat);else
switch(format.charAt(iFormat)){case'd':output+=formatNumber('d',date.getDate(),2);break;case'D':output+=formatName('D',date.getDay(),dayNamesShort,dayNames);break;case'o':var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--)
doy+=this._getDaysInMonth(date.getFullYear(),m);output+=formatNumber('o',doy,3);break;case'm':output+=formatNumber('m',date.getMonth()+1,2);break;case'M':output+=formatName('M',date.getMonth(),monthNamesShort,monthNames);break;case'y':output+=(lookAhead('y')?date.getFullYear():(date.getYear()%100<10?'0':'')+date.getYear()%100);break;case'@':output+=date.getTime();break;case"'":if(lookAhead("'"))
output+="'";else
literal=true;break;default:output+=format.charAt(iFormat);}}
return output;},_possibleChars:function(format){var chars='';var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++)
if(literal)
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
chars+=format.charAt(iFormat);else
switch(format.charAt(iFormat)){case'd':case'm':case'y':case'@':chars+='0123456789';break;case'D':case'M':return null;case"'":if(lookAhead("'"))
chars+="'";else
literal=true;break;default:chars+=format.charAt(iFormat);}
return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst){var dateFormat=this._get(inst,'dateFormat');var dates=inst.input?inst.input.val().split(this._get(inst,'rangeSeparator')):null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);if(dates.length>0){var settings=this._getFormatConfig(inst);if(dates.length>1){date=this.parseDate(dateFormat,dates[1],settings)||defaultDate;inst.endDay=date.getDate();inst.endMonth=date.getMonth();inst.endYear=date.getFullYear();}
try{date=this.parseDate(dateFormat,dates[0],settings)||defaultDate;}catch(e){this.log(e);date=defaultDate;}}
inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates[0]?date.getDate():0);inst.currentMonth=(dates[0]?date.getMonth():0);inst.currentYear=(dates[0]?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,'defaultDate'),new Date());var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date;},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setUTCDate(date.getUTCDate()+offset);return date;};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||'d'){case'd':case'D':day+=parseInt(matches[1],10);break;case'w':case'W':day+=parseInt(matches[1],10)*7;break;case'm':case'M':month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case'y':case'Y':year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;}
matches=pattern.exec(offset);}
return new Date(year,month,day);};date=(date==null?defaultDate:(typeof date=='string'?offsetString(date,this._getDaysInMonth):(typeof date=='number'?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));return(date&&date.toString()=='Invalid Date'?defaultDate:date);},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(this._get(inst,'rangeSelect')){if(endDate){endDate=this._determineDate(endDate,null);inst.endDay=endDate.getDate();inst.endMonth=endDate.getMonth();inst.endYear=endDate.getFullYear();}else{inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear;}}
if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)
this._notifyChange(inst);this._adjustInstDate(inst);if(inst.input)
inst.input.val(clear?'':this._formatDate(inst)+
(!this._get(inst,'rangeSelect')?'':this._get(inst,'rangeSeparator')+
this._formatDate(inst,inst.endDay,inst.endMonth,inst.endYear)));},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=='')?null:new Date(inst.currentYear,inst.currentMonth,inst.currentDay));if(this._get(inst,'rangeSelect')){return[inst.rangeStart||startDate,(!inst.endYear?inst.rangeStart||startDate:new Date(inst.endYear,inst.endMonth,inst.endDay))];}else
return startDate;},_generateHTML:function(inst){var today=new Date();today=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 clear=(this._get(inst,'mandatory')?'':'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(\'#'+inst.id+'\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'clearStatus'),initStatus)+'>'+
this._get(inst,'clearText')+'</a></div>');var controls='<div class="ui-datepicker-control">'+(isRTL?'':clear)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+
this._addStatus(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 currentDate=(!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay));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=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
var prevText=this._get(inst,'prevText');prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,new Date(drawYear,drawMonth-stepMonths,1),this._getFormatConfig(inst)));var prevBigText=(showBigPrevNext?this._get(inst,'prevBigText'):'');prevBigText=(!navigationAsDateFormat?prevBigText:this.formatDate(prevBigText,new Date(drawYear,drawMonth-stepBigMonths,1),this._getFormatConfig(inst)));var prev='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?(showBigPrevNext?'<a onclick="jQuery.datepicker._adjustDate(\'#'+inst.id+'\', -'+stepBigMonths+', \'M\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'prevBigStatus'),initStatus)+'>'+prevBigText+'</a>':'')+'<a onclick="jQuery.datepicker._adjustDate(\'#'+inst.id+'\', -'+stepMonths+', \'M\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'prevStatus'),initStatus)+'>'+prevText+'</a>':(hideIfNoPrevNext?'':'<label>'+prevBigText+'</label><label>'+prevText+'</label>'))+'</div>';var nextText=this._get(inst,'nextText');nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,new Date(drawYear,drawMonth+stepMonths,1),this._getFormatConfig(inst)));var nextBigText=(showBigPrevNext?this._get(inst,'nextBigText'):'');nextBigText=(!navigationAsDateFormat?nextBigText:this.formatDate(nextBigText,new Date(drawYear,drawMonth+stepBigMonths,1),this._getFormatConfig(inst)));var next='<div class="ui-datepicker-next">'+(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate(\'#'+inst.id+'\', +'+stepMonths+', \'M\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'nextStatus'),initStatus)+'>'+nextText+'</a>'+
(showBigPrevNext?'<a onclick="jQuery.datepicker._adjustDate(\'#'+inst.id+'\', +'+stepBigMonths+', \'M\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'nextBigStatus'),initStatus)+'>'+nextBigText+'</a>':''):(hideIfNoPrevNext?'':'<label>'+nextText+'</label><label>'+nextBigText+'</label>'))+'</div>';var currentText=this._get(inst,'currentText');var gotoDate=(this._get(inst,'gotoCurrent')&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var html=(prompt?'<div class="'+this._promptClass+'">'+prompt+'</div>':'')+
(closeAtTop&&!inst.inline?controls:'')+'<div class="ui-datepicker-links">'+(isRTL?next:prev)+
(this._isInRange(inst,gotoDate)?'<div class="ui-datepicker-current">'+'<a onclick="jQuery.datepicker._gotoToday(\'#'+inst.id+'\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'currentStatus'),initStatus)+'>'+
currentText+'</a></div>':'')+(isRTL?prev:next)+'</div>';var firstDay=this._get(inst,'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 highlightWeek=this._get(inst,'highlightWeek');var showOtherMonths=this._get(inst,'showOtherMonths');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 endDate=inst.endDay?new Date(inst.endYear,inst.endMonth,inst.endDay):currentDate;for(var row=0;row<numMonths[0];row++)
for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,inst.selectedDay);html+='<div class="ui-datepicker-one-month'+(col==0?' ui-datepicker-new-row':'')+'">'+
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,showStatus,initStatus,monthNames)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead>'+'<tr class="ui-datepicker-title-row">'+
(showWeeks?'<td'+this._addStatus(showStatus,inst.id,weekStatus,initStatus)+'>'+
this._get(inst,'weekHeader')+'</td>':'');for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var dayStatus=(status.indexOf('DD')>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+='<td'+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end-cell"':'')+'>'+
(!changeFirstDay?'<span':'<a onclick="jQuery.datepicker._changeFirstDay(\'#'+inst.id+'\', '+day+');"')+
this._addStatus(showStatus,inst.id,dayStatus,initStatus)+' title="'+dayNames[day]+'">'+
dayNamesMin[day]+(changeFirstDay?'</a>':'</span>')+'</td>';}
html+='</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth)
inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var tzDate=new Date(drawYear,drawMonth,1-leadDays);var utcDate=new Date(drawYear,drawMonth,1-leadDays);var printDate=utcDate;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="ui-datepicker-days-row">'+
(showWeeks?'<td class="ui-datepicker-week-col"'+
this._addStatus(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||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="ui-datepicker-days-cell'+
((dow+firstDay+6)%7>=5?' ui-datepicker-week-end-cell':'')+
(otherMonth?' ui-datepicker-other-month':'')+
(printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth?' ui-datepicker-days-cell-over':'')+
(unselectable?' '+this._unselectableClass:'')+
(otherMonth&&!showOtherMonths?'':' '+daySettings[1]+
(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?' '+this._currentClass:'')+
(printDate.getTime()==today.getTime()?' ui-datepicker-today':''))+'"'+
((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':'')+
(unselectable?(highlightWeek?' onmouseover="jQuery(this).parent().addClass(\'ui-datepicker-week-over\');"'+' onmouseout="jQuery(this).parent().removeClass(\'ui-datepicker-week-over\');"':''):' onmouseover="jQuery(this).addClass(\'ui-datepicker-days-cell-over\')'+
(highlightWeek?'.parent().addClass(\'ui-datepicker-week-over\')':'')+';'+
(!showStatus||(otherMonth&&!showOtherMonths)?'':'jQuery(\'#ui-datepicker-status-'+
inst.id+'\').html(\''+(dateStatus.apply((inst.input?inst.input[0]:null),[printDate,inst])||initStatus)+'\');')+'"'+' onmouseout="jQuery(this).removeClass(\'ui-datepicker-days-cell-over\')'+
(highlightWeek?'.parent().removeClass(\'ui-datepicker-week-over\')':'')+';'+
(!showStatus||(otherMonth&&!showOtherMonths)?'':'jQuery(\'#ui-datepicker-status-'+
inst.id+'\').html(\''+initStatus+'\');')+'" onclick="jQuery.datepicker._selectDay(\'#'+
inst.id+'\','+drawMonth+','+drawYear+', this);"')+'>'+
(otherMonth?(showOtherMonths?printDate.getDate():'&#xa0;'):(unselectable?printDate.getDate():'<a>'+printDate.getDate()+'</a>'))+'</td>';tzDate.setDate(tzDate.getDate()+1);utcDate.setUTCDate(utcDate.getUTCDate()+1);printDate=(tzDate>utcDate?tzDate:utcDate);}
html+='</tr>';}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
html+='</tbody></table></div>';}
html+=(showStatus?'<div style="clear: both;"></div><div id="ui-datepicker-status-'+inst.id+'" class="ui-datepicker-status">'+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="ui-datepicker-cover"></iframe>':'');return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,showStatus,initStatus,monthNames){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showMonthAfterYear=this._get(inst,'showMonthAfterYear');var html='<div class="ui-datepicker-header">';var monthHtml='';if(secondary||!this._get(inst,'changeMonth'))
monthHtml+=monthNames[drawMonth]+'&#xa0;';else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-new-month" '+'onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+'onclick="jQuery.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+
this._addStatus(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;if(secondary||!this._get(inst,'changeYear'))
html+=drawYear;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=endYear=new Date().getFullYear();year+=parseInt(years[0],10);endYear+=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="ui-datepicker-new-year" '+'onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+'onclick="jQuery.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+
this._addStatus(showStatus,inst.id,this._get(inst,'yearStatus'),initStatus)+'>';for(;year<=endYear;year++){html+='<option value="'+year+'"'+
(year==drawYear?' selected="selected"':'')+'>'+year+'</option>';}
html+='</select>';}
if(showMonthAfterYear)
html+=monthHtml;html+='</div>';return html;},_addStatus:function(showStatus,id,text,initStatus){return(showStatus?' onmouseover="jQuery(\'#ui-datepicker-status-'+id+'\').html(\''+(text||initStatus)+'\');" '+'onmouseout="jQuery(\'#ui-datepicker-status-'+id+'\').html(\''+initStatus+'\');"':'');},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=='Y'?offset:0);var month=inst.drawMonth+(period=='M'?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+
(period=='D'?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=='M'||period=='Y')
this._notifyChange(inst);},_notifyChange:function(inst){var onChange=this._get(inst,'onChangeMonthYear');if(onChange)
onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,'numberOfMonths');return(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+'Date'),null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}
return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date));},_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=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0)
date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));return this._isInRange(inst,date);},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,'shortYearCutoff');shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,'dayNamesShort'),dayNames:this._get(inst,'dayNames'),monthNamesShort:this._get(inst,'monthNamesShort'),monthNames:this._get(inst,'monthNames')};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}
var date=(day?(typeof day=='object'?day:new Date(year,month,day)):new Date(inst.currentYear,inst.currentMonth,inst.currentDay));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&&(($.browser.safari&&typeof a=='object'&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))));};$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document.body).append($.datepicker.dpDiv).mousedown($.datepicker._checkExternalClick);$.datepicker.initialized=true;}
var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'))
return $.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this[0]].concat(otherArgs));return this.each(function(){typeof options=='string'?$.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options);});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();})(jQuery);(function($){$.widget("ui.progressbar",{_init:function(){this._interval=this.options.interval;var self=this,options=this.options,id=(new Date()).getTime()+Math.random(),text=options.text||'0%';this.element.addClass("ui-progressbar").width(options.width);$.extend(this,{active:false,pixelState:0,percentState:0,identifier:id,bar:$('<div class="ui-progressbar-bar ui-hidden"></div>').css({width:'0px',overflow:'hidden',zIndex:100}),textElement:$('<div class="ui-progressbar-text"></div>').html(text).css({width:'0px',overflow:'hidden'}),textBg:$('<div class="ui-progressbar-text ui-progressbar-text-back"></div>').html(text).css({width:this.element.width()}),wrapper:$('<div class="ui-progressbar-wrap"></div>')});this.wrapper.append(this.bar.append(this.textElement.addClass(options.textClass)),this.textBg).appendTo(this.element);},plugins:{},ui:function(e){return{instance:this,identifier:this.identifier,options:this.options,element:this.bar,textElement:this.textElement,pixelState:this.pixelState,percentState:this.percentState};},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="progressbar"?n:["progressbar",n].join(""),[e,this.ui()],this.options[n]);},destroy:function(){this.stop();this.element.removeClass("ui-progressbar ui-progressbar-disabled").removeData("progressbar").unbind(".progressbar").find('.ui-progressbar-wrap').remove();delete jQuery.easing[this.identifier];},enable:function(){this.element.removeClass("ui-progressbar-disabled");this.disabled=false;},disable:function(){this.element.addClass("ui-progressbar-disabled");this.disabled=true;},start:function(){var self=this,options=this.options;if(this.disabled){return;}
jQuery.easing[this.identifier]=function(x,t,b,c,d){var inc=options.increment,width=options.width,step=((inc>width?width:inc)/width),state=Math.round(x/step)*step;return state>1?1:state;};self.active=true;setTimeout(function(){self.active=false;},options.duration);this._animate();this._propagate('start',this.ui());return false;},_animate:function(){var self=this,options=this.options,interval=options.interval;this.bar.animate({width:options.width},{duration:interval,easing:this.identifier,step:function(step,b){self.progress((step/options.width)*100);var timestamp=new Date().getTime(),elapsedTime=(timestamp-b.startTime);options.interval=interval-elapsedTime;},complete:function(){delete jQuery.easing[self.identifier];self.pause();if(self.active){}}});},pause:function(){if(this.disabled)return;this.bar.stop();this._propagate('pause',this.ui());},stop:function(){this.bar.stop();this.bar.width(0);this.textElement.width(0);this.bar.addClass('ui-hidden');this.options.interval=this._interval;this._propagate('stop',this.ui());},text:function(text){this.textElement.html(text);this.textBg.html(text);},progress:function(percentState){if(this.bar.is('.ui-hidden')){this.bar.removeClass('ui-hidden');}
this.percentState=percentState>100?100:percentState;this.pixelState=(this.percentState/100)*this.options.width;this.bar.width(this.pixelState);this.textElement.width(this.pixelState);if(this.options.range&&!this.options.text){this.textElement.html(Math.round(this.percentState)+'%');}
this._propagate('progress',this.ui());}});$.ui.progressbar.defaults={width:300,duration:3000,interval:200,increment:1,range:true,text:'',addClass:'',textClass:''};})(jQuery);/*
 * Flexigrid for jQuery - New Wave Grid
 *
 * Copyright (c) 2008 Paulo P. Marinas (webplicity.net/flexigrid)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-07-14 00:09:43 +0800 (Tue, 14 Jul 2008) $
 */
 
(function($){
		  
	$.addFlex = function(t,p)
	{

		if (t.grid) return false; //return if already exist	
		
		// apply default properties
		p = $.extend({
			 height: 200, //default height
			 width: 'auto', //auto width
			 striped: true, //apply odd even stripes
			 novstripe: false,
			 minwidth: 30, //min width of columns
			 minheight: 80, //min height of columns
			 resizable: true, //resizable table
			 url: false, //ajax url
			 method: 'POST', // data sending method
			 dataType: 'xml', // type of data loaded
			 errormsg: 'Connection Error',
			 usepager: false, //
			 nowrap: true, //
			 page: 1, //current page
			 total: 1, //total pages
			 useRp: true, //use the results per page select box
			 rp: 15, // results per page
			 rpOptions: [10,15,20,25,40],
			 title: false,
			 pagestat: 'Displaying {from} to {to} of {total} items',
			 procmsg: 'Processing, please wait ...',
			 query: '',
			 qtype: '',
			 nomsg: 'No items',
			 minColToggle: 1, //minimum allowed column to be hidden
			 showToggleBtn: true, //show or hide column toggle popup
			 hideOnSubmit: true,
			 autoload: true,
			 blockOpacity: 0.5,
			 onToggleCol: false,
			 onChangeSort: false,
			 onSuccess: false,
			 onSubmit: false // using a custom populate function
		  }, p);
		  		

		$(t)
		.show() //show if hidden
		.attr({cellPadding: 0, cellSpacing: 0, border: 0})  //remove padding and spacing
		.removeAttr('width') //remove width properties	
		;
		
		//create grid class
		var g = {
			hset : {},
			rePosDrag: function () {

			var cdleft = 0 - this.hDiv.scrollLeft;
			if (this.hDiv.scrollLeft>0) cdleft -= Math.floor(p.cgwidth/2);
			$(g.cDrag).css({top:g.hDiv.offsetTop+1});
			var cdpad = this.cdpad;
			
			$('div',g.cDrag).hide();
			
			$('thead tr:first th:visible',this.hDiv).each
				(
			 	function ()
					{
					var n = $('thead tr:first th:visible',g.hDiv).index(this);

					var cdpos = parseInt($('div',this).width());
					var ppos = cdpos;
					if (cdleft==0) 
							cdleft -= Math.floor(p.cgwidth/2); 

					cdpos = cdpos + cdleft + cdpad;
					
					$('div:eq('+n+')',g.cDrag).css({'left':cdpos+'px'}).show();

					cdleft = cdpos;
					}
				);
				
			},
			fixHeight: function (newH) {
					newH = false;
					if (!newH) newH = $(g.bDiv).height();
					var hdHeight = $(this.hDiv).height();
					$('div',this.cDrag).each(
						function ()
							{
								$(this).height(newH+hdHeight);
							}
					);
					
					var nd = parseInt($(g.nDiv).height());
					
					if (nd>newH)
						$(g.nDiv).height(newH).width(200);
					else
						$(g.nDiv).height('auto').width('auto');
					
					$(g.block).css({height:newH,marginBottom:(newH * -1)});
					
					var hrH = g.bDiv.offsetTop + newH;
					if (p.height != 'auto' && p.resizable) hrH = g.vDiv.offsetTop;
					$(g.rDiv).css({height: hrH});
				
			},
			dragStart: function (dragtype,e,obj) { //default drag function start
				
				if (dragtype=='colresize') //column resize
					{
						$(g.nDiv).hide();$(g.nBtn).hide();
						var n = $('div',this.cDrag).index(obj);
						var ow = $('th:visible div:eq('+n+')',this.hDiv).width();
						$(obj).addClass('dragging').siblings().hide();
						$(obj).prev().addClass('dragging').show();
						
						this.colresize = {startX: e.pageX, ol: parseInt(obj.style.left), ow: ow, n : n };
						$('body').css('cursor','col-resize');
					}
				else if (dragtype=='vresize') //table resize
					{
						var hgo = false;
						$('body').css('cursor','row-resize');
						if (obj) 
							{
							hgo = true;
							$('body').css('cursor','col-resize');
							}
						this.vresize = {h: p.height, sy: e.pageY, w: p.width, sx: e.pageX, hgo: hgo};
						
					}

				else if (dragtype=='colMove') //column header drag
					{
						$(g.nDiv).hide();$(g.nBtn).hide();
						this.hset = $(this.hDiv).offset();
						this.hset.right = this.hset.left + $('table',this.hDiv).width();
						this.hset.bottom = this.hset.top + $('table',this.hDiv).height();
						this.dcol = obj;
						this.dcoln = $('th',this.hDiv).index(obj);
						
						this.colCopy = document.createElement("div");
						this.colCopy.className = "colCopy";
						this.colCopy.innerHTML = obj.innerHTML;
						if ($.browser.msie)
						{
						this.colCopy.className = "colCopy ie";
						}
						
						
						$(this.colCopy).css({position:'absolute',float:'left',display:'none', textAlign: obj.align});
						$('body').append(this.colCopy);
						$(this.cDrag).hide();
						
					}
														
				$('body').noSelect();
			
			},
			dragMove: function (e) {
			
				if (this.colresize) //column resize
					{
						var n = this.colresize.n;
						var diff = e.pageX-this.colresize.startX;
						var nleft = this.colresize.ol + diff;
						var nw = this.colresize.ow + diff;
						if (nw > p.minwidth)
							{
								$('div:eq('+n+')',this.cDrag).css('left',nleft);
								this.colresize.nw = nw;
							}
					}
				else if (this.vresize) //table resize
					{
						var v = this.vresize;
						var y = e.pageY;
						var diff = y-v.sy;
						
						if (!p.defwidth) p.defwidth = p.width;
						
						if (p.width != 'auto' && !p.nohresize && v.hgo)
						{
							var x = e.pageX;
							var xdiff = x - v.sx;
							var newW = v.w + xdiff;
							if (newW > p.defwidth)
								{
									this.gDiv.style.width = newW + 'px';
									p.width = newW;
								}
						}
						
						var newH = v.h + diff;
						if ((newH > p.minheight || p.height < p.minheight) && !v.hgo)
							{
								this.bDiv.style.height = newH + 'px';
								p.height = newH;
								this.fixHeight(newH);
							}
						v = null;
					}
				else if (this.colCopy) {
					$(this.dcol).addClass('thMove').removeClass('thOver'); 
					if (e.pageX > this.hset.right || e.pageX < this.hset.left || e.pageY > this.hset.bottom || e.pageY < this.hset.top)
					{
						//this.dragEnd();
						$('body').css('cursor','move');
					}
					else 
					$('body').css('cursor','pointer');
					$(this.colCopy).css({top:e.pageY + 10,left:e.pageX + 20, display: 'block'});
				}													
			
			},
			dragEnd: function () {

				if (this.colresize)
					{
						var n = this.colresize.n;
						var nw = this.colresize.nw;

								$('th:visible div:eq('+n+')',this.hDiv).css('width',nw);
								$('tr',this.bDiv).each (
									function ()
										{
										$('td:visible div:eq('+n+')',this).css('width',nw);
										}
								);
								this.hDiv.scrollLeft = this.bDiv.scrollLeft;


						$('div:eq('+n+')',this.cDrag).siblings().show();
						$('.dragging',this.cDrag).removeClass('dragging');
						this.rePosDrag();
						this.fixHeight();
						this.colresize = false;
					}
				else if (this.vresize)
					{
						this.vresize = false;
					}
				else if (this.colCopy)
					{
						$(this.colCopy).remove();
						if (this.dcolt != null)
							{
							
							
							if (this.dcoln>this.dcolt)
								
								$('th:eq('+this.dcolt+')',this.hDiv).before(this.dcol);
							else
								$('th:eq('+this.dcolt+')',this.hDiv).after(this.dcol);
							
							
							
							this.switchCol(this.dcoln,this.dcolt);
							$(this.cdropleft).remove();
							$(this.cdropright).remove();
							this.rePosDrag();
							
																			
							}
						
						this.dcol = null;
						this.hset = null;
						this.dcoln = null;
						this.dcolt = null;
						this.colCopy = null;
						
						$('.thMove',this.hDiv).removeClass('thMove');
						$(this.cDrag).show();
					}										
				$('body').css('cursor','default');
				$('body').noSelect(false);
			},
			toggleCol: function(cid,visible) {
				
				var ncol = $("th[axis='col"+cid+"']",this.hDiv)[0];
				var n = $('thead th',g.hDiv).index(ncol);
				var cb = $('input[value='+cid+']',g.nDiv)[0];
				
				
				if (visible==null)
					{
						visible = ncol.hide;
					}
				
				
				
				if ($('input:checked',g.nDiv).length<p.minColToggle&&!visible) return false;
				
				if (visible)
					{
						ncol.hide = false;
						$(ncol).show();
						cb.checked = true;
					}
				else
					{
						ncol.hide = true;
						$(ncol).hide();
						cb.checked = false;
					}
					
						$('tbody tr',t).each
							(
								function ()
									{
										if (visible)
											$('td:eq('+n+')',this).show();
										else
											$('td:eq('+n+')',this).hide();
									}
							);							
				
				this.rePosDrag();
				
				if (p.onToggleCol) p.onToggleCol(cid,visible);
				
				return visible;
			},
			switchCol: function(cdrag,cdrop) { //switch columns
				
				$('tbody tr',t).each
					(
						function ()
							{
								if (cdrag>cdrop)
									$('td:eq('+cdrop+')',this).before($('td:eq('+cdrag+')',this));
								else
									$('td:eq('+cdrop+')',this).after($('td:eq('+cdrag+')',this));
							}
					);
					
					//switch order in nDiv
					if (cdrag>cdrop)
						$('tr:eq('+cdrop+')',this.nDiv).before($('tr:eq('+cdrag+')',this.nDiv));
					else
						$('tr:eq('+cdrop+')',this.nDiv).after($('tr:eq('+cdrag+')',this.nDiv));
						
					if ($.browser.msie&&$.browser.version<7.0) $('tr:eq('+cdrop+') input',this.nDiv)[0].checked = true;	
					
					this.hDiv.scrollLeft = this.bDiv.scrollLeft;
			},			
			scroll: function() {
					this.hDiv.scrollLeft = this.bDiv.scrollLeft;
					this.rePosDrag();
			},
			addData: function (data) { //parse data
				
				if (p.preProcess)
					data = p.preProcess(data);
				
				$('.pReload',this.pDiv).removeClass('loading');
				this.loading = false;

				if (!data) 
					{
					$('.pPageStat',this.pDiv).html(p.errormsg);	
					return false;
					}

				if (p.dataType=='xml')
					p.total = +$('rows total',data).text();
				else
					p.total = data.total;
					
				if (p.total==0)
					{
					$('tr, a, td, div',t).unbind();
					$(t).empty();
					p.pages = 1;
					p.page = 1;
					this.buildpager();
					$('.pPageStat',this.pDiv).html(p.nomsg);
					return false;
					}
				
				p.pages = Math.ceil(p.total/p.rp);
				
				if (p.dataType=='xml')
					p.page = +$('rows page',data).text();
				else
					p.page = data.page;
				
				this.buildpager();

				//build new body
				var tbody = document.createElement('tbody');
				
				if (p.dataType=='json')
				{
					$.each
					(
					 data.rows,
					 function(i,row) 
					 	{
							var tr = document.createElement('tr');
							if (i % 2 && p.striped) tr.className = 'erow';
							
							if (row.id) tr.id = 'row' + row.id;
							
							//add cell
							$('thead tr:first th',g.hDiv).each
							(
							 	function ()
									{
										
										var td = document.createElement('td');
										var idx = $(this).attr('axis').substr(3);
										td.align = this.align;
										td.innerHTML = row.cell[idx];
										$(tr).append(td);
										td = null;
									}
							); 
							
							
							if ($('thead',this.gDiv).length<1) //handle if grid has no headers
							{

									for (idx=0;idx<cell.length;idx++)
										{
										var td = document.createElement('td');
										td.innerHTML = row.cell[idx];
										$(tr).append(td);
										td = null;
										}
							}							
							
							$(tbody).append(tr);
							tr = null;
						}
					);				
					
				} else if (p.dataType=='xml') {

				i = 1;

				$("rows row",data).each
				(
				 
				 	function ()
						{
							
							i++;
							
							var tr = document.createElement('tr');
							if (i % 2 && p.striped) tr.className = 'erow';

							var nid =$(this).attr('id');
							if (nid) tr.id = 'row' + nid;
							
							nid = null;
							
							var robj = this;

							
							
							$('thead tr:first th',g.hDiv).each
							(
							 	function ()
									{
										
										var td = document.createElement('td');
										var idx = $(this).attr('axis').substr(3);
										td.align = this.align;
										td.innerHTML = $("cell:eq("+ idx +")",robj).text();
										$(tr).append(td);
										td = null;
									}
							);
							
							
							if ($('thead',this.gDiv).length<1) //handle if grid has no headers
							{
								$('cell',this).each
								(
								 	function ()
										{
										var td = document.createElement('td');
										td.innerHTML = $(this).text();
										$(tr).append(td);
										td = null;
										}
								);
							}
							
							$(tbody).append(tr);
							tr = null;
							robj = null;
						}
				);
				
				}

				$('tr',t).unbind();
				$(t).empty();
				
				$(t).append(tbody);
				this.addCellProp();
				this.addRowProp();
				
				//this.fixHeight($(this.bDiv).height());
				
				this.rePosDrag();
				
				tbody = null; data = null; i = null; 
				
				if (p.onSuccess) p.onSuccess();
				if (p.hideOnSubmit) $(g.block).remove();//$(t).show();
				
				this.hDiv.scrollLeft = this.bDiv.scrollLeft;
				if ($.browser.opera) $(t).css('visibility','visible');
				
			},
			changeSort: function(th) { //change sortorder
			
				if (this.loading) return true;
				
				$(g.nDiv).hide();$(g.nBtn).hide();
				
				if (p.sortname == $(th).attr('abbr'))
					{
						if (p.sortorder=='asc') p.sortorder = 'desc'; 
						else p.sortorder = 'asc';						
					}
				
				$(th).addClass('sorted').siblings().removeClass('sorted');
				$('.sdesc',this.hDiv).removeClass('sdesc');
				$('.sasc',this.hDiv).removeClass('sasc');
				$('div',th).addClass('s'+p.sortorder);
				p.sortname= $(th).attr('abbr');
				
				if (p.onChangeSort)
					p.onChangeSort(p.sortname,p.sortorder);
				else
					this.populate();				
			
			},
			buildpager: function(){ //rebuild pager based on new properties
			
			$('.pcontrol input',this.pDiv).val(p.page);
			$('.pcontrol span',this.pDiv).html(p.pages);
			
			var r1 = (p.page-1) * p.rp + 1; 
			var r2 = r1 + p.rp - 1; 
			
			if (p.total<r2) r2 = p.total;
			
			var stat = p.pagestat;
			
			stat = stat.replace(/{from}/,r1);
			stat = stat.replace(/{to}/,r2);
			stat = stat.replace(/{total}/,p.total);
			
			$('.pPageStat',this.pDiv).html(stat);
			
			},
			populate: function () { //get latest data

				if (this.loading) return true;

				if (p.onSubmit)
					{
						var gh = p.onSubmit();
						if (!gh) return false;
					}

				this.loading = true;
				if (!p.url) return false;
				
				$('.pPageStat',this.pDiv).html(p.procmsg);
				
				$('.pReload',this.pDiv).addClass('loading');
				
				$(g.block).css({top:g.bDiv.offsetTop});
				
				if (p.hideOnSubmit) $(this.gDiv).prepend(g.block); //$(t).hide();
				
				if ($.browser.opera) $(t).css('visibility','hidden');
				
				if (!p.newp) p.newp = 1;
				
				if (p.page>p.pages) p.page = p.pages;
				//var param = {page:p.newp, rp: p.rp, sortname: p.sortname, sortorder: p.sortorder, query: p.query, qtype: p.qtype};
				var param = [
					 { name : 'page', value : p.newp }
					,{ name : 'rp', value : p.rp }
					,{ name : 'sortname', value : p.sortname}
					,{ name : 'sortorder', value : p.sortorder }
					,{ name : 'query', value : p.query}
					,{ name : 'qtype', value : p.qtype}
				];							 
							 
				if (p.params)
					{
						for (var pi = 0; pi < p.params.length; pi++) param[param.length] = p.params[pi];
					}
				
					$.ajax({
					   type: p.method,
					   url: p.url,
					   data: param,
					   dataType: p.dataType,
					   success: function(data){g.addData(data);},
					   error: function(data) { try { if (p.onError) p.onError(data); } catch (e) {} }
					 });
			},
			doSearch: function () {
				p.query = $('input[name=q]',g.sDiv).val();
				p.qtype = $('select[name=qtype]',g.sDiv).val();
				p.newp = 1;

				this.populate();				
			},
			changePage: function (ctype){ //change page
			
				if (this.loading) return true;
			
				switch(ctype)
				{
					case 'first': p.newp = 1; break;
					case 'prev': if (p.page>1) p.newp = parseInt(p.page) - 1; break;
					case 'next': if (p.page<p.pages) p.newp = parseInt(p.page) + 1; break;
					case 'last': p.newp = p.pages; break;
					case 'input': 
							var nv = parseInt($('.pcontrol input',this.pDiv).val());
							if (isNaN(nv)) nv = 1;
							if (nv<1) nv = 1;
							else if (nv > p.pages) nv = p.pages;
							$('.pcontrol input',this.pDiv).val(nv);
							p.newp =nv;
							break;
				}
			
				if (p.newp==p.page) return false;
				
				if (p.onChangePage) 
					p.onChangePage(p.newp);
				else				
					this.populate();
			
			},
			addCellProp: function ()
			{
				
					$('tbody tr td',g.bDiv).each
					(
						function ()
							{
									var tdDiv = document.createElement('div');
									var n = $('td',$(this).parent()).index(this);
									var pth = $('th:eq('+n+')',g.hDiv).get(0);
			
									if (pth!=null)
									{
									if (p.sortname==$(pth).attr('abbr')&&p.sortname) 
										{
										this.className = 'sorted';
										}
									 $(tdDiv).css({textAlign:pth.align,width: $('div:first',pth)[0].style.width});
									 
									 if (pth.hide) $(this).css('display','none');
									 
									 }
									 
									 if (p.nowrap==false) $(tdDiv).css('white-space','normal');
									 
									 if (this.innerHTML=='') this.innerHTML = '&nbsp;';
									 
									 //tdDiv.value = this.innerHTML; //store preprocess value
									 tdDiv.innerHTML = this.innerHTML;
									 
									 var prnt = $(this).parent()[0];
									 var pid = false;
									 if (prnt.id) pid = prnt.id.substr(3);
									 
									 if (pth!=null)
									 {
									 if (pth.process) pth.process(tdDiv,pid);
									 }
									 
									$(this).empty().append(tdDiv).removeAttr('width'); //wrap content

									//add editable event here 'dblclick'

							}
					);
					
			},
			getCellDim: function (obj) // get cell prop for editable event
			{
				var ht = parseInt($(obj).height());
				var pht = parseInt($(obj).parent().height());
				var wt = parseInt(obj.style.width);
				var pwt = parseInt($(obj).parent().width());
				var top = obj.offsetParent.offsetTop;
				var left = obj.offsetParent.offsetLeft;
				var pdl = parseInt($(obj).css('paddingLeft'));
				var pdt = parseInt($(obj).css('paddingTop'));
				return {ht:ht,wt:wt,top:top,left:left,pdl:pdl, pdt:pdt, pht:pht, pwt: pwt};
			},
			addRowProp: function()
			{
					$('tbody tr',g.bDiv).each
					(
						function ()
							{
							$(this)
							.click(
								function (e) 
									{ 
										var obj = (e.target || e.srcElement); if (obj.href || obj.type) return true;
										//we should set selected class - kurund
										//$(this).toggleClass('trSelected');
										if (p.singleSelect) $(this).siblings().removeClass('trSelected');
									}
							)
							.mousedown(
								function (e)
									{
										if (e.shiftKey)
										{
										$(this).toggleClass('trSelected'); 
										g.multisel = true; 
										this.focus();
										$(g.gDiv).noSelect();
										}
									}
							)
							.mouseup(
								function ()
									{
										if (g.multisel)
										{
										g.multisel = false;
										$(g.gDiv).noSelect(false);
										}
									}
							)
							.hover(
								function (e) 
									{ 
									if (g.multisel) 
										{
										$(this).toggleClass('trSelected'); 
										}
									},
								function () {}						
							)
							;
							
							if ($.browser.msie&&$.browser.version<7.0)
								{
									$(this)
									.hover(
										function () { $(this).addClass('trOver'); },
										function () { $(this).removeClass('trOver'); }
									)
									;
								}
							}
					);
					
					
			},
			pager: 0
			};		
		
		//create model if any
		if (p.colModel)
		{
			thead = document.createElement('thead');
			tr = document.createElement('tr');
			
			for (i=0;i<p.colModel.length;i++)
				{
					var cm = p.colModel[i];
					var th = document.createElement('th');

					th.innerHTML = cm.display;
					
					if (cm.name&&cm.sortable)
						$(th).attr('abbr',cm.name);
					
					//th.idx = i;
					$(th).attr('axis','col'+i);
					
					if (cm.align)
						th.align = cm.align;
						
					if (cm.width) 
						$(th).attr('width',cm.width);

					if (cm.hide)
						{
						th.hide = true;
						}
						
					if (cm.process)
						{
							th.process = cm.process;
						}

					$(tr).append(th);
				}
			$(thead).append(tr);
			$(t).prepend(thead);
		} // end if p.colmodel	

		//init divs
		g.gDiv = document.createElement('div'); //create global container
		g.mDiv = document.createElement('div'); //create title container
		g.hDiv = document.createElement('div'); //create header container
		g.bDiv = document.createElement('div'); //create body container
		g.vDiv = document.createElement('div'); //create grip
		g.rDiv = document.createElement('div'); //create horizontal resizer
		g.cDrag = document.createElement('div'); //create column drag
		g.block = document.createElement('div'); //creat blocker
		g.nDiv = document.createElement('div'); //create column show/hide popup
		g.nBtn = document.createElement('div'); //create column show/hide button
		g.iDiv = document.createElement('div'); //create editable layer
		g.tDiv = document.createElement('div'); //create toolbar
		g.sDiv = document.createElement('div');
		
		if (p.usepager) g.pDiv = document.createElement('div'); //create pager container
		g.hTable = document.createElement('table');

		//set gDiv
		g.gDiv.className = 'flexigrid';
		if (p.width!='auto') g.gDiv.style.width = p.width + 'px';

		//add conditional classes
		if ($.browser.msie)
			$(g.gDiv).addClass('ie');
		
		if (p.novstripe)
			$(g.gDiv).addClass('novstripe');

		$(t).before(g.gDiv);
		$(g.gDiv)
		.append(t)
		;

		//set toolbar
		if (p.buttons) 
		{
			g.tDiv.className = 'tDiv';
			var tDiv2 = document.createElement('div');
			tDiv2.className = 'tDiv2';
			
			for (i=0;i<p.buttons.length;i++)
				{
					var btn = p.buttons[i];
					if (!btn.separator)
					{
						var btnDiv = document.createElement('div');
						btnDiv.className = 'fbutton';
						btnDiv.innerHTML = "<div><span>"+btn.name+"</span></div>";
						if (btn.bclass) 
							$('span',btnDiv)
							.addClass(btn.bclass)
							.css({paddingLeft:20})
							;
						btnDiv.onpress = btn.onpress;
						btnDiv.name = btn.name;
						if (btn.onpress)
						{
							$(btnDiv).click
							(	
								function () 
								{
								this.onpress(this.name,g.gDiv);
								}
							);
						}
						$(tDiv2).append(btnDiv);
						if ($.browser.msie&&$.browser.version<7.0)
						{
							$(btnDiv).hover(function(){$(this).addClass('fbOver');},function(){$(this).removeClass('fbOver');});
						}
						
					} else {
						$(tDiv2).append("<div class='btnseparator'></div>");
					}
				}
				$(g.tDiv).append(tDiv2);
				$(g.tDiv).append("<div style='clear:both'></div>");
				$(g.gDiv).prepend(g.tDiv);
		}
		
		//set hDiv
		g.hDiv.className = 'hDiv';

		$(t).before(g.hDiv);

		//set hTable
			g.hTable.cellPadding = 0;
			g.hTable.cellSpacing = 0;
			$(g.hDiv).append('<div class="hDivBox"></div>');
			$('div',g.hDiv).append(g.hTable);
			var thead = $("thead:first",t).get(0);
			if (thead) $(g.hTable).append(thead);
			thead = null;
		
		if (!p.colmodel) var ci = 0;

		//setup thead			
			$('thead tr:first th',g.hDiv).each
			(
			 	function ()
					{
						var thdiv = document.createElement('div');
						
						
					
						if ($(this).attr('abbr'))
							{
							$(this).click(
								function (e) 
									{
										
										if (!$(this).hasClass('thOver')) return false;
										var obj = (e.target || e.srcElement);
										if (obj.href || obj.type) return true; 
										g.changeSort(this);
									}
							)
							;
							
							if ($(this).attr('abbr')==p.sortname)
								{
								this.className = 'sorted';
								thdiv.className = 's'+p.sortorder;
								}
							}
							
							if (this.hide) $(this).hide();
							
							if (!p.colmodel)
							{
								$(this).attr('axis','col' + ci++);
							}
							
							
						 $(thdiv).css({textAlign:this.align, width: this.width + 'px'});
						 thdiv.innerHTML = this.innerHTML;
						 
						$(this).empty().append(thdiv).removeAttr('width')
						.mousedown(function (e) 
							{
								g.dragStart('colMove',e,this);
							})
						.hover(
							function(){
								if (!g.colresize&&!$(this).hasClass('thMove')&&!g.colCopy) $(this).addClass('thOver');
								
								if ($(this).attr('abbr')!=p.sortname&&!g.colCopy&&!g.colresize&&$(this).attr('abbr')) $('div',this).addClass('s'+p.sortorder);
								else if ($(this).attr('abbr')==p.sortname&&!g.colCopy&&!g.colresize&&$(this).attr('abbr'))
									{
										var no = '';
										if (p.sortorder=='asc') no = 'desc';
										else no = 'asc';
										$('div',this).removeClass('s'+p.sortorder).addClass('s'+no);
									}
								
								if (g.colCopy) 
									{
									var n = $('th',g.hDiv).index(this);
									
									if (n==g.dcoln) return false;
									
									
									
									if (n<g.dcoln) $(this).append(g.cdropleft);
									else $(this).append(g.cdropright);
									
									g.dcolt = n;
									
									} else if (!g.colresize) {
										
									var nv = $('th:visible',g.hDiv).index(this);
									var onl = parseInt($('div:eq('+nv+')',g.cDrag).css('left'));
									var nw = parseInt($(g.nBtn).width()) + parseInt($(g.nBtn).css('borderLeftWidth'));
									nl = onl - nw + Math.floor(p.cgwidth/2);
									
									$(g.nDiv).hide();$(g.nBtn).hide();
									
									$(g.nBtn).css({'left':nl,top:g.hDiv.offsetTop}).show();
									
									var ndw = parseInt($(g.nDiv).width());
									
									$(g.nDiv).css({top:g.bDiv.offsetTop});
									
									if ((nl+ndw)>$(g.gDiv).width())
										$(g.nDiv).css('left',onl-ndw+1);
									else
										$(g.nDiv).css('left',nl);
										
									if ($(this).hasClass('sorted')) 
										$(g.nBtn).addClass('srtd');
									else
										$(g.nBtn).removeClass('srtd');
										
									}
									
							},
							function(){
								$(this).removeClass('thOver');
								if ($(this).attr('abbr')!=p.sortname) $('div',this).removeClass('s'+p.sortorder);
								else if ($(this).attr('abbr')==p.sortname)
									{
										var no = '';
										if (p.sortorder=='asc') no = 'desc';
										else no = 'asc';
										
										$('div',this).addClass('s'+p.sortorder).removeClass('s'+no);
									}
								if (g.colCopy) 
									{								
									$(g.cdropleft).remove();
									$(g.cdropright).remove();
									g.dcolt = null;
									}
							})
						; //wrap content
					}
			);

		//set bDiv
		g.bDiv.className = 'bDiv';
		$(t).before(g.bDiv);
		$(g.bDiv)
		.css({ height: (p.height=='auto') ? 'auto' : p.height+"px"})
		.scroll(function (e) {g.scroll()})
		.append(t)
		;
		
		if (p.height == 'auto') 
			{
			$('table',g.bDiv).addClass('autoht');
			}


		//add td properties
		g.addCellProp();
		
		//add row properties
		g.addRowProp();
		
		//set cDrag
		
		var cdcol = $('thead tr:first th:first',g.hDiv).get(0);
		
		if (cdcol != null)
		{		
		g.cDrag.className = 'cDrag';
		g.cdpad = 0;
		
		g.cdpad += (isNaN(parseInt($('div',cdcol).css('borderLeftWidth'))) ? 0 : parseInt($('div',cdcol).css('borderLeftWidth'))); 
		g.cdpad += (isNaN(parseInt($('div',cdcol).css('borderRightWidth'))) ? 0 : parseInt($('div',cdcol).css('borderRightWidth'))); 
		g.cdpad += (isNaN(parseInt($('div',cdcol).css('paddingLeft'))) ? 0 : parseInt($('div',cdcol).css('paddingLeft'))); 
		g.cdpad += (isNaN(parseInt($('div',cdcol).css('paddingRight'))) ? 0 : parseInt($('div',cdcol).css('paddingRight'))); 
		g.cdpad += (isNaN(parseInt($(cdcol).css('borderLeftWidth'))) ? 0 : parseInt($(cdcol).css('borderLeftWidth'))); 
		g.cdpad += (isNaN(parseInt($(cdcol).css('borderRightWidth'))) ? 0 : parseInt($(cdcol).css('borderRightWidth'))); 
		g.cdpad += (isNaN(parseInt($(cdcol).css('paddingLeft'))) ? 0 : parseInt($(cdcol).css('paddingLeft'))); 
		g.cdpad += (isNaN(parseInt($(cdcol).css('paddingRight'))) ? 0 : parseInt($(cdcol).css('paddingRight'))); 

		$(g.bDiv).before(g.cDrag);
		
		var cdheight = $(g.bDiv).height();
		var hdheight = $(g.hDiv).height();
		
		$(g.cDrag).css({top: -hdheight + 'px'});
		
		$('thead tr:first th',g.hDiv).each
			(
			 	function ()
					{
						var cgDiv = document.createElement('div');
						$(g.cDrag).append(cgDiv);
						if (!p.cgwidth) p.cgwidth = $(cgDiv).width();
						$(cgDiv).css({height: cdheight + hdheight})
						.mousedown(function(e){g.dragStart('colresize',e,this);})
						;
						if ($.browser.msie&&$.browser.version<7.0)
						{
							g.fixHeight($(g.gDiv).height());
							$(cgDiv).hover(
								function () 
								{
								g.fixHeight();
								$(this).addClass('dragging') 
								},
								function () { if (!g.colresize) $(this).removeClass('dragging') }
							);
						}
					}
			);
		
		//g.rePosDrag();
							
		}
		

		//add strip		
		if (p.striped) 
			$('tbody tr:odd',g.bDiv).addClass('erow');
			
			
		if (p.resizable && p.height !='auto') 
		{
		g.vDiv.className = 'vGrip';
		$(g.vDiv)
		.mousedown(function (e) { g.dragStart('vresize',e)})
		.html('<span></span>');
		$(g.bDiv).after(g.vDiv);
		}
		
		if (p.resizable && p.width !='auto' && !p.nohresize) 
		{
		g.rDiv.className = 'hGrip';
		$(g.rDiv)
		.mousedown(function (e) {g.dragStart('vresize',e,true);})
		.html('<span></span>')
		.css('height',$(g.gDiv).height())
		;
		if ($.browser.msie&&$.browser.version<7.0)
		{
			$(g.rDiv).hover(function(){$(this).addClass('hgOver');},function(){$(this).removeClass('hgOver');});
		}
		$(g.gDiv).append(g.rDiv);
		}
		
		// add pager
		if (p.usepager)
		{
		g.pDiv.className = 'pDiv';
		g.pDiv.innerHTML = '<div class="pDiv2"></div>';
		$(g.bDiv).after(g.pDiv);
		var html = ' <div class="pGroup"> <div class="pFirst pButton"><span></span></div><div class="pPrev pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pcontrol">Page <input type="text" size="4" value="1" /> of <span> 1 </span></span></div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pNext pButton"><span></span></div><div class="pLast pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pReload pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pPageStat"></span></div>';
		$('div',g.pDiv).html(html);
		
		$('.pReload',g.pDiv).click(function(){g.populate()});
		$('.pFirst',g.pDiv).click(function(){g.changePage('first')});
		$('.pPrev',g.pDiv).click(function(){g.changePage('prev')});
		$('.pNext',g.pDiv).click(function(){g.changePage('next')});
		$('.pLast',g.pDiv).click(function(){g.changePage('last')});
		$('.pcontrol input',g.pDiv).keydown(function(e){if(e.keyCode==13) g.changePage('input')});
		if ($.browser.msie&&$.browser.version<7) $('.pButton',g.pDiv).hover(function(){$(this).addClass('pBtnOver');},function(){$(this).removeClass('pBtnOver');});
			
			if (p.useRp)
			{
			var opt = "";
			for (var nx=0;nx<p.rpOptions.length;nx++)
			{
				if (p.rp == p.rpOptions[nx]) sel = 'selected="selected"'; else sel = '';
				 opt += "<option value='" + p.rpOptions[nx] + "' " + sel + " >" + p.rpOptions[nx] + "&nbsp;&nbsp;</option>";
			};
			$('.pDiv2',g.pDiv).prepend("<div class='pGroup'><select name='rp'>"+opt+"</select></div> <div class='btnseparator'></div>");
			$('select',g.pDiv).change(
					function ()
					{
						if (p.onRpChange) 
							p.onRpChange(+this.value);
						else
							{
							p.newp = 1;
							p.rp = +this.value;
							g.populate();
							}
					}
				);
			}
		
		//add search button
		if (p.searchitems)
			{
				$('.pDiv2',g.pDiv).prepend("<div class='pGroup'> <div class='pSearch pButton'><span></span></div> </div>  <div class='btnseparator'></div>");
				$('.pSearch',g.pDiv).click(function(){$(g.sDiv).slideToggle('fast',function(){$('.sDiv:visible input:first',g.gDiv).trigger('focus');});});				
				//add search box
				g.sDiv.className = 'sDiv';
				
				sitems = p.searchitems;
				
				var sopt = "";
				for (var s = 0; s < sitems.length; s++)
				{
					if (p.qtype=='' && sitems[s].isdefault==true)
					{
					p.qtype = sitems[s].name;
					sel = 'selected="selected"';
					} else sel = '';
					sopt += "<option value='" + sitems[s].name + "' " + sel + " >" + sitems[s].display + "&nbsp;&nbsp;</option>";						
				}
				
				if (p.qtype=='') p.qtype = sitems[0].name;
				
				$(g.sDiv).append("<div class='sDiv2'>Quick Search <input type='text' size='30' name='q' class='qsbox' /> <select name='qtype'>"+sopt+"</select> <input type='button' value='Clear' /></div>");

				$('input[name=q],select[name=qtype]',g.sDiv).keydown(function(e){if(e.keyCode==13) g.doSearch()});
				$('input[value=Clear]',g.sDiv).click(function(){$('input[name=q]',g.sDiv).val(''); p.query = ''; g.doSearch(); });
				$(g.bDiv).after(g.sDiv);				
				
			}
		
		}
		$(g.pDiv,g.sDiv).append("<div style='clear:both'></div>");
	
		// add title
		if (p.title)
		{
			g.mDiv.className = 'mDiv';
			g.mDiv.innerHTML = '<div class="ftitle">'+p.title+'</div>';
			$(g.gDiv).prepend(g.mDiv);
			if (p.showTableToggleBtn)
				{
					$(g.mDiv).append('<div class="ptogtitle" title="Minimize/Maximize Table"><span></span></div>');
					$('div.ptogtitle',g.mDiv).click
					(
					 	function ()
							{
								$(g.gDiv).toggleClass('hideBody');
								$(this).toggleClass('vsble');
							}
					);
				}
			//g.rePosDrag();
		}

		//setup cdrops
		g.cdropleft = document.createElement('span');
		g.cdropleft.className = 'cdropleft';
		g.cdropright = document.createElement('span');
		g.cdropright.className = 'cdropright';

		//add block
		g.block.className = 'gBlock';
		var gh = $(g.bDiv).height();
		var gtop = g.bDiv.offsetTop;
		$(g.block).css(
		{
			width: g.bDiv.style.width,
			height: gh,
			background: 'white',
			position: 'relative',
			marginBottom: (gh * -1),
			zIndex: 1,
			top: gtop,
			left: '0px'
		}
		);
		$(g.block).fadeTo(0,p.blockOpacity);				
		
		// add column control
		if ($('th',g.hDiv).length)
		{
			
			g.nDiv.className = 'nDiv';
			g.nDiv.innerHTML = "<table cellpadding='0' cellspacing='0'><tbody></tbody></table>";
			$(g.nDiv).css(
			{
				marginBottom: (gh * -1),
				display: 'none',
				top: gtop
			}
			).noSelect()
			;
			
			var cn = 0;
			
			
			$('th div',g.hDiv).each
			(
			 	function ()
					{
						var kcol = $("th[axis='col" + cn + "']",g.hDiv)[0];
						var chk = 'checked="checked"';
						if (kcol.style.display=='none') chk = '';
						
						$('tbody',g.nDiv).append('<tr><td class="ndcol1"><input type="checkbox" '+ chk +' class="togCol" value="'+ cn +'" /></td><td class="ndcol2">'+this.innerHTML+'</td></tr>');
						cn++;
					}
			);
			
			if ($.browser.msie&&$.browser.version<7.0)
				$('tr',g.nDiv).hover
				(
				 	function () {$(this).addClass('ndcolover');},
					function () {$(this).removeClass('ndcolover');}
				);
			
			$('td.ndcol2',g.nDiv).click
			(
			 	function ()
					{
						if ($('input:checked',g.nDiv).length<=p.minColToggle&&$(this).prev().find('input')[0].checked) return false;
						return g.toggleCol($(this).prev().find('input').val());
					}
			);
			
			$('input.togCol',g.nDiv).click
			(
			 	function ()
					{
						
						if ($('input:checked',g.nDiv).length<p.minColToggle&&this.checked==false) return false;
						$(this).parent().next().trigger('click');
						//return false;
					}
			);


			$(g.gDiv).prepend(g.nDiv);
			
			$(g.nBtn).addClass('nBtn')
			.html('<div></div>')
			.attr('title','Hide/Show Columns')
			.click
			(
			 	function ()
				{
			 	$(g.nDiv).toggle(); return true;
				}
			);
			
			if (p.showToggleBtn) $(g.gDiv).prepend(g.nBtn);
			
		}
		
		// add date edit layer
		$(g.iDiv)
		.addClass('iDiv')
		.css({display:'none'})
		;
		$(g.bDiv).append(g.iDiv);
		
		// add flexigrid events
		$(g.bDiv)
		.hover(function(){$(g.nDiv).hide();$(g.nBtn).hide();},function(){if (g.multisel) g.multisel = false;})
		;
		$(g.gDiv)
		.hover(function(){},function(){$(g.nDiv).hide();$(g.nBtn).hide();})
		;
		
		//add document events
		$(document)
		.mousemove(function(e){g.dragMove(e)})
		.mouseup(function(e){g.dragEnd()})
		.hover(function(){},function (){g.dragEnd()})
		;
		
		//browser adjustments
		if ($.browser.msie&&$.browser.version<7.0)
		{
			$('.hDiv,.bDiv,.mDiv,.pDiv,.vGrip,.tDiv, .sDiv',g.gDiv)
			.css({width: '100%'});
			$(g.gDiv).addClass('ie6');
			if (p.width!='auto') $(g.gDiv).addClass('ie6fullwidthbug');			
		} 
		
		g.rePosDrag();
		g.fixHeight();
		
		//make grid functions accessible
		t.p = p;
		t.grid = g;
		
		// load data
		if (p.url&&p.autoload) 
			{
			g.populate();
			}
		
		return t;		
			
	};

	var docloaded = false;

	$(document).ready(function () {docloaded = true} );

	$.fn.flexigrid = function(p) {

		return this.each( function() {
				if (!docloaded)
				{
					$(this).hide();
					var t = this;
					$(document).ready
					(
						function ()
						{
						$.addFlex(t,p);
						}
					);
				} else {
					$.addFlex(this,p);
				}
			});

	}; //end flexigrid

	$.fn.flexReload = function(p) { // function to reload grid

		return this.each( function() {
				if (this.grid&&this.p.url) this.grid.populate();
			});

	}; //end flexReload

	$.fn.flexOptions = function(p) { //function to update general options

		return this.each( function() {
				if (this.grid) $.extend(this.p,p);
			});

	}; //end flexOptions

	$.fn.flexToggleCol = function(cid,visible) { // function to reload grid

		return this.each( function() {
				if (this.grid) this.grid.toggleCol(cid,visible);
			});

	}; //end flexToggleCol

	$.fn.flexAddData = function(data) { // function to add data to grid

		return this.each( function() {
				if (this.grid) this.grid.addData(data);
			});

	};

	$.fn.noSelect = function(p) { //no select plugin by me :-)

		if (p == null) 
			prevent = true;
		else
			prevent = p;

		if (prevent) {
		
		return this.each(function ()
			{
				if ($.browser.msie||$.browser.safari) $(this).bind('selectstart',function(){return false;});
				else if ($.browser.mozilla) 
					{
						$(this).css('MozUserSelect','none');
						$('body').trigger('focus');
					}
				else if ($.browser.opera) $(this).bind('mousedown',function(){return false;});
				else $(this).attr('unselectable','on');
			});
			
		} else {

		
		return this.each(function ()
			{
				if ($.browser.msie||$.browser.safari) $(this).unbind('selectstart');
				else if ($.browser.mozilla) $(this).css('MozUserSelect','inherit');
				else if ($.browser.opera) $(this).unbind('mousedown');
				else $(this).removeAttr('unselectable','on');
			});
		
		}

	}; //end noSelect
		
})(jQuery);/*
 * Autocomplete - jQuery plugin 1.0.2
 *
 * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
 *
 */

;(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);
		
		// if highlight is set to false, replace it with a do-nothing function
		options.highlight = options.highlight || function(value) { return value; };
		
		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
		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
	};

	// Create $ object for input element
	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;
	
	// prevent form submit in opera when selecting with return key
	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
		if (blockSubmit) {
			blockSubmit = false;
			return false;
		}
	});
	
	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
		// track last key pressed
		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;
			
			// matches also semicolon
			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
			case KEY.TAB:
			case KEY.RETURN:
				if( selectCurrent() ) {
					// stop default to prevent a form submit, Opera needs special handling
					event.preventDefault();
					blockSubmit = true;
					return false;
				}
				break;
				
			case KEY.ESC:
				select.hide();
				break;
				
			default:
				clearTimeout(timeout);
				timeout = setTimeout(onChange, options.delay);
				break;
		}
	}).focus(function(){
		// track whether the field has focus, we shouldn't process any
		// results if the field no longer has focus
		hasFocus++;
	}).blur(function() {
		hasFocus = 0;
		if (!config.mouseDownOnSelect) {
			hideResults();
		}
	}).click(function() {
		// show select when clicking in a focused field
		if ( hasFocus++ > 1 && !select.visible() ) {
			onChange(0, true);
		}
	}).bind("search", function() {
		// TODO why not just specifying both arguments?
		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 we've updated the data, repopulate
		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];
	}
	
	// fills in the input box w/the first match (assumed to be the best match)
	// q: the term entered
	// sValue: the first matching result
	function autoFill(q, sValue){
		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
		// if the last user key pressed was backspace, don't autofill
		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
			// select the portion of the value not typed by the user (so the next character will erase)
			$.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) {
			// call search and run callback
			$input.search(
				function (result){
					// if no value found, clear the input box
					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)
			// position cursor at end of input field
			$.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);
		// recieve the cached data
		if (data && data.length) {
			success(term, data);
		// if an AJAX url has been supplied, try loading the data now
		} 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({
				// try to leverage ajaxQueue plugin to abort previous requests
				mode: "abort",
				// limit abortion to this input
				port: "autocomplete" + input.name,
				dataType: options.dataType,
				url: options.url,
				data: $.extend({
					s: 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 {
			// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
			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: 0,
	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 (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;
		// track the matches
		var stMatchSets = {},
			nullData = 0;

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( !options.url ) options.cacheLength = 1;
		
		// track all options for minChars = 0
		stMatchSets[""] = [];
		
		// loop through the array and create a lookup structure
		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
			var rawValue = options.data[i];
			// if rawValue is a string, make an array otherwise just reference the array
			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 no lookup array for this character exists, look it up now
			if( !stMatchSets[firstChar] ) 
				stMatchSets[firstChar] = [];

			// if the match is a string
			var row = {
				value: value,
				data: rawValue,
				result: options.formatResult && options.formatResult(rawValue) || value
			};
			
			// push the current match into the set list
			stMatchSets[firstChar].push(row);

			// keep track of minChars zero items
			if ( nullData++ < options.max ) {
				stMatchSets[""].push(row);
			}
		};

		// add the data items to the cache
		$.each(stMatchSets, function(i, value) {
			// increase the cache size
			options.cacheLength++;
			// add to the cache
			add(i, value);
		});
	}
	
	// populate any existing data
	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 dealing w/local data and matchContains than we must make sure
			 * to loop through all the data collections looking for matches
			 */
			if( !options.url && options.matchContains ){
				// track all matches
				var csub = [];
				// loop through all the data grids for matches
				for( var k in data ){
					// don't search through the stMatchSets[""] (minChars: 0) cache
					// this prevents duplicates
					if( k.length > 0 ){
						var c = data[k];
						$.each(c, function(i, x) {
							// if we've got a match, add it to the array
							if (matchSubset(x.value, q)) {
								csub.push(x);
							}
						});
					}
				}				
				return csub;
			} else 
			// if the exact item exists, use it
			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;
	
	// Create results
	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();
			// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
			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;
		// more fun with IE, sometimes event.target is empty, just ignore it then
		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;
		}
		// apply bgiframe if available
		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).width(),
				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) {
						// IE doesn't recalculate width when scrollbar disappears
						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);/**
*    Chained Selects for jQuery 
*    Copyright (C) 2008 Ziadin Givan www.CodeAssembly.com  
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see http://www.gnu.org/licenses/
*
*    
*   settings = { usePost : true, before:function() {}, after: function() {}, default: null, parameters : { parameter1 : 'value1', parameter2 : 'value2'} }	
*   if usePost is true, then the form will use POST to pass the parameters to the target, otherwise will use GET
*   "before" function is called before the ajax request and "after" function is called after the ajax request.
*   If defaultValue is not null then the specified option will be selected.
*   You can specify additional parameters to be sent to the the server in settings.parameters.
*
*/
;(function($) {
    
jQuery.fn.chainSelect = function( target, url, settings ) 
{
  return this.each( function()
  {
	$(this).change( function( ) 
	{
		settings = $.extend(
		{
			after : null,
			before : null,
			usePost : false,
			defaultValue : null,
			parameters : {'_id' : $(this).attr('id'), '_name' : $(this).attr('name')}
        } , settings);

		settings.parameters._value =  $(this).val();

		if (settings.before != null) 
		{
			settings.before( target );
		}

		ajaxCallback = function(data, textStatus) 
		{
			$(target).html("");//clear old options
			data = eval(data);//get json array
                        if ( data != null ) {
			    for (i = 0; i < data.length; i++) {
				$(target).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
			    }
			} else {
				$(target).get(0).add(new Option('- select a country -', 0), document.all ? i : null);
			}

			if (settings.defaultValue != null)
			{
				$(target).val(settings.defaultValue);//select default value
			} else
			{
				$("option:first", target).attr( "selected", "selected" );//select first option
			}

			if (settings.after != null) 
			{
				settings.after(target);
			}

			$(target).change();//call next chain
		};

		if (settings.usePost == true)
		{
			$.post( url, settings.parameters, ajaxCallback );
		} else
		{
			$.get( url, settings.parameters, ajaxCallback );
		}
	});
  });
};

})(jQuery);/*
 * Treeview pre-1.4.1 - jQuery plugin to hide and show branches of a tree
 * 
 * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
 * http://docs.jquery.com/Plugins/Treeview
 *
 * Copyright (c) 2007 Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
 *
 */;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){if(this==event.target)toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("<div class=\""+CLASSES.hitarea+"\"/>").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery);/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2446 $
 *
 * Version 2.1.1
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))