function $(id){return document.getElementById(id)}function hx_class(node,classname){if(!node)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_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_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()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'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}var flashinstalled=0;var flashversion=0;if(navigator.plugins&&navigator.plugins.length){var x=navigator.plugins["Shockwave Flash"];if(x){flashinstalled=2;if(x.description){var y=x.description;flashversion=y.charAt(y.indexOf('.')-1)}}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<=9;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.appVersion.match(/msie [4-7]/i)){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(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)}var hx_showing;var hx_over;var hx_timeout=0;function hx_menus_init(){if(typeof hx_menus!=='object')return false;for(var i in hx_menus){if(hx_menus[i].par)if(!hx_menus[hx_menus[i].par]){p=document.getElementById(hx_menus[i].par);while(!hx_menus[p.id])p=p.parentNode;hx_menus[i].par=p.id}var obj=document.getElementById(i);if(typeof hx_menus[i]=='object')set_menu_handlers(obj);var items=obj.getElementsByTagName('*');for(j=0;j<items.length;j++)set_menu_handlers(items[j])}}hx_onload(hx_menus_init);function set_menu_handlers(o){if(typeof o.onmouseover!='function')o.onmouseover=function(){if(typeof hx_menus_over=='function')hx_menus_over(o)};else{var i=o.onmouseover;o.onmouseover=function(){i();if(typeof hx_menus_over=='function')hx_menus_over(o)}}if(typeof o.onmouseout!='function')o.onmouseout=function(){if(typeof hx_menus_out=='function')hx_menus_out(o)};else{var i=o.onmouseout;o.onmouseout=function(){i();if(typeof hx_menus_out=='function')hx_menus_out(o)}}}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_menus_over(o){if(hx_over)return false;hx_over=true;if(hx_timeout)clearTimeout(hx_timeout);hx_timeout=0;var trigger=false;hx_showing=o;for(i in hx_menus)if(hx_menus[i].tri==o.id){hx_showing=document.getElementById(i);trigger=true;var pm=document.getElementById(hx_menus[hx_showing.id].par);var tleft=get_offset_pos(o)[0];var ttop=get_offset_pos(o)[1];var pleft=get_offset_pos(pm)[0];var ptop=get_offset_pos(pm)[1];var side=hx_menus[hx_showing.id].pos.charAt(0);var flush=hx_menus[hx_showing.id].pos.charAt(1);var top,left;hx_showing.style.top='-30000px';hx_showing.style.display='block';switch(side){case 't':top=ptop-hx_showing.offsetHeight;break;case 'b':top=ptop+pm.offsetHeight;break;case 'l':left=pleft-hx_showing.offsetWidth;break;default:left=pleft+pm.offsetWidth}switch(flush){case 'l':left=tleft;break;case 'r':left=tleft+o.offsetWidth-hx_showing.offsetWidth;break;case 'b':top=ttop+o.offsetHeight-hx_showing.offsetHeight;break;case 'c':case 'm':if(side=='t'||side=='b')left=tleft+o.offsetWidth/2+hx_showing.offsetWidth/2;else top=ttop+o.offsetHeight/2+hx_showing.offsetHeight/2;break;default:top=ttop}if(hx_menus[hx_menus[hx_showing.id].par].par){var prev=document.getElementById(hx_menus[hx_showing.id].par);var pleft=get_offset_pos(prev)[0];var ptop=get_offset_pos(prev)[1]}var root=first=hx_showing;while(hx_menus[root.id].par){first=root;root=document.getElementById(hx_menus[root.id].par)}var all=root;var rleft=get_offset_pos(all)[0];var rtop=get_offset_pos(all)[1];if(hx_menus[first.id].pos.match(/^[tb]/i)){if(left+hx_showing.offsetWidth>rleft+root.offsetWidth){if(prev&&!side.match(/[tb]/))left=pleft-hx_showing.offsetWidth;else left=rleft+root.offsetWidth-hx_showing.offsetWidth}if(left<rleft){if(prev&&!side.match(/[tb]/))left=pleft+prev.offsetWidth;else left=rleft}}top+=parseInt(hx_menus[hx_showing.id].top);left+=parseInt(hx_menus[hx_showing.id].left);hx_showing.style.display='none';hx_showing.style.left=left+'px';hx_showing.style.top=top+'px';hx_show_menu()}if(!trigger){hx_over=false;for(i in hx_menus)if(hx_menus[i].par)if(hx_menus[i].par==o.id||hx_menus[i].tri==o.id)hx_over=true}while(!hx_menus[hx_showing.id])hx_showing=hx_showing.parentNode;par=o;while(!hx_menus[par.id])par=par.parentNode;if(!hx_over||hx_menus[par.id]=='top')hx_hide_menus();hx_class(o,'hover',1);hx_class_active(hx_showing,1)}function hx_class_active(c,action){while(!hx_menus[c.id])c=c.parentNode;while(hx_menus[c.id].tri){c=document.getElementById(hx_menus[c.id].tri);hx_class(c,'active',action);while(!hx_menus[c.id])c=c.parentNode}}function hx_menus_out(o){hx_over=false;hx_class(o,'hover',-1);hx_class(o,'active',-1);hx_class_active(o,-1);if(hx_showing)try{while(hx_menus[hx_showing.id].par)hx_showing=document.getElementById(hx_menus[hx_showing.id].par)}catch(e){if(hx_showing.parentNode)hx_showing=hx_showing.parentNode;hx_menus_out(o);return false}var ie=navigator.appVersion.match(/MSIE [4-6]/);hx_timeout=setTimeout('hx_hide_menus()',ie?hx_menu_delay_ie:hx_menu_delay)}function hx_show_menu(){hx_showing.style.display='block'}function hx_hide_menus(){var stay=new Array();var s=hx_showing;while(s){stay[stay.length]=s.id;for(i in hx_menus)if(i==s.id)s=hx_menus[i].par?document.getElementById(hx_menus[i].par):false}for(i in hx_menus)if(stay.toString().indexOf(i)===-1)if(hx_menus[i]!='top')document.getElementById(i).style.display='none'}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))e[i].setAttribute('href',e[i].getAttribute('href').replace(f,'@'));if(e[i].nodeType==1)restoreEmails(e[i])}}hx_onload(hx_validate);