/***************************************************************************
- File: wand.js - Let's use the wand
- Version: 10.10.11
***************************************************************************/

$m.h.geo_get={name:"geo_get",data_att:"geo_get",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){var b=$m.id(a),c=$m.geo.init_settings(b);$m.geo.request.element_id=a;$m.get_tag_name(a)=="a"&&b.blur();if($m.geo.send_request(c,a)===false){$m.ev(c.callback_fail);return false}}};
$m.h.ajax_click={name:"ajax_click",data_att:"ajax_click",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){$m.ajax.debug=="high"&&$m.de.add_item("$m.h.ajax_click.exec in_id = "+a);var b=$m.id(a),c=$m.ajax.init_settings(b);$m.ajax.request.element_id=a;$m.get_tag_name(a)=="a"&&b.blur();if($m.ajax.send_request(c,a)===false){$m.ev(c.callback_fail);return false}}};
$m.h.ajax_change={name:"ajax_change",data_att:"ajax_change",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"change",this.exec)},exec:function(a){$m.ajax.debug=="high"&&$m.de.add_item("$m.h.ajax_change.exec in_id = "+a);var b=$m.id(a),c=$m.ajax.init_settings(b);c.query+="&"+b.name+"="+b.value;$m.ajax.request.element_id=a;if($m.ajax.send_request(c,a)===false){$m.ev(c.callback_fail);return false}}};
$m.h.ajax_submit={name:"ajax_submit",data_att:"ajax_submit",construct:function(){$m.elements.bind($m.tags.form,this.data_att,"submit",this.exec)},exec:function(a){var b=$m.id(a),c=$m.ajax.init_settings(b),d="";$m.ajax.request.element_id=a;for(var e=b.getElementsByTagName("INPUT"),f=0,g=e.length;f<g;f++)if(e[f].type=="radio"&&e[f].checked===true)d+="&"+e[f].getAttribute("name")+"="+encodeURIComponent(e[f].value);else if(e[f].type=="checkbox"&&e[f].checked===true)d+="&"+e[f].getAttribute("name")+"="+
encodeURIComponent(e[f].value);else(e[f].type=="radio"||e[f].type=="checkbox")&&e[f].checked!==true||(d+="&"+e[f].getAttribute("name")+"="+encodeURIComponent(e[f].value));e=b.getElementsByTagName("TEXTAREA");f=0;for(g=e.length;f<g;f++)if($m.is_good_string(e[f].value)!==false)d+="&"+e[f].getAttribute("name")+"="+encodeURIComponent(e[f].value);b=b.getElementsByTagName("SELECT");f=0;for(e=b.length;f<e;f++){g=0;for(var h=b[f].length;g<h;g++)if(b[f][g].selected===true)d+="&"+b[f].getAttribute("name")+
"="+encodeURIComponent(b[f][g].value)}c.url=$m.att(a,"action");c.method=$m.att(a,"method");c.query=d;if($m.ajax.debug!==false){$m.de.add_item("settings.url = "+c.url);$m.de.add_item("settings.method = "+c.method);$m.de.add_item("settings.query = "+c.query)}$m.ajax.send_request(c,a)===false&&$m.ev(c.callback_fail)}};
$m.h.fire_event={name:"fire_event",data_att:"fire_event",data_att_on:"data-mjf_fe_on",data_att_exe:"data-mjf_fe_exe",data_att_id:"data-mjf_fe_id",construct:function(){for(var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b=0,c=a.length;b<c;b++)$m.elements.bind(a[b],this.data_att,a[b].getAttribute(this.data_att_on),this.exec)},exec:function(a){var b=$m.id(a),c=b.getAttribute($m.h.fire_event.data_att_exe),d=b.getAttribute($m.h.fire_event.data_att_id);try{$m.id(d)[c]()}catch(e){$m.de.add_item("$m.h.fire_event.exec("+
a+") failed")}$m.get_tag_name(a)=="a"&&b.blur()}};
$m.h.img_rollovers={name:"img_rollovers",data_att:"img_rollovers",construct:function(){if($m.vd.is_mobile_touch!==true){for(var a=0,b=$m.tags.img.length;a<b;a++)if($m.has_att($m.tags.img[a],$m.data_att,this.data_att)){var c=$m.id($m.tags.img[a]),d=new Image;d.src=c.getAttribute("data-mjf_img_on");c.setAttribute("data-mjf_img_off",$m.tags.img[a].src)}$m.elements.bind($m.tags.img,this.data_att,"mouseover",this.do_rollover);$m.elements.bind($m.tags.img,this.data_att,"mouseout",this.undo_rollover)}},
do_rollover:function(a){a=$m.id(a);a.src=a.getAttribute("data-mjf_img_on")},undo_rollover:function(a){a=$m.id(a);a.src=a.getAttribute("data-mjf_img_off")}};$m.h.confirm_click={name:"confirm_click",data_att:"confirm_click",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){return confirm($m.id(a).title)}};
$m.h.open_new_win={name:"open_new_win",data_att:"open_new_win",construct:function(){for(var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b=0,c=a.length;b<c;b++)$m.add_class(a[b],this.data_att);$m.elements.bind(a,this.data_att,"click",this.exec)},exec:function(a){var b=$m.id(a),c="new_win_"+a,d=b.getAttribute("data-mjf_win_dim"),e=b.getAttribute("href"),f=$m.att(a,"data-mjf_ga_track");$m.is_good_string(e)&&f===null&&$m.ga_track({category:"MJF Open New Win",action:a+" Click",label:e});
if(d=="normal")window.open(e,c);else{a=d.split("x");a="toolbar=no,location=no,resizable=yes,scrollbars=yes,menubar=no,width="+a[0]+",height="+a[1];window.open(e,c,a)}b.blur()}};
$m.h.ga_click_track={name:"ga_click_track",data_att:"ga_click_track",construct:function(){$m.elements.bind($m.tags.a,this.data_att,"click",this.exec)},exec:function(a){var b=$m.id(a);b=b.getAttribute("href");var c=$m.att(a,"data-mjf_ga_track");$m.is_good_string(b)&&c===null&&$m.ga_track({category:"MJF GA Click",action:a+" Click",label:b})}};
$m.h.dropdown_menu={name:"dropdown_menu",data_att:"dropdown_menu",uls_tag:{},timeout:false,timeout_setting:false,construct:function(){$m.ajax_init===false&&$m.write_css($m.config.basedir+"stylesheets/dropdown_menu.css");for(var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b=[],c="",d="",e=0,f=a.length;e<f;e++){b=$m.tag(a[e].getAttribute("id"),"li");for(var g=0,h=b.length;g<h;g++){c=b[g].getAttribute("id");if($m.is_good_string(c)===true){d=$m.tag(c,"ul");if(d[0]!==undefined){this.uls_tag[c]=
d[0];this.uls_tag[c].className="ddm_ul_off";tmp_lis_id_obj=$m.id(c);tmp_lis_id_obj.className="ddm_li_off";tmp_lis_id_obj.setAttribute("data-mjf_ddm","off");if($m.vd.is_mobile_touch===true)$m.element.bind(c,"click",this.show);else{$m.element.bind(c,"mouseover",this.show);$m.element.bind(c,"mouseout",this.hide)}}}}$m.remove_class(a[e],"display_none")}},show:function(){clearTimeout($m.h.dropdown_menu.timeout);var a=$m.id(this.id),b=this.id,c=a.getAttribute("data-mjf_ddm");for(var d in $m.h.dropdown_menu.uls_tag){$m.id(d).className=
"ddm_li_off";$m.id($m.h.dropdown_menu.uls_tag[d]).className="ddm_ul_off"}if($m.vd.is_mobile_touch===true)if(c=="off"){a.className="ddm_li_on";$m.h.dropdown_menu.uls_tag[b].className="ddm_ul_on";a.setAttribute("data-mjf_ddm","on")}else{a.className="ddm_li_off";$m.h.dropdown_menu.uls_tag[b].className="ddm_ul_off";a.setAttribute("data-mjf_ddm","off")}else{a.className="ddm_li_on";$m.h.dropdown_menu.uls_tag[b].className="ddm_ul_on"}},hide:function(){var a=$m.id(this.id),b=this.id;$m.h.dropdown_menu.timeout=
setTimeout(function(){a.className="ddm_li_off";$m.h.dropdown_menu.uls_tag[b].className="ddm_ul_off"},750)}};
$m.h.img_slideshow={name:"img_slideshow",data_att:false,img_folder:false,imgs:[],img_id:{},cnt:0,delay:false,animate:false,timeout:false,construct:function(a){$m.h.img_slideshow.click.construct();this.imgs=a.imgs;this.img_id=$m.id(a.img_id);this.img_folder=this.img_id.src.slice(0,this.img_id.src.lastIndexOf("/")+1);this.delay=a.delay*1000;this.animate=a.animate;for(var b=0,c=this.imgs.length;b<c;b++){a=new Image;a.src=this.img_folder+this.imgs[b]}this.start()},start:function(){this.timeout=setTimeout("$m.h.img_slideshow.cycle()",
$m.h.img_slideshow.delay)},cycle:function(){$m.h.img_slideshow.cnt++;if($m.h.img_slideshow.cnt==$m.h.img_slideshow.imgs.length)$m.h.img_slideshow.cnt=0;$m.h.img_slideshow.img_id.src=$m.h.img_slideshow.img_folder+$m.h.img_slideshow.imgs[$m.h.img_slideshow.cnt];$m.h.img_slideshow.animate===true&&$m.h.animations.opaque.exec($m.h.img_slideshow.img_id,"none","fast");$m.h.img_slideshow.timeout=setTimeout("$m.h.img_slideshow.cycle()",$m.h.img_slideshow.delay)},click:{name:"click",data_att:"img_slideshow_click",
construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){$m.h.img_slideshow.img_id.src=$m.h.img_slideshow.img_folder+a;$m.h.img_slideshow.animate===true&&$m.h.animations.opaque.exec($m.h.img_slideshow.img_id,"none","fast");clearTimeout($m.h.img_slideshow.timeout)}}};
$m.h.tool_tip={name:"tool_tip",data_att:"tool_tip",data_att_cont:"data-mjf_tt_id",all:[],css:{all:"tool_tip_cont",on:"tool_tip_cont_on"},timeout:false,construct:function(){if($m.vd.is_mobile_touch!==true){for(var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b="",c=0,d=a.length;c<d;c++){b=a[c].getAttribute(this.data_att_cont);this.all.push(b);$m.element.bind(b,"mouseover",this.show_tip_cont);$m.element.bind(b,"mouseout",this.hide_tip_cont);$m.add_class(b,this.css.all)}$m.elements.bind(a,
this.data_att,"mouseover",this.show_tip);$m.elements.bind(a,this.data_att,"mouseout",this.hide_tip)}},show_tip:function(a){clearTimeout($m.h.tool_tip.timeout);for(var b=0,c=$m.h.tool_tip.all.length;b<c;b++)$m.remove_class($m.h.tool_tip.all[b],$m.h.tool_tip.css.on);$m.add_class($m.id(a).getAttribute($m.h.tool_tip.data_att_cont),$m.h.tool_tip.css.on)},hide_tip:function(a){$m.h.tool_tip.timeout=setTimeout(function(){$m.remove_class($m.id(a).getAttribute($m.h.tool_tip.data_att_cont),$m.h.tool_tip.css.on)},
1000)},show_tip_cont:function(){clearTimeout($m.h.tool_tip.timeout);$m.add_class(this.id,$m.h.tool_tip.css.on)},hide_tip_cont:function(){var a=this.id;$m.h.tool_tip.timeout=setTimeout(function(){$m.remove_class(a,$m.h.tool_tip.css.on)},1000)}};
$m.h.lightswitch={name:"lightswitch",data_att:"lightswitch",css:{block:"lightswitch_block",none:"lightswitch_none"},construct:function(){var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b="",c="",d=[],e="";b=$m.cookies.get("mjf_lswitches");if(b!==false&&$m.ajax_init===false){b=$m.cookies.thaw("mjf_lswitches");c="";e=0;for(var f=b.length;e<f;e++)for(var g in b[e])if(c=$m.id(g)){c.setAttribute("data-mjf_lswitch_state",b[e][g]);d.push(g)}}g=0;for(f=a.length;g<f;g++){c=a[g].getAttribute("id");
b=$m.id(c);current_id_use_css=b.getAttribute("data-mjf_lswitch_use_css");if($m.is_in_array(d,c)===false){e=b.getAttribute("data-mjf_lswitch_id");if($m.has_class(e,"display_block")){if($m.get_tag_name(b)=="input")$m.id(b).checked=true;$m.is_set(current_id_use_css)&&current_id_use_css=="false"||$m.add_class(c,this.css.block);b.setAttribute("data-mjf_lswitch_state","block")}else if($m.has_class(e,"display_inline")){$m.is_set(current_id_use_css)&&current_id_use_css=="false"||$m.add_class(c,this.css.block);
b.setAttribute("data-mjf_lswitch_state","inline")}else{if($m.get_tag_name(b)=="input")$m.id(b).checked=false;$m.is_set(current_id_use_css)&&current_id_use_css=="false"||$m.add_class(c,this.css.none);b.setAttribute("data-mjf_lswitch_state","none")}}else $m.h.lightswitch.update(c,b.getAttribute("data-mjf_lswitch_state"))}$m.elements.bind(a,this.data_att,"click",this.exec)},exec:function(a){var b=$m.id(a),c=b.getAttribute("data-mjf_lswitch_state"),d=b.getAttribute("data-mjf_lswitch_display")?b.getAttribute("data-mjf_lswitch_display"):
"",e=b.getAttribute("data-mjf_lswitch_id");new_state=c=="none"?d=="inline"?"inline":"block":"none";$m.get_tag_name(a)=="a"&&b.blur();$m.h.lightswitch.update(a,new_state);b.setAttribute("data-mjf_lswitch_state",new_state);$m.h.animations.opaque.exec(e,"none","fast")},update:function(a,b){var c=$m.id(a),d=c.getAttribute("data-mjf_lswitch_use_css"),e=c.getAttribute("data-mjf_lswitch_id");switch(b){case "block":$m.is_set(d)&&d=="false"||$m.replace_class(a,$m.h.lightswitch.css.none,$m.h.lightswitch.css.block);
$m.replace_class(e,"display_none","display_block");break;case "inline":$m.is_set(d)&&d=="false"||$m.replace_class(a,$m.h.lightswitch.css.none,$m.h.lightswitch.css.block);$m.replace_class(e,"display_none","display_inline");break;case "none":$m.is_set(d)&&d=="false"||$m.replace_class(a,$m.h.lightswitch.css.block,$m.h.lightswitch.css.none);$m.has_class(e,"display_block")?$m.replace_class(e,"display_block","display_none"):$m.replace_class(e,"display_inline","display_none");break}if(c.getAttribute("data-mjf_lswitch_cookie")===
null||c.getAttribute("data-mjf_lswitch_cookie")!="false")$m.cookies.freeze("mjf_lswitches",a,b)}};
$m.h.dynamic_tabs={name:"dynamic_tabs",data_att:"dynamic_tabs",dtab_anchors_id:[],dtab_anchors:[],dtab_groups:[],construct:function(){var a=$m.get_tags_with_att($m.tags.a,$m.data_att,this.data_att),b=[],c="",d="",e=$m.cookies.get("mjf_dtabs");c=0;for(var f=a.length;c<f;c++)if($m.has_att(a[c],$m.data_att,this.data_att)&&a[c].getAttribute("data-mjf_dtab_set")){d=a[c].getAttribute("data-mjf_dtab_set");if($m.is_array(this.dtab_anchors[d])!==true)this.dtab_anchors[d]=[];this.dtab_anchors[d].push(a[c].getAttribute("id"));
b.push(a[c]);this.dtab_anchors_id.push(a[c].getAttribute("id"))}$m.elements.bind(b,this.data_att,"click",this.exec);a=0;for(b=$m.tags.all.length;a<b;a++)if(!$m.has_att($m.tags.all[a],$m.data_att,this.data_att))if($m.tags.all[a].getAttribute("id")&&$m.tags.all[a].getAttribute("data-mjf_dtab_set")){c=$m.tags.all[a].getAttribute("id");$m.has_class(c,"display_block")===false&&$m.add_class(c,"display_none");d=$m.tags.all[a].getAttribute("data-mjf_dtab_set");if($m.is_array(this.dtab_groups[d])!==true)this.dtab_groups[d]=
[];this.dtab_groups[d].push(c)}if($m.is_good_string(window.location.hash)){var g=window.location.hash.replace(/^#/,"");if($m.id(g)&&$m.is_in_array(this.dtab_anchors_id,g)!==false){this.exec(g);window.location="#"}}else if(e!==false){d=$m.cookies.thaw("mjf_dtabs");e=0;for(a=d.length;e<a;e++)for(g in d[e])$m.id(d[e][g])&&this.exec(d[e][g])}},exec:function(a){var b=$m.id(a),c="",d=$m.att(a,"data-mjf_ga_track"),e=b.getAttribute("data-mjf_dtab_set"),f=0;for(c=$m.h.dynamic_tabs.dtab_anchors[e].length;f<
c;f++)$m.remove_class($m.h.dynamic_tabs.dtab_anchors[e][f],"tab_link_active");$m.add_class(b,"tab_link_active");b.blur();f=0;for(var g=$m.h.dynamic_tabs.dtab_groups[e].length;f<g;f++){c=$m.h.dynamic_tabs.dtab_groups[e][f];$m.has_class(c,"display_none")===false&&$m.add_class(c,"display_none");$m.remove_class(c,"display_block")}f=b.getAttribute("data-mjf_dtab_id");$m.replace_class(f,"display_none","display_block");if(b.getAttribute("data-mjf_dtab_cookie")===null||b.getAttribute("data-mjf_dtab_cookie")!=
"false")$m.cookies.freeze("mjf_dtabs",e,a);$m.h.animations.opaque.exec(f,"none","fast");d===null&&$m.ga_track({category:"MJF Dynamic Tabs",action:a+" Click",label:f})}};$m.h.print_onclick={name:"print_onclick",data_att:"print_onclick",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){window.print&&window.print();$m.get_tag_name(a)=="a"&&$m.id(a).blur()}};
$m.h.print_onload={name:"print_onload",data_att:"print_onload",construct:function(){window.print&&window.print()}};
$m.h.darkroom={name:"darkroom",data_att:"darkroom",data_att_content:"data-mjf_dr_id",data_att_xy:"data-mjf_dr_xy",data_att_overlay:"data-mjf_dr_overlay",data_att_form:"data-mjf_dr_form",data_att_cancel:"dr_cancel",dr_contents:[],dr_forms:[],css:{all:"dr_content",current:"dr_content_current"},buffer:60,buffer_top:20,construct:function(){for(var a=$m.get_tags_with_att($m.tags.a,$m.data_att,this.data_att),b=$m.id($m.body_id),c=0,d=a.length;c<d;c++){var e=a[c].getAttribute(this.data_att_content),f=$m.id(e);
if($m.is_in_array(this.dr_contents,e)===false){f.style.visibility="hidden";$m.remove_class(e,"display_none");f.setAttribute("data-mjf_dr_height",f.offsetHeight);f.setAttribute("data-mjf_dr_width",f.offsetWidth);$m.add_class(f,this.css.all);f.style.visibility="visible";this.dr_contents.push(e);this.insert_cancel_img(e)}e=a[c].getAttribute(this.data_att_form);$m.is_good_string(e)&&$m.is_in_array(this.dr_forms,e)===false&&this.dr_forms.push(e)}if($m.id("dr_overlay")===false){c=document.createElement("div");
c.setAttribute("id","dr_overlay");if($m.vd.is_msie6_or_lower===true)c.style.cssText+="filter: alpha(opacity = 85);";b.appendChild(c);$m.win.bind("resize",function(){$m.h.darkroom.resize_overlay()})}$m.elements.bind(a,this.data_att,"click",this.exec);$m.elements.bind($m.tags.img,this.data_att_cancel,"click",this.hide)},resize_overlay:function(){var a=$m.id("dr_overlay");if(a.style.display=="block"){a.style.display="none";$m.vd.get_view_port();a.style.height=$m.vd.total_page_height+"px";a.style.width=
$m.vd.total_page_width+"px";a.style.display="block"}},exec:function(a){var b=$m.id(a),c=b.getAttribute($m.h.darkroom.data_att_content),d=$m.id(c),e=b.getAttribute($m.h.darkroom.data_att_xy),f=$m.id("dr_overlay"),g=true;if($m.get_tag_name(a)=="a"){var h=b.getAttribute("href"),i=$m.att(a,"data-mjf_ga_track");$m.is_good_string(h)&&i===null&&$m.ga_track({category:"MJF Darkroom",action:a+" Click",label:c});b.blur()}$m.h.darkroom.hide_all();$m.vd.get_view_port();f.style.height=$m.vd.total_page_height+"px";
f.style.width=$m.vd.total_page_width+"px";if($m.has_att(b,$m.h.darkroom.data_att_overlay,"true")===true){$m.id("dr_overlay").style.display="block";g=false}if($m.is_good_string(e)){b=$m.get_pos_x(a);a=$m.get_pos_y(a);e=e.split("x");b=e[0].match("-")?b-parseInt(e[0].replace("-","")):b+parseInt(e[0]);e=e[1].match("-")?a-parseInt(e[1].replace("-","")):a+parseInt(e[1]);if($m.vd.visible_page_width<b)d.style.right="40px";else d.style.left=b+"px";if($m.vd.visible_page_height<e)d.style.bottom="40px";else d.style.top=
e+"px"}else{e=parseInt(d.getAttribute("data-mjf_dr_height"));a=parseInt(d.getAttribute("data-mjf_dr_width"));d.style.top=$m.vd.visible_page_height>=e+$m.h.darkroom.buffer_top?parseInt($m.vd.visible_page_height/2)-parseInt(e/2)+($m.vd.scrolled_top-40)+"px":$m.h.darkroom.buffer_top+$m.vd.scrolled_top+"px";if($m.vd.total_page_width>=a+$m.h.darkroom.buffer){d.style.left=parseInt($m.vd.total_page_width/2)-parseInt(a/2)+"px";d.style.width=a+"px"}else{d.style.left=$m.h.darkroom.buffer+"px";d.style.width=
$m.vd.total_page_width-$m.h.darkroom.buffer*2-10+"px"}}$m.add_class(d,$m.h.darkroom.css.current);g===true&&$m.h.animations.opaque.exec(d,"none","fast")},insert_cancel_img:function(a){var b=$m.id(a),c=document.createElement("img"),d="cursor: pointer; float: right; height: 30px; width: 30px;";d+=$m.vd.is_msie6_or_lower===true?" margin: -7px -7px auto auto;":" margin: -20px -20px auto auto;";c.setAttribute("src",$m.config.basedir+"images/icons/icon_cancel.png");c.setAttribute("alt","Cancel");c.setAttribute("title",
"Close");c.setAttribute("height","30");c.setAttribute("width","30");c.setAttribute("data-mjf",$m.h.darkroom.data_att_cancel);c.setAttribute("id",a+".close_img");c.style.cssText=d;b.insertBefore(c,b.firstChild)},hide:function(a){$m.remove_class(a.split(".")[0],$m.h.darkroom.css.current);$m.id("dr_overlay").style.display="none"},hide_all:function(){for(var a=0,b=$m.h.darkroom.dr_contents.length;a<b;a++)$m.remove_class($m.h.darkroom.dr_contents[a],$m.h.darkroom.css.current);$m.id("dr_overlay").style.display=
"none"}};$m.h.submit_onclick={name:"submit_onclick",data_att:"submit_onclick",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){var b=$m.att(a,"data-mjf_soc_id"),c=$m.id(b);$m.get_tag_name(a)=="a"&&$m.id(a).blur();if($m.is_set($m.h.form_required.valid_forms[b])===true)$m.h.form_required.exec(b)===true?c.submit():(window.location="#"+b)}};
$m.h.form_required={name:"form_required",data_att:"form_required",required_att:"field_required",valid_forms:[],construct:function(){for(var a=$m.get_tags_with_att($m.tags.form,$m.data_att,this.data_att),b=0,c=a.length;b<c;b++){var d=$m.id(a[b]),e=d.getAttribute("id"),f=[],g="",h=[];d.setAttribute("name",e);f=$m.get_fields_with_att(a[b],["radio","checkbox"],$m.data_att,this.required_att);d=0;for(var i=f.length;d<i;d++)if(g!=f[d].getAttribute("name")){g=f[d].getAttribute("name");h.push(document[e][f[d].getAttribute("name")])}this.valid_forms[e]=
{required_simple:$m.get_fields_with_att(a[b],["text","password","textarea","file"],$m.data_att,this.required_att),required_selects:$m.get_fields_with_att(a[b],["select"],$m.data_att,this.required_att),required_options:h}}$m.elements.bind($m.tags.form,this.data_att,"submit",this.exec)},exec:function(a){wand.darkroom==true&&$m.is_in_array($m.h.darkroom.dr_forms,a)===false&&$m.att(a,"data-mjf_dr_hide")!=="false"&&$m.h.darkroom.hide_all();var b=true,c=0;c=$m.h.form_required.valid_forms[a].required_simple;
for(var d in c){$m.remove_class(c[d].parentNode,"field_error_parent");$m.remove_class(c[d].id,"field_error");if(c[d].type!="file")c[d].value=c[d].value.replace(/^\s+|\s+$/g,"");if($m.is_good_string(c[d].value)===false)if(c[d].disabled===false&&c[d].readOnly===false){$m.add_class(c[d].parentNode,"field_error_parent");$m.add_class(c[d].id,"field_error");b=false}}c=$m.h.form_required.valid_forms[a].required_selects;for(d in c){$m.remove_class(c[d].parentNode,"field_error_parent");$m.remove_class(c[d].id,
"field_error");if($m.is_good_string(c[d].value)===false)if(c[d].disabled===false){$m.add_class(c[d].parentNode,"field_error_parent");$m.add_class(c[d].id,"field_error");b=false}}a=$m.h.form_required.valid_forms[a].required_options;var e=false;for(d in a){c=0;if($m.is_good_string(a[d].length)===true){e=0;for(var f=a[d].length;e<f;e++)a[d][e].checked===true&&c++;e=$m.id(a[d][0].getAttribute("id"))}else{e=$m.id(a[d].getAttribute("id"));e.checked===true&&c++}if(c==0){$m.add_class(e.parentNode,"field_error_parent");
b=false}else $m.remove_class(e.parentNode,"field_error_parent")}return b===true?true:false}};
$m.h.check_all_boxes={name:"check_all_boxes",data_att:"check_all_boxes",checkall_att:"data-mjf_checkall",construct:function(){for(var a=[],b=[],c=0,d=$m.tags.form.length;c<d;c++){a=$m.get_fields_with_att($m.tags.form[c],["checkbox"],$m.data_att,this.data_att);b=b.concat(a)}$m.elements.bind(b,this.data_att,"click",this.exec)},exec:function(a){var b=$m.id(a),c=[],d=[];b=b.checked===true?true:false;for(var e=0,f=$m.tags.form.length;e<f;e++){c=$m.get_fields_with_att($m.tags.form[e],["checkbox"],$m.h.check_all_boxes.checkall_att,
a);d=d.concat(c)}e=0;for(a=d.length;e<a;e++)if(d[e].disabled===false){d[e].checked=b===false?true:false;d[e].click()}}};
$m.h.clear_onfocus={name:"clear_onfocus",data_att:"clear_onfocus",construct:function(){for(var a=[],b=[],c=0,d=$m.tags.form.length;c<d;c++){a=$m.get_fields_with_att($m.tags.form[c],["text","password","textarea"],$m.data_att,this.data_att);b=b.concat(a)}$m.elements.bind(b,this.data_att,"focus",this.do_focus);$m.elements.bind(b,this.data_att,"blur",this.do_blur)},do_blur:function(a){a=$m.id(a);if($m.is_good_string(a.value)===false)a.value=a.defaultValue},do_focus:function(a){a=$m.id(a);if(a.defaultValue==
a.value)a.value=""}};$m.h.clear_onload={name:"clear_onload",data_att:"clear_onload",construct:function(){for(var a=[],b=[],c=0,d=$m.tags.form.length;c<d;c++){a=$m.get_fields_with_att($m.tags.form[c],["text","password","textarea"],$m.data_att,this.data_att);b=b.concat(a)}a=0;for(c=b.length;a<c;a++)b[a].value=""}};
$m.h.clear_onclick={name:"clear_onclick",data_att:"clear_onclick",data_att_form:"data-mjf_coc_form",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){var b=$m.att(a,$m.h.clear_onclick.data_att_form);$m.id(b);var c=$m.tag(b,"input");a=0;for(var d=c.length;a<d;a++)if(c[a].getAttribute("type")=="checkbox"||c[a].getAttribute("type")=="radio")c[a].checked=false;else if(!(c[a].getAttribute("type")=="submit"||c[a].getAttribute("type")=="reset"||c[a].getAttribute("type")==
"button"))c[a].value="";c=$m.tag(b,"textarea");a=0;for(d=c.length;a<d;a++)c[a].value="";b=$m.tag(b,"select");a=0;for(c=b.length;a<c;a++)b[a].selectedIndex=-1}};
$m.h.check_other_onfocus={name:"check_other_onfocus",data_att:"check_other_onfocus",check_other_onfocus_id_att:"data-mjf_check_other_onfocus_id",construct:function(){for(var a=[],b=[],c=0,d=$m.tags.form.length;c<d;c++){a=$m.get_fields_with_att($m.tags.form[c],["text","password","textarea","file","select"],$m.data_att,this.data_att);b=b.concat(a)}$m.elements.bind(b,this.data_att,"focus",this.exec)},exec:function(a){a=$m.id(a).getAttribute($m.h.check_other_onfocus.check_other_onfocus_id_att);if($m.is_good_string(a))$m.id(a).checked=
true}};$m.h.click_disable={name:"click_disable",data_att:"click_disable",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){$m.id($m.id(a).getAttribute("data-mjf_click_disable_id")).disabled=true}};$m.h.click_enable={name:"click_enable",data_att:"click_enable",construct:function(){$m.elements.bind($m.tags.all,this.data_att,"click",this.exec)},exec:function(a){$m.id($m.id(a).getAttribute("data-mjf_click_enable_id")).disabled=false}};
$m.h.s2lcus={name:"s2lcus",data_att:"s2lcus",construct:function(){for(var a=[],b=[],c=0,d=$m.tags.form.length;c<d;c++){a=$m.get_fields_with_att($m.tags.form[c],["text","textarea"],$m.data_att,this.data_att);b=b.concat(a)}$m.elements.bind(b,this.data_att,"keyup",this.exec);$m.elements.bind(b,this.data_att,"change",this.exec)},exec:function(a){a=$m.id(a);$m.id(a.getAttribute("data-mjf_s2lcus")).value=a.value.toLowerCase().replace(/\W/g,"_").replace(/^_+|_+$/g,"")}};
$m.h.change_field_type={name:"change_field_type",data_att:"change_field_type",data_att_cft:"data-mjf_cft",data_att_cft_clear:"data-mjf_cft_clear",construct:function(){for(var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b=0,c=a.length;b<c;b++)$m.elements.bind(a[b],this.data_att,"focus",this.exec)},exec:function(a){var b=$m.id(a),c=$m.atts(b),d=$m.att(a,$m.h.change_field_type.data_att_cft_clear);c.type=$m.att(a,$m.h.change_field_type.data_att_cft);b.onfocus=null;if(d!==null)c.value=
"";$m.create_tag(b.parentNode,"input",c).focus();b.parentNode.removeChild(b)}};
$m.h.copy_fields={name:"copy_fields",data_att:"copy_fields",data_att_on:"data-mjf_cf_on",data_att_master:"data-mjf_cf_master",data_att_slaves:"data-mjf_cf_slaves",data_att_slave:"data-mjf_cf_slave",data_att_m2s:"data-mjf_cf_m2s",data_att_m2slave:"data-mjf_cf_m2slave",construct:function(){for(var a=$m.get_tags_with_att($m.tags.all,$m.data_att,this.data_att),b=0,c=a.length;b<c;b++)$m.elements.bind(a[b],this.data_att,a[b].getAttribute(this.data_att_on),this.exec)},exec:function(a){var b=$m.id(a),c="",
d=false,e=$m.att(a,$m.h.copy_fields.data_att_master),f=$m.is_set(e)===true?$m.id(e):false,g=$m.att(a,$m.h.copy_fields.data_att_slave),h=$m.att(a,$m.h.copy_fields.data_att_m2s);if($m.get_tag_name(a)=="input"&&$m.att(a,"type")=="checkbox"&&b.checked===false)d=true;if($m.is_set(g)===true)if(d===true)$m.id(g).value="";else $m.id(g).value=$m.get_tag_name(a)=="select"?f[f.selectedIndex].value:f.value;else if($m.is_set(h)===true){g=$m.get_tags_with_att($m.tags.all,$m.h.copy_fields.data_att_m2s,h);b=b="";
h=0;for(var i=g.length;h<i;h++){b=g[h].getAttribute("id");if(a!=b){b=$m.id(b);$m.id(b.getAttribute($m.h.copy_fields.data_att_m2slave)).value=d===true?"":b.value}}}else{g=$m.att(a,$m.h.copy_fields.data_att_slaves);g=$m.get_tags_with_att($m.tags.all,$m.h.copy_fields.data_att_slaves,g);h=0;for(i=g.length;h<i;h++){c=g[h].getAttribute("id");if(d===true&&e!=c)$m.id(c).value="";else if(f===false)$m.id(c).value=$m.get_tag_name(a)=="select"?b[b.selectedIndex].value:b.value;else $m.id(c).value=f.value}}}};
$m.h.animations={opaque:{name:"opaque",data_att:"opaque",speed:{slow:66,medium:33,fast:0},amt:0.1,exec:function(a,b,c){if(!($m.vd.is_mobile_touch===true||$m.config.animations.use===false)){a=$m.id(a);switch(c){case "slow":c=$m.h.animations.opaque.speed.slow;break;case "medium":c=$m.h.animations.opaque.speed.medium;break;case "fast":default:c=$m.h.animations.opaque.speed.fast;break}if(b=="full"){$m.h.animations.opaque.set(a,1);$m.h.animations.opaque.go(a,"down",1,c)}else{$m.h.animations.opaque.set(a,
0);$m.h.animations.opaque.go(a,"up",0,c)}}},go:function(a,b,c,d){if(b=="down")if(c>0){$m.h.animations.opaque.set(a,c);setTimeout(function(){$m.h.animations.opaque.go(a,b,c,d)},d);c-=$m.h.animations.opaque.amt}else $m.h.animations.opaque.set(a,0);else if(c<1){$m.h.animations.opaque.set(a,c);setTimeout(function(){$m.h.animations.opaque.go(a,b,c,d)},d);c+=$m.h.animations.opaque.amt}else $m.h.animations.opaque.set(a,1)},set:function(a,b){a.style.opacity=b}}};

