$(function(){$(document).ready(function(){function r(){n[""]=0;$("#nav li a").each(function(){var e=$(this).attr("href");if(e!=""&&e!="#"){var t=$(e).offset(),r=t.top;n[e.substr(1)]=Math.round(r-62)}})}function i(e){var t="";for(var r in n){if(n[r]<e){t=r}}return t}var e=$("#md-navbar"),t=$("#nav"),n={};$(window).scroll(function(){var n=window.pageYOffset||$(document).scrollTop();var s=$("header").height()-60;if(n>=s){if(!e.hasClass("md-fix")){e.addClass("md-fix").addClass("nav-fix").css({top:"-60px",opacity:0}).animate({top:"0",opacity:1})}}else{if(e.hasClass("md-fix")){e.removeClass("md-fix").animate({top:"-60px",opacity:0},function(){$(this).css({opacity:1}).removeClass("nav-fix")})}}r();var o=i(n);if(o!==""){var u=t.find("a[href=#"+o+"]").parent();if(!u.is(".current")){$("#nav li.current").removeClass("current");u.addClass("current");t.find("li.back").stop().animate({width:u[0].offsetWidth,left:u[0].offsetLeft},500)}}else{var u=t.find("li").first();if(!u.is(".current")){$("#nav li.current").removeClass("current");u.addClass("current");t.find("li.back").stop().animate({width:u[0].offsetWidth,left:u[0].offsetLeft},500)}}});$(window).resize(function(){var e=$(window).width();if(e<1500){var t=e/2;$("#md-spotlight").height(t);if(e<760){var n=(t-$("#md-spotlight .md-intro").height())/2;$("#md-spotlight .md-intro").css("margin-top",n)}else{$("#md-spotlight .md-intro").css("margin-top",t*.12)}}});$(window).resize();var s=responsiveNav("#nav",{animate:true,transition:400,label:"<span></span><span></span><span></span>",insert:"after",customToggle:"",openPos:"relative",jsClass:"js",init:function(){},open:function(){$("#md-navbar .arrow").show()},close:function(){$("#md-navbar .arrow").hide()},onshow:function(){$menu=$("li.current",t);t.find("li.back").stop().css({width:$menu[0].offsetWidth,left:$menu[0].offsetLeft})}});$("#nav li a").click(function(){var e=$(this).attr("href");if(e!=""&&e!="#"){var n=$(e);$("html,body").animate({scrollTop:n.offset().top-60})}else{$("html,body").animate({scrollTop:0})}if(t.attr("aria-hidden")=="false"){s.toggle()}return false});$(".tabs-wrap").tabs();$("#accordion,#toogle,#accordion-rwd").accordion({collapsible:true,heightStyle:"content"});$(".md-icon-dialog").hover(function(){$(".md-dialog",this).stop(true,true).fadeIn()},function(){$(".md-dialog",this).stop(true,true).fadeOut()});$("#md-slider-1").cycle({fx:"scrollHorz",speed:1e3,next:"#md-slider-1-ctrl .slide-next",prev:"#md-slider-1-ctrl .slide-pre",pager:"#md-slider-1-switch",fit:1,log:false});$("#md-slider-2").cycle({fx:"fade",slides:"> div",speed:500,timeout:3e3,pager:"#md-slider-2-switch",log:false});$("#md-slider-3").cycle({fx:"scrollHorz",speed:1e3,slides:"> div",next:"#md-slider-3-ctrl .slide-next",prev:"#md-slider-3-ctrl .slide-prev",log:false});$(".origami").origami({});$("#origami-accordion .accordion-toggle").click(function(){$(this).parent().parent().toggleClass("active");$(this).parent().next().slideToggle();return false});var o=0;var u=setInterval(function(){o=o<$("#landing-title span.option").size()-1?o+1:0;$("#landing-title span.option-next").html();var e=$("#landing-title span.option:eq("+o+")").html();$("#landing-title span.active").html(e)},2e3);$(".demo_changer a.change-orange").click(function(){$("#styleswitcher").attr("href","css/style-orange.css");return false});$(".demo_changer a.change-green").click(function(){$("#styleswitcher").attr("href","css/style-green.css");return false});$(".demo_changer a.change-blue").click(function(){$("#styleswitcher").attr("href","css/style-blue.css");return false});if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)){}else{$(function(){$(".lavaLamp").lavaLamp({fx:"backout",speed:600})})}})})