﻿/****************************************************************************************	
	[GLOBAL JQUERY FUNCTIONS]
*****************************************************************************************/
// Superfish dropdown menu
$(document).ready(function() { 
	$("ul#nav-main").superfish({delay:400,animation:{height:"show"},speed:"fast",autoArrows:false,dropShadows:false}); 
});
// Enable forms to be submitted via ENTER key
var AreaSelector = ".search,.submit";
var ButtonSelector = "input[type='submit'],input[type='image'],button";
$(document).ready(function() {
jQuery.each($(AreaSelector), function() {
        $(this).keypress(function(e) {
            if (e.which == 13 && e.target.type != 'textarea') {
                var arrItems = $(this).find(ButtonSelector);
                if (arrItems.length > 0) {
                    $(this).find(ButtonSelector)[0].click();
                } else {
                    eval($(this).find(".btn-submit")[0].href);
                }
                return false;
            }
        });
    });
});
// Clear text input values
var swap_text_boxes = [];
$(document).ready(function() {
    jQuery.each($("input[type='text'].autoclear"), function() {
        swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
        $(this).bind('focus', function() {
            if ($(this).val() == swap_text_boxes[$(this).attr('id')]) {
                $(this).val('');
            }
        });
        $(this).bind('blur', function() {
            if ($(this).val() == '') {
                $(this).val(swap_text_boxes[$(this).attr('id')]);
            }
        }); 
    });
});
// Append WAI-ARIA landmark roles
$(document).ready(function() {
    // Header
    $("#header").attr("role","banner");
	// Search
    $(".search").attr("role","search");
	// Navigation
    $("#nav-main, #sidebar ul").attr("role","navigation");
	// Main Content
    $("#content-main").attr("role","main");
    // Aside
    $("#aside").attr("role","complementary");
	// Footer
    $("#footer").attr("role","contentinfo");
});
/****************************************************************************************	
	[JQUERY PLUGINS]
*****************************************************************************************/
/*
 Superfish v1.4.8 - jQuery menu widget Copyright (c) 2008 Joel Birch CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 Dual licensed under the MIT and GPL licenses: http://www.opensource.org/licenses/mit-license.php, http://www.gnu.org/licenses/gpl.html
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(2($){$.k.z=2(d){4 e=$.k.z,c=e.c,$N=$([\'<O 1k="\',c.P,\'"> &#1l;</O>\'].g(\'\')),q=2(){4 a=$(3),l=A(a);Q(l.B);a.R().1m().r()},C=2(){4 a=$(3),l=A(a),o=e.9;Q(l.B);l.B=1n(2(){o.D=($.1o(a[0],o.$m)>-1);a.r();t(o.$m.E&&a.F([\'h.\',o.j].g(\'\')).E<1){q.8(o.$m)}},o.S)},A=2(a){4 b=a.F([\'5.\',c.G,\':T\'].g(\'\'))[0];e.9=e.o[b.U];u b},V=2(a){a.v(c.W).1p($N.1q())};u 3.n(2(){4 s=3.U=e.o.E;4 o=$.X({},e.Y,d);o.$m=$(\'h.\'+o.H,3).1r(0,o.Z).n(2(){$(3).v([o.j,c.I].g(\' \')).1s(\'h:10(5)\').11(o.H)});e.o[s]=e.9=o;$(\'h:10(5)\',3)[($.k.12&&!o.13)?\'12\':\'1t\'](q,C).n(2(){t(o.14)V($(\'>a:T-1u\',3))}).w(\'.\'+c.I).r();4 b=$(\'a\',3);b.n(2(i){4 a=b.15(i).F(\'h\');b.15(i).1v(2(){q.8(a)}).1w(2(){C.8(a)})});o.16.8(3)}).n(2(){4 a=[c.G];t(e.9.J&&!($.x.17&&$.x.18<7))a.1x(c.y);$(3).v(a.g(\' \'))})};4 f=$.k.z;f.o=[];f.9={};f.K=2(){4 o=f.9;t($.x.17&&$.x.18>6&&o.J&&o.L.19!=1y)3.1z(f.c.y+\'-1a\')};f.c={I:\'p-1A\',G:\'p-1B-1C\',W:\'p-1D-5\',P:\'p-1E-1F\',y:\'p-1G\'};f.Y={j:\'1H\',H:\'1I\',Z:1,S:1J,L:{19:\'1K\'},1b:\'1L\',14:M,J:M,13:1c,16:2(){},1d:2(){},1e:2(){},1f:2(){}};$.k.X({r:2(){4 o=f.9,w=(o.D===M)?o.$m:\'\';o.D=1c;4 a=$([\'h.\',o.j].g(\'\'),3).1M(3).w(w).11(o.j).1g(\'>5\').1N().1h(\'1i\',\'1j\');o.1f.8(a);u 3},R:2(){4 o=f.9,1O=f.c.y+\'-1a\',$5=3.v(o.j).1g(\'>5:1j\').1h(\'1i\',\'1P\');f.K.8($5);o.1d.8($5);$5.1Q(o.L,o.1b,2(){f.K.8($5);o.1e.8($5)});u 3}})})(1R);',62,116,'||function|this|var|ul|||call|op|||||||join|li||hoverClass|fn|menu|path|each||sf|over|hideSuperfishUl||if|return|addClass|not|browser|shadowClass|superfish|getMenu|sfTimer|out|retainPath|length|parents|menuClass|pathClass|bcClass|dropShadows|IE7fix|animation|true|arrow|span|arrowClass|clearTimeout|showSuperfishUl|delay|first|serial|addArrow|anchorClass|extend|defaults|pathLevels|has|removeClass|hoverIntent|disableHI|autoArrows|eq|onInit|msie|version|opacity|off|speed|false|onBeforeShow|onShow|onHide|find|css|visibility|hidden|class|187|siblings|setTimeout|inArray|append|clone|slice|filter|hover|child|focus|blur|push|undefined|toggleClass|breadcrumb|js|enabled|with|sub|indicator|shadow|sfHover|overideThisToUse|800|show|normal|add|hide|sh|visible|animate|jQuery'.split('|'),0,{}))