$(document).ready(function(){var sectionDesc=$("div.section-list div.section");sectionDesc.hide().filter(":first").show();$("div.section-list ul.sub-nav li").filter(":first").addClass("current");$("div.section-list ul.sub-nav li a").click(function(){sectionDesc.hide();sectionDesc.filter(this.hash).show();$(this).parents("div.section-list ul.sub-nav").children("li").removeClass("current");$(this).parent().addClass("current");tOffset=$(this).parents("div.section-list").offset();$(window).scrollTop(tOffset.top);return false});$(".wrapper .hidden").hide();$(".wrapper .hidden").parent().append("<a href='#' class='btn-small Unibody8 unhide'><span class='more'>more &#187;</span><span class='less' style='display:none'>&#171; less</span></a>");$(".wrapper a.unhide").click(function(event){$(this).parent().children(".hidden").toggle();$(this).children().toggle();event.preventDefault()});$.each($("input:text, textarea"),function(i,v){if($(v).val()!=""){$(v).prev("label").hide()}});$("form input:text, form textarea").focus(function(){$(this).prev("label").hide()});$("form input:text, form textarea").blur(function(){if($(this).val()==""){$(this).prev("label").show()}});$("#fb-header-quote").fancybox({width:"65%",height:"70%",autoScale:false,transitionIn:"none",transitionOut:"none",type:"iframe"});$("#fb-full-wish").fancybox({width:"55%",height:"70%",autoScale:false,autoDimensions:false,transitionIn:"none",transitionOut:"none",centerOnScroll:true});$("#mycarousel").jcarousel({auto:5,visible:3,animation:3000,wrap:"circular",buttonNextHTML:null,buttonPrevHTML:null});var sidebar=$(".sidebar"),right_point=$(".wrapper").offset().left,MARGIN_TOP=21,REAL_TOP=210,the_window=$(window),SIDEBAR_IS_FIXED=(sidebar.css("position")=="fixed");SIDEBAR_IS_BOTTOM=(sidebar.css("top")=="auto");the_window.scroll(function(){overlap=eval($(".sidebar, .footer").is(":overlapping"));topmost_point=sidebar.offset().top-42;top_window_point=the_window.scrollTop();equallib=eval(topmost_point==the_window.scrollTop());not_equallib=eval(topmost_point>the_window.scrollTop());if(the_window.scrollTop()>REAL_TOP){if(overlap&&!not_equallib){sidebar.css({position:"absolute",top:"auto",bottom:"-1px",right:"0"});SIDEBAR_IS_FIXED=false}else{sidebar.css({position:"fixed",top:"0",bottom:"auto",right:right_point});SIDEBAR_IS_FIXED=true}}else{sidebar.css({position:"absolute",top:"0",bottom:"auto",right:"0"});SIDEBAR_IS_FIXED=false}});the_window.resize(function(){right_point=$(".wrapper").offset().left;if(SIDEBAR_IS_FIXED){sidebar.css("right",right_point)}})});
