// Function returns a random number between 1 and n
function rand(n){return(Math.floor(Math.random()*n+1));}

jQuery(document).ready(function(){
 
  // Disable HTML title attribute for slider images
  jQuery('.promo_slider img').removeAttr('title');
 
  // Get all instances of promo_slider on the page
  var sliders = jQuery('.promo_slider_wrapper');
  
  // Cycle through each slider
  jQuery.each(sliders, function(){
	
	// Define current slider
	var currentSlider = jQuery(this);
	var thisSlider = jQuery('.promo_slider', currentSlider);
	
	// Get all panels
    var panels = jQuery('.panel', thisSlider);
	
	// Get total count of panels
    var panelCount = panels.length;
	
	// Set number for first panel
	if( promo_slider_options.startOn == 'first' ) var initialPanel = 1;
	else var initialPanel = rand(panelCount);
	if( currentSlider.hasClass('random') ) initialPanel = rand(panelCount);
	if( currentSlider.hasClass('first') ) initialPanel = 1;
	
	// Should we pause the slider on mouseover?
	var pauseOnMouseover;
	if( currentSlider.hasClass('pause') ) pauseOnMouseover = true;
	else pauseOnMouseover = false;
	
	// Assign variable for setInterval
	var sliderInterval;
	
	// Set time delay
	var timeDelay = promo_slider_options.timeDelay;
	if( jQuery('.promo_slider_time_delay', thisSlider).html() ){
		timeDelay = jQuery('.promo_slider_time_delay', thisSlider).html();
	}
	
	// Set auto advance variable
	var autoAdvance = promo_slider_options.autoAdvance;
	if( thisSlider.hasClass('auto_advance') ) autoAdvance = true;
	if( thisSlider.hasClass('no_auto_advance') ) autoAdvance = false;
	if( panelCount < 2 ) autoAdvance = false;
	
	// Set navigation option
	var navOption = promo_slider_options.nav_option;
	if( currentSlider.hasClass('default_nav') ) navOption = 'default';
	else if( currentSlider.hasClass('fancy_nav') ) navOption = 'fancy';
	else if( currentSlider.hasClass('links_nav') ) navOption = 'links';
	else if( currentSlider.hasClass('thumb_nav') ) navOption = 'thumb';
	else navOption = false;
	
	// Hide all panels
	panels.hide();
	
	// Show initial panel and add class 'current' to active panel
	jQuery('.panel-' + initialPanel, currentSlider).show().addClass('current');
	
	if(panelCount > 1 && (navOption == 'default' || navOption == 'fancy' || navOption == 'thumb') ){

	  jQuery('.promo_slider_nav').show();
	  jQuery('.promo_slider_thumb_nav').show();
	
	  if(navOption == 'fancy' || navOption == 'default'){
		  // Generate HTML for navigation
		  var navHTML = '';
		  jQuery.each(panels, function(index, object){
			// Set panel title
			panelTitle = jQuery('.panel-'+(index+1)+' span.panel-title', currentSlider).html();
			  newSpan = '<span class="'+(index+1)+'" title="'+panelTitle+'">'+(index+1)+'</span>';
			  if( (index + 1) != panelCount){newSpan = newSpan + '<b class="promo_slider_sep"> | </b>';}
			navHTML = navHTML + newSpan;
		  });
		  
		  // Insert HTML into nav
		  jQuery('.slider_selections', currentSlider).html(navHTML);
	  }
	  
	  // Set click functions for each span in the slider nav
	  var slideNav = jQuery('.slider_selections span', currentSlider);
	  jQuery.each(slideNav, function(index, object){
		jQuery(object).click(function(){ 
		  clearInterval(sliderInterval);
		  if( !jQuery(object).hasClass('current') ) progress(jQuery(object).attr('class'), currentSlider, panelCount);
		  if(autoAdvance) sliderInterval = setInterval(function(){progress('forward', currentSlider, panelCount);}, (timeDelay * 1000));
		});
	  });
	  
	  // Set active span class to 'current'
	  jQuery('.slider_selections span[class=' + initialPanel + ']', currentSlider).addClass('current');
	  
	}
	
	// Create click functions for navigational elements
	jQuery('.move_forward', currentSlider).click(function(){ 
	  clearInterval(sliderInterval);
	  progress('forward', currentSlider, panelCount);
	  if(autoAdvance) sliderInterval = setInterval(function(){progress('forward', currentSlider, panelCount);}, (timeDelay * 1000));
	});
	jQuery('.move_backward', currentSlider).click(function(){
	  clearInterval(sliderInterval);
	  progress('backward', currentSlider, panelCount);
	  if(autoAdvance) sliderInterval = setInterval(function(){progress('forward', currentSlider, panelCount);}, (timeDelay * 1000));
	});
	
	
	if( autoAdvance ){
	
		// Begin auto advancement of slides
		sliderInterval = setInterval(function(){progress('forward', currentSlider, panelCount);}, (timeDelay * 1000));
	
		if( pauseOnMouseover ){
		
			// Pause slide advancement on mouseover
			jQuery(thisSlider).mouseover(function(){
				clearInterval(sliderInterval);
			});
		
			// Continue slide advancement on mouseout
			jQuery(thisSlider).mouseout(function(){
				sliderInterval = setInterval(function(){progress('forward', currentSlider, panelCount);}, (timeDelay * 1000));
			});
		
		}
		
	}
	
  });
  
  // Progress to selected panel
  function progress(value, currentSlider, panelCount){
	  
	  // Find number of current panel
	  var currentValue = jQuery('div.promo_slider > .panel', currentSlider).index(jQuery('div.panel.current', currentSlider)) + 1;

	  // Set value of new panel
  	  if(value == 'forward'){
		var newValue = currentValue + 1;
		if(newValue > panelCount){newValue = 1;}
	  }
	  else if(value == 'backward'){
		var newValue = currentValue - 1;
		if(newValue == 0){newValue = panelCount;}
	  }
	  else{
		var newValue = value;
	  }
	  
	  // Assign variables for ease of use
	  var currentItem = jQuery('.panel-' + currentValue, currentSlider);
	  var newItem = jQuery('.panel-' + newValue, currentSlider);
	  var currentSpan = jQuery('.slider_selections span.current', currentSlider);
	  var newSpan = jQuery('.slider_selections span.' + newValue, currentSlider);
	  
	  // Add / Remove classes
	  currentItem.removeClass('current');
	  newItem.addClass('current');
	  currentSpan.removeClass('current');
	  newSpan.addClass('current');
	  
	  // Fade in / out
	  currentItem.fadeOut('fast', function(){
		newItem.fadeIn('fast');
	  });

  }

});
;/*
Plugin Name: ZipList Recipe Plugin
Plugin URI: http://www.ziplist.com/recipe_plugin
Plugin GitHub: https://github.com/Ziplist/recipe_plugin
Description: A plugin that adds all the necessary microdata to your recipes, so they will show up in Google's Recipe Search
Version: 1.41
Author: ZipList.com
Author URI: http://www.ziplist.com/
License: CC 3.0 http://creativecommons.org/licenses/by/3.0/

This code is derived from an example provided by Ulrik D. Hansen and licensed under the Creative Commons Attribution License.
You can see the original post at http://www.808.dk/?code-javascript-print
*/

/*
This section refers to any extensions made to the original work.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

var win=null;
function zlrPrint(id)
{
	var content = document.getElementById(id).innerHTML;
	win = window.open();
	self.focus();
	win.document.open();
	win.document.write('<html><head>');
	win.document.write('<link charset=\'utf-8\' href=\'http://www.zlcdn.com/stylesheets/minibox/zlrecipe-print.css\' rel=\'stylesheet\' type=\'text/css\' />');
	/* win.document.write('<link charset=\'utf-8\' href=\'http://dev.ziplist.com.s3.amazonaws.com/zlrecipe-print.css\' rel=\'stylesheet\' type=\'text/css\' />'); */
	win.document.write('</head><body>');
	win.document.write('<div id=\'zlrecipe-print-container\' >');
	win.document.write(content);
	win.document.write('</div>');
	win.document.write('</body></html>');
	win.document.close();
	win.print();
	// win.close();
}

;(function(b){b.fn.tabs=function(){return this.each(function(){var a=b(this),c=a.attr("id");b(".section",a).css({position:"absolute",width:"100%"});b(".sections",a).css("height",b("#"+b(".navi li.active a",a).attr("href"),a).outerHeight(!0));b(".navi > li > a[href]",a).bind(a.data("event")||"click",function(d){if(b(".sections, .sections li",a).is(":animated")||b(this).parent("li").hasClass("active"))return!1;d.preventDefault();var e=b("#"+b(".navi li.active",a).removeClass("active").find("a").attr("href"),
a),g=b("#"+b(this).parent("li").addClass("active").find("a").attr("href"),a);b.cookie(c,g.attr("id"),{path:"/"});switch(a.data("fx")){case "height":b(".sections",a).animate({height:0},{duration:333,easing:"easeInBack",complete:function(){e.hide();g.show();b(this).animate({height:g.outerHeight(!0)},{duration:333,easing:"easeOutCirc"})}});break;case "fade":e.fadeOut(333);g.fadeIn(333);b(".sections",a).animate({height:g.outerHeight(!0)},{duration:300,specialEasing:{opacity:"easeOutQuad",height:"easeOutExpo"}});
break;default:e.hide(),g.show(),b(".sections",a).css("height",g.outerHeight(!0))}});b(".navi li a",a).each(function(){window.location.hash==b(this).attr("href")&&b(this).trigger("click")})})}})(jQuery);(function(b){b.fn.highlightText=function(b,c,d){b=RegExp("(<[^>]*>)|(\\b"+b.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")+")",c?"ig":"g");if(0<this.length)return this.html(this.html().replace(b,function(b,a,c){return"<"==b.charAt(0)?b:'<strong class="'+d+'">'+c+"</strong>"}))}})(jQuery);
(function(b){b.fn.CollapsibleMenu=function(){return this.each(function(){b("li.extends",this).addClass("collapsed");b("li.extends.active, li.extends.active-parent",this).removeClass("collapsed").addClass("expanded");var a=/event-([^\s]+)/.exec(b(this).attr("class"))[1];b('li.extends span.expand, li.extends a[href="#"]',this).bind(a,function(a){a.stopImmediatePropagation();var a=b(this),d=a.nextAll("ul:first"),e=a.parent(),g=a.closest(".collapsible, .accordion"),a=function(a,c){b(a).animate({opacity:c,
height:c,marginTop:c,marginBottom:c,paddingTop:c,paddingBottom:c},{duration:200,step:function(){g.parents("li.block .sections").height(g.height())},complete:function(){e.removeClass("expanded collapsed");d.is("ul:visible")?e.addClass("expanded"):e.addClass("collapsed")}})};if(g.hasClass("collapsible")){if(void 0===d[0])window.location.href=this.href;a(d,"toggle")}else{context_menu=this.parentNode.parentNode;if(d.is("ul:visible"))return g.hasClass("collapsible")&&a(b("ul:visible",context_menu).first(),
"hide"),!1;d.is("ul:visible")||(a(b("ul:visible",context_menu).first(),"hide"),a(d,"show"))}return!1})})}})(jQuery);
(function(b){b.fn.bubble=function(){var a=b('<div class="tip"></div>').appendTo("body"),c="",d="";return this.mouseover(function(){var e=b(this).attr("title"),g=e.indexOf("|")+1,i=e.indexOf("|",g);c=e;d=e.substring(g,i);e=e.substr(i+1,e.length);a.html(e);d&&a.prepend("<p><strong>"+d+"</strong></p>");b(this).attr("title","");a.show()}).mousemove(function(b){a.css({top:b.pageY+22,left:b.pageX+10})}).mouseout(function(){a.hide();b(this).attr("title",c)}).click(function(){a.hide();b(this).attr("title",
c)})}})(jQuery);
(function(b){b.fn.clearField=function(a){a=b.extend({blurClass:"clearFieldBlurred",activeClass:"clearFieldActive",attribute:"data-default",value:""},a);return this.each(function(){var c=b(this),d=c.attr(a.attribute),e=!1;a.value=c.val();void 0==d?c.attr(a.attribute,c.val()).addClass(a.blurClass):a.value=d;if(c.is(":password")){var g=b('<input type="text" />').attr("class",c.attr("class")).val(d).addClass("pass-label").hide();c.after(g);e=!0;g.focus(function(){g.hide();c.show().focus()})}c.focus(function(){c.val()==d&&
!c.is(":password")&&c.val("").removeClass(a.blurClass).addClass(a.activeClass);"url"==c.attr("name")&&""==c.val()&&c.val("http://").removeClass(a.blurClass).addClass(a.activeClass)});c.blur(function(){""==c.val()||"url"==c.attr("name")&&"http://"==c.val()?c.is(":password")&&e?(c.hide(),g.show()):c.val(d).removeClass(a.activeClass).addClass(a.blurClass):c.removeClass(a.blurClass).addClass(a.activeClass)});c.blur()})}})(jQuery);
(function(b){b.fn.clearFieldCheck=function(){return this.each(function(){var a=function(b){b.val()==(b.data("default")||"http://")&&b.val("");b.is(":password")&&(b.next(".pass-label").hide(),b.show())};b(this).is("form")?b(".clearField",b(this)).each(function(){a(b(this))}):a(b(this))})}})(jQuery);
(function(b){b.fn.commentControls=function(){return this.each(function(){var a=b(this);a.delegate("#email","change",function(){b.ajax({url:atom_config.blog_url,type:"GET",context:this,data:{atom:"get_avatar",email:b(this).val(),name:a.find("#name").val()},success:function(b){""!=b&&a.find(".comment.new .avatar").html(b)}})});a.delegate(".comment-reply","click",function(c){c.preventDefault();var c=b(this).attr("id"),d=c.lastIndexOf("-"),c=c.substr(++d);a.find(".comment.new").hide();a.find("#comment_parent").attr("value",
c);a.find("#cancel-reply").show();a.find(".comment.new").appendTo("#comment-body-"+c).show(0,function(){a.find("#comment").each(function(){if(this.createTextRange){var a=this.createTextRange();a.collapse(!1);a.select()}b(this).focus()})})});a.delegate("#cancel-reply","click",function(c){c.preventDefault();a.find(".comment.new").hide();a.find("#comment_parent").attr("value","0");b(this).hide();a.find(".comment.new").appendTo(a.find("li.new")).show(0,function(){a.find("#comment").each(function(){if(this.createTextRange){var a=
this.createTextRange();a.collapse(!1);a.select()}b(this).focus()})})});a.delegate(".comment-quote","click",function(c){var d=a.find("#comment"),e=b(this).parents(".comment");c.preventDefault();d.clearFieldCheck();jQuery.fn.appendVal=function(b){return this.each(function(){this.value+=b})};d.appendVal('<blockquote>\n<a href="'+b(".comment-id",e).attr("href")+'">\n<strong><em>'+b(".comment-author",e).html()+":</em></strong>\n</a>\n "+function(b,a){var c,d=0,e=0,b=b+"";c=a?(a+"").replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,
"$1"):" \n\r\t\u000c\u000b\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";d=b.length;for(e=0;e<d;e++)if(-1===c.indexOf(b.charAt(e))){b=b.substring(e);break}d=b.length;for(e=d-1;0<=e;e--)if(-1===c.indexOf(b.charAt(e))){b=b.substring(0,e+1);break}return-1===c.indexOf(b.charAt(0))?b:""}(function(b,a){a=(((a||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");return b.replace(/<\!--[\s\S]*?--\>|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
function(b,c){return-1<a.indexOf("<"+c.toLowerCase()+">")?b:""})}(b(".comment-text",e).html(),"<em><strong><i><b><a><code>"))+"\n</blockquote>\n");d.clearFieldCheck();d.focus()});a.delegate("a.vote","click",function(a){a.preventDefault();b.ajax({url:atom_config.blog_url,type:"GET",context:this,data:{atom:"comment_karma",karma:b(this).data("vote")},success:function(a){var c=b(this).parent().find(".karma");c.html(a);0<parseInt(a)?(c.removeClass("negative"),c.addClass("positive")):0>parseInt(a)&&(c.removeClass("positive"),
c.addClass("negative"));b(this).parent().find("a").remove()}})});a.delegate("a.show","click",function(c){c.preventDefault();b.ajax({url:atom_config.blog_url,type:"GET",context:this,data:{atom:"get_comment",comment_id:b(this).data("comment")},success:function(c){c=b("<ul />").html(c).find(".comment-body").hide();c=c[0].outerHTML||c.clone().appendTo("<div>").parent().html();b(this).parents(".comment-head").after(c);b("body").hasClass("no-fx")?(b(this).parents("li").find(".comment-body").show(),b(this).parents(".sections").height(a.height()+
15)):b(this).parents("li").find(".comment-body").animate({opacity:"show",height:"show",marginTop:"show",marginBottom:"show",paddingTop:"show",paddingBottom:"show"},{duration:333,complete:function(){b(this).parents(".sections").height(a.height()+15)}});b(this).remove()}})})})}})(jQuery);
(function(b){b.fn.toggleVisibility=function(){return this.live("click",function(){event.preventDefault();var a=b("#"+b(this).data("target"));return b("body").hasClass("no-fx")?b(a).toggle(0):b.support.opacity?b(a).animate({opacity:"toggle",height:"toggle"},333,"easeOutQuart"):b(a).animate({height:"toggle"},333,"easeOutQuart")})}})(jQuery);
(function(b){b.fn.webShots=function(){return this.each(function(a){var c=b(this).attr("title"),d="http://s.wordpress.com/mshots/v1/"+encodeURIComponent(b(this).attr("href"))+"?w=400",e=b('<div class="webshot" id="webshot-'+a+'"><img src="'+d+'" width="400" alt="'+c+'" /></div>').hide().appendTo(document.body);b("body").hasClass("no-fx");return b(this).mouseover(function(){e.show()}).mousemove(function(b){e.css({left:b.pageX+15,top:b.pageY+15})}).mouseout(function(){e.hide()})})}})(jQuery);
(function(b){b.fn.goTopControl=function(){return this.each(function(){var a=b(this);b(window).scroll(function(){b.support.hrefNormalized||a.css({position:"absolute",top:b(window).scrollTop()+b(window).height()-50});500<=b(window).scrollTop()?a.fadeIn(200):a.fadeOut(200)});a.click(function(){b("html, body.browser-chrome").animate({scrollTop:0},"slow");return!1})})}})(jQuery);
(function(b){b.fn.showMoreControl=function(a,c,d){return this.each(function(){var e=b(this);b("a.more",this).click(function(g){g.preventDefault();var g=parseInt(b(this).data("count")),i=b(this);b.ajax({type:"GET",url:atom_config.blog_url,data:{instance:a,atom:c,offset:g,_ajax_nonce:d},dataType:"json",context:this,beforeSend:function(){b(this).addClass("loading")},complete:function(){b(this).removeClass("loading")},success:function(a){""!=a.output&&(b("body").hasClass("no-fx")?(b(a.output).appendTo(e.find("ul")),
i.parents(".sections").height(e.height())):b(a.output).appendTo(e.find("ul")).hide().each(function(a){b(this).delay(333*a).animate({opacity:"show",height:"show",marginTop:"show",marginBottom:"show",paddingTop:"show",paddingBottom:"show"},{duration:333,step:function(){i.parents(".sections").height(e.height())}})}));i.data("count",a.offset);a.more||i.hide()}})})})}})(jQuery);
(function(b){b.fn.nudgeLinks=function(){return this.each(function(){var a=b(this).data("dir"),c="margin"+a.charAt(0).toUpperCase()+a.slice(1),d=-parseInt(b(this).data("amt"));b("a",this).each(function(){var a=b(this),g=a.css(c),i={},j={};i[c]=d+parseInt(g);j[c]=g;a.hover(function(){a.stop().animate(i,166)},function(){a.stop().animate(j,166)})})})}})(jQuery);
(function(b){b.fn.imageSlider=function(a){a=b.extend({width:!1,height:!1,squareSize:80,stripeWidth:80,showPager:!0,showArrows:!0,autoplay:!0,transition:"random",delay:10},a);return this.each(function(){a.width=a.width||b(this).width();a.height=a.height||b(this).height();a.squareSize=Math.min(Math.max(a.squareSize,47),188);a.stripeWidth=Math.min(Math.max(a.stripeWidth,30),188);a.delay=1E3*parseInt(b(this).data("delay"),10)||1E3*a.delay;var c=b('<div class="loading"></div>').css({left:a.width/2-80,
top:a.height/2-10}),d=b('<div class="i-controls"></div>'),e=b('<div class="next-slide"></div>'),g=b('<a href="" class="link"></a>').hide().appendTo(d),i=b(this).prepend(e).append(d).prepend(c),j=[],l=0,o=0,k=b(".slide",i).length,f=0,t=null,q="undefined"!==typeof i.data("autoplay")?i.data("autoplay"):a.autoplay,h=!1,m=Math.ceil(a.height/a.squareSize),r=Math.ceil(a.width/a.squareSize),p=Math.ceil(a.width/a.stripeWidth),y={animationFade:function(b,a,c){e.css({backgroundImage:"url("+j[a].image+")",opacity:0}).animate({opacity:1},
{duration:1333,complete:c,easing:"easeOutSine"})},animationSlideH:function(b,c,d,f){e.css({backgroundImage:"url("+j[c].image+")",left:f?a.width:-a.width}).animate({left:0},{duration:999,complete:d,easing:"easeOutExpo"})},animationSlideV:function(b,c,d,f){e.css({backgroundImage:"url("+j[c].image+")",top:f?a.height:-a.height}).animate({top:0},{duration:999,complete:d,easing:"easeOutExpo"})},animationRandomTiles:function(a,c,d){for(var f=[],a=0;a<m*r-1;++a)f[a]=20*a;for(var g,h,a=f.length;a;g=parseInt(Math.random()*
a),h=f[--a],f[a]=f[g],f[g]=h);b(".square",e).css({backgroundImage:"url("+j[c].image+")",opacity:0}).each(function(a){b(this).stop().delay(f[a]).animate({opacity:1},{duration:999,easing:"easeOutQuad",complete:Math.max.apply(Math,f)!==f[a]||d})})},animationHorizontalTiles:function(a,c,d,f){var g=f?0:m*r-1;b(".square",e).css({backgroundImage:"url("+j[c].image+")",opacity:0}).each(function(a){b(this).stop().delay(30*(f?m*r-a:a)).animate({opacity:1},{duration:666,easing:"easeOutSine",complete:a!==g||d})})},
animationDiagonalTiles:function(c,d,f,g){var h=0,k=g?0:m*r-1;b(".square",e).css({backgroundImage:"url("+j[g?d:c].image+")",opacity:g?0:1});g?n(-20,-20):e.css("background-image","url("+j[d].image+")");i.removeClass("no-overflow");for(c=0;c<m;c++)for(d=0;d<r;d++)b(".square-"+h,e).stop().delay(100*(g?m-c+r-d:d+c)).animate({opacity:g?1:0,left:g?d*a.squareSize:d*a.squareSize-20,top:g?c*a.squareSize:c*a.squareSize-20},{duration:333,complete:h!==k||f}),++h},animationSpiral:function(a,c,d,f){var a=[],g=Math.ceil(m/
2),h,i,k,l=0;for(k=0;k<g;k++){for(h=i=k;h<r-k-1;h++)a[l++]=i*r+h;h=r-k-1;for(i=k;i<m-k-1;i++)a[l++]=i*r+h;i=m-k-1;for(h=r-k-1;h>k;h--)a[l++]=i*r+h;h=k;for(i=m-k-1;i>k;i--)a[l++]=i*r+h}f&&a.reverse();for(var n=0;n<l;n++)b(".square-"+a[n],e).css({backgroundImage:"url("+j[c].image+")",opacity:0}).each(function(){b(this).stop().delay(30*n).animate({opacity:1},{duration:666,easing:"easeOutSine",complete:n!=l-1||d})})},animationRandomStripes:function(a,c,d){for(var a=[],f=0;f<p-1;++f)a[f]=60*f;for(var g,
h,f=a.length;f;g=parseInt(Math.random()*f),h=a[--f],a[f]=a[g],a[g]=h);b(".stripe",e).css({backgroundImage:"url("+j[c].image+")",opacity:0,top:-40});for(f=0;f<p;f++)b(".stripe-"+f,e).stop().delay(a[f]).animate({opacity:1,top:0},{duration:999,specialEasing:{opacity:"easeOutQuad",top:"easeOutElastic"},complete:Math.max.apply(Math,a)!==a[f]||d})},animationStripeWave:function(a,c,d,f){a=f?0:p-1;b(".stripe",e).css({backgroundImage:"url("+j[c].image+")",opacity:0,top:-30});i.removeClass("no-overflow");for(c=
0;c<p;c++)b(".stripe-"+c,e).stop().delay(30*(f?p-c:c)).animate({opacity:1,top:0},{duration:999,specialEasing:{opacity:"easeOutSine",top:"easeOutElastic"},complete:c!==a||d})},animationCurtain:function(c,d,f,g){c=g?0:p-1;b(".stripe",e).css({backgroundImage:"url("+j[d].image+")",opacity:0,height:0,top:-(a.height/2)});i.removeClass("no-overflow");for(d=0;d<p;d++)b(".stripe-"+d,e).stop().delay(70*(g?p-d:d)).animate({opacity:1,height:a.height,top:0},{duration:333,specialEasing:{opacity:"easeInSine",height:"easeOutQuad",
top:"easeOutQuad"},complete:d!==c||f})},animationInterweave:function(c,d,f,g){c=g?0:p-1;b(".stripe",e).css({backgroundImage:"url("+j[d].image+")",opacity:0});b(".stripe:even",e).css("top",-a.height);b(".stripe:odd",e).css("top",a.height);i.removeClass("no-overflow");for(d=0;d<p;d++)b(".stripe-"+d,e).stop().delay(50*(g?p-d:d)).animate({opacity:1,top:0},{duration:666,specialEasing:{opacity:"easeOutSine",top:"easeOutExpo"},complete:d!==c||f})}},A=function(){return e.is(":animated")||b("div",e).is(":animated")||
b(".caption",d).is(":animated")},w=function(a,c){clearTimeout(t);o=l;l=a;i.css("background-image","url("+j[o].image+")");g.hide();b(".pager a",d).removeClass("current");b(".pager a:eq("+l+")",d).addClass("current");s();var f;("random"!=j[l].transition?y["animation"+j[l].transition]:y[function(){var b=0,a,c;for(c in y)Math.random()<1/++b&&(a=c);return a}()])(o,l,function(){i.removeClass("no-overflow").addClass("no-overflow").css("background-image","url("+j[l].image+")");b("div",e).add(e).css("background-image",
"");n(0,0);x();u(l);j[l].link&&g.attr("href",j[l].link).show().trigger("href_updated");q&&v()},c)},v=function(){t=setTimeout(function(){w("undefined"==typeof j[l+1]?0:l+1)},j[l].delay)},u=function(c){c=0===b(".caption",d).length?b(j[c].caption).appendTo(d):b(".caption",d).replaceAll(b(j[c].caption));c.hasClass("push-left")?c.css("width",0.3*a.width).css({opacity:0,left:-(0.3*a.width)}).stop().show().animate({opacity:1,left:0},{duration:333,easing:"easeOutExpo"}):c.hasClass("push-right")?c.css("width",
0.3*a.width).css({opacity:0,right:-(0.3*a.width)}).stop().show().animate({opacity:1,right:0},{duration:333,easing:"easeOutExpo"}):c.css({opacity:0,bottom:-c.outerHeight()}).stop().show().animate({opacity:1,bottom:0},{duration:333,easing:"easeOutExpo"})},s=function(){var c=b(".caption",d);c.hasClass("push-left")?c.stop().animate({opacity:0,left:-(0.3*a.width)},{duration:333,easing:"easeOutExpo",complete:function(){c.remove()}}):c.hasClass("push-right")?c.stop().animate({right:-(0.3*a.width),opacity:0},
{duration:333,easing:"easeOutExpo",complete:function(){c.remove()}}):c.stop().animate({opacity:0,bottom:-c.outerHeight()},{duration:333,easing:"easeOutExpo",complete:function(){c.remove()}})},n=function(c,d){for(var f=0;f<m;f++)for(var g=0;g<r;g++)b(".square-"+(r*f+g),e).css({backgroundPosition:-g*a.squareSize+"px "+-f*a.squareSize+"px",backgroundRepeat:"no-repeat",position:"absolute",left:g*a.squareSize+c,top:f*a.squareSize+d,opacity:0,width:a.squareSize,height:a.squareSize})},x=function(){for(var c=
0;c<p;c++)b(".stripe-"+c,e).css({backgroundPosition:-c*a.stripeWidth+"px 0",backgroundRepeat:"no-repeat",position:"absolute",left:c*a.stripeWidth,top:0,opacity:0,width:a.stripeWidth,height:a.height})};b(".slide",i).each(function(){var o={delay:1E3*parseInt(b(this).data("delay"))||a.delay,transition:b(this).data("fx")||a.transition,link:b("img:first",this).parent("a").attr("href")||"",image:b("img:first",this).attr("src"),caption:b(".caption",this).clone().wrap("<div></div>").parent().html()};j.push(o);
b("<img>",this).load(function(){++f;if(k===f){i.css("background-image","url("+j[0].image+")").addClass("no-overflow");j[0].link&&g.attr("href",j[0].link).show().trigger("href_updated");b(".slide",i).remove();c.remove();if(i.data("controls")){var o=i.data("controls").replace(/ /g,"").split(",");a.showPager=!!~b.inArray("pager",o);a.showArrows=!!~b.inArray("arrows",o)}a.showArrows&&(b("<a>",{"class":"prev",css:{top:a.height/2-48,opacity:0},click:function(){if(!A()){var b=l-1;"undefined"==typeof j[b]&&
(b=k-1);w(b,!0);return!1}}}).appendTo(d),b("<a>",{"class":"next",css:{top:a.height/2-48,opacity:0},click:function(){if(!A()){var b=l+1;"undefined"==typeof j[b]&&(b=0);w(b);return!1}}}).appendTo(d));if(a.showPager){b("<div>",{"class":"pager",css:{opacity:0}}).appendTo(d);for(o=0;o<k;o++)b(".pager",d).append(b("<a"+(0==o?' class="current"':"")+">"+(o+1)+"</a>"));b(".pager a",d).click(function(){if(b(this).index()==l||A())return!1;clearInterval(t);w(b(this).index(),l>b(this).index());return!1})}d.hover(function(){b(".pager, a.next, a.prev",
d).stop().animate({opacity:1},333);clearInterval(t);q&&(h=!0,q=!1)},function(){b(".pager, a.next, a.prev",d).stop().animate({opacity:0},666);h&&(v(),q=!0)});u(0);for(o=0;o<m*r;o++)e.append(b("<div />").addClass("square square-"+o));n(0,0);for(o=0;o<p;o++)e.append(b("<div />").addClass("stripe stripe-"+o));x();d.fadeIn(333);!(2>k)&&q&&v()}}).attr("src",o.image)})})}})(jQuery);
jQuery.cookie=function(b,a,c){if("undefined"!=typeof a){c=c||{};if(null===a)a="",c.expires=-1;var d="";if(c.expires&&("number"==typeof c.expires||c.expires.toUTCString))"number"==typeof c.expires?(d=new Date,d.setTime(d.getTime()+864E5*c.expires)):d=c.expires,d="; expires="+d.toUTCString();var e=c.path?"; path="+c.path:"",g=c.domain?"; domain="+c.domain:"",c=c.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(a),d,e,g,c].join("")}else{a=null;if(document.cookie&&""!=document.cookie){c=
document.cookie.split(";");for(d=0;d<c.length;d++)if(e=jQuery.trim(c[d]),e.substring(0,b.length+1)==b+"="){a=decodeURIComponent(e.substring(b.length+1));break}}return a}};jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(b,a,c,d,e){return jQuery.easing[jQuery.easing.def](b,a,c,d,e)},easeInQuad:function(b,a,c,d,e){return d*(a/=e)*a+c},easeOutQuad:function(b,a,c,d,e){return-d*(a/=e)*(a-2)+c},easeInOutQuad:function(b,a,c,d,e){return 1>(a/=e/2)?d/2*a*a+c:-d/2*(--a*(a-2)-1)+c},easeInCubic:function(b,a,c,d,e){return d*(a/=e)*a*a+c},easeOutCubic:function(b,a,c,d,e){return d*((a=a/e-1)*a*a+1)+c},easeInOutCubic:function(b,a,c,d,e){return 1>(a/=e/2)?d/2*a*a*a+c:
d/2*((a-=2)*a*a+2)+c},easeInQuart:function(b,a,c,d,e){return d*(a/=e)*a*a*a+c},easeOutQuart:function(b,a,c,d,e){return-d*((a=a/e-1)*a*a*a-1)+c},easeInOutQuart:function(b,a,c,d,e){return 1>(a/=e/2)?d/2*a*a*a*a+c:-d/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(b,a,c,d,e){return d*(a/=e)*a*a*a*a+c},easeOutQuint:function(b,a,c,d,e){return d*((a=a/e-1)*a*a*a*a+1)+c},easeInOutQuint:function(b,a,c,d,e){return 1>(a/=e/2)?d/2*a*a*a*a*a+c:d/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(b,a,c,d,e){return-d*Math.cos(a/
e*(Math.PI/2))+d+c},easeOutSine:function(b,a,c,d,e){return d*Math.sin(a/e*(Math.PI/2))+c},easeInOutSine:function(b,a,c,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+c},easeInExpo:function(b,a,c,d,e){return 0==a?c:d*Math.pow(2,10*(a/e-1))+c},easeOutExpo:function(b,a,c,d,e){return a==e?c+d:d*(-Math.pow(2,-10*a/e)+1)+c},easeInOutExpo:function(b,a,c,d,e){return 0==a?c:a==e?c+d:1>(a/=e/2)?d/2*Math.pow(2,10*(a-1))+c:d/2*(-Math.pow(2,-10*--a)+2)+c},easeInCirc:function(b,a,c,d,e){return-d*(Math.sqrt(1-(a/=e)*
a)-1)+c},easeOutCirc:function(b,a,c,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+c},easeInOutCirc:function(b,a,c,d,e){return 1>(a/=e/2)?-d/2*(Math.sqrt(1-a*a)-1)+c:d/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(b,a,c,d,e){var b=1.70158,g=0,i=d;if(0==a)return c;if(1==(a/=e))return c+d;g||(g=0.3*e);i<Math.abs(d)?(i=d,b=g/4):b=g/(2*Math.PI)*Math.asin(d/i);return-(i*Math.pow(2,10*(a-=1))*Math.sin((a*e-b)*2*Math.PI/g))+c},easeOutElastic:function(b,a,c,d,e){var b=1.70158,g=0,i=d;if(0==a)return c;if(1==
(a/=e))return c+d;g||(g=0.3*e);i<Math.abs(d)?(i=d,b=g/4):b=g/(2*Math.PI)*Math.asin(d/i);return i*Math.pow(2,-10*a)*Math.sin((a*e-b)*2*Math.PI/g)+d+c},easeInOutElastic:function(b,a,c,d,e){var b=1.70158,g=0,i=d;if(0==a)return c;if(2==(a/=e/2))return c+d;g||(g=e*0.3*1.5);i<Math.abs(d)?(i=d,b=g/4):b=g/(2*Math.PI)*Math.asin(d/i);return 1>a?-0.5*i*Math.pow(2,10*(a-=1))*Math.sin((a*e-b)*2*Math.PI/g)+c:0.5*i*Math.pow(2,-10*(a-=1))*Math.sin((a*e-b)*2*Math.PI/g)+d+c},easeInBack:function(b,a,c,d,e,g){void 0==
g&&(g=1.70158);return d*(a/=e)*a*((g+1)*a-g)+c},easeOutBack:function(b,a,c,d,e,g){void 0==g&&(g=1.70158);return d*((a=a/e-1)*a*((g+1)*a+g)+1)+c},easeInOutBack:function(b,a,c,d,e,g){void 0==g&&(g=1.70158);return 1>(a/=e/2)?d/2*a*a*(((g*=1.525)+1)*a-g)+c:d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+c},easeInBounce:function(b,a,c,d,e){return d-jQuery.easing.easeOutBounce(b,e-a,0,d,e)+c},easeOutBounce:function(b,a,c,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+c:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?
d*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(b,a,c,d,e){return a<e/2?0.5*jQuery.easing.easeInBounce(b,2*a,0,d,e)+c:0.5*jQuery.easing.easeOutBounce(b,2*a-e,0,d,e)+0.5*d+c}});
(function(b){b.extend(b.fn,{livequery:function(a,c,d){var e=this,g;b.isFunction(a)&&(d=c,c=a,a=void 0);b.each(b.livequery.queries,function(b,j){if(e.selector==j.selector&&e.context==j.context&&a==j.type&&(!c||c.$lqguid==j.fn.$lqguid)&&(!d||d.$lqguid==j.fn2.$lqguid))return(g=j)&&!1});g=g||new b.livequery(this.selector,this.context,a,c,d);g.stopped=!1;g.run();return this},expire:function(a,c,d){var e=this;b.isFunction(a)&&(d=c,c=a,a=void 0);b.each(b.livequery.queries,function(g,i){e.selector==i.selector&&
e.context==i.context&&(!a||a==i.type)&&(!c||c.$lqguid==i.fn.$lqguid)&&(!d||d.$lqguid==i.fn2.$lqguid)&&!this.stopped&&b.livequery.stop(i.id)});return this}});b.livequery=function(a,c,d,e,g){this.selector=a;this.context=c;this.type=d;this.fn=e;this.fn2=g;this.elements=[];this.stopped=!1;this.id=b.livequery.queries.push(this)-1;e.$lqguid=e.$lqguid||b.livequery.guid++;if(g)g.$lqguid=g.$lqguid||b.livequery.guid++;return this};b.livequery.prototype={stop:function(){var b=this;this.type?this.elements.unbind(this.type,
this.fn):this.fn2&&this.elements.each(function(c,d){b.fn2.apply(d)});this.elements=[];this.stopped=!0},run:function(){if(!this.stopped){var a=this,c=this.elements,d=b(this.selector,this.context),e=d.not(c);this.elements=d;this.type?(e.bind(this.type,this.fn),0<c.length&&b.each(c,function(c,e){0>b.inArray(e,d)&&b.event.remove(e,a.type,a.fn)})):(e.each(function(){a.fn.apply(this)}),this.fn2&&0<c.length&&b.each(c,function(c,e){0>b.inArray(e,d)&&a.fn2.apply(e)}))}}};b.extend(b.livequery,{guid:0,queries:[],
queue:[],running:!1,timeout:null,checkQueue:function(){if(b.livequery.running&&b.livequery.queue.length)for(var a=b.livequery.queue.length;a--;)b.livequery.queries[b.livequery.queue.shift()].run()},pause:function(){b.livequery.running=!1},play:function(){b.livequery.running=!0;b.livequery.run()},registerPlugin:function(){b.each(arguments,function(a,c){if(b.fn[c]){var d=b.fn[c];b.fn[c]=function(){var a=d.apply(this,arguments);b.livequery.run();return a}}})},run:function(a){void 0!=a?0>b.inArray(a,
b.livequery.queue)&&b.livequery.queue.push(a):b.each(b.livequery.queries,function(a){0>b.inArray(a,b.livequery.queue)&&b.livequery.queue.push(a)});b.livequery.timeout&&clearTimeout(b.livequery.timeout);b.livequery.timeout=setTimeout(b.livequery.checkQueue,1E3)},stop:function(a){void 0!=a?b.livequery.queries[a].stop():b.each(b.livequery.queries,function(a){b.livequery.queries[a].stop()})}});b.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass",
"toggleClass","empty","remove","html");b(function(){b.livequery.play()})})(jQuery);
(function(b){b.fn.superfish=function(a){var d=b.fn.superfish,e=d.c,g=b(['<span class="',e.arrowClass,'">&nbsp;</span>'].join("")),i=function(){var a=l(b(this));clearTimeout(a.sfTimer);b(this).showSuperfishUl().siblings().hideSuperfishUl()},j=function(){var a=l(b(this)),c=b(this),e=d.op;clearTimeout(a.sfTimer);a.sfTimer=setTimeout(function(){e.retainPath=-1<b.inArray(c[0],e.path);c.hideSuperfishUl();e.path.length&&1>c.parents(["li.",e.hoverClass].join("")).length&&i.call(e.path)},e.delay)},l=function(b){b=
b.parents(["ul.",e.menuClass,":first"].join(""))[0];d.op=d.o[b.serial];return b};return this.each(function(){var l=this.serial=d.o.length,k=b.extend({},d.defaults,a);if(b("body").hasClass("no-fx"))k.fx=!1;if(k.fx){if(b(this).hasClass("slide-up"))k.dir="marginBottom";if(b(this).hasClass("slide-left"))k.dir="marginLeft";if(b(this).hasClass("slide-right"))k.dir="marginRight"}k.path=b("li."+k.pathClass,this).slice(0,k.pathLevels).each(function(){b(this).addClass([k.hoverClass,e.bcClass].join(" ")).filter("li:has(ul)").removeClass(k.pathClass)});
d.o[l]=d.op=k;b("li:has(ul)",this).hover(i,j).each(function(){k.autoArrows&&b(">a:first-child",this).addClass(e.anchorClass).append(g.clone())}).not("."+e.bcClass).hideSuperfishUl();var f=b("a",this);f.each(function(b){var a=f.eq(b).parents("li");f.eq(b).focus(function(){i.call(a)}).blur(function(){j.call(a)})})}).each(function(){var a=[e.menuClass];b(this).addClass(a.join(" "))})};var a=b.fn.superfish;a.o=[];a.op={};a.c={bcClass:"breadcrumb",menuClass:"superfish",anchorClass:"has-submenus",arrowClass:"arrow"};
a.defaults={hoverClass:"open",pathClass:"overideThisToUse",pathLevels:1,delay:500,dir:"marginTop",fx:!0,autoArrows:!0};b.fn.extend({hideSuperfishUl:function(){var c=a.op,d=!0===c.retainPath?c.path:"";c.retainPath=!1;d=b(["li.",c.hoverClass].join(""),this).add(this).not(d).removeClass(c.hoverClass).find(">ul");if(c.fx){var e={};e[c.dir]=20;b.support.opacity&&(e.opacity=0);d.stop().animate(e,150,"swing",function(){b(this).css({display:"none"})})}else d.css({display:"none"});return this},showSuperfishUl:function(){var c=
a.op;if(c.fx){var d={},e={};d.display="block";d[c.dir]=20;e[c.dir]=0;if(b.support.opacity)d.opacity=0,e.opacity=1;b(this).addClass(c.hoverClass).find(">ul:hidden").css(d).stop().animate(e,150,"swing")}else b(this).addClass(c.hoverClass).find(">ul:hidden").css({display:"block"});return this}})})(jQuery);
(function(b){var a,c,d,e,g,i,j,l,o,k=0,f={},t=[],q=0,h={},m=[],r=null,p=new Image,y=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,A=/[^\.]\.(swf)\s*$/i,w=0,v="",u,s,n=!1,x=b.extend(b("<div/>")[0],{prop:0}),C=function(){c.hide();p.onerror=p.onload=null;r&&r.abort();a.empty()},D=function(){!1===f.onError(t,k,f)?(c.hide(),n=!1):(f.titleShow=!1,f.width="auto",f.height="auto",a.html('<p id="fb-error">The requested content cannot be loaded.<br />Please try again later.</p>'),z())},B=function(){var d=t[k],e,g,h,j,l,
m;C();f=b.extend({},b.fn.fancybox.defaults,"undefined"==typeof b(d).data("fancybox")?f:b(d).data("fancybox"));m=f.onStart(t,k,f);if(!1===m)n=!1;else{"object"==typeof m&&(f=b.extend(f,m));h=f.title||(d.nodeName?b(d).attr("title"):d.title)||"";if(d.nodeName&&!f.orig)f.orig=b(d).children("img:first").length?b(d).children("img:first"):b(d);""===h&&f.orig&&f.titleFromAlt&&(h=f.orig.attr("alt"));e=f.href||(d.nodeName?b(d).attr("href"):d.href)||null;if(/^(?:javascript)/i.test(e)||"#"==e)e=null;if(f.type){if(g=
f.type,!e)e=f.content}else f.content?g="html":e&&(g=e.match(y)?"image":e.match(A)?"swf":0===e.indexOf("#")?"inline":"ajax");if(g){"inline"==g&&(d=e.substr(e.indexOf("#")),g=0<b(d).length?"inline":"ajax");f.type=g;f.href=e;f.title=h;if(f.autoDimensions)"html"==f.type||"inline"==f.type||"ajax"==f.type?(f.width="auto",f.height="auto"):f.autoDimensions=!1;if(f.modal)f.overlayShow=!0,f.hideOnOverlayClick=!1,f.hideOnContentClick=!1,f.enableEscapeButton=!1;f.padding=parseInt(f.padding,10);f.margin=parseInt(f.margin,
10);a.css("padding",f.padding+f.margin);b(".fb-inline-tmp").unbind("fb-cancel").bind("fb-change",function(){b(this).replaceWith(i.children())});switch(g){case "html":a.html(f.content);z();break;case "inline":if(!0===b(d).parent().is("#fb-content")){n=!1;break}b('<div class="fb-inline-tmp" />').hide().insertBefore(b(d)).bind("fb-cleanup",function(){b(this).replaceWith(i.children())}).bind("fb-cancel",function(){b(this).replaceWith(a.children())});b(d).appendTo(a);z();break;case "image":n=!1;c.show();
p=new Image;p.onerror=function(){D()};p.onload=function(){n=!0;p.onerror=p.onload=null;f.width=p.width;f.height=p.height;b("<img />").attr({id:"fb-img",src:p.src,alt:f.title}).appendTo(a);I()};p.src=e;break;case "swf":f.scrolling="no";j='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+f.width+'" height="'+f.height+'"><param name="movie" value="'+e+'"></param>';l="";b.each(f.swf,function(b,a){j+='<param name="'+b+'" value="'+a+'"></param>';l+=" "+b+'="'+a+'"'});j+='<embed src="'+
e+'" type="application/x-shockwave-flash" width="'+f.width+'" height="'+f.height+'"'+l+"></embed></object>";a.html(j);z();break;case "ajax":n=!1,c.show(),f.ajax.win=f.ajax.success,r=b.ajax(b.extend({},f.ajax,{url:e,data:f.ajax.data||{},error:function(b){0<b.status&&D()},success:function(b,d,g){if(200==("object"==typeof g?g:r).status){if("function"==typeof f.ajax.win){m=f.ajax.win(e,b,d,g);if(!1===m){c.hide();return}if("string"==typeof m||"object"==typeof m)b=m}a.html(b);z()}}}))}}else D()}},z=function(){var c=
f.width,d=f.height,c=-1<c.toString().indexOf("%")?parseInt((b(window).width()-2*f.margin)*parseFloat(c)/100,10)+"px":"auto"==c?"auto":c+"px",d=-1<d.toString().indexOf("%")?parseInt((b(window).height()-2*f.margin)*parseFloat(d)/100,10)+"px":"auto"==d?"auto":d+"px";a.wrapInner('<div style="width:'+c+";height:"+d+";overflow: "+("auto"==f.scrolling?"auto":"yes"==f.scrolling?"scroll":"hidden")+';position:relative;"></div>');f.width=a.width();f.height=a.height();I()},I=function(){var H,J;c.hide();if(e.is(":visible")&&
!1===h.onCleanup(m,q,h))b.event.trigger("fb-cancel"),n=!1;else{n=!0;b(i.add(d)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");e.is(":visible")&&e.css("height",e.height());m=t;q=k;h=f;h.overlayShow?(d.css({opacity:h.overlayOpacity,cursor:h.hideOnOverlayClick?"pointer":"auto",height:b(document).height()}),d.is(":visible")||d.show()):d.hide();s=M();v=h.title||"";w=0;j.empty().removeAttr("style").removeClass();if(!1!==h.titleShow&&(v=b.isFunction(h.titleFormat)?h.titleFormat(v,
m,q,h):v&&v.length?v:!1)&&""!==v)j.html(v).appendTo("body").show(),j.css({width:s.width-2*h.padding,marginLeft:h.padding,marginRight:h.padding}),w=j.outerHeight(!0),j.appendTo(g),s.height+=w;j.hide();if(e.is(":visible"))b(l.add(o)).hide(),H=e.position(),u={top:H.top,left:H.left,width:e.width(),height:e.height()},J=u.width==s.width&&u.height==s.height,i.fadeTo(h.changeFade,0.3,function(){var c=function(){i.html(a.contents()).fadeTo(h.changeFade,1,E)};b.event.trigger("fb-change");i.empty().removeAttr("filter").css({"border-width":h.padding,
width:s.width-2*h.padding,height:f.autoDimensions?"auto":s.height-w-2*h.padding});J?c():(x.prop=0,b(x).animate({prop:1},{duration:h.changeSpeed,easing:h.easingChange,step:F,complete:c}))});else if(e.removeAttr("style"),i.css("border-width",h.padding),"elastic"==h.transitionIn){u=K();i.html(a.contents());e.show();if(h.opacity)s.opacity=0;x.prop=0;b(x).animate({prop:1},{duration:h.speedIn,easing:h.easingIn,step:F,complete:E})}else 0<w&&j.show(),i.css({width:s.width-2*h.padding,height:f.autoDimensions?
"auto":s.height-w-2*h.padding}).html(a.contents()),e.css(s).fadeIn("none"==h.transitionIn?0:h.speedIn,E)}},L=function(){(h.enableEscapeButton||h.enableKeyboardNav)&&b(document).bind("keydown.fb",function(a){if(27==a.keyCode&&h.enableEscapeButton)a.preventDefault(),b.fancybox.close();else if((37==a.keyCode||39==a.keyCode)&&h.enableKeyboardNav&&"INPUT"!==a.target.tagName&&"TEXTAREA"!==a.target.tagName&&"SELECT"!==a.target.tagName)a.preventDefault(),b.fancybox[37==a.keyCode?"prev":"next"]()});if(h.showNavArrows){if(h.cyclic&&
1<m.length||0!==q)b("a",l).css("top",e.height()/2-b("a",l).height()/2),l.show();if(h.cyclic&&1<m.length||q!=m.length-1)b("a",o).css("top",e.height()/2-b("a",l).height()/2),o.show()}else l.hide(),o.hide()},E=function(){b.support.opacity||(i.get(0).style.removeAttribute("filter"),e.get(0).style.removeAttribute("filter"));f.autoDimensions&&i.css("height","auto");e.css("height","auto");v&&v.length&&j.show();L();h.hideOnContentClick&&i.bind("click",b.fancybox.close);h.hideOnOverlayClick&&d.bind("click",
b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);h.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);e.show();n=!1;b.fancybox.center();h.onComplete(m,q,h);var a,c;if(m.length-1>q&&(a=m[q+1].href,"undefined"!==typeof a&&a.match(y)))c=new Image,c.src=a;if(0<q&&(a=m[q-1].href,"undefined"!==typeof a&&a.match(y)))c=new Image,c.src=a},F=function(b){var a={width:parseInt(u.width+(s.width-u.width)*b,10),height:parseInt(u.height+(s.height-u.height)*b,10),top:parseInt(u.top+(s.top-
u.top)*b,10),left:parseInt(u.left+(s.left-u.left)*b,10)};if("undefined"!==typeof s.opacity)a.opacity=0.5>b?0.5:b;e.css(a);i.css({width:a.width-2*h.padding,height:a.height-w*b-2*h.padding})},G=function(){return[b(window).width()-2*h.margin,b(window).height()-2*h.margin,b(document).scrollLeft()+h.margin,b(document).scrollTop()+h.margin]},M=function(){var b=G(),a={},c=h.autoScale,d=2*h.padding;a.width=-1<h.width.toString().indexOf("%")?parseInt(b[0]*parseFloat(h.width)/100,10):h.width+d;a.height=-1<
h.height.toString().indexOf("%")?parseInt(b[1]*parseFloat(h.height)/100,10):h.height+d;if(c&&(a.width>b[0]||a.height>b[1]))if("image"==f.type||"swf"==f.type){c=h.width/h.height;if(a.width>b[0])a.width=b[0],a.height=parseInt((a.width-d)/c+d,10);if(a.height>b[1])a.height=b[1],a.width=parseInt((a.height-d)*c+d,10)}else a.width=Math.min(a.width,b[0]),a.height=Math.min(a.height,b[1]);a.top=parseInt(Math.max(b[3]-20,b[3]+0.5*(b[1]-a.height-40)),10);a.left=parseInt(Math.max(b[2]-20,b[2]+0.5*(b[0]-a.width-
40)),10);return a},K=function(){var a=f.orig?b(f.orig):!1,c={};a&&a.length?(c=a.offset(),c.top+=parseInt(a.css("paddingTop"),10)||0,c.left+=parseInt(a.css("paddingLeft"),10)||0,c.top+=parseInt(a.css("border-top-width"),10)||0,c.left+=parseInt(a.css("border-left-width"),10)||0,c.width=a.width(),c.height=a.height(),c={width:c.width+2*h.padding,height:c.height+2*h.padding,top:c.top-h.padding-20,left:c.left-h.padding-20}):(a=G(),c={width:2*h.padding,height:2*h.padding,top:parseInt(a[3]+0.5*a[1],10),left:parseInt(a[2]+
0.5*a[0],10)});return c};b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(a){a.preventDefault();n||(n=!0,b(this).blur(),t=[],k=0,a=b(this).attr("rel")||"",!a||""==a||"nofollow"===a?t.push(this):(t=b("a[rel="+a+"], area[rel="+a+"]"),k=t.index(this)),B())});return this};b.fancybox=function(a,c){var d;if(!n){n=!0;d="undefined"!==typeof c?c:{};t=[];k=parseInt(d.index,10)||0;if(b.isArray(a)){for(var e=
0,f=a.length;e<f;e++)"object"==typeof a[e]?b(a[e]).data("fancybox",b.extend({},d,a[e])):a[e]=b({}).data("fancybox",b.extend({content:a[e]},d));t=jQuery.merge(t,a)}else"object"==typeof a?b(a).data("fancybox",b.extend({},d,a)):a=b({}).data("fancybox",b.extend({content:a},d)),t.push(a);if(k>t.length||0>k)k=0;B()}};b.fancybox.next=function(){return b.fancybox.pos(q+1)};b.fancybox.prev=function(){return b.fancybox.pos(q-1)};b.fancybox.pos=function(a){n||(a=parseInt(a),t=m,-1<a&&a<m.length?(k=a,B()):h.cyclic&&
1<m.length&&(k=a>=m.length?0:m.length-1,B()))};b.fancybox.cancel=function(){n||(n=!0,b.event.trigger("fb-cancel"),C(),f.onCancel(t,k,f),n=!1)};b.fancybox.close=function(){function a(){d.fadeOut("fast");j.empty().hide();e.hide();b.event.trigger("fb-cleanup");i.empty();h.onClosed(m,q,h);m=f=[];q=k=0;h=f={};n=!1}if(!n&&!e.is(":hidden"))if(n=!0,h&&!1===h.onCleanup(m,q,h))n=!1;else if(C(),b(l.add(o)).hide(),b(i.add(d)).unbind(),b(window).unbind("resize.fb scroll.fb"),b(document).unbind("keydown.fb"),i.find("iframe").attr("src",
"about:blank"),e.stop(),"elastic"==h.transitionOut){u=K();var c=e.position();s={top:c.top,left:c.left,width:e.width(),height:e.height()};if(h.opacity)s.opacity=1;j.empty().hide();x.prop=1;b(x).animate({prop:0},{duration:h.speedOut,easing:h.easingOut,step:F,complete:a})}else e.fadeOut("none"==h.transitionOut?0:h.speedOut,a)};b.fancybox.resize=function(){d.is(":visible")&&d.css("height",b(document).height());b.fancybox.center(!0)};b.fancybox.center=function(a){var b,c;if(!n&&(c=!0===a?1:0,b=G(),c||
!(e.width()>b[0]||e.height()>b[1])))e.stop().animate({top:parseInt(Math.max(b[3]-20,b[3]+0.5*(b[1]-i.height()-40)-h.padding)),left:parseInt(Math.max(b[2]-20,b[2]+0.5*(b[0]-i.width()-40)-h.padding))},"number"==typeof a?a:200)};b.fancybox.init=function(){b("#fb-wrap").length||(b("body").append(a=b('<div id="fb-tmp"></div>'),c=b('<div id="fb-loading"></div>'),d=b('<div id="fb-overlay"></div>'),e=b('<div id="fb-wrap"></div>')),g=b('<div id="fb-outer"></div>').appendTo(e),g.append(i=b('<div id="fb-content"></div>'),
j=b('<div id="fb-title"></div>'),l=b('<div id="fb-left"><a>prev</a></<div'),o=b('<div id="fb-right"><a>next</a></<div')),c.click(b.fancybox.cancel),b("a",l).click(function(a){a.preventDefault();b.fancybox.prev()}),b("a",o).click(function(a){a.preventDefault();b.fancybox.next()}),b.fn.mousewheel&&e.bind("mousewheel.fb",function(a,c){if(n)a.preventDefault();else if(0==b(a.target).get(0).clientHeight||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight)a.preventDefault(),b.fancybox[0<c?
"prev":"next"]()}),b.support.opacity||e.addClass("fb-ie"))};b.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!0,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:0.5,titleShow:!0,titleFormat:null,titleFromAlt:!1,transitionIn:"elastic",transitionOut:"elastic",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"easeOutBack",
easingOut:"easeInBack",showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
jQuery(document).ready(function(b){var a=atom_config.options.split("|");b(document).bind("atom_ready",function(){-1!==b.inArray("effects",a)&&(b("body").removeClass("no-fx"),b(".nudge").nudgeLinks(),b("a.go-top").goTopControl());b(".nav ul.menu, nav > ul, .tabs > .navi").superfish();b("a.screenshot").webShots();b(".accordion, .collapsible").CollapsibleMenu();b(".toggle").toggleVisibility();b("a.tt").bubble();"single"===atom_config.context&&b("#comments").commentControls();b(".clearField").clearField();
b("form").submit(function(){b(".clearField",this).each(function(){b(this).clearFieldCheck()});return!0});b("form").each(function(){b("a.submit",this).click(function(){b(this).parents("form").submit()})});b(".tabs").tabs();b(".iSlider").imageSlider();-1!==b.inArray("lightbox",a)&&(b("a").filter(function(){return!!this.href.match(/.+\.(jpg|jpeg|png|gif)$/i)}).each(function(){this.rel+="group-"+b(this).parents("div").index()}).fancybox(),b('a[rel="lightbox"]').fancybox(),b("a").bind("href_updated",function(){this.href.match(/.+\.(jpg|jpeg|png|gif)$/i)&&
b(this).fancybox()}));-1!==b.inArray("generate_thumbs",a)&&b("span.no-img.regen").livequery(function(){var a=b(this).attr("id").split(/-/g).slice(1);b(this).removeClass("regen");b.ajax({url:atom_config.blog_url,type:"GET",context:this,data:{atom:"update_thumb",attachment_size:b(this).data("size"),post_id:a[0],thumb_id:a[1]},beforeSend:function(){b(this).addClass("loading")},success:function(a){""!=a?b(this).replaceWith(a):b(this).removeClass("loading")}})});b(".page-navi.single a").click(function(a){a.preventDefault();
b.ajax({url:b(this).attr("href"),type:"GET",context:this,beforeSend:function(){b(this).addClass("loading")},success:function(a){b(a).find(".posts .hentry").hide().appendTo(b(".posts")).fadeIn(333);(a=b(a).find(".page-navi.single a").attr("href"))?b(this).attr("href",a).removeClass("loading"):b(this).remove()}})})}).trigger("atom_ready")});
