var _foreach=Array.prototype.foreach=function(f){for(var i=0;i<this.length;i++)f(this[i]);return this};function $2array(o){if(typeof o!=="undefined"&&typeof o.length!=="undefined"&&o.constructor!==Array&&typeof o.foreach==="undefined"){o.foreach=_foreach;o.asArray=true}return o}var ext_lst=[];$addHandler(window,"unload",function(e){for(var e,i=0;e=ext_lst[i++];)e.obj[e.name]=null});function $ext(n,f){function attach_func(o){o[n]=f;ext_lst.push({obj:o,name:n})}function fix_html_elm(o){if(/^\$tags$/i.test(n)||!o)return;attach_func(o);if(o.$tags===void 0){o.$tags=function(tagName,copy){var lst;if(!!copy){lst=[];var arr=this.getElementsByTagName(tagName);for(var i=0;i<arr.length;i++){attach_func(arr[i]);lst.push(arr[i])}}else{lst=$2array(this.getElementsByTagName(tagName));if(!!lst.foreach)lst.foreach(attach_func)}return lst};ext_lst.push({obj:o,name:"$tags"})}return o}if(typeof HTMLElement!=="undefined")fix_html_elm(HTMLElement.prototype);else{function xd(dn){var old=document[dn];document[dn]=function(tn){var o=old(tn);return fix_html_elm(o)}}xd("createElement");xd("getElementById");(function(){var old=document.getElementsByTagName;document.getElementsByTagName=function(tn){var arr=$2array(old(tn));return arr.foreach(fix_html_elm)}})()}}$new=function(tn,cn,ih){var o=document.createElement(tn);if(/string/i.test(typeof cn))o.className=cn;if(/string/i.test(typeof ih))o.innerHTML=ih;return o};$ext("wrapAround",function(fw,removing){if(!!removing)p.paretnNode.replaceChild(fw(this),this);else{var p=this.parentNode,r=$new("div");p.insertBefore(r,this);p.replaceChild(fw(this),r);delete r}});$ext("createChild",function(tn,cn,ih){return this.appendChild($new(tn,cn,ih))});function fix_hitch_txt_box(o){if(/text/i.test(o.type)&&!o.fixed){o.wrapAround(function(el){var div=$new("span","hib");div.createChild("span","left");div.createChild("span","body").appendChild(el);div.createChild("span","right");return div});o.fixed=true}}var fix_hitch_opt_box=function(){var zidx=2000,tabidx=11,currentOpenDiv;return function(s,maxOptListHeight){if(!!s.fixed)return;s.fixed=true;var _maxOptListHeight=maxOptListHeight,txtbox=$new("input",s.className+" opts");txtbox.type="text";txtbox.id=s.id+"_tb";txtbox.name=s.name+"_tb";txtbox.title=txtbox.value=s.options[s.selectedIndex].text;txtbox.setAttribute("autocomplete","off");txtbox.className+=" _ignore_escape_";$addHandler(txtbox,"selectstart",function(e){e.stopPropagation();e.preventDefault()});$(txtbox).focus(function(){$(this).parents("p.formItem").addClass("active")});$(txtbox).blur(function(){if(!div.showing)$(this).parents("p.formItem").removeClass("active")});s.oldid=s.id;s.oldname=s.name;s.id=s.name="";s.parentNode.insertBefore(txtbox,s);$("label[htmlFor='"+s.oldid+"']").each(function(){if(!this.processed){$addHandler(this,"click",function(e){e.stopPropagation();e.preventDefault()});this.htmlFor=txtbox.id;this.processed=true}});fix_hitch_txt_box(txtbox);txtbox.parentNode.parentNode.style.position="relative";var hiddenfld=document.createElement("input");hiddenfld.type="hidden";hiddenfld.id=s.oldid;hiddenfld.name=s.oldname;hiddenfld.value=s.value;s.parentNode.appendChild(hiddenfld);var ddarrow=txtbox.parentNode.createChild("span","optarrow"),div=txtbox.parentNode.createChild("span","selectpanel");div.style.position="absolute";div.showing=false;div.fixed=false;div.id=s.oldid+"_box";div.tabindex=tabidx++;div.append=function(text,tooltip,value,href){var a=this.createChild("a",null,text);a.alt=text;a.sval=value;a.title=tooltip;a.idx=this.length()-1;a.unselect=option_unselect;a.select=option_select;a.onselect=function(){return false};if(href){a.href=href;$addHandler(a,"mousedown",function(e){setTimeout(function(){window.location=href},0)})}else{a.href="";$addHandler(a,"mousedown",select_option);$addHandler(a,"keypress",select_option)}$addHandler(a,"mouseover",function(e){highlight_option(this.idx)});if(a.alt==txtbox.value)option_select.call(a,false)};div.length=function(){return this.childNodes.length};div.remove=function(idx){if(idx>=0&&idx<this.length()){this.removeChild(this.childNodes[idx]);if(idx==div.cur_h)div.cur_h=void 0;else if(idx<div.cur_h)div.cur_h--}};div.clear=function(){while(this.length()>0)this.removeChild(this.childNodes[0])};div.select=function(idx,raiseEvt){if(idx>=0&&idx<this.length())this.childNodes[idx].select(raiseEvt)};div.hide=function(){if(this.showing){this.style.display="none";if(!div.bodyclick)$(txtbox).focus();else{$(this).parents("p.formItem").removeClass("active");div.bodyclick=false}}this.parentNode.parentNode.style.zIndex="1000";this.showing=false;currentOpenDiv=undefined};div.show=function(){currentOpenDiv=this;this.style.display="block";this.parentNode.parentNode.style.zIndex="3000";this.style.height=this.style.width="";this.style.overflowY=this.style.overflowX="";var bounds=Sys.UI.DomElement.getBounds(this),parentBounds=Sys.UI.DomElement.getBounds(this.parentNode.parentNode),height=bounds.height,width=bounds.width,overflowx="hidden",overflowy="hidden";if(width>400)height+=15;if(height>_maxOptListHeight)width+=15;width=Math.max(width,parentBounds.width);if(width>400){width=400;overflowx="scroll"}if(height>_maxOptListHeight){height=_maxOptListHeight;overflowy="scroll"}this.style.height=height+"px";this.style.width=width+"px";this.style.overflowX=overflowx;this.style.overflowY=overflowy;var length=this.length();for(var i=0;i<length;i++)this.childNodes[i].style.width="99%";this.showing=true;this.focus();$(this).parents("p.formItem").addClass("active");highlight_option(this.cur_sel)};div.onclick=function(e){if(!e)return;if(currentOpenDiv!==void 0&&currentOpenDiv.id!==div.id)currentOpenDiv.hide();if(div.showing)div.hide();else div.show();if(typeof cultureList_bodyclick=="function")cultureList_bodyclick(e);e.stopPropagation();e.preventDefault()};txtbox.parentNode.style.zIndex=zidx--;$addHandler(txtbox,"click",div.onclick);$addHandler(ddarrow,"click",div.onclick);$addHandler(txtbox.parentNode.parentNode,"click",div.onclick);if(!div.once){$addHandler(document.body,"mousedown",function(e){if($(e.target).hasClass("selectpanel"))return;if(e.target!==txtbox.parentNode&&div.showing){div.bodyclick=true;div.hide()}});div.once=true}$addHandler(txtbox,"keyup",function(e){var key=get_key_code(e),opts=div.$tags("a"),init_state=false;if(div.cur_sel===void 0){div.cur_sel=0;opts[0].select();init_state=true}switch(key){case Sys.UI.Key.down:if(div.cur_sel<opts.length-1&&!init_state){div.cur_sel++;if(div.cur_sel>0)opts[div.cur_sel-1].unselect();opts[div.cur_sel].select()}if(div.style.display!="block")txtbox.select();break;case Sys.UI.Key.up:if(div.cur_sel>0){div.cur_sel--;if(div.cur_sel<opts.length-1)opts[div.cur_sel+1].unselect();opts[div.cur_sel].select()}if(div.style.display!="block")txtbox.select();break;case Sys.UI.Key.space:div.show();break;default:break}});$addHandler(txtbox,"keydown",function(e){var key=get_key_code(e);if(key===Sys.UI.Key.enter||key===Sys.UI.Key.esc||key==Sys.UI.Key.tab)div.hide();if(key!=Sys.UI.Key.up&&key!=Sys.UI.Key.down&&key!=Sys.UI.Key.tab){e.stopPropagation();e.preventDefault()}});$addHandler(div,"keydown",function(e){var key=get_key_code(e);if(key==Sys.UI.Key.down||key==Sys.UI.Key.up){var opt=key==Sys.UI.Key.down?div.cur_h+1:div.cur_h-1;highlight_option(opt);e.stopPropagation();e.preventDefault()}});function highlight_option(optionIdx){var opts=div.$tags("a");if(optionIdx<0||optionIdx>opts.length-1)return;if(div.cur_h!==void 0){var cls=div.cur_h==div.cur_sel?"selected":"";opts[div.cur_h].className=cls}div.cur_h=optionIdx;if(div.showing)opts[div.cur_h].focus();opts[div.cur_h].className=" highlighted "}function select_option(e){var key=get_key_code(e);if(key!=13)if(key!=0&&key!=undefined)return;this.select();e.stopPropagation();e.preventDefault()}function option_unselect(){this.sel=false;this.className=this.className.replace(/\bselected\b/i,"")}function option_select(){if(div.selectedOption!==void 0)div.selectedOption.unselect();this.sel=true;this.className+=" selected ";div.cur_sel=this.idx;div.selectedOption=this;txtbox.parentNode.title=txtbox.title=txtbox.value=this.alt;div.hide();hiddenfld.value=this.sval;div.selectedIndex=this.idx;var raiseEvt=arguments[0];if(!!div.onchange&&(raiseEvt===void 0||raiseEvt===true))div.onchange();if(typeof Page_IsValid!="undefined"&&!Page_IsValid&&typeof Page_ClientValidate=="function"){Page_ClientValidate();Page_BlockSubmit=false}}function get_key_code(e){return e.charCode||e.keyCode}s.style.display="none";if(typeof fix_hitch_opt_box_loadsync!="undefined"&&fix_hitch_opt_box_loadsync==true){for(var i=0;i<s.options.length;i++)div.append(s.options[i].text,s.options[i].title,s.options[i].value,s.options[i].getAttribute("href"));div.fixed=true;if(!!s.parentNode)s.parentNode.removeChild(s)}else var i=0,timer=window.setInterval(function(){if(i<s.options.length){div.append(s.options[i].text,s.options[i].title,s.options[i].value,s.options[i].getAttribute("href"));i++}else{window.clearInterval(timer);div.fixed=true;if(!!s.parentNode)s.parentNode.removeChild(s)}},3)}}();function fix_hitch_curve_box(id){var curvbox=$get(id);if(!!curvbox&&!curvbox.fixed)curvbox.wrapAround(function(o){var div=$new("div","box_curv");div.createChild("span","top");div.appendChild(o);div.id=o.id;div.fixed=true;o.id="";div.createChild("span","end");return div})}function fix_hitch_glow_box(id){var glowbox=$get(id);if(!!glowbox&&!glowbox.fixed)glowbox.wrapAround(function(o){var div=$new("div","box_glow box_glow_green");div.id=id;div.fixed=true;o.id="";div.createChild("div","tabs tabs_fix");div.createChild("div","body").appendChild(o);div.createChild("div","end");return div})}var ux_fix=function(){if(!!ux_fix.fix)ux_fix.fix()};$addHandler(window,"load",ux_fix)