var wpTimeout=10000;var maxContainerWidth=1440;var maxContainerHeight=800;function pageReady(){chainRequire(["/javascripts/jquery_plugins.js"],pluginsReady);if($.browser.msie&&parseInt($.browser.version)<7){$("#map-toggle").click(function(){alert("Sorry this feature is not supported on your browser.  Please update your browser and try again.")})}else{$("#map-toggle").toggle(function(){drawerOpen("/main/map")},drawerClose)}loadFeeds();var a=1;var c=2;function b(){currentWp++;if(currentWp>=wps.length){currentWp=0}wp=wps[currentWp];file="/images/wallpapers/"+wp.file;$(new Image()).attr("src",file).load(function(d){$("#wallpaper"+c).css("backgroundImage","url("+file+")");setTimeout(function(){$("#wallpaper"+a).fadeOut("slow");$("#wallpaper"+c).fadeIn("slow",function(){$("#wallpaper-info").hide().find(".title").html(wp.title?wp.title:" ").end().find(".subtitle").html(wp.subtitle?wp.subtitle:" ").end().show()});a=a==1?2:1;c=c==1?2:1;setTimeout(b,wpTimeout)},100)})}setTimeout(b,wpTimeout);setupContainer()}function pluginsReady(){setupShadows()}function setupShadows(){$("#nav-one li").hover(function(){$("ul",this).dropShadow({left:5,top:5,blur:3}).fadeIn("fast")},function(){$(this).find(".dropShadow").remove()});if(document.all){$("#nav-one li").hoverClass("sfHover")}}function setupContainer(){$(window).resize(function(){var a=$(this).height();var b=$(this).width();$("#super-container").css("height",a>maxContainerHeight?maxContainerHeight+"px":a+"px");$("#super-container").css("width",b>maxContainerWidth?maxContainerWidth+"px":b+"px");$("#scroll-container").width($("#super-container").width());$("#scroll-container").height($("#super-container").height())}).resize()}$.fn.hoverClass=function(a){return this.each(function(){$(this).hover(function(){$(this).addClass(a)},function(){$(this).removeClass(a)})})};function chainRequire(a,c,b){if(a.length){require=a.shift();$.getScript(require,function(){chainRequire(a,c,b)})}else{c(b)}}function drawerOpen(a){$.ajax({url:a,success:drawerDataLoaded,error:function(b,c,d){},dataType:"json"})}function drawerDataLoaded(a){if(a.require){chainRequire(a.require,drawerReady,a)}else{drawerReady(a)}}function drawerReady(a){if(a.callback){window[a.callback](a.data)}if(a.nav){$("#drawer-nav").html(a.nav).slideDown()}$("#drawer").html(a.content);$("#drawer").animate({left:400},1500)}function drawerClose(){$("#drawer-nav").slideUp();$("#drawer").animate({left:-500},1500)}function feedError(a,b,c){console.log("Feed Error");console.log(a,b,c)}function updateFeedArea(a){$.ajax({url:"main/load_"+a,success:function(b){$("#"+a+"-feed .feed-content").html(b)},error:feedError,dataType:"html"})}function loadFeeds(){updateFeedArea("flickr");updateFeedArea("twitter");updateFeedArea("reddit")};
