/***************************************************************************
- File: magic.js - Let's have some magic
- Version: 10.9.28
***************************************************************************/

var mjf_timer = new Date().getTime();

var mjf_config =
{
	 basedir : "/resources/javascript/magic/"
	,create_html5 : true
	,global_debug : false // false, "low", "high"
	,animations : {
		use : true
	}
	,ajax : {
		 use : true
		,debug : false // false, "low", "high"
		,visual : true		
	}
	,geo : {
		 use : false
		,visual : true
	}
	,send_timezone_to : false // false, "/resources/javascript/magic/docs/timezone.php", etc.
}

var wand={},trick={},$m={h:{},t:{},vd:{},timer:false,ready:false,ajax_init:false,data_att:"data-mjf",body_id:"magic_body",top_msg_parent:"top_msg_parent",top_msg_id:"top_msg",ga:false,when_ready:function(){document.addEventListener&&
document.addEventListener("DOMContentLoaded",$m.init,false)},init:function(){$m.execute()},construct:function(a,b,c,d){this.config=a;this.wand=b;this.trick=c;this.timer=d;this.vd.construct();this.dt.calculate_time_zone();this.config.create_html5===true&&$m.vd.is_msie&&$m.create_html5()},ga_track:function(a){typeof pageTracker=="object"&&typeof pageTracker._trackPageview=="function"&&pageTracker._trackEvent(a.category,a.action,a.label);setTimeout(function(){},100)},create_html5:function(){for(var a=
["abbr","article","aside","audio","bb","canvas","datagrid","datalist","details","dialog","eventsource","figure","footer","header","hgroup","mark","menu","meter","nav","output","progress","section","time","video"],b=0,c=a.length;b<c;b++)document.createElement(a[b])},execute:function(){if(this.ready!==true){this.ready=true;this.config.global_debug!==false&&this.de.construct();this.check_for_body_id();this.top_msg("information","Loading...");this.init_children(false);this.config.geo.use===true&&this.geo.construct();
$m.config.global_debug==="high"&&$m.de.add_item("$m.vd.ua = "+$m.vd.ua);$m.de.add_item("~ MJF initialized in "+((new Date).getTime()-$m.timer)/1000+" seconds")}},check_for_body_id:function(){var a=$m.tag("document","body")[0];a.getAttribute("id")&&a.getAttribute("id")!==""?($m.body_id=a.getAttribute("id")):a.setAttribute("id",$m.body_id)},top_msg:function(){return true},init_children:function(a){if(a===true)$m.ajax_init=true;this.tags={a:this.tag("document","a"),all:this.tag("document","*"),img:this.tag("document",
"img"),form:this.tag("document","form")};for(var b in $m.wand)if(this.h[b]===undefined){a='wand "'+b+'" is not initialized correctly';this.de.throw_browser_error(a)}else{this.h[b].construct($m.wand[b]);$m.config.global_debug==="high"&&$m.de.add_item("Executed >> $m.h."+b+".construct("+$m.wand[b]+")")}for(var c in $m.trick)if($m.t[c]===undefined){a='trick "'+c+'" is not initialized correctly';this.de.throw_browser_error(a)}else{$m.t[c].construct();for(var d in $m.trick[c])if($m.t[c][d]===undefined){a=
'$m.trick "'+c+"."+d+'" is not initialized correctly';this.de.throw_browser_error(a)}else{$m.t[c][d].construct($m.trick[c][d]);$m.config.global_debug==="high"&&$m.de.add_item("Executed >> $m.t["+c+"]["+d+"].construct($m.trick["+c+"]["+d+"])")}}$m.ajax_init=false;$m.config.ajax.use===true&&$m.ajax.xml_request_init();$m.config.global_debug==="high"&&$m.ajax_init===true&&$m.de.add_item("~ MJF initialized in "+((new Date).getTime()-$m.timer)/1000+" seconds")},write_css:function(a){var b=document.createElement("link");
b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",a);$m.tag("document","head")[0].appendChild(b)},write_script:function(a){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a);b.setAttribute("charset","UTF-8");this.tag("document","head")[0].appendChild(b)},tag:function(a,b){a=a=="document"?document:document.getElementById(a);return a.getElementsByTagName(b.toUpperCase())},get_tag_name:function(a){return $m.id(a).nodeName.toLowerCase()},
create_tag:function(a,b,c,d){b=document.createElement(b);var e="";for(var g in c){if(g=="class")$m.vd.is_msie7_or_lower?b.setAttribute("className",c[g]):b.setAttribute("class",c[g]);b.setAttribute(g,c[g]);if(g=="id")e=c[g]}$m.is_object(a)===true?a.appendChild(b):$m.id(a).appendChild(b);tag_id_obj=$m.id(e);if($m.is_good_string(d)===true&&e.length>0)tag_id_obj.innerHTML=d;return b},remove_tag:function(a){a=$m.id(a);a.parentNode.removeChild(a)},strip_tags:function(a){a=$m.id(a);return a===false?false:
a.innerHTML.replace(/<\/?[^>]+(>|$)/g,"")},win:{bind:function(a,b){a="on"+a;var c=window[a];window[a]=typeof window[a]=="function"?function(){c();b()}:b}},element:{bind:function(a,b,c){a=$m.id(a);b="on"+b;a[b]=c}},elements:{listeners:[],bind:function(a,b,c,d){c="on"+c;var e="",g="",h="";h="";if(a.length===undefined){var f=[];f[0]=a}else if($m.is_set(a.tagName)&&a.tagName.toLowerCase()=="select"){f=[];f[0]=a}else f=a;a=0;for(var l=f.length;a<l;a++){g=$m.id(f[a].getAttribute("id"));if($m.has_att(g,
$m.data_att,b)){e=g.getAttribute("id");h=g.getAttribute($m.data_att);h=h.split("|");for(var i=0,m=h.length;i<m;i++)if(h[i]==b)break;if($m.is_array(this.listeners[e])!==true)this.listeners[e]=[];if($m.is_array(this.listeners[e][c])!==true)this.listeners[e][c]=[];f[a][c]=$m.exec[c];this.listeners[e][c][i]=d;$m.has_att(g,$m.data_att,"return_false")&&g.setAttribute("data-mjf_return_value","false")}}}},exec:{go:function(a,b,c){for(var d in $m.elements.listeners[a][b])if($m.elements.listeners[a][b][d](a,
c)===false)return false;return $m.get_return(a)===false?false:true},onabort:function(a){return $m.exec.go(this.getAttribute("id"),"onabort",a)},onblur:function(a){return $m.exec.go(this.getAttribute("id"),"onblur",a)},onclick:function(a){return $m.exec.go(this.getAttribute("id"),"onclick",a)},onchange:function(a){return $m.exec.go(this.getAttribute("id"),"onchange",a)},ondblclick:function(a){return $m.exec.go(this.getAttribute("id"),"ondblclick",a)},onfocus:function(a){return $m.exec.go(this.getAttribute("id"),
"onfocus",a)},onkeydown:function(a){return $m.exec.go(this.getAttribute("id"),"onkeydown",a)},onkeypress:function(a){return $m.exec.go(this.getAttribute("id"),"onkeypress",a)},onkeyup:function(a){return $m.exec.go(this.getAttribute("id"),"onkeyup",a)},onload:function(a){return $m.exec.go(this.getAttribute("id"),"onload",a)},onmousemove:function(a){return $m.exec.go(this.getAttribute("id"),"onmousemove",a)},onmousedown:function(a){return $m.exec.go(this.getAttribute("id"),"onmousedown",a)},onmouseup:function(a){return $m.exec.go(this.getAttribute("id"),
"onmouseup",a)},onmouseover:function(a){return $m.exec.go(this.getAttribute("id"),"onmouseover",a)},onmouseout:function(a){return $m.exec.go(this.getAttribute("id"),"onmouseout",a)},onreset:function(a){return $m.exec.go(this.getAttribute("id"),"onreset",a)},onresize:function(a){return $m.exec.go(this.getAttribute("id"),"onresize",a)},onselect:function(a){return $m.exec.go(this.getAttribute("id"),"onselect",a)},onsubmit:function(a){return $m.exec.go(this.getAttribute("id"),"onsubmit",a)},onunload:function(a){return $m.exec.go(this.getAttribute("id"),
"onunload",a)}}};
$m.dt={current_year:false,current_month:false,current_date:false,current_hour:false,current_minute:false,current_second:false,current_milliseconds:false,am_pm:false,timezone:false,timezone_dst:false,get_date_now:function(){this.obj_date=new Date;this.current_year=this.obj_date.getFullYear();this.current_month=this.obj_date.getMonth();this.current_month++;if(this.current_month<10)this.current_month="0"+this.current_month;this.current_date=this.obj_date.getDate();if(this.current_date<10)this.current_date=
"0"+this.current_date;return this.current_year+"-"+this.current_month+"-"+this.current_date},get_time_now:function(){this.obj_date=new Date;this.current_hour=this.obj_date.getHours();this.am_pm=this.current_hour<12?"am":"pm";if(this.current_hour==0)this.current_hour=12;if(this.current_hour>12)this.current_hour-=12;this.current_minute=this.obj_date.getMinutes();this.current_minute+="";if(this.current_minute.length==1)this.current_minute="0"+this.current_minute;this.current_second=this.obj_date.getSeconds();
this.current_second+="";if(this.current_second.length==1)this.current_second="0"+this.current_second;this.current_milliseconds=this.obj_date.getMilliseconds();this.current_milliseconds=this.current_second+"";if(this.current_milliseconds.length==1)this.current_milliseconds="0"+this.current_milliseconds;return this.current_hour+":"+this.current_minute+":"+this.current_second+this.am_pm},calculate_time_zone:function(){var a=new Date,b=new Date(a.getFullYear(),0,1,0,0,0,0);a=new Date(a.getFullYear(),
6,1,0,0,0,0);var c=b.toGMTString(),d=new Date(c.substring(0,c.lastIndexOf(" ")-1));c=a.toGMTString();c=new Date(c.substring(0,c.lastIndexOf(" ")-1));b=(b-d)/3600000;a=(a-c)/3600000;if(b==a)this.timezone_dst="0";else{if(b-a>=0)b=a;this.timezone_dst="1"}this.timezone=b;if($m.config.global_debug=="high"){b="this.timezone = "+this.timezone;setTimeout("throw new Error("+b+")",0)}$m.config.send_timezone_to!==false&&$m.write_script($m.config.send_timezone_to+"?tz="+this.timezone)},convert:function(a){var b=
parseInt(a);a-=parseInt(a);a*=60;var c=parseInt(a);a-=parseInt(a);a*=60;parseInt(a);a=b;a=b==0?"00":b>0?b<10?"+0"+b:"+"+b:b>-10?"-0"+Math.abs(b):b;c=c<10?"0"+c:c;return a+":"+c}};
$m.vd={name:"visitor_data",browser:false,version:"?",version_major:"?",screen_height:false,screen_width:false,screen_depth:false,visible_page_height:false,visible_page_width:false,scrolled_left:false,scrolled_top:false,total_page_height:false,total_page_width:false,cookies_enabled:false,ua:navigator.userAgent,is_mobile_touch:false,match_windows:"Windows",is_windows:false,match_macintosh:"Macintosh",is_macintosh:false,match_linux:"Linux",is_linux:false,match_iphone:"iPhone",is_iphone:false,match_android:"Android",
is_android:false,match_webos:"webOS",is_webos:false,match_blackberry:"BlackBerry",is_blackberry:false,match_msie:"MSIE",is_msie:false,is_msie6_or_lower:false,match_msie7:"MSIE 7",is_msie7:false,is_msie7_or_lower:false,match_msie8:"MSIE 8",is_msie8:false,is_msie8_or_lower:false,match_msie9:"MSIE 9",is_msie8_or_lower:false,is_msie9:false,match_gecko:"Gecko",is_gecko:false,match_firefox:"Firefox",is_firefox:false,match_firefox2:"Firefox/2",is_firefox2:false,match_firefox3:"Firefox/3",is_firefox3:false,
match_firefox3_5:"Firefox/3.5",is_firefox3_5:false,match_firefox3_6:"Firefox/3.6",is_firefox3_6:false,match_webkit:"AppleWebKit",is_webkit:false,match_safari:"Safari",is_safari:false,match_mobile_safari:"Mobile Safari",is_mobile_touch_safari:false,match_chrome:"Chrome",is_chrome:false,match_pre:"Pre/1.0",is_pre:false,match_opera:"Opera",is_opera:false,construct:function(){var a="";if(this.ua.match(this.match_windows))this.is_windows=true;if(this.ua.match(this.match_macintosh))this.is_macintosh=true;
if(this.ua.match(this.match_linux))this.is_linux=true;if(this.ua.match(this.match_iphone))this.is_mobile_touch=this.is_iphone=true;if(this.ua.match(this.match_android))this.is_mobile_touch=this.is_android=true;if(this.ua.match(this.match_webos))this.is_mobile_touch=this.is_webos=true;if(this.ua.match(this.match_blackberry)){this.is_mobile_touch=this.is_blackberry=true;this.browser=this.match_blackberry}if((a=this.ua.indexOf("Opera"))!=-1){this.is_opera=true;this.browser=this.match_opera;this.version=
parseFloat(this.ua.substring(a+6));this.version_major=parseInt(""+this.version)}if(this.ua.match(this.match_gecko)){this.is_gecko=true;this.browser=this.match_gecko;if(this.ua.match(this.match_firefox)){this.is_firefox=true;this.browser=this.match_firefox}if(this.ua.match(this.match_firefox2)){this.is_firefox2=true;this.browser=this.match_firefox2}if(this.ua.match(this.match_firefox3)){this.is_firefox3=true;this.browser=this.match_firefox3}if(this.ua.match(this.match_firefox3_5)){this.is_firefox3=
false;this.is_firefox3_5=true;this.browser=this.match_firefox3_5}if(this.ua.match(this.match_firefox3_6)){this.is_firefox3_5=this.is_firefox3=false;this.is_firefox3_6=true;this.browser=this.match_firefox3_6}}if(this.ua.match(this.match_webkit)){this.is_gecko=false;this.is_webkit=true;this.browser=this.match_webkit;if(this.ua.match(this.match_safari)){this.is_safari=true;this.browser=this.match_safari}if(this.ua.match(this.match_chrome)){this.is_safari=false;this.is_chrome=true;this.browser=this.match_chrome}if(this.ua.match(this.match_mobile_safari)){this.is_safari=
false;this.is_mobile_touch=true;this.browser=this.match_mobile_safari}if(this.ua.match(this.match_pre)){this.is_safari=false;this.is_mobile_touch=this.is_pre=true;this.browser=this.match_pre}}if((a=this.ua.indexOf("MSIE"))!=-1){this.is_msie6_or_lower=this.is_msie=true;this.browser=this.match_msie;this.version=parseFloat(this.ua.substring(a+5));this.version_major=parseInt(""+this.version);if(this.ua.match(this.match_msie7)){this.is_msie7_or_lower=this.is_msie7=true;this.is_msie6_or_lower=false;this.browser=
this.match_msie7}if(this.ua.match(this.match_msie8)){this.is_msie8_or_lower=this.is_msie8=true;this.is_msie6_or_lower=false;this.browser=this.match_msie8}if(this.ua.match(this.match_msie9)){this.is_msie9_or_lower=this.is_msie9=true;this.is_msie6_or_lower=false;this.browser=this.match_msie8}$m.fix_msie()}this.screen_height=screen.height;this.screen_width=screen.width;this.screen_depth=screen.colorDepth;this.cookies_enabled=navigator.cookieEnabled},get_view_port:function(){$m.vd.visible_page_height=
document.documentElement&&document.documentElement.clientHeight||window.innerHeight||self.innerHeight||document.body.clientHeight;$m.vd.visible_page_width=document.documentElement&&document.documentElement.clientWidth||window.innerWidth||self.innerWidth||document.body.clientWidth;$m.vd.scrolled_left=document.documentElement&&document.documentElement.scrollLeft||window.pageXOffset||self.pageXOffset||document.body.scrollLeft;$m.vd.scrolled_top=document.documentElement&&document.documentElement.scrollTop||
window.pageYOffset||self.pageYOffset||document.body.scrollTop;$m.vd.total_page_height=document.documentElement&&document.documentElement.scrollHeight?document.documentElement.scrollHeight:document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight;$m.vd.total_page_width=document.documentElement&&document.documentElement.scrollWidth?document.documentElement.scrollWidth:document.body.scrollWidth>document.body.offsetWidth?document.body.scrollWidth:document.body.offsetWidth}};
$m.fix_msie=function(){if($m.vd.is_msie7_or_lower){document.nativeGetElementById=document.getElementById;document.getElementById=function(a){var b=document.nativeGetElementById(a);if(b)if(b.attributes.id.value==a)return b;else for(b=1;b<document.all[a].length;b++)if(document.all[a][b].attributes.id.value==a)return document.all[a][b];return null}}};
$m.de={name:"magic_debugger",construct:function(){if(this.new_document===undefined){var a="toolbar=no,location=no,resizable=yes,scrollbars=yes,menubar=no,width=600,height=500";a=window.open("","debug_win",a);if(a===undefined||a===null){setTimeout(function(){$m.top_msg("warning","Please allow pop-up windows if you'd like to use the Magic Debugger")},10);return $m.config.global_debug=false}this.new_document=a.document;this.new_document_begin='<!DOCTYPE html><html><head><title>Magic Debugger</title><link href="'+
$m.config.basedir+'stylesheets/magic_debugger.css" rel="stylesheet"></head><body>';this.new_document_content="<h1>Magic Debugger &raquo; "+$m.dt.get_date_now()+" "+$m.dt.get_time_now()+'</h1><div id="debug_box"></div>';this.new_document_content+='<p id="clear_debugger"><input type="button" value="clear" onclick="window.opener.$m.de.clear_debugger();"></p>';this.new_document_end="</body></html>";this.new_document.write(this.new_document_begin+this.new_document_content+this.new_document_end);this.new_document.close()}$m.vd.is_safari===
true&&a.blur();this.debug_box_id=this.new_document.getElementById("debug_box")},add_item:function(a){if($m.config.global_debug===false)return false;a=a.replace(new RegExp("<","gi"),"&lt;");a=a.replace(new RegExp(">","gi"),"&gt;");var b=((new Date).getTime()-$m.timer)/1000+"";if(b.length==3)b+="00";else if(b.length==4)b+="0";this.debug_box_id.innerHTML="<p>"+b+" | "+a+"</p>"+this.debug_box_id.innerHTML},clear_debugger:function(){this.debug_box_id.innerHTML=" ";return false},throw_browser_error:function(a){setTimeout("throw new Error('Magic: "+
a+"')",0)},get_wand:function(){var a="Debugging 'wand' ~~";for(var b in $m.wand)if($m.h[b]!==undefined)a+="$m.wand."+b+"="+$m.wand[b]+"; ";this.add_item(a)},get_this:function(a,b){this.add_item("Debugging This '"+a+"' ~~");for(var c in b)this.add_item("k = "+c+" ~~> "+b[c])},get_array:function(a,b){this.add_item("Debugging Array '"+a+"' ~~");if($m.is_array(b))if(b.length==0)this.add_item(a+" is empty");else for(var c=0,d=b.length;c<d;c++)this.add_item(a+"["+c+"] = "+b[c]);else this.add_item("Oops! '"+
a+"' isn't an array!")},get_object:function(a,b){this.add_item("Debugging Object '"+a+"' ~~");for(var c in b)this.add_item("Property='"+c+"'; Type='"+typeof b[c]+"'; Value='"+b[c]+"' ~~~~~ ")},get_type:function(a,b){this.add_item("typeof ("+a+") == "+typeof b)},throw_error:function(a,b,c){$m.de.add_item("~~ JavaScript Error: "+a+" ~~ Line: "+c+" ~~ URL: "+b);return true}};$m.set_prop_to_val=function(a,b,c){a[b]=c};$m.is_string=function(a){return typeof a=="string"};
$m.is_number=function(a){return typeof a=="number"};$m.is_object=function(a){return typeof a=="object"};$m.is_array=function(a){return typeof a=="object"&&a instanceof Array};$m.is_good_string=function(a){return $m.is_set(a)===false?false:a.length<=0?false:true};
$m.is_in_array=function(a,b){if($m.is_object(b)===true)for(var c=0,d=b.length;c<d;c++){if($m.is_string(b[c])===true)for(var e=0,g=a.length;e<g;e++)if($m.is_string(a[e])===true&&b[c]==a[e])return true}else{c=0;for(g=a.length;c<g;c++)if(a[c]==b)return c}return false};$m.du_to_space=function(a){return a.replace(/[\-_\s]/g," ")};$m.dus_to_slash=function(a){return a.replace(/[\-_\s]/g,"/")};$m.ds_to_uscore=function(a){return a.replace(/[\-\s]/g,"_")};
$m.get_initial_uc=function(a){return a.replace(/([A-Za-z]+)/g,function(b,c){return c.substr(0,1).toUpperCase()+c.toLowerCase().substr(1,c.length)})};$m.get_uc_first=function(a){a.toLowerCase();return a.substr(0,1).toUpperCase()+a.substr(1)};$m.is_set=function(a){return a===""||a===undefined||a===null||a===false?false:true};$m.array_unique=function(a){var b=[],c=0,d=a.length;a:for(;c<d;c++){for(var e=0,g=b.length;e<g;e++)if(b[e]==a[c])continue a;b[b.length]=a[c]}return b};
$m.obj_merge=function(a,b){for(var c in b)try{b[c].constructor==Object?(a[c]=$m.obj_merge(a[c],b[c])):(a[c]=b[c])}catch(d){a[c]=b[c]}return a};$m.get_pos_x=function(a){var b=$m.id(a);a=b.offsetLeft;for(b=b.offsetParent;b!=null;){a+=b.offsetLeft;b=b.offsetParent}return a};$m.get_pos_y=function(a){var b=$m.id(a);a=b.offsetTop;for(b=b.offsetParent;b!=null;){a+=b.offsetTop;b=b.offsetParent}return a};
$m.id=function(a){if($m.is_object(a)===true)return a;return $m.is_good_string(a)!==true?false:document.getElementById(a)===undefined?false:document.getElementById(a)===null?false:document.getElementById(a)};$m.att=function(a,b){if($m.vd.is_msie7_or_lower){a=document.all[a].attributes[b];return a===undefined?null:a.value}else{a=$m.id(a).getAttribute(b);return a===null?null:a}};
$m.atts=function(a){if($m.is_object(a)===false)return false;for(var b={},c=a.attributes.length,d=0;d<c;d++)if($m.vd.is_msie7_or_lower){if(a.attributes[d].specified&&a.attributes[d].name)b[a.attributes[d].name]=a.attributes[d].value}else if(a.attributes[d].name)b[a.attributes[d].name]=a.attributes[d].value;return b};
$m.add_class=function(a,b){a=$m.id(a);if(a===null)return false;if(a.className){var c=a.className.split(" ");if($m.is_in_array(c,b)!==false)return false;else{c.push(b);a.className=c.join(" ")}}else a.className=b};$m.remove_class=function(a,b){a=$m.id(a);if(a===null)return false;if(a.className){var c=a.className.split(" ");b=$m.is_in_array(c,b);if(b!==false){c.splice(b,1);a.className=c.join(" ")}else return false}};$m.replace_class=function(a,b,c){$m.remove_class(a,b);$m.add_class(a,c)};
$m.has_class=function(a,b){return $m.id(a).className.match(b)?true:false};$m.has_att=function(a,b,c){if($m.is_set(a)===false)return false;if(a.getAttribute("id")&&a.getAttribute(b)){a.getAttribute("id");a=a.getAttribute(b);a=a.split("|");if($m.is_object(a)===true){c=$m.is_in_array(a,c);return c!==false?true:false}else return false}else return false};$m.get_tags_with_att=function(a,b,c){for(var d=[],e=0,g=a.length;e<g;e++)$m.has_att(a[e],b,c)===true&&d.push(a[e]);return d};
$m.get_fields_with_att=function(a,b,c,d){var e=[],g="textarea",h="select",f=["button","checkbox","file","password","radio","submit","text"];a=$m.id(a);if($m.is_in_array(b,f)!==false){var l=a.getElementsByTagName("INPUT");f=0;for(var i=l.length;f<i;f++)for(var m in b)l[f].type==b[m]&&$m.has_att(l[f],c,d)&&e.push(l[f])}if($m.is_in_array(b,g)!==false){g=a.getElementsByTagName("TEXTAREA");f=0;for(m=g.length;f<m;f++)$m.has_att(g[f],c,d)&&e.push(g[f])}if($m.is_in_array(b,h)!==false){b=a.getElementsByTagName("SELECT");
f=0;for(h=b.length;f<h;f++)$m.has_att(b[f],c,d)&&e.push(b[f])}return e};$m.set_return=function(a,b){a=$m.id(a);if(a===false)return false;else a.setAttribute("data-mjf_return_value",b)};$m.get_return=function(a){a=$m.id(a);if(a===false)return false;else{a=a.getAttribute("data-mjf_return_value");return a=a==="false"?false:true}};$m.get_keycode=function(a){var b="";if(!a)a=window.event;return b=a.keyCode?a.keyCode:a.which?a.which:false};
$m.get_mousebutton=function(a){var b="";if(!a)a=window.event;return b=a.button?a.button:a.which?a.which:false};
$m.set_cursor=function(a,b){var c=$m.id(a);if(c===null)return false;if(c.value.length==0)try{c.focus()}catch(d){$m.de.add_item("$m.set_cursor("+a+", "+b+") failed")}else{var e=b=="start"?0:c.value.length;if(c.setSelectionRange)try{c.focus();c.setSelectionRange(c.value.length,e)}catch(g){$m.de.add_item("$m.set_cursor("+a+", "+b+") failed during id.setSelectionRange")}else if(c.createTextRange)try{range=c.createTextRange();range.collapse(true);range.moveEnd("character",e);range.moveStart("character",
c.value.length);range.select()}catch(h){$m.de.add_item("$m.set_cursor("+a+", "+b+") failed during id.createTextRange")}}};$m.scroll_to_id=function(a){var b=$m.id(a);if(b===null)return false;setTimeout(function(){window.scrollTo($m.get_pos_x(a),$m.get_pos_y(a))},100)};$m.get_rand_num=function(a){if($m.is_good_string(a)===false)a=10;for(var b="",c="",d=0;d<a;d++){b=Math.floor(Math.random()*10);c+=b+""}return c};$m.ev=function(a){return eval(a)};
$m.move_script_to_head=function(a){for(var b="";a.match(/(<script[^>]+javascript[^>]+>\s*(<!--)?)/i);){a=a.substr(a.indexOf(RegExp.$1)+RegExp.$1.length);if(!a.match(/((--\>)?\s*<\/script>)/))break;b=a.substr(0,a.indexOf(RegExp.$1));a=a.substring(b.length+RegExp.$1.length);var c=document.createElement("script");c.setAttribute("type","text/javascript");c.text=b;$m.tag("document","head")[0].appendChild(c);return a}};
$m.cookies={set:function(a,b,c,d){if($m.vd.cookies_enabled===true){a=escape(a)+"="+escape(b);a+=";path=";a+=$m.is_set(c)?c:"/";if($m.is_set(d)){c=new Date;c.setTime(c.getTime()+d*86400000);a+=";expires="+c.toGMTString()}document.cookie=a;return true}return false},get:function(a){if($m.vd.cookies_enabled===true)for(var b=document.cookie.split("; "),c="",d=0,e=b.length;d<e;d++){c=b[d].split("=");if(c[0]==a)return unescape(c[1])}return false},remove:function(a){$m.cookies.set(a,"","",-1)},freeze:function(a,
b,c){var d=$m.cookies.get(a);if(d!==false){d=d.split("|");for(var e=false,g=0,h=d.length;g<h;g++)if(d[g].match(b)){d[g]=b+":"+c;e=true}e===false&&d.push(b+":"+c);$m.cookies.set(a,d.join("|"),"",30)}else $m.cookies.set(a,b+":"+c,"",30)},thaw:function(a){a=$m.cookies.get(a);if(a!==false){a=a.split("|");for(var b=[],c=[],d=0,e=a.length;d<e;d++){c=a[d].split(":");if($m.is_array(b[d])===false)b[d]=[];b[d][c[0]]=c[1]}return b}else return false}};
$m.geo={name:"geo",has:false,go:false,watch_id:false,defaults:{timeout:10,max_age:300,keep_watching:false},error_codes:{0:"Unknown error",1:"Permission denied",2:"Position unavailable",3:"Timed out"},request:{element_id:false,timeout:false,max_age:false,keep_watching:false,update_id:false,update_id_scroll_top:false,callback_success:false,callback_fail:false,error:false},pos:false,construct:function(){if(navigator.geolocation){$m.geo.has=true;$m.geo.go=navigator.geolocation}else $m.de.add_item("navigator.geolocation doesn't exist in this browser.")},
init_settings:function(a){var b=a.getAttribute("data-data-mjf_geo_keep_watching");b=b&&b=="true"?true:false;return{timeout:parseInt(a.getAttribute("data-data-mjf_geo_timeout")?a.getAttribute("data-data-mjf_geo_timeout"):$m.geo.defaults.timeout)*1000,max_age:parseInt(a.getAttribute("data-data-mjf_geo_max_age")?a.getAttribute("data-data-mjf_geo_max_age"):$m.geo.defaults.max_age)*1000,keep_watching:b,update_id:a.getAttribute("data-mjf_geo_update_id"),update_id_scroll_top:a.getAttribute("data-mjf_geo_update_id_scroll_top")==
"true"?true:false,callback_success:a.getAttribute("data-mjf_geo_call_on_success")?a.getAttribute("data-mjf_geo_call_on_success"):"$m.geo.simple_content_update()",callback_fail:a.getAttribute("data-mjf_geo_call_on_fail")?a.getAttribute("data-mjf_geo_call_on_fail"):"$m.geo.request_failed()"}},send_request:function(a){if($m.geo.has===true&&$m.config.geo.use===true){$m.config.geo.visual===true&&$m.add_class($m.geo.request.element_id,"geo_visual");update_id=$m.id($m.geo.request.update_id);update_id.innerHTML=
"Requesting location...";$m.geo.request.update_id=a.update_id;$m.geo.request.timeout=a.timeout;$m.geo.request.max_age=a.max_age;$m.geo.request.keep_watching=a.keep_watching;$m.geo.request.update_id=a.update_id;$m.geo.request.update_id_scroll_top=a.update_id_scroll_top;$m.geo.request.callback_success=a.callback_success;$m.geo.request.callback_fail=a.callback_fail;$m.geo.get_pos()}else{$m.de.add_item("$m.config.geo.use === false; Set to true to use.");return false}},get_pos:function(){$m.de.add_item("Executing >> $m.geo.get_pos()");
$m.geo.watch_id=$m.geo.go.watchPosition(function(a){$m.geo.get_watch(a)},function(a){$m.geo.get_error(a)},{timeout:$m.geo.request.timeout,maximumAge:$m.geo.request.max_age})},get_watch:function(a){$m.geo.pos=a;$m.geo.request.keep_watching===false&&$m.geo.go.clearWatch($m.geo.watch_id);$m.config.geo.visual===true&&$m.remove_class($m.geo.request.element_id,"geo_visual");$m.ev($m.geo.request.callback_success)},get_error:function(a){$m.geo.request.error="Error getting location: "+$m.geo.error_codes[a.code]+
".";$m.geo.request.keep_watching===false&&$m.geo.go.clearWatch($m.geo.watch_id);$m.config.geo.visual===true&&$m.remove_class($m.geo.request.element_id,"geo_visual");$m.ev($m.geo.request.callback_fail)},simple_content_update:function(){$m.de.add_item("Executing >> $m.geo.simple_content_update()");if($m.id($m.geo.request.update_id)!==false){var a=$m.id($m.geo.request.update_id),b='<table class="general_table">';b+='<tr><td class="align_right">Timestamp</td><td>'+$m.geo.pos.timestamp+"</td></tr>";b+=
'<tr><td class="align_right">Latitude</td><td>'+$m.geo.pos.coords.latitude+" decimal degrees</td></tr>";b+='<tr><td class="align_right">Longitude</td><td>'+$m.geo.pos.coords.longitude+" decimal degrees</td></tr>";b+='<tr><td class="align_right">Accuracy</td><td>'+$m.geo.pos.coords.accuracy+" meters</td></tr>";b+='<tr><td class="align_right">Altitude</td><td>'+$m.geo.pos.coords.altitude+" meters (may return 0 if not supported)</td></tr>";b+='<tr><td class="align_right">Altitude Accuracy</td><td>'+
$m.geo.pos.coords.altitudeAccuracy+" meters (may return 0 if not supported)</td></tr>";b+='<tr><td class="align_right">Heading</td><td>'+$m.geo.pos.coords.heading+" degrees</td></tr>";b+='<tr><td class="align_right">Speed</td><td>'+$m.geo.pos.coords.speed+" meters per second</td></tr>";b+='<tr><td class="align_right">Street Number</td><td>'+$m.geo.pos.address.streetNumber+"</td></tr>";b+='<tr><td class="align_right">Street</td><td>'+$m.geo.pos.address.street+"</td></tr>";b+='<tr><td class="align_right">Premises</td><td>'+
$m.geo.pos.address.premises+"</td></tr>";b+='<tr><td class="align_right">City</td><td>'+$m.geo.pos.address.city+"</td></tr>";b+='<tr><td class="align_right">County</td><td>'+$m.geo.pos.address.county+"</td></tr>";b+='<tr><td class="align_right">Region</td><td>'+$m.geo.pos.address.region+"</td></tr>";b+='<tr><td class="align_right">Country</td><td>'+$m.geo.pos.address.country+"</td></tr>";b+='<tr><td class="align_right">Country Code</td><td>'+$m.geo.pos.address.countryCode+"</td></tr>";b+='<tr><td class="align_right">Postal Code</td><td>'+
$m.geo.pos.address.postalCode+"</td></tr>";b+="<table>";a.innerHTML="";a.innerHTML=b;$m.geo.do_scroll()}},request_failed:function(){if($m.id($m.geo.request.update_id)!==false){var a=$m.id($m.geo.request.update_id);a.innerHTML="";a.innerHTML=$m.geo.request.error;$m.geo.do_scroll()}},do_scroll:function(){$m.geo.request.update_id_scroll_top===true&&setTimeout(function(){$m.id($m.geo.request.update_id).scrollTop=0},100)}};
$m.ajax={name:"ajax",ao:false,throbber_html:'<img src="../images/throbber.gif" alt="Please wait...">',request:{element_id:false,url:false,update_id:false,update_id_scroll_top:false,response_text:false,ga_track:false,waiting_msg:"We're waiting for a response on your request...",failed_msg:"Unfortunately your request could not be completed at this time. Please try again later.",rs_msg:["0. Open hasn't been called.","1. Open called; Send hasn't.","2. Open called; Send has been called; No response from the server.",
"3. Server responded; Ready for data.","4. Server responded; Returned data!"]},xml_request_init:function(){try{$m.ajax.ao=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{$m.ajax.ao=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){$m.ajax.ao=new XMLHttpRequest}}},init_settings:function(a){var b={method:a.getAttribute("data-mjf_ajax_click_method")?a.getAttribute("data-mjf_ajax_click_method"):"get",url:a.getAttribute("data-mjf_ajax_url"),query:a.getAttribute("data-mjf_ajax_query")?a.getAttribute("data-mjf_ajax_query"):
"",update_id:a.getAttribute("data-mjf_ajax_update_id"),update_id_scroll_top:a.getAttribute("data-mjf_ajax_update_id_scroll_top")=="true"?true:false,callback_success:a.getAttribute("data-mjf_ajax_call_on_success")?a.getAttribute("data-mjf_ajax_call_on_success"):"$m.ajax.simple_content_update()",callback_fail:a.getAttribute("data-mjf_ajax_call_on_fail")?a.getAttribute("data-mjf_ajax_call_on_fail"):"$m.ajax.request_failed()"};$m.ajax.request.ga_track=a.getAttribute("data-mjf_ga_track")===null?true:false;
return b},send_request:function(a){if($m.config.ajax.use===false){$m.de.add_item("$m.config.ajax.use === false; Set to true to use.");return false}$m.config.ajax.visual===true&&$m.add_class($m.ajax.request.element_id,"ajax_visual");$m.config.ajax.debug=="high"&&$m.de.add_item("Executing >> $m.ajax.send_request("+a.method+","+a.url+","+a.query+","+a.update_id+")");var b=a.query;b=b+"&ajax_call="+(new Date).getTime();$m.config.ajax.debug!==false&&$m.de.add_item("final_query_string = "+b);$m.ajax.xml_request_init();
if($m.ajax.ao){$m.ajax.request.update_id=a.update_id;$m.ajax.request.update_id_scroll_top=a.update_id_scroll_top;$m.ajax.request.url=a.url;$m.ajax.request.method=a.method;$m.ajax.request.callback=a.callback_success;$m.ajax.ao.onreadystatechange=$m.ajax.return_request;switch(a.method){case "get":$m.ajax.ao.open("GET",a.url+"?"+b,true);$m.config.ajax.debug!==false&&$m.de.add_item('$m.ajax.ao.open("GET", '+a.url+"?"+b+", true)");$m.ajax.ao.send(null);break;case "post":$m.ajax.ao.open("POST",a.url,true);
$m.config.ajax.debug!==false&&$m.de.add_item('$m.ajax.ao.open("POST", '+a.url+", true)");$m.ajax.ao.setRequestHeader("Content-type","application/x-www-form-urlencoded");$m.ajax.ao.setRequestHeader("Content-length",b.length);$m.ajax.ao.setRequestHeader("Connection","close");$m.ajax.ao.send(b)}}else{$m.config.ajax.debug!==false&&$m.de.add_item("$m.ajax.ao = "+$m.ajax.ao);return false}},simple_content_update:function(){if($m.id($m.ajax.request.update_id)!==false){var a=$m.id($m.ajax.request.update_id),
b=$m.ajax.ao.responseText;if($m.config.ajax.debug=="high"){$m.de.add_item("$m.ajax.request.update_id = "+$m.ajax.request.update_id);$m.de.add_item("$m.ajax.ao.responseText = "+$m.ajax.ao.responseText)}a.innerHTML="";a.innerHTML=$m.ajax.ao.responseText;b=$m.move_script_to_head(b);$m.ajax.request.update_id_scroll_top===true&&setTimeout(function(){a.scrollTop=0},100);$m.h.animations.opaque.exec($m.ajax.request.update_id,"none","fast");$m.timer=(new Date).getTime();$m.init_children(true)}},request_failed:function(){$m.id($m.ajax.request.update_id).innerHTML=
$m.ajax.request.failed_msg;$m.h.animations.opaque.exec($m.ajax.request.update_id,"none","fast")},return_request:function(){switch($m.ajax.ao.readyState){case 0:$m.config.ajax.debug=="high"&&$m.de.add_item("$m.ajax.ao.readyState = "+$m.ajax.request.rs_msg[0]);break;case 1:$m.config.ajax.debug=="high"&&$m.de.add_item("$m.ajax.ao.readyState = "+$m.ajax.request.rs_msg[1]);break;case 2:$m.config.ajax.debug=="high"&&$m.de.add_item("$m.ajax.ao.readyState = "+$m.ajax.request.rs_msg[2]);break;case 3:$m.config.ajax.debug==
"high"&&$m.de.add_item("$m.ajax.ao.readyState = "+$m.ajax.request.rs_msg[3]);break;case 4:$m.config.ajax.debug=="high"&&$m.de.add_item("$m.ajax.ao.readyState = "+$m.ajax.request.rs_msg[4]);if($m.ajax.ao.status==200||window.location.href.indexOf("http")==-1){$m.ajax.request.response_text=$m.ajax.ao.responseText==0?$m.ajax.request.waiting_msg:$m.ajax.ao.responseText;$m.ev($m.ajax.request.callback);$m.ajax.request.ga_track===true&&$m.ga_track({category:"MJF AJAX",action:$m.ajax.request.element_id+" "+
$m.get_uc_first($m.ajax.request.method),label:$m.ajax.request.url})}else $m.ajax.request_failed();$m.config.ajax.visual===true&&$m.remove_class($m.ajax.request.element_id,"ajax_visual");break}}};
shortcut={all_shortcuts:{},add:function(a,b,c){var d={type:"keydown",propagate:false,disable_in_input:false,target:document,keycode:false};if(c)for(var e in d){if(typeof c[e]=="undefined")c[e]=d[e]}else c=d;d=c.target;if(typeof c.target=="string")d=document.getElementById(c.target);a=a.toLowerCase();function g(h){h=h||window.event;if(c.disable_in_input){var f;if(h.target)f=h.target;else if(h.srcElement)f=h.srcElement;if(f.nodeType==3)f=f.parentNode;if(f.tagName=="INPUT"||f.tagName=="TEXTAREA")return}if(h.keyCode)code=
h.keyCode;else if(h.which)code=h.which;f=String.fromCharCode(code).toLowerCase();if(code==188)f=",";if(code==190)f=".";var l=a.split("+"),i=0,m={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"},p={esc:27,escape:27,tab:9,space:32,"return":13,enter:13,backspace:8,scrolllock:145,scroll_lock:145,scroll:145,capslock:20,caps_lock:20,caps:20,numlock:144,num_lock:144,num:144,pause:19,"break":19,insert:45,
home:36,"delete":46,end:35,pageup:33,page_up:33,pu:33,pagedown:34,page_down:34,pd:34,left:37,up:38,right:39,down:40,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},j={shift:{wanted:false,pressed:false},ctrl:{wanted:false,pressed:false},alt:{wanted:false,pressed:false},meta:{wanted:false,pressed:false}};if(h.ctrlKey)j.ctrl.pressed=true;if(h.shiftKey)j.shift.pressed=true;if(h.altKey)j.alt.pressed=true;if(h.metaKey)j.meta.pressed=true;for(var n=0;k=l[n],n<l.length;n++)if(k==
"ctrl"||k=="control"){i++;j.ctrl.wanted=true}else if(k=="shift"){i++;j.shift.wanted=true}else if(k=="alt"){i++;j.alt.wanted=true}else if(k=="meta"){i++;j.meta.wanted=true}else if(k.length>1)p[k]==code&&i++;else if(c.keycode)c.keycode==code&&i++;else if(f==k)i++;else if(m[f]&&h.shiftKey){f=m[f];f==k&&i++}if(i==l.length&&j.ctrl.pressed==j.ctrl.wanted&&j.shift.pressed==j.shift.wanted&&j.alt.pressed==j.alt.wanted&&j.meta.pressed==j.meta.wanted){b(h);if(!c.propagate){h.cancelBubble=true;h.returnValue=
false;if(h.stopPropagation){h.stopPropagation();h.preventDefault()}return false}}}this.all_shortcuts[a]={callback:g,target:d,event:c.type};if(d.addEventListener)d.addEventListener(c.type,g,false);else if(d.attachEvent)d.attachEvent("on"+c.type,g);else d["on"+c.type]=g},remove:function(a){a=a.toLowerCase();var b=this.all_shortcuts[a];delete this.all_shortcuts[a];if(b){a=b.event;var c=b.target;b=b.callback;if(c.detachEvent)c.detachEvent("on"+a,b);else if(c.removeEventListener)c.removeEventListener(a,
b,false);else c["on"+a]=false}}};$m.when_ready();$m.win.bind("load",function(){$m.init()});$m.construct(mjf_config,wand,trick,mjf_timer);

