/*----------------------------------------------------

	JSONLOAD.JS

----------------------------------------------------*/

$(document).ready(function(){

	var bodyid = $('body').attr('id');
	
	// A. Close Response Messages
	//------------------------------------------------------------------------------------------

	$('#msg-response').bind("click", function(){
		if(!$('#msg-response').find('a').length){
			if($('#msg-response').is(':visible')){
				$("#msg-response").slideUp();
			}
		}
	});
	if($('#msg-response').find('a').length){ $("#msg-response span").hide(); }
	
	// B. Input Hints
	//------------------------------------------------------------------------------------------	

	if(!Modernizr.input.placeholder){
		$('input[type="text"], textarea').each(function(){
			if(!$(this).val()){
				var obj = $(this).attr('placeholder');
				if(obj != undefined){ this.value = $(this).attr('placeholder'); }
			}	
			$(this).focus(function(){
				if(this.value == $(this).attr('placeholder')){
					this.value = '';
				}
			});
			$(this).blur(function(){
				if(this.value == ''){
					var placeholder = $(this).attr('placeholder');
					if(placeholder != undefined){ this.value = $(this).attr('placeholder');}
				}
			});
		});
	}

	
	// C. In Page Links
	//------------------------------------------------------------------------------------------
		
	$('a.in-link').click(function(){  
 		if(location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname){
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if($target.length){
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 900);
				return false;
			}
		}  
  	});
	
	// D. Sub Navigation
	//------------------------------------------------------------------------------------------

	var config = {    
		sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
		interval: 200,  // number = milliseconds for onMouseOver polling interval    
		over: doOpen,   // function = onMouseOver callback (REQUIRED)    
		timeout: 200,   // number = milliseconds delay before onMouseOut    
		out: doClose    // function = onMouseOut callback (REQUIRED)    
	};
	function doOpen() {
		$('ul:first',this).css('display', 'block');
	}
	function doClose() {
		$('ul:first',this).css('display', 'none');
	}
	if($('.no-touch').length > 0){
		$("nav li").hoverIntent(config);
	}else{
		$("nav > ul li:first-child ul li:first-child").after('<li><a href="/">Home</a>');
		$("nav > ul li a").click(function(ev){
			if($(this).parent('li').children('ul').length > 0){
				if($(this).parent('li').children('ul').is(':visible')){
					$(this).parent('li').children('ul').hide();	
				}else{
					$("nav > ul li ul").hide();
					$(this).parent('li').children('ul').show();	
				}
			}
			ev.preventDefault();
		});
		$("nav > ul li span").click(function(ev){
			if($(this).parent('li').children('ul').length > 0){
				if($(this).parent('li').children('ul').is(':visible')){
					$(this).parent('li').children('ul').hide();	
				}else{
					$("nav > ul li ul").hide();
					$(this).parent('li').children('ul').show();	
				}
			}
			ev.preventDefault();
		});
	}
	
	
	// E. Latest News
	//------------------------------------------------------------------------------------------

    $(function () {
        $('#js-news').ticker({
			titleText: 'Latest News: '
		});
    });
	
	
	// F. Main Banner
	//------------------------------------------------------------------------------------------	
	if(bodyid == 'index'){
	
		$('.banner').after('<div class="banner banner-2">&nbsp;</div><div class="banner banner-3">&nbsp;</div>');
		$('.banner').hide();

		var InfiniteRotator = {
        	init: function(){
				//initial fade-in time (in milliseconds)
				var initialFadeIn = 0;
				//interval between items (in milliseconds)
				var itemInterval = 7500;
				//cross-fade time (in milliseconds)
				var fadeTime = 3500;
				//count number of items
				var numberOfItems = $('.banner').length;
				//set current item
				var currentItem = 0;
				//show first item
				$('.banner').eq(currentItem).fadeIn(initialFadeIn);
				//loop through the items
				var infiniteLoop = setInterval(function(){
					$('.banner').eq(currentItem).fadeOut(fadeTime);
	 
					if(currentItem == numberOfItems -1){
						currentItem = 0;
					}else{
						currentItem++;
					}
					$('.banner').eq(currentItem).fadeIn(fadeTime);
	 
				}, itemInterval);
        	}
    	};
    InfiniteRotator.init();
	
	}
	
	
	// G. Comments
	//------------------------------------------------------------------------------------------	
	
	if($('#comments li').length > 2){
		$('#comments li').hide();
		$('#comments form').hide();
		$('#comments li:nth-child(1)').show();
		$('#comments li:nth-child(2)').show();
		$('#comments ul').after('<div id="comment-hide">&nbsp;</div><a class="showall">Show all comments</a>');
	
		$('#comments h3').click(function(){
			showhideComments();
		});
		$('#comments .showall').click(function(){
			showhideComments();
		});
		
		function showhideComments(){
			if($('#comments li:last-child').is(':visible')){
				$('#comments li').hide();
				$('#comments form').hide();
				$('#comments li:nth-child(1)').show();
				$('#comments li:nth-child(2)').show();
				$('#comment-hide').show();
				$('.showall').show();
			}else{
				$('#comments li').show();
				$('#comment-hide').hide();
				$('#comments form').show();
				$('.showall').hide();
			}
		}
	}


	// H. Postcard
	//------------------------------------------------------------------------------------------	
	
	var postcard = $('#postcard');
	$('#gallery-nav').after(postcard);
	if($('.postcard-visible').length <= 0){
		$('#postcard').hide();
	}
	
	$('#link-postcard').click(function(ev){
		if($('#postcard').is(':visible')){
			$('#postcard').slideUp('slow');
		}else{
			$('#postcard').slideDown('slow');
		}
		ev.preventDefault();
	});
	
	
	// I. External Links
	//------------------------------------------------------------------------------------------	
	$("a[href^=http]").each(function(){
		if(this.href.indexOf(location.hostname) == -1) {
		  	$(this).attr('target', '_blank');
		}
	});
	
	
	// J. Drop Down Page Subnav
	//------------------------------------------------------------------------------------------		
	function alterPageSubnav(){
		$('.subnav-dd').hide();
		$('.subnav-dd').wrapInner('<li><ul>');
		$('.subnav-dd').removeClass('subnav-btns');
		var heading =  $('.subnav-dd').attr('title');
		$('.subnav-dd > li').prepend('<h6>'+heading+'</h6>');
		$('.subnav-dd ul').hide();
		$('.subnav-dd').show();
		$('.subnav-dd h6').click(function(event){
			if($(this).siblings('ul').is(':visible')){
				$(this).siblings('ul').fadeOut();
			}else{
				$(this).siblings('ul').fadeIn();
			}
			$(document).one('click',function() {
				$('.subnav-dd ul').fadeOut();
			});
			event.stopPropagation();	
		});
		
	}
	alterPageSubnav();

	// K. Loading
	//------------------------------------------------------------------------------------------
	$('body').append('<div id="page-load"><div></div>');
	$("#page-load").delay(100).hide();
	$('nav form').submit(function(){
		$("#page-load").delay(1000).fadeIn();
	});
		
});


// 01. trim
//------------------------------------------------------------------------------------------

function trim(str) {
	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) {
		if (/\S/.test(str.charAt(i))) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}

// XXX. Plugins
//------------------------------------------------------------------------------------------

/*News Ticker*/
(function(a){a.fn.ticker=function(b){var c=a.extend({},a.fn.ticker.defaults,b);var d="#"+a(this).attr("id");var e=a(this).get(0).tagName;return this.each(function(){function o(c){m();switch(c){case"prev":if(b.position==0){b.position=f(b.newsArr)-2}else if(b.position==1){b.position=f(b.newsArr)-1}else{b.position=b.position-2}a(b.dom.titleElem).html(b.newsArr["item-"+b.position].type);a(b.dom.contentID).html(b.newsArr["item-"+b.position].content);break;case"next":a(b.dom.titleElem).html(b.newsArr["item-"+b.position].type);a(b.dom.contentID).html(b.newsArr["item-"+b.position].content);break}if(b.position==f(b.newsArr)-1){b.position=0}else{b.position++}}function n(){b.play=true;b.paused=false;l()}function m(){b.play=false;a(b.dom.tickerID+","+b.dom.revealID+","+b.dom.titleID+","+b.dom.titleElem+","+b.dom.revealElem+","+b.dom.contentID).stop(true,true);a(b.dom.revealID+","+b.dom.revealElem).hide();a(b.dom.wrapperID).find(b.dom.titleID+","+b.dom.titleElem).show().end().find(b.dom.contentID).show()}function l(){if(b.play){a(b.dom.contentID).delay(c.pauseOnItems).fadeOut(c.fadeOutSpeed);if(c.displayType=="fade"){a(b.dom.contentID).fadeOut(c.fadeOutSpeed,function(){a(b.dom.wrapperID).find(b.dom.revealElem+","+b.dom.contentID).hide().end().find(b.dom.tickerID+","+b.dom.revealID).show().end().find(b.dom.tickerID+","+b.dom.revealID).removeAttr("style");j()})}else{a(b.dom.revealID).hide(0,function(){a(b.dom.contentID).fadeOut(c.fadeOutSpeed,function(){a(b.dom.wrapperID).find(b.dom.revealElem+","+b.dom.contentID).hide().end().find(b.dom.tickerID+","+b.dom.revealID).show().end().find(b.dom.tickerID+","+b.dom.revealID).removeAttr("style");j()})})}}else{a(b.dom.revealElem).hide()}}function k(){if(b.play){var d=a(b.dom.titleElem).width()+20;a(b.dom.revealID).css(c.direction,d+"px");if(c.displayType=="fade"){a(b.dom.revealID).hide(0,function(){a(b.dom.contentID).css(c.direction,d+"px").fadeIn(c.fadeInSpeed,l)})}else if(c.displayType=="scroll"){}else{a(b.dom.revealElem).show(0,function(){a(b.dom.contentID).css(c.direction,d+"px").show();animationAction=c.direction=="right"?{marginRight:distance+"px"}:{marginLeft:distance+"px"};a(b.dom.revealID).css("margin-"+c.direction,"0px").delay(20).animate(animationAction,time,"linear",l)})}}else{return false}}function j(){b.contentLoaded=true;a(b.dom.titleElem).html(b.newsArr["item-"+b.position].type);a(b.dom.contentID).html(b.newsArr["item-"+b.position].content);if(b.position==f(b.newsArr)-1){b.position=0}else{b.position++}distance=a(b.dom.contentID).width();time=distance/c.speed;k()}function i(){if(b.contentLoaded==false){if(c.ajaxFeed){if(c.feedType=="xml"){a.ajax({url:c.feedUrl,cache:false,dataType:c.feedType,async:true,success:function(a){count=0;for(var d=0;d<a.childNodes.length;d++){if(a.childNodes[d].nodeName=="rss"){xmlContent=a.childNodes[d]}}for(var e=0;e<xmlContent.childNodes.length;e++){if(xmlContent.childNodes[e].nodeName=="channel"){xmlChannel=xmlContent.childNodes[e]}}for(var h=0;h<xmlChannel.childNodes.length;h++){if(xmlChannel.childNodes[h].nodeName=="item"){xmlItems=xmlChannel.childNodes[h];var i,k=false;for(var l=0;l<xmlItems.childNodes.length;l++){if(xmlItems.childNodes[l].nodeName=="title"){i=xmlItems.childNodes[l].lastChild.nodeValue}else if(xmlItems.childNodes[l].nodeName=="link"){k=xmlItems.childNodes[l].lastChild.nodeValue}if(i!==false&&i!=""&&k!==false){b.newsArr["item-"+count]={type:c.titleText,content:'<a href="'+k+'">'+i+"</a>"};count++;i=false;k=false}}}}if(f(b.newsArr<1)){g("Couldn't find any content from the XML feed for the ticker to use!");return false}j();b.contentLoaded=true}})}else{g("Code Me!")}}else if(c.htmlFeed){if(a(d+" LI").length>0){a(d+" LI").each(function(d){b.newsArr["item-"+d]={type:c.titleText,content:a(this).html()}});j()}else{g("Couldn't find HTML any content for the ticker to use!");return false}}else{g("The ticker is set to not use any types of content! Check the settings for the ticker.");return false}}}function h(){a(b.dom.wrapperID).append('<div id="'+b.dom.tickerID.replace("#","")+'"><div id="'+b.dom.titleID.replace("#","")+'"><span><!-- --></span></div><p id="'+b.dom.contentID.replace("#","")+'"></p><div id="'+b.dom.revealID.replace("#","")+'"><span><!-- --></span></div></div>');a(b.dom.wrapperID).removeClass("no-js").addClass("has-js "+c.direction);a(b.dom.tickerElem+","+b.dom.contentID).hide();if(c.controls){a(b.dom.controlsID).live("click mouseover mousedown mouseout mouseup",function(c){var d=c.target.id;if(c.type=="click"){switch(d){case b.dom.prevID.replace("#",""):b.paused=true;a(b.dom.playPauseID).addClass("paused");o(d);break;case b.dom.nextID.replace("#",""):b.paused=true;a(b.dom.playPauseID).addClass("paused");o(d);break;case b.dom.playPauseID.replace("#",""):if(b.play==true){b.paused=true;a(b.dom.playPauseID).addClass("paused");m()}else{b.paused=false;a(b.dom.playPauseID).removeClass("paused");n()}break}}else if(c.type=="mouseover"&&a("#"+d).hasClass("controls")){a("#"+d).addClass("over")}else if(c.type=="mousedown"&&a("#"+d).hasClass("controls")){a("#"+d).addClass("down")}else if(c.type=="mouseup"&&a("#"+d).hasClass("controls")){a("#"+d).removeClass("down")}else if(c.type=="mouseout"&&a("#"+d).hasClass("controls")){a("#"+d).removeClass("over")}});a(b.dom.wrapperID).append('<ul id="'+b.dom.controlsID.replace("#","")+'"><li id="'+b.dom.playPauseID.replace("#","")+'" class="controls"></li><li id="'+b.dom.prevID.replace("#","")+'" class="controls"></li><li id="'+b.dom.nextID.replace("#","")+'" class="controls"></li></ul>')}if(c.displayType!="fade"){a(b.dom.contentID).mouseover(function(){if(b.paused==false){m()}}).mouseout(function(){if(b.paused==false){n()}})}i()}function g(a){if(c.debugMode){if(window.console&&window.console.log){window.console.log(a)}else{alert(a)}}}function f(a){var b=0,c;for(c in a){if(a.hasOwnProperty(c))b++}return b}var b={position:0,time:0,distance:0,newsArr:{},play:true,paused:false,contentLoaded:false,dom:{contentID:"#ticker-content",titleID:"#ticker-title",titleElem:"#ticker-title SPAN",tickerID:"#ticker",wrapperID:"#ticker-wrapper",revealID:"#ticker-swipe",revealElem:"#ticker-swipe SPAN",controlsID:"#ticker-controls",prevID:"#prev",nextID:"#next",playPauseID:"#play-pause"}};if(e!="UL"&&e!="OL"&&c.htmlFeed===true){g("Cannot use <"+e.toLowerCase()+"> type of element for this plugin - must of type <ul> or <ol>");return false}c.direction=="rtl"?c.direction="right":c.direction="left";h();})};a.fn.ticker.defaults={speed:.1,ajaxFeed:false,feedUrl:"",feedType:"xml",displayType:"reveal",htmlFeed:true,debugMode:true,controls:true,titleText:"Latest",direction:"ltr",pauseOnItems:3e3,fadeInSpeed:600,fadeOutSpeed:300}})(jQuery)

/* HoverIntent */
eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('(6($){$.J.K=6(f,g){8 5={y:7,l:I,H:0};5=$.u(5,g?{v:f,z:g}:f);8 d,b,k,i;8 h=6(3){d=3.G;b=3.B};8 m=6(3,2){2.4=o(2.4);9((w.x(k-d)+w.x(i-b))<5.y){$(2).D("n",h);2.j=1;c 5.v.t(2,[3])}E{k=d;i=b;2.4=r(6(){m(3,2)},5.l)}};8 C=6(3,2){2.4=o(2.4);2.j=0;c 5.z.t(2,[3])};8 q=6(e){8 p=(e.A=="s"?e.N:e.U)||e.T;R(p&&p!=a){S{p=p.O}P(e){p=a}}9(p==a){c Q}8 3=F.u({},e);8 2=a;9(2.4){2.4=o(2.4)}9(e.A=="s"){k=3.G;i=3.B;$(2).M("n",h);9(2.j!=1){2.4=r(6(){m(3,2)},5.l)}}E{$(2).D("n",h);9(2.j==1){2.4=r(6(){C(3,2)},5.H)}}};c a.s(q).L(q)}})(F);',57,57,'||ob|ev|hoverIntent_t|cfg|function||var|if|this|cY|return|cX||||track|pY|hoverIntent_s|pX|interval|compare|mousemove|clearTimeout||handleHover|setTimeout|mouseover|apply|extend|over|Math|abs|sensitivity|out|type|pageY|delay|unbind|else|jQuery|pageX|timeout|100|fn|hoverIntent|mouseout|bind|fromElement|parentNode|catch|false|while|try|relatedTarget|toElement'.split('|'),0,{}))

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


Modernizr.addTest('boxsizing', function () {
  var s = ['boxSizing', 'MozBoxSizing', 'WebkitBoxSizing', 'msBoxSizing'], div = document.createElement('div');

  for (var i = 0, l = s.length ; i < l ; i++) {
    if(div.style[s[i]] !=undefined)
      return true;
  } 

  return false;
});
