/**********************************************************************************
***********************************************************************************
**
** CSS Browser Selector v0.4.0 (Nov 02, 2010)
** Rafael Lima (http://rafael.adm.br)
** http://rafael.adm.br/css_browser_selector
** License: http://creativecommons.org/licenses/by/2.5/
** Contributors: http://rafael.adm.br/css_browser_selector#contributors
**
***********************************************************************************
**********************************************************************************/
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);


/**********************************************************************************
***********************************************************************************
**
** hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
** <http://cherne.net/brian/resources/jquery.hoverIntent.html>
** 
** @param  f  onMouseOver function || An object with configuration options
** @param  g  onMouseOut function  || Nothing (use configuration options object)
** @author    Brian Cherne brian(at)cherne(dot)net
**
***********************************************************************************
**********************************************************************************/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);


/**********************************************************************************
***********************************************************************************
**
** Modernizr v1.7  www.modernizr.com
** Modernizr adds classes to the <html> element which allow you to target specific 
** browser functionality in your stylesheet. 
**
***********************************************************************************
**********************************************************************************/
window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=!!(a[b]in l);return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return a.getContext&&a.getContext("2d")},r.canvastext=function(){return e.canvas&&C(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return"ontouchstart"in a||w("@media ("+o.join("touch-enabled),(")+"modernizr)")},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;){var d=p[b].toLowerCase();if(a[d+"_indexedDB"]||a[d+"IndexedDB"])return!0}return!1},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c<d)e=a[c],(b=e.media||b)!="screen"&&f.push(p(e.imports,b),e.cssText);return f.join("")}function o(a){var b=-1;while(++b<e)a.createElement(d[b])}var c="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",d=c.split("|"),e=d.length,f=new RegExp("(^|\\s)("+c+")","gi"),g=new RegExp("<(/*)("+c+")","gi"),h=new RegExp("(^|[^\\n]*?\\s)("+c+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),i=b.createDocumentFragment(),j=b.documentElement,k=j.firstChild,l=b.createElement("body"),m=b.createElement("style"),n;o(b),o(i),k.insertBefore(m,k.firstChild),m.media="print",a.attachEvent("onbeforeprint",function(){var a=-1,c=p(b.styleSheets,"all"),k=[],o;n=n||b.body;while((o=h.exec(c))!=null)k.push((o[1]+o[2]+o[3]).replace(f,"$1.iepp_$2")+o[4]);m.styleSheet.cssText=k.join("\n");while(++a<e){var q=b.getElementsByTagName(d[a]),r=q.length,s=-1;while(++s<r)q[s].className.indexOf("iepp_")<0&&(q[s].className+=" iepp_"+d[a])}i.appendChild(n),j.appendChild(l),l.className=n.className,l.innerHTML=n.innerHTML.replace(g,"<$1font")}),a.attachEvent("onafterprint",function(){l.innerHTML="",j.removeChild(l),j.appendChild(n),m.styleSheet.cssText=""})}(a,b),e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document)


/**********************************************************************************
***********************************************************************************
**
**  BigText
**  http://www.zachleat.com/web/bigtext-makes-text-big/
**
***********************************************************************************
**********************************************************************************/
;(function($)
{
    // Purposeful Global
    BigText = {
        STARTING_PX_FONT_SIZE: 11,
        DEFAULT_MAX_FONT_SIZE_EM: 48,
        GLOBAL_STYLE_ID: 'bigtext-style',
        STYLE_ID: 'bigtext-id',
        LINE_CLASS_PREFIX: 'bigtext-line',
        LINE_FOCUS_CLASS: 'bigtext-focus',
        EXEMPT_CLASS: 'bigtext-exempt',
        DEFAULT_CHILD_SELECTOR: '> div',
        childSelectors: {
            div: '> div',
            ol: '> li',
            ul: '> li'
        },
        DATA_KEY: 'bigtextOptions',
        counter: 0,
        init: function($head)
        {
            if(!$('#'+BigText.GLOBAL_STYLE_ID).length) {
                $head.append(BigText.generateStyleTag(BigText.GLOBAL_STYLE_ID, ['.bigtext { font-size: ' + BigText.STARTING_PX_FONT_SIZE + 'px; }']));
            }
        },
        getStyleId: function(elementId)
        {
            return BigText.STYLE_ID + '-' + elementId;
        },
        generateStyleTag: function(id, css)
        {
            return $('<style>' + css.join('\n') + '</style>').attr('id', id);
        },
        generateFontSizeCss: function(elementId, linesFontSizes, lineWordSpacings)
        {
            var css = [],
                styleId = BigText.getStyleId(elementId);
    
            for(var j=0, k=linesFontSizes.length; j<k; j++) {
                css.push('#' + elementId + ' .' + BigText.LINE_CLASS_PREFIX + j + ' {' +
                    (linesFontSizes[j] ? ' font-size: ' + linesFontSizes[j] + 'em;' : '') +
                    (lineWordSpacings[j] ? ' word-spacing: ' + lineWordSpacings[j] + 'px;' : '') + ' }');
            }
    
            $('#' + styleId).remove();
            return BigText.generateStyleTag(styleId, css);
        },
        testLineDimensions: function($line, maxwidth, property, size, interval, units)
        {
            $line.css(property, size + units);
    
            if($line.width() >= maxwidth) {
                $line.css(property, '');
    
                return parseFloat((parseFloat(size) - interval).toFixed(2));
            }
    
            return false;
        }
    };

    $.fn.bigtext = function(options)
    {
        var $headCache = $('head');
        BigText.init($headCache);
    
        options = $.extend({
                    maxfontsize: BigText.DEFAULT_MAX_FONT_SIZE_EM,
                    childSelector: '',
                    /* function(onResizeFunction) {
* $(window).unbind('resize.bigtext').bind('resize', onResizeFunction);
* }
*/
                    bindResize: null,
                    resize: true
                }, options || {});
    
        return this.each(function()
        {
            var $t = $(this).addClass('bigtext'),
                id = $t.attr('id'),
                childSelector = options.childSelector ||
                            BigText.childSelectors[this.tagName.toLowerCase()] ||
                            BigText.DEFAULT_CHILD_SELECTOR,
                maxwidth = $t.width(),
                $c = $t.clone(true)
                            .addClass('bigtext-cloned')
                            .removeAttr('id')
                            .css({
                                'min-width': parseInt(maxwidth, 10),
                                width: 'auto',
                                position: 'absolute',
                                left: -9999,
                                top: -9999
                            }).appendTo(document.body);

            if(!id) {
                id = 'bigtext-id' + (BigText.counter++);
                $t.attr('id', id);
            }

            if(options.resize) {
                // Cache options, used in BigText.resizeFunction
                $t.data(BigText.DATA_KEY, options);

                function resizeFunction()
                {
                    var $t = $('#'+id);
                    $t.bigtext($t.data(BigText.DATA_KEY));
                }

                if($.isFunction(options.bindResize)) {
                    options.bindResize(resizeFunction);
                } else if($.throttle) {
                    // https://github.com/cowboy/jquery-throttle-debounce
                    $(window).unbind('resize.bigtext').bind('resize.bigtext', $.throttle(100, resizeFunction));
                } else if($.fn.smartresize) {
                    // https://github.com/lrbabe/jquery-smartresize/
                    $(window).unbind('smartresize.bigtext').bind('smartresize.bigtext', resizeFunction);
                }
            }

            var styleId = BigText.getStyleId(id);
            $('#' + styleId).remove();
    
            // font-size isn't the only thing we can modify, we can also mess with:
            // word-spacing and letter-spacing.
            // Note: webkit does not respect subpixel letter-spacing or word-spacing,
            // nor does it respect hundredths of a font-size em.
            var fontSizes = [],
                wordSpacings = [];
    
            $c.find(childSelector).css({
                float: 'left',
                clear: 'left'
            }).each(function(lineNumber) {
                var $line = $(this),
                    intervals = [16,8,4,2,1,.1,.01],
                    fontMatch = 1,
                    lineMax;

                if($line.hasClass(BigText.EXEMPT_CLASS)) {
                    fontSizes.push(null);
                    return;
                }

                for(var m=0, n=intervals.length; m<n; m++) {
                    inner: for(var j=1, k=10; j<=k; j++) {
                        lineMax = BigText.testLineDimensions($line, maxwidth, 'font-size', fontMatch + j*intervals[m], intervals[m], 'em');
    
                        if(lineMax !== false) {
                            fontMatch = lineMax;
                            break inner;
                        }
                    }
    
                    if(fontMatch > options.maxfontsize) {
                        break;
                    }
                }
    
                if(fontMatch > options.maxfontsize) {
                    fontSizes.push(options.maxfontsize);
                } else {
                    fontSizes.push(fontMatch);
                }
            }).each(function(lineNumber) {
                var $line = $(this),
                    wordSpacing = 0,
                    interval = 1,
                    maxWordSpacing;

                if($line.hasClass(BigText.EXEMPT_CLASS)) {
                    wordSpacings.push(null);
                    return;
                }

                // must re-use font-size, even though it was removed above.
                $line.css('font-size', fontSizes[lineNumber] + 'em');
    
                for(var m=0, n=10; m<n; m+=interval) {
                    maxWordSpacing = BigText.testLineDimensions($line, maxwidth, 'word-spacing', m, interval, 'px');
                    if(maxWordSpacing !== false) {
                        wordSpacing = maxWordSpacing;
                        break;
                    }
                }
    
                $line.css('font-size', '');
                wordSpacings.push(wordSpacing);
            }).removeAttr('style');
    
            $headCache.append(BigText.generateFontSizeCss(id, fontSizes, wordSpacings));
    
            $c.remove();
    
            $t.find(childSelector).each(function(lineNumber)
            {
                $(this).each(function()
                    {
                        // remove existing line classes.
                        this.className = this.className.replace(new RegExp('\\s*' + BigText.LINE_CLASS_PREFIX + '\\d+'), '');
                    })
                    .addClass(BigText.LINE_CLASS_PREFIX + lineNumber)
                    [maxwidth / fontSizes[lineNumber] < 80 ? 'addClass' : 'removeClass'](BigText.LINE_FOCUS_CLASS);
            });
        });
    };
})(jQuery);


/**********************************************************************************
***********************************************************************************
**
** File: flexi-background.js
**
** Author:
** Michael Bester <http://kimili.com>
**
** About: Version
** 2.0
**
** Description:
** Javascript to set up full-screen flexible backgrounds in all widely used browsers.
**
** Requirements:
** jQuery 1.3.2 or higher <http://jquery.com>
**
** License:
** Copyright 2010, Michael Bester.
** Released under the MIT license <http://opensource.org/licenses/mit-license.php>
**
***********************************************************************************
**********************************************************************************/
(function($){
	/**
		CONFIGURATION:
		Define the size of our background image
	*/
	var bgImageSize = {
		width	: 1380,
		height	: 1020
	};
	/*	END CONFIGURATION */
	/**
		Detect support for CSS background-size. No need for any more javascript if background-size is supported.
		Property detection adapted from the most excellent Modernizr <http://modernizr.com>
	*/
	if ((function(){
		var el 		= document.createElement('div'),
			bs 		= 'backgroundSize',
			ubs		= bs.charAt(0).toUpperCase() + bs.substr(1),
			props	= [bs, 'Webkit' + ubs, 'Moz' + ubs, 'O' + ubs];
			
		for ( var i in props ) {
			if ( el.style[props[i]] !== undefined ) {
				return true;
			}
		}
		return false;
	}())) {
		return;
	};
	
	/**
		We also want to leave IE6 and below out in the cold with this
	*/
	if ( $.browser.msie && parseInt($.browser.version, 10) <= 6 ) {
		return;
	}
	
	/**
		If we've gotten here, we don't have background-size support,
		so we'll have to mimic it with Javascript.
		Let's set up some variables
	*/
	var $window		= $(window),
		imageID		= 'expando',
		tallClass	= 'tall',
		wideClass	= 'wide',
		$body, $bgImage, $wrapper, img, url, imgAR,

		/*
			Now we can move on with the core functionality of Flexibackground
		*/
		initialize = function() {
		
			// No need for any of this if the screen isn't bigger than the background image
			if (screen.availWidth <= bgImageSize.width && screen.availHeight <= bgImageSize.height) {
				return;
			}
		
			// Grab elements we'll reference throughout
			$body = $('body');
		
			// Parse out the URL of the background image and drop out if we don't have one
			url = $body.css('backgroundImage').replace(/^url\(("|')?|("|')?\);?$/g, '') || false;
			if (!url || url === "none" || url === "") {
				return;
			}
		
			// Get the aspect ratio of the image
			imgAR = bgImageSize.width / bgImageSize.height;

			// Create a new image element
			$bgImage = $(document.createElement('img'))
						.attr('src', url)
						.attr('id', imageID);
		
			// Create a wrapper and append the image to it.
			// The wrapper ensures we don't get scrollbars.
			$wrapper = $(document.createElement('div'))
						.css({
							'overflow'	: 'hidden',
							'position'	: 'fixed',
							'width'		: '100%',
							'height'	: '100%',
							'top'		: '0',
							'left'		: '0',
							'z-index'	: '-1'
						});
		
			$body.append(
				$wrapper.append($bgImage)
			);
		
			// Set up a resize listener to add/remove classes from the body 
			$(window)
				.resize(resizeAction)
				// roll it out by triggering a resize
				.trigger('resize');
		
		},
	
		/**
			Set up the action that happens on resize
		*/
		resizeAction = function() {
			var win = {
				height	: $window.height(),
				width	: $window.width()
			},

			// The current aspect ratio of the window
			winAR = win.width / win.height;

			// Determine if we need to show the image and whether it needs to stretch tall or wide
			if (win.width < bgImageSize.width && win.height < bgImageSize.height) {
				$body.removeClass(wideClass + ' ' + tallClass);
			} else if (winAR < imgAR) {
				$body
					.removeClass(wideClass)
					.addClass(tallClass);
				// Center the image
				$bgImage.css('left', Math.min(((win.width - bgImageSize.width) / 2), 0));
			} else if (winAR > imgAR) {
				$body
					.addClass(wideClass)
					.removeClass(tallClass);
				$bgImage.css('left', 0);
			}
		};
	
	// When the document is ready, run this thing.
	$(document).ready(initialize);
	
})(jQuery);
/**********************************************************************************
***********************************************************************************
**
** jQuery below executes when the page loads.  Everything above this line is
** source code for various plugins
**
***********************************************************************************
**********************************************************************************/
$(document).ready(function() {

	//When page loads...
	$(window).resize(function(){
		$('body').css('min-height',$("#wrapper").outerHeight(true));
	});
	$('.big-text').bigtext();
	$("#principles li:last").css('padding','0px').css('margin','0px').css('border-bottom','none');
	$("#other-links li:last").css('padding','0px').css('margin','0px').css('border-bottom','none');
	$("#social li:last").css('border-right','none');
	$('#iam-dropdown li:first').addClass('active');
	$('.potential-member-menu').show();
	
	$('#sites-list a').each(function(){
		$(this).attr('target','_blank');
	});
	
	$('.cf-ol li').has('.reqtxt, .emailreqtxt').css('background','rgba(255,0,0,0.1)');
	$(window).load(function(){
		$(window).trigger('resize');
	});
	
	//On Click Event
	$(".hasTab").click(function() {
		$(".close-tab").click(function(){
			$("#social li").removeClass("active").removeClass("notactive");
			$(".social-popout").stop().hide(200);
		});
		$('#social li').removeClass('active').removeClass('notactive');
		$(this).parent("li").addClass('active').siblings().addClass('notactive');
		$(".social-popout").hide();
		var toShow = $(this).attr('rel');
		var chk = $(toShow).css('display');
		if(chk == "block"){
			return false;
		}else{
			$(toShow).show(200);
		}
	});
	
	//On Click Event
	$("#aos-list li").click(function() {

		$("#aos-list li").find("a").removeClass("active"); // Remove any "active" class
		$(this).find("a").addClass("active"); // Add "active" class to selected tab
		$(".aos-service").fadeOut().hide(); // Hide all tab content

		var activeTab2 = $(this).find("a").attr("href"); // Find the href attribute value to identify the active tab + content
		$(activeTab2).fadeIn(); // Fade in the active ID content
				
		return false;
	});
	
	/*$('.landing-clip').click(function(){
		if( $(this).height() == 125 ){
			$(this).find('.landing-overlay').hide();
			$(this).animate({'height':'352px'}, 200);
		}
		else if( $(this).height() == 352 ){
			$(this).animate({'height':'125px'},200, function(){
				$(this).find('.landing-overlay').fadeIn('fast');
			});
		}
	});*/
	
	$('.landing-clip:last').css('margin-bottom','30px');
	
	$('.landing-clip').hover(
		function(){
			$(this).find('.landing-overlay').hide();
			$(this).stop().animate({'height':'352px'}, 200,function(){
				$(window).trigger('resize');
			});
		},
		function(){
			$(this).stop().animate({'height':'125px'},200, function(){
				$(this).find('.landing-overlay').fadeIn('fast');
				$(window).trigger('resize');
			});
		}
	);
	
	
	$('.principles li:first').css('color','#fff').find("div").show();
	
	$('.principles li').hover(
		function(){
			$(".principles div").hide();
			$('.principles li').css('color','#9f9f9f');
			$(this).css('color','#fff').find("div").show();
		}, 
		function(){
			//
		}
	);
	
	$('#profiles .thumbnail:last').css('margin-right','0px');
	$('#profiles .thumbnail').fadeTo('fast', 0.5).hover(
		function(){
			$(this).fadeTo('fast', 1.0).find('div.profile-content').slideDown('fast');	
		},function(){
			$(this).fadeTo('fast', 0.5).find('div.profile-content').slideUp('fast');
		}
	);
	
	
	
	
	
	
	/*===============================
	These functions leverage the hoverIntent plugin to 
	produce the "I Am.." dropdown	
	================================*/
	
		//On Hover -
		function topNavHoverOver(){
			$(this).addClass("active"); // add active class to the li
			var activeDD = $(this).find("a").attr("rel"); // find the href attr. value to identify what should be displayed in the dropdown
			$(activeDD).show(); // fade in the content
		}
		//On Hover Out
		function topNavHoverOut(){
			$(this).removeClass("active"); // remove the active class from the li
			var activeDD = $(this).find("a").attr("rel"); // find the href attr. value to indentify what should be hidden in the dropdown
			$(activeDD).hide(); // fade out the content
		}
		
		function ddHoverOver(){
			$('.cat-menu').hide();
			$('#iam-dropdown li.dropdown').removeClass('active');
			$(this).addClass("active"); // add active class to the li
			var activeDD = $(this).find("a").attr("rel"); // find the href attr. value to identify what should be displayed in the dropdown
			$(activeDD).show(); // fade in the content
		}
		function ddHoverOut(){
			
		}

		// set config for hoverIntent
	var config = {
		sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
		interval: 100, // number = milliseconds for onMouseOver polling interval
    	over: topNavHoverOver, // function = onMouseOver callback (REQUIRED)    
     	timeout: 100, // number = milliseconds delay before onMouseOut    
    	out: topNavHoverOut // function = onMouseOut callback (REQUIRED)    
	};
	// set config for hoverIntent
	var config2 = {
		sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
		interval: 100, // number = milliseconds for onMouseOver polling interval
    	over: ddHoverOver, // function = onMouseOver callback (REQUIRED)    
     	timeout: 100, // number = milliseconds delay before onMouseOut    
    	out: ddHoverOut // function = onMouseOut callback (REQUIRED)    
	};
	
	/*===========================================================================
		leverage hoverIntent and my functions on elements with the dropdown class. 
		**Note apply the dropdown class to the li or parent element not the anchor tag.**
		**Note, you can nest dropdown items! **
		**Also it is a requirement that the target dropdown element be a child of the element with the dropdown class**
	===========================================================================*/
	$(".iam").hoverIntent( config );
	$(".sites-list").hoverIntent( config );
	$("#iam-dropdown li.dropdown").hoverIntent( config2 );			
});
