function $(id){return document.getElementById(id)}function $$(tag){return document.createElement(tag)}function $_(text){return document.createTextNode(text)}function hx_class(node,classname){if(!node)return false;if(node.nodeType!=1)return false;var classes=node.className?node.className.replace(/(^\s+|\s+$)/,'').split(/\s+/):new Array();var found=-1;for(var i=0;i<classes.length;i++)if(classes[i]==classname)found=i;var action;if(action=arguments[2]){if(found>=0&&action<0)classes[found]=null;if(found==-1&&action>0)classes[classes.length]=classname}else return found>=0;for(i=0;i<classes.length;i++)if(!classes[i])classes.splice(i,1);node.className=classes.join(' ')}function hx_style(node,property){var i,sides;if(property.match(/:/)){var p=property.replace(/(^\s+|\s+$)/g,'').split(/\s*;\s*/);for(var t in p){i=p[t].split(/\s*:\s*/,2);hx_style(node,i[0],i[1])}}else{var p=property.replace(/\-(\w)/g,function(){return arguments[1].toUpperCase()});if(arguments.length>2){var r,m,i,vals,j;var val=arguments[2];var side=['Top','Right','Bottom','Left'];var patterns={'Style':/^(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)$/i,'Width':/^([0-9]+[a-z]{0,2}|thin|medium|thick)$/i};if(p=='border'){var t='',th='';vals=val.split(/\s+/);for(i in vals){th='';for(j in patterns){if(vals[i].match(patterns[j]))th=j;if(th=='')th='Color'}t=(t==th||t=='')?th:'Combo'}if(t=='Combo')for(i in side)hx_style(node,'border'+side[i],val);else hx_style(node,'border'+t,val)}else if(r=p.match(/^(margin|padding|border(Width|Style|Color))$/)){if(r[2])r[1]='border';var sides=val.split(/\s+/);if(sides.length==1)sides[1]=sides[0];if(sides.length==2){sides[2]=sides[0];sides[3]=sides[1]}else if(sides.length==3)sides[3]=sides[1];for(i in side)hx_style(node,r[1]+side[i]+(r[2]?r[2]:''),sides[i])}else if(r=p.match(/^border(Top|Right|Bottom|Left)$/)){vals=val.split(/\s+/);for(val in vals){m='Color';for(i in patterns)if(vals[val].match(patterns[i]))m=i;hx_style(node,'border'+r[1]+m,vals[val])}}else{try{node.style[p]=val}catch(e){}}}var ret;if(window.getComputedStyle)ret=getComputedStyle(node,null)[p];else if(node.currentStyle)ret=node.currentStyle[p];else if(node.style||typeof ret=='undefined')ret=node.style[p];return typeof ret=='undefined'?'dammit':ret}}function hx_http_build_query(obj){var ret='';var n='';var p=arguments[1];for(var i in obj){n=p?p+'%5B'+i+'%5D':i;if(ret.length)ret+='&';if(typeof obj[i]=='object')ret+=hx_http_build_query(obj[i],n);else ret+=n+'='+encodeURIComponent(obj[i])}return ret}function hx_dom(txt){var ret;try{ret=new ActiveXObject("Microsoft.XMLDOM");ret.async="false";xmlDoc.loadXML(txt)}catch(e){try{var parser=new DOMParser();ret=parser.parseFromString(txt,'text/xml')}catch(e){return false}}return ret}function hx_new_ajax(){var ret,e;try{ret=new XMLHttpRequest()}catch(e){try{ret=new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{ret=new ActiveXObject('Microsoft.XMLHTTP')}catch(e){ret=false}}}return ret}function hx_dom_to_text(obj){if(obj.nodeType!=1)return obj.nodeValue;var ret='<';ret+=obj.tagName.toLowerCase();for(var sis=0;sis<obj.attributes.length;sis++)if(!obj.attributes[sis].value.match(/^(null|false|0|inherit|)$/)){ret+=' ';ret+=obj.attributes[sis].name;ret+='="';ret+=obj.attributes[sis].value;ret+='"'}if(!obj.childNodes.length)return ret+' />';ret+='>';for(var fi=0;fi<obj.childNodes.length;fi++)ret+=hx_dom_to_text(obj.childNodes[fi]);ret+='</';ret+=obj.tagName.toLowerCase();ret+='>';return ret}Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+str_pad(this.getUTCMonth()+1,2,'0',-1)+'-'+str_pad(this.getUTCDate(),2,'0',-1)+'T'+str_pad(this.getUTCHours(),2,'0',-1)+':'+str_pad(this.getUTCMinutes(),2,'0',-1)+':'+str_pad(this.getUTCSeconds(),2,'0',-1)+'Z'};function json_encode(value,whitelist){var charsub={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case 'string':return r.test(value)?'"'+value.replace(r,function(a){var c=charsub[a];if(c)return c;c=a.charCodeAt();return '\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case 'number':return isFinite(value)?String(value):'null';case 'boolean':case 'null':return String(value);case 'object':if(!value)return 'null';if(typeof value.toJSON==='function')return json_encode(value.toJSON());a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1)a.push(json_encode(value[i],whitelist)||'null');return '['+a.join(',')+']'}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=json_encode(value[k],whitelist);if(v)a.push(json_encode(k)+':'+v)}}}else{for(k in value)if(typeof k==='string'){v=json_encode(value[k],whitelist);if(v)a.push(json_encode(k)+':'+v)}}return '{'+a.join(',')+'}'}}var hx_onload_collection=[];function hx_onload(func){if(typeof func!=='function')return false;hx_onload_collection[hx_onload_collection.length]=func}function hx_onload_exec(){for(var i=0;i<hx_onload_collection.length;i++)hx_onload_collection[i]()}if(typeof window.onload!='function')window.onload=hx_onload_exec;else{var hx_onload_original=window.onload;window.onload=function(){hx_onload_original();hx_onload_exec()}}function hx_scroll_x(){if(typeof window.pageXOffset=='number')return window.pageXOffset;else if(document.body&&document.body.scrollLeft)return document.body.scrollLeft;else if(document.documentElement&&document.documentElement.scrollLeft)return document.documentElement.scrollLeft;else return 0}function hx_scroll_y(){if(typeof window.pageYOffset=='number')return window.pageYOffset;else if(document.body&&document.body.scrollTop)return document.body.scrollTop;else if(document.documentElement&&document.documentElement.scrollTop)return document.documentElement.scrollTop;else return 0}function hx_inner_width(){if(typeof window.innerWidth=='number')return window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)return document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)return document.body.clientWidth;else return 0}function hx_inner_height(){if(typeof window.innerHeight=='number')return window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)return document.body.clientHeight;else return 0}function hx_body_width(){if(typeof scrollMaxX=='number')return scrollMaxX+window.innerWidth;else if(document.body.scrollWidth)return document.body.scrollWidth;else return 0}function hx_body_height(){if(typeof scrollMaxY=='number')return scrollMaxY+window.innerHeight;else if(document.body.scrollHeight)return document.body.scrollHeight;else return 0}function hx_make_editable(obj){if(obj.editing)return false;obj.editing=true;var parts,j,i;var options={};if(arguments.length>1)for(i=1;i<arguments.length;i++){if(typeof arguments[i]=='string'){if(arguments[i].match(/^\{/))eval('arguments[i] = '+arguments[i]);else{parts=arguments[i].split('&');for(j=0;j<parts.length;j++)options[parts[j].split('=')[0]]=unescape(parts[j].split('=',2)[1])}}if(typeof arguments[i]=='object')for(j in arguments[i])options[j]=arguments[i][j]}var rows=options['rows']?parseInt(options['rows'],10):1;var styles=[];if(options['mimic']){var includeStyles=/(margin|padding|border|font|lineheight|width|Moz|background|cursor|text|spacing|display|color)/i;for(i in obj.style)if(typeof obj.style[i]!='function')if(i.match(includeStyles))styles[styles.length]=i+':'+hx_style(obj,i)}var displayStyle=styles['display']?styles['display']:'block';var editor=document.createElement(rows==1?'input':'textarea');obj.style.display='none';obj.parentNode.insertBefore(editor,obj);obj.editor=editor;editor.source=obj;if(options['callback']){eval('editor.callback='+options['callback']);editor.onblur=function(){if(editor.source){obj.finishEdit();editor.callback(obj,editor.value)}};editor.onkeydown=function(e){if(window.event)e=window.event;if(e.keyCode==27){obj.cancelEdit();editor.callback(obj,null)}if((e.keyCode==13&&rows==1)||e.keyCode==9){obj.finishEdit();editor.callback(obj,editor.value)}}}else editor.callback=function(){};obj.cancelEdit=function(){hx_autosize(editor,false);if(editor.sizer)editor.sizer.parentNode.removeChild(editor.sizer);editor.parentNode.removeChild(editor);editor.source=null;obj.style.display='';obj.editing=false};obj.finishEdit=function(){obj.innerHTML=editor.value?(editor.tagName.toLowerCase()=='textarea'?editor.value.replace(/\n/g,'<br/>'):editor.value):String.fromCharCode(160);obj.cancelEdit()};if(options['style'])styles[styles.length]=options['style'];if(options['mimic'])hx_class(editor,obj.className,1);if(options['class'])hx_class(editor,options['class'],1);hx_class(editor,'hx_editor',1);for(i in styles)hx_style(editor,styles[i]);if(!options['rows'])editor.style.height='auto';if(rows==1){editor.type='text'}else{editor.setAttribute('rows',rows?rows:1)}editor.value=obj.childNodes.length?obj.childNodes[0].nodeValue.replace(/\s*<br[^>]*?>\s*/ig,"\n").replace(/^(\xA0|&nbsp;)$/,'').replace(/\s+/," "):'';if(options['rows']=='auto')hx_autosize(editor);if(obj.id)editor.id=obj.id+'_editor';var pn=editor;while(pn=pn.parentNode){if(pn.nodeName.toLowerCase()=='body')break;if(hx_style(pn,'display')=='none')hx_style(pn,'display','')}editor.focus();return editor}function hx_autosize(obj){if(obj.nodeType!=1)return false;if(obj.tagName.toLowerCase()!='textarea')return false;var action=true;if(arguments.length>1)action=arguments[1];if(action){obj.sizing=true;if(!obj.sizer){var sizer=document.createElement('div');obj.sizer=sizer;obj.parentNode.appendChild(sizer);var includeStyles=/(font|lineheight|Moz|text|spacing)/i;for(var i in obj.style)if(typeof obj.style[i]!='function')if(i.match(includeStyles))hx_style(sizer,i,hx_style(obj,i));hx_style(sizer,'padding:0;margin:0;border:0');sizer.style.width='auto';sizer.innerHTML='i';sizer.style.position='absolute';sizer.style.top='0px';sizer.style.left='-15000px';sizer.style.height='auto';sizer.iWidth=sizer.offsetWidth;obj.autosize_update=function(){var padding=0;if(navigator.userAgent.match(/msie/i))padding=parseInt(hx_style(this,'borderLeftWidth'),10)+parseInt(hx_style(this,'borderRightWidth'),10)+parseInt(hx_style(this,'paddingLeft'),10)+parseInt(hx_style(this,'paddingRight'),10);var w=hx_style(this,'width');if(w=='auto')w=this.offsetWidth;this.sizer.style.width=(parseInt(w,10)-4-Math.floor(this.sizer.iWidth/2)-padding)+'px';var lines=this.value.split("\n");this.sizer.innerHTML='';for(var i=0;i<lines.length;i++){if(i)this.sizer.appendChild(document.createElement('br'));this.sizer.appendChild(document.createTextNode(lines[i].replace(/  /g,'&#160; ')))}this.sizer.appendChild(document.createTextNode('W'));if(this.sizing)obj.style.height=(Math.max(this.sizer.offsetHeight,8)+parseInt(hx_style(this,'paddingTop'),10)+parseInt(hx_style(this,'paddingBottom'),10)+parseInt(hx_style(this,'borderTopWidth'),10)+parseInt(hx_style(this,'borderBottomWidth'),10)+2)+'px'};if(typeof obj.onkeypress!='function')obj.onkeypress=obj.autosize_update;else{var oldkeypress=obj.onkeypress;obj.onkeypress=function(e){oldkeypress(e);obj.autosize_update()}}if(typeof obj.onkeyup!='function')obj.onkeyup=obj.autosize_update;else{var oldkeyup=obj.onkeyup;obj.onkeyup=function(e){oldkeyup(e);obj.autosize_update()}}obj.onmousedown=function(e){if(window.event)e=window.event;if(e.button==2){if(!obj.hx_interval)obj.hx_interval=setInterval(obj.autosize_update,100)}}}obj.style.overflow='hidden';obj.autosize_update();return sizer}else{obj.sizing=false;obj.style.overflow='';return true}}function str_pad(input,length){var side=0;var chr=' ';if(arguments.length>2)chr=arguments[2];if(arguments.length>3)side=arguments[3];var ret=input+'';while(ret.length<length)ret=side>0?ret+chr:chr+ret;return ret}function hx_numeric_entities(txt){var table={"quot":34,"amp":38,"lt":60,"gt":62,"OElig":338,"oelig":339,"Scaron":352,"scaron":353,"Yuml":376,"circ":710,"tilde":732,"ensp":8194,"emsp":8195,"thinsp":8201,"zwnj":8204,"zwj":8205,"lrm":8206,"rlm":8207,"ndash":8211,"mdash":8212,"lsquo":8216,"rsquo":8217,"sbquo":8218,"ldquo":8220,"rdquo":8221,"bdquo":8222,"dagger":8224,"Dagger":8225,"permil":8240,"lsaquo":8249,"rsaquo":8250,"euro":8364,"fnof":402,"Alpha":913,"Beta":914,"Gamma":915,"Delta":916,"Epsilon":917,"Zeta":918,"Eta":919,"Theta":920,"Iota":921,"Kappa":922,"Lambda":923,"Mu":924,"Nu":925,"Xi":926,"Omicron":927,"Pi":928,"Rho":929,"Sigma":931,"Tau":932,"Upsilon":933,"Phi":934,"Chi":935,"Psi":936,"Omega":937,"alpha":945,"beta":946,"gamma":947,"delta":948,"epsilon":949,"zeta":950,"eta":951,"theta":952,"iota":953,"kappa":954,"lambda":955,"mu":956,"nu":957,"xi":958,"omicron":959,"pi":960,"rho":961,"sigmaf":962,"sigma":963,"tau":964,"upsilon":965,"phi":966,"chi":967,"psi":968,"omega":969,"thetasym":977,"upsih":978,"piv":982,"bull":8226,"hellip":8230,"prime":8242,"Prime":8243,"oline":8254,"frasl":8260,"weierp":8472,"image":8465,"real":8476,"trade":8482,"alefsym":8501,"larr":8592,"uarr":8593,"rarr":8594,"darr":8595,"harr":8596,"crarr":8629,"lArr":8656,"uArr":8657,"rArr":8658,"dArr":8659,"hArr":8660,"forall":8704,"part":8706,"exist":8707,"empty":8709,"nabla":8711,"isin":8712,"notin":8713,"ni":8715,"prod":8719,"sum":8721,"minus":8722,"lowast":8727,"radic":8730,"prop":8733,"infin":8734,"ang":8736,"and":8743,"or":8744,"cap":8745,"cup":8746,"int":8747,"there4":8756,"sim":8764,"cong":8773,"asymp":8776,"ne":8800,"equiv":8801,"le":8804,"ge":8805,"sub":8834,"sup":8835,"nsub":8836,"sube":8838,"supe":8839,"oplus":8853,"otimes":8855,"perp":8869,"sdot":8901,"lceil":8968,"rceil":8969,"lfloor":8970,"rfloor":8971,"lang":9001,"rang":9002,"loz":9674,"spades":9824,"clubs":9827,"hearts":9829,"diams":9830,"nbsp":160,"iexcl":161,"cent":162,"pound":163,"curren":164,"yen":165,"brvbar":166,"sect":167,"uml":168,"copy":169,"ordf":170,"laquo":171,"not":172,"shy":173,"reg":174,"macr":175,"deg":176,"plusmn":177,"sup2":178,"sup3":179,"acute":180,"micro":181,"para":182,"middot":183,"cedil":184,"sup1":185,"ordm":186,"raquo":187,"frac14":188,"frac12":189,"frac34":190,"iquest":191,"Agrave":192,"Aacute":193,"Acirc":194,"Atilde":195,"Auml":196,"Aring":197,"AElig":198,"Ccedil":199,"Egrave":200,"Eacute":201,"Ecirc":202,"Euml":203,"Igrave":204,"Iacute":205,"Icirc":206,"Iuml":207,"ETH":208,"Ntilde":209,"Ograve":210,"Oacute":211,"Ocirc":212,"Otilde":213,"Ouml":214,"times":215,"Oslash":216,"Ugrave":217,"Uacute":218,"Ucirc":219,"Uuml":220,"Yacute":221,"THORN":222,"szlig":223,"agrave":224,"aacute":225,"acirc":226,"atilde":227,"auml":228,"aring":229,"aelig":230,"ccedil":231,"egrave":232,"eacute":233,"ecirc":234,"euml":235,"igrave":236,"iacute":237,"icirc":238,"iuml":239,"eth":240,"ntilde":241,"ograve":242,"oacute":243,"ocirc":244,"otilde":245,"ouml":246,"divide":247,"oslash":248,"ugrave":249,"uacute":250,"ucirc":251,"uuml":252,"yacute":253,"thorn":254,"yuml":255};return txt.replace(/&([a-z]{1,9});/ig,function(){return table[arguments[1]]?'&#'+table[arguments[1]]+';':''})}function hx_html_decode(s){return hx_numeric_entities(s).replace(/&#(\d+);/g,function(){return String.fromCharCode(arguments[1])})}function get_offset_pos(o){var x,y;x=y=0;do{x+=o.offsetLeft;y+=o.offsetTop}while(o=o.offsetParent);return[x,y]}function hx_creditcard(){var n,t,d,v,i;d=new Date();for(i=0;i<arguments.length;i++){v=arguments[i];if(typeof v=='number')n=v;else if(typeof v=='object'){d=v;d.setHours(23);d.setMinutes(59);d.setSeconds(59);d.setMilliseconds(999);d.setMonth(d.getMonth()+1);d.setDate(0)}else if(v.match(/\d/))n=v;else t=v}if(!n)return false;n=n.toString().replace(/[^\d]/g,'').split('');if(n.length<2)return false;var sum=0;for(i=0;i<n.length;i++)sum+=(n.length-i)%2?parseInt(n[i]):(parseInt(n[i])*2-1)%9+1;if(sum%10)return false;if(t){t=t.replace(/^(di[ns]|[a-ce-z]).*$/i,'$1').toLowerCase();var m={'m':/^5[1-5]\d{14}$/,'v':/^4\d{12}(\d{3})?$/,'a':/^3[47]\d{13}$/,'din':/^3(0[0-5]\d{11}|[68]\d{12})$/,'dis':/^6011\d{12}$/};if(!m[t])return false;if(!n.join('').match(m[t]))return false}if(d){var now=new Date();if(d<now)return false}return true}function clone(o){if(typeof o!='object'||o==null||o instanceof RegExp)return o;var ret;if(o instanceof Array){ret=[];for(var i=0;i<o.length;i++)ret[ret.length]=clone(o[i])}else{ret={};for(var i in o)ret[i]=clone(o[i])}return ret}function hx_form_to_obj(f){var ret={};for(var i=0;i<f.length;i++)if(f[i].type.match(/(checkbox|radio)/i)?f[i].checked:1)ret[f[i].name]=f[i].value;return ret}function hx_opacity(obj,val){var s=obj.style;s.opacity=val;s.MozOpacity=val;s.KhtmlOpacity=val;s.filter="alpha(opacity="+parseInt(val*100)+")";s.zoom=1}function length(obj){var ret=0;for(var i in obj)ret++;return ret}function csort(key){var reverse=arguments.length>1?arguments[1]:false;return function(a,b){var x=a[key].toLowerCase();var y=b[key].toLowerCase();if(x<y)return reverse?1:-1;if(x>y)return reverse?-1:1;return 0}}function hx_grammar_list(args){if(!args.length)return '';var a='and';if(arguments.length>1)a=arguments[1];return args.length>1?args.slice(0,args.length-1).join(', ')+' '+a+' '+args[args.length-1]:args[0]}var flashinstalled=0;var flashversion=0;if(typeof hx_flash_user_innerhtml=='undefined')hx_flash_use_innerhtml=false;if(navigator.plugins&&navigator.plugins.length){var x=navigator.plugins["Shockwave Flash"];if(x){flashinstalled=2;if(x.description){flashversion=x.description.match(/\d+/)[0]}}else flashinstalled=1;if(navigator.plugins["Shockwave Flash 2.0"]){flashinstalled=2;flashversion=2}}else if(navigator.mimeTypes&&navigator.mimeTypes.length){var x=navigator.mimeTypes['application/x-shockwave-flash'];if(x&&x.enabledPlugin)flashinstalled=2;else flashinstalled=1}else{document.write('<scr'+'ipt language="vbscript" type="text/vbscript"> \n');document.write('function getFlashVersion() \n');document.write('On Error Resume Next \n');for(var i=2;i<=10;i++)document.write(' If IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'")) Then getFlashVersion = '+i+' \n');document.write('end function \n');document.write('</scr'+'ipt> \n');flashversion=getFlashVersion()}flashversion=parseInt(flashversion);var flashattrs="align,archive,border,classid,codebase,codetype,data,declare,height,hspace,name,standby,type,usemap,vspace,width,id,style,class";function hx_flash(){if(typeof flashobjects!=='object')return false;for(var i in flashobjects){var fo=flashobjects[i];var obj=document.getElementById(i);if(flashversion>=fo['version']){var n=document.createElement('object');n.style.cssText=obj.style.cssText;n.id=obj.id;n.className=obj.className;n.setAttribute('type','application/x-shockwave-flash');n.setAttribute('data',fo['src']);for(var k in fo){if(flashattrs.match(new RegExp('(^|,)'+k+'(,|$)')))n.setAttribute(k,fo[k]);else if(k!='version'){var param=document.createElement('param');param.name=k=='src'?'movie':k;param.value=fo[k];n.appendChild(param)}}if(navigator.userAgent.match(/msie [4-7]/i)||hx_flash_use_innerhtml){obj.innerHTML=hx_dom_to_text(n);obj.parentNode.replaceChild(obj.firstChild,obj);obj.style.visibility=''}else{obj.parentNode.replaceChild(n,obj);n.style.visibility=''}}else obj.style.visibility=''}}hx_onload(hx_flash);var redirects=new Object();var checks=[];var submitter=new Object();var xh;function hxformmail(form){setLoadingDisplay(form,true);submitter.disabled=true;var e=getFormErrors(form);showErrors(form,e);if(e.length){return false}xh=hx_new_ajax();if(xh===false)return true;xh.open("POST",'/hx/modules/formmail.php?hx_fm=ajax',true);xh.onreadystatechange=checkReadyState;xh.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xh.send(buildPostBody(form));return false}function checkReadyState(){if(xh.readyState!=4)return false;var r=xh.responseText;if(!r.match(/\n/)){formSuccess(r.replace(/(^\s+|\s+$)/,''))}else{var lines=r.split("\n");var form=document.getElementById(lines[0]);if(lines[1])var iv=lines[1].split(',');var e=lines[2].split('|');showErrors(form,e);if(iv)for(var i=0;i<iv.length;i++)setInvalidClass(iv[i],true)}}function formSuccess(formname){setLoadingDisplay(document.getElementById(formname),false);var resp=document.getElementById(formname+'_response');if(resp){resp.style.display='';document.getElementById(formname+'_main').style.display='none'}else if(redirects[formname])document.location=redirects[formname]}function showErrors(form,e){if(e.length){setLoadingDisplay(form,false);submitter.disabled=false}var ediv=document.getElementById(form.getAttribute('id')+'_errors');if(ediv){ediv.style.display=e.length?'':'none';var list=document.getElementById(form.getAttribute('id')+'_errorlist');list.innerHTML='';for(var i=0;i<e.length;i++){list.innerHTML+='<li>'+e[i]+'</li>'}}else if(e.length)alert(e.join("\n"))}function getFormErrors(form){var e=Array(),ret=Array();var fields=checks[form.getAttribute('id')];for(f in fields){var r=fields[f].match(/^.(.+)[^a-z]([a-z]*)$/i);var v=form[f].value.match(new RegExp(r[1],r[2]));if(!v)e[e.length]=f;setInvalidClass(f,!v)}if(e.length){for(var i=0;i<e.length;i++)e[i]=getLabel(form[e[i]]);var last=e[e.length-1];var msg;e.length--;if(e.length)msg='The '+e.join(', ')+' and '+last+' fields are invalid.';else msg='The '+last+' field is invalid';ret[0]=msg}return ret}function getLabel(element){var labels=document.getElementsByTagName('label');for(var i=0;i<labels.length;i++)if(labels[i].htmlFor==element.id)return labels[i].innerHTML.replace(/(^\s+|[-:;,.=\s]*$)/,'');return element.name}function buildPostBody(form){var ret='';var tags=['input','select','textarea'];for(var t=0;t<tags.length;t++){var n=form.getElementsByTagName(tags[t]);for(i=0;i<n.length;i++){type=n[i].getAttribute('type');if(type){type=type.toLowerCase();if(!type.match(/(checkbox|radio|submit|reset)/i)||n[i].checked)ret+='&'+n[i].name+'='+encodeURIComponent(n[i].value?n[i].value:'-')}else ret+='&'+n[i].name+'='+encodeURIComponent(n[i].value?n[i].value:'-')}}if(ret)ret=ret.substr(1);return ret}function reloadCaptcha(img){if(!submitter.disabled)img.src=img.src.replace(/(^|&|&amp;)r=\d{7}(?=&|$)/ig,"$1r="+Math.floor(1000000+Math.random()*9000000))}function setInvalidClass(name,invalid){if(!name)return false;var items=Array();var inputs=document.getElementsByName(name);for(var i=0;i<inputs.length;i++)items[i]=inputs[i];var labels=document.getElementsByTagName('label');for(i=0;i<labels.length;i++)if(labels[i].getAttribute('for')==items[0].getAttribute('id'))items[items.length]=labels[i];for(i=0;i<items.length;i++){var c=Array(),n=Array();if(items[i].className)c=items[i].className.split(' ');var found=false;for(var j=0;j<c.length;j++){if(c[j].toLowerCase()=='invalid'){found=true;if(invalid)n[n.length]='invalid'}else n[n.length]=c[j]}if(invalid&&!found)n[n.length]='invalid';items[i].className=n.join(' ')}}function setLoadingDisplay(element,loading){var all=element.getElementsByTagName('*');for(var i=0;i<all.length;i++)if(all[i].className){if(all[i].className.match(/(^|\s)loading(\s|$)/i))all[i].style.display=loading?'':'none';else if(all[i].className.match(/(^|\s)notloading(\s|$)/i))all[i].style.display=loading?'none':''}}function hx_showtab(id){var tabs=document.getElementById(id).parentNode.childNodes;for(var i=0;i<tabs.length;i++)if(tabs[i].nodeType==1)if(tabs[i].className)if(tabs[i].className.match(/(^|\s)hx_tab(\s|$)/)){tabs[i].style.display=tabs[i].id==id?'':'none'}var tl=document.getElementById(id).parentNode.parentNode.getElementsByTagName('div')[0].getElementsByTagName('a');for(i=0;i<tl.length;i++)hx_class(tl[i],'current',tl[i].href.indexOf(id)>=0?1:-1)}function hx_load_img_hovers(){if(typeof hx_img_hovers!='object')return false;var img,attr;for(var i in hx_img_hovers){attr=hx_img_hovers[i];img=$(i);img.hover=new Image();img.hover.src=attr.src;img.hover.width=attr.width?attr.width:img.width;img.hover.height=attr.height?attr.height:img.height;img.cold=new Image();img.cold.src=img.src;img.cold.width=img.width;img.cold.height=img.height}}hx_onload(hx_load_img_hovers);function hx_hover(id,state){var obj=$(id);var f=state?obj.hover:obj.cold;obj.src=f.src;obj.width=f.width;obj.height=f.height}function hx_autocomplete_init(){if(typeof hx_autocomplete!='object')return;for(var i in hx_autocomplete)hx_autocomplete_assign($(i),hx_autocomplete[i])}function hx_autocomplete_assign(obj,p){if(typeof hx_autocomplete!='object')hx_autocomplete={};if(typeof obj.onkeyup=='function')obj.onkeyup_after_auto=obj.onkeyup;obj.onkeyup=function(e){if(window.event)e=window.event;this.hasFocus=true;hx_autocomplete_onkeyup(this,e);if(typeof this.onkeyup_after_auto=='function')this.onkeyup_after_auto(e)};if(typeof obj.onblur=='function')obj.onblur_after_auto=obj.onblur;obj.onblur=function(){this.autocomplete.style.display='none';this.hasFocus=false;if(typeof this.onblur_after_auto=='function')this.onblur_after_auto()};if(typeof obj.autocomplete!='object'){if(!p['align'])p.align='';if(!p['width'])p.width='100%';if(!p['limit'])p.limit=999;var div=document.createElement('div');var body=obj.parentNode;while(!body.tagName.match(/^body$/i))body=body.parentNode;body.appendChild(div);if(p['style'])hx_style(div,p.style);if(p['class'])hx_class(div,p['class'],1);hx_class(div,'hx_autocomplete',1);p.width=p.width+'';var w;if(w=p.width.match(/^([0-9]+)%$/))p.width=''+obj.offsetWidth*w[1]/100;hx_style(div,'display:none;position:absolute;z-index:10000');hx_style(div,'width',p.width-parseInt(hx_style(div,'border-left-width'))-parseInt(hx_style(div,'border-right-width'))-parseInt(hx_style(div,'padding-left'))-parseInt(hx_style(div,'padding-right'))+(p.width.match(/[^0-9]/)?'':'px'));div.id=obj.id+'_autocomplete';obj.autocomplete=div;obj.hx_autocomplete_value=''}if(p._src.match(/^ajax:/i))obj.hx_autocomplete_timeout=0;hx_autocomplete[obj.id]=p}function hx_autocomplete_onkeyup(obj,e){if(window.event)e=window.event;var r,i;var ac=obj.autocomplete;if(e.keyCode>=112&&e.keyCode<=123)return;switch(e.keyCode){case 27:ac.style.display='none';return;case 40:case 34:case 98:if(ac.childNodes)for(i=0;i<ac.childNodes.length;i++)if(hx_class(ac.childNodes[i],'active')){if(ac.childNodes[i].nextSibling)hx_autocomplete_activate(ac.childNodes[i].nextSibling);return}case 38:case 33:case 104:if(ac.childNodes)for(i=0;i<ac.childNodes.length;i++)if(hx_class(ac.childNodes[i],'active'))if(ac.childNodes[i].previousSibling)hx_autocomplete_activate(ac.childNodes[i].previousSibling);return;case 37:case 39:case 35:case 36:case 16:case 17:case 18:case 91:case 93:case 20:case 144:case 145:case 44:case 19:return;case 13:if(ac.style.display!='none')for(i=0;i<ac.childNodes.length;i++)if(hx_class(ac.childNodes[i],'active'))hx_autocomplete_select(ac.childNodes[i]);return}var src=hx_autocomplete[obj.id]._src;if(r=src.match(/^ajax:(?:([^:]+):)?(.*)$/i)){if(!obj.hx_autocomplete_value)hx_autocomplete_query(obj)}else{var val=obj.value.replace(/(^\s|\s$)/g,'').toLowerCase();eval('r='+src+';');var all=[],opt=[];if(typeof r!='object')return;if(typeof r.length=='number')for(i=0;i<r.length;i++)all[i]=r[i]+'';else for(i in r)all[all.length]=r[i];if(val.length)for(i=0;i<all.length;i++)if(opt.length<hx_autocomplete[obj.id].limit)if(all[i].replace(/(^\s|\s$)/g,'').substring(0,val.length).toLowerCase()==val)opt[opt.length]='<strong>'+all[i].substr(0,val.length)+'</strong>'+all[i].substr(val.length,all[i].length-val.length);hx_autocomplete_display(obj,opt)}}function hx_autocomplete_query(obj){if(r=hx_autocomplete[obj.id]._src.match(/^ajax:(?:([^:]+):)?(.*)$/i)){obj.hx_autocomplete_value=obj.value;hx_ajax({'value':obj.value,'id':obj.id,'hx_autocomplete':1},r[2],function(d){hx_autocomplete_display(obj,d)},r[1]?r[1]:'')}}function hx_autocomplete_position(obj){var p=hx_autocomplete[obj.id];var top=parseInt(p['top']?p['top']:0);var left=parseInt(p['left']?p['left']:0);hx_style(obj.autocomplete,'top',(get_offset_pos(obj)[1]+obj.offsetHeight+top)+'px');hx_style(obj.autocomplete,'left',(get_offset_pos(obj)[0]+left+(p.align.match(/r/i)?obj.offsetWidth-obj.autocomplete.offsetWidth:0))+'px')}function hx_autocomplete_display(obj,options){var ac,i,o;if(!(ac=obj.autocomplete))return;if(obj.value!=obj.hx_autocomplete_value&&obj.hasFocus)hx_autocomplete_query(obj);else obj.hx_autocomplete_value='';if(!options){ac.style.display='none';return}var opt=[];if(options.length)opt=options;else for(i in options)opt[opt.length]=options[i];if(!opt.length){ac.style.display='none';return}while(ac.childNodes.length)ac.removeChild(ac.lastChild);for(i=0;i<opt.length;i++){o=document.createElement('div');hx_class(o,'hx_autocomplete_option',1);if(!i)hx_class(o,'active',1);o.innerHTML=hx_numeric_entities(opt[i].toString());o.onmouseover=function(){hx_autocomplete_activate(this)};o.onmousedown=function(){hx_autocomplete_select(this)};ac.appendChild(o)}hx_autocomplete_position(obj);ac.style.display=obj.hasFocus?'':'none'}function hx_autocomplete_activate(obj){var p=obj.parentNode.childNodes;for(var i=0;i<p.length;i++)hx_class(p[i],'active',p[i]==obj?1:-1)}function hx_autocomplete_select(obj){for(var i in hx_autocomplete)if($(i).autocomplete==obj.parentNode)var tgt=$(i);tgt.value=obj.innerHTML.replace(/<.*?>/g,'');obj.parentNode.style.display='none';if(i=hx_autocomplete[tgt.id]['onselect'])eval(i.replace(/\bthis\b/g,'tgt'))}hx_onload(hx_autocomplete_init);var hx_aq={};var hx_ac={};var hxh=hx_new_ajax();function hx_ajax(){var tid=0;for(i in hx_aq)tid=Math.max(tid,i);tid++;hx_ac[tid]=arguments[2]?arguments[2]:false;var q={};q.tid=tid;q.func=arguments[1];if(arguments.length>3)q.file=arguments[3];var data=arguments[0];if(typeof data=='object'){if(data.nodeName){if(data.nodeName.toUpperCase()=='FORM'){q.type='form';var tags=['input','select','textarea'];q.data={};for(var t=0;t<tags.length;t++){var n=data.getElementsByTagName(tags[t]);for(i=0;i<n.length;i++)if(n[i].name){type=n[i].getAttribute('type');if(type){type=type.toLowerCase();if(!type.match(/^(checkbox|radio|submit|reset)$/i)||n[i].checked)q.data[n[i].name]=n[i].value?n[i].value:''}else	q.data[n[i].name]=n[i].value?n[i].value:''}}}else if(data.nodeName.toUpperCase().match(/^(input|select|textarea)$/i)){q.type='field';q.data=data.value?data.value:''}}else{q.type='object';q.data=json_encode(data)}}else{q.type='string';q.data=data.toString().replace(/(^\s+|\s+$)/g,'')}hx_aq[tid]=q;hx_ajax_process();return tid}function hx_ajax_state_change(){if(hxh.readyState!=4)return false;eval('var r='+(hxh.responseText?hxh.responseText:'{}')+';');delete hx_aq[r.tid];if(r.e)alert(r.e);else if(hx_ac[r.tid])hx_ac[r.tid](r.r);hx_ajax_process()}function hx_ajax_process(){if(hxh.readyState%4>0)return false;for(var i in hx_ac)if(!hx_aq[i])delete hx_ac[i];for(var i in hx_aq)if(hx_aq[i].tid){hx_ajax_send(i);return i}hx_ajax_loaders(0)}function hx_ajax_send(i){hx_ajax_loaders(1);hxh.onreadystatechange=function(){};if(!navigator.userAgent.match(/opera/i))hxh.abort();hxh.onreadystatechange=hx_ajax_state_change;hxh.open("POST",'/hx/modules/ajax.php?hx_ajax=ajax',true);hxh.setRequestHeader('Content-Type','application/x-www-form-urlencoded');hxh.send(hx_http_build_query(hx_aq[i]))}function hx_ajax_loaders(s){var a=document.getElementsByTagName('*');for(var i=0;i<a.length;i++)if(a[i].className)if(a[i].className.match(/(^|\s)ajax_loader(\s|$)/i))a[i].style.visibility=s?'visible':'hidden'}function hx_validate(){var test=/^target\s*[:=]\s*(\w+)\s*$/ig;var tags=['a','area'];var a,m,i;for(var t in tags){var anchors=document.getElementsByTagName(tags[t]);for(i=0;i<anchors.length;i++){a=anchors[i];if(a.getAttribute('rel'))if(m=a.getAttribute('rel').match(test))a.target=m[1]}}restoreEmails(document.documentElement)}function restoreEmails(obj){var e=obj.childNodes;var f=/\.email\.\d{5}\.at\./g;for(var i=0;i<e.length;i++){if(e[i].nodeType==3)e[i].nodeValue=e[i].nodeValue.replace(f,'@');if(e[i].nodeName.match(/^a$/i))if(e[i].getAttribute('href'))e[i].setAttribute('href',e[i].getAttribute('href').replace(f,'@'));if(e[i].nodeType==1)restoreEmails(e[i])}}hx_onload(hx_validate);var hx_ease={'sine':function(i){return Math.sin((i-0.5)*Math.PI)/2+0.5},'linear':function(i){return i},'cubic':function(i){return Math.pow(i*2-1,3)/2+0.5}};var hx_transitions=[];var hx_transitions_interval=0;function hx_transition(obj,property,target,frames){if(!obj)return;if(!obj.nodeType==1)return;var t=new hx_transition_class(obj,property,target,frames,arguments.length>4?arguments[4]:null,arguments.length>5?arguments[5]:hx_ease.sine);obj.transition=t;var found=false;for(var i=0;i<hx_transitions.length;i++)if(hx_transitions[i]==obj)found=true;if(!found)hx_transitions.push(obj);if(!hx_transitions_interval)hx_transitions_interval=setInterval(hx_transitions_step,40)}function hx_transitions_step(){var t;for(var i=0;i<hx_transitions.length;i++){t=hx_transitions[i].transition;t.step();if(t.currentFrame==t.totalFrames){hx_transitions.splice(i,1);i--;if(typeof t.oncomplete=='string')eval(t.oncomplete);if(typeof t.oncomplete=='function')t.oncomplete()}}if(!hx_transitions.length){clearInterval(hx_transitions_interval);hx_transitions_interval=0}}function hx_transition_class(obj,property,target,frames,oncomplete,ease){var i;this.parent=obj;this.currentFrame=0;this.totalFrames=Math.max(1,frames);this.property=property.toLowerCase();this.startValue=hx_style(this.parent,this.property);this.startValue=typeof this.startValue=='string'?this.startValue.split(/\s+/):[this.startValue];if(this.startValue=='auto'){if(this.property=='height')this.startValue=[this.parent.offsetHeight]}else for(i=0;i<this.startValue.length;i++)this.startValue[i]=parseFloat(this.startValue[i]);this.endValue=typeof target=='object'?target:[target];this.oncomplete=oncomplete;this.ease=ease;this.step=function(){this.currentFrame++;var v=[],i;for(i=0;i<this.startValue.length;i++)v[i]=this.startValue[i]+(this.endValue[i]-this.startValue[i])*this.ease(this.currentFrame/this.totalFrames);if(this.property=='opacity')hx_opacity(this.parent,v[0]);else{var p=hx_style(this.parent,this.property);var ps;if(p=='auto')ps=['','','px'];else if(typeof p=='string')ps=p.match(/^([^\d]*?)-?\d*(?:\.\d+)?([^\s]*)/i);if(!ps)ps=['','',''];hx_style(this.parent,this.property,ps[1]+v.join(ps[2]+' '+ps[1])+ps[2])}}}function sineScale(i){return Math.sin((i-0.5)*Math.PI)/2+0.5}function hx_tree(){var ret=$$('div');ret.className='tree';if(arguments.length){ret.appendChild(ret.a=$$('a'));ret.a.appendChild($_(arguments[0]));ret.a.href='javascript:';ret.a.onclick=function(){var rlt=true;this.treeEvent=this.parentNode.expanded?this.parentNode.onclose:this.parentNode.onopen;if(typeof this.treeEvent=='function')rlt=this.treeEvent();if(typeof this.treeEvent=='string')rlt=eval(this.treeEvent);if(!this.parentNode.list||rlt===false)return;this.parentNode.expanded=!this.parentNode.expanded;this.parentNode.render()}}ret.add=function(label){if(!this.list){this.appendChild(this.list=$$('div'));this.list.className='list';this.list.style.overflow='hidden';this.list.appendChild(this.list.inner=$$('div'));if(!navigator.userAgent.match(/msie/i))this.list.style.position='relative';this.list.inner.style.bottom=0;this.render(true)}var ret;this.list.inner.appendChild(ret=hx_tree(label,false));hx_class(this.firstChild,'has_children',1);ret.parent=this;return ret};ret.remove=function(){if(!arguments.length){if(this.parent)this.parent.remove(this);else this.parentNode.removeChild(this)}else{var t=arguments[0];if(typeof t!='object')t=this.items(t);this.list.inner.removeChild(t);if(!this.items().length){hx_class(this.firstChild,'has_children',-1);this.firstChild.style.backgroundPosition=this.firstChild.style.backgroundPositionY=''}}};ret.render=function(){if(!this.list)return;if(arguments[0]){this.list.inner.style.position='';this.list.style.height=this.expanded?'auto':0}else{hx_transition(this.list,'height',this.expanded?this.list.inner.offsetHeight:0,7,function(){this.parent.parentNode.render(true)});if(!navigator.userAgent.match(/msie/i)){this.list.style.height=!this.expanded?this.list.inner.offsetHeight+'px':0;this.list.inner.style.position='absolute';hx_transition(this.a,'background-position',this.expanded?[0,20]:[0,125],7,null,hx_ease.linear)}else hx_transition(this.a,'background-position-y',this.expanded?20:125,7,null,hx_ease.linear)}};ret.items=function(){if(!this.list)return false;if(!arguments.length)return this.list.inner.childNodes;var i=arguments[0];if(i<0)i+=this.list.inner.childNodes.length;return this.list.inner.childNodes[i]};ret.expanded=arguments.length>1?arguments[1]:true;ret.onopen=ret.onclose=null;ret.render();return ret}